Merge pull request 'feature/ace-in-frame' (#124) from feature/ace-in-frame into develop
167
apps/common/main/lib/component/AceEditor.js
Normal file
@ -0,0 +1,167 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2024
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
|
||||
if (Common === undefined)
|
||||
var Common = {};
|
||||
|
||||
define([], function () {
|
||||
'use strict';
|
||||
|
||||
Common.UI.AceEditor = Common.UI.BaseView.extend({
|
||||
initialize : function(options) {
|
||||
Common.UI.BaseView.prototype.initialize.call(this, options);
|
||||
|
||||
this.parentEl = options.parentEl;
|
||||
this.parentEl && this.render(this.parentEl);
|
||||
},
|
||||
|
||||
render: function (parentEl) {
|
||||
this.parentEl = typeof parentEl === 'string' ? $(parentEl) : parentEl;
|
||||
|
||||
this.iframe = document.createElement("iframe");
|
||||
this.iframe.width = '100%';
|
||||
this.iframe.height = '100%';
|
||||
this.iframe.align = "top";
|
||||
this.iframe.frameBorder = 0;
|
||||
this.iframe.scrolling = "no";
|
||||
this.iframe.onload = _.bind(this._onLoad,this);
|
||||
this.parentEl.append(this.iframe);
|
||||
|
||||
this.loadMask = new Common.UI.LoadMask({owner: this.parentEl});
|
||||
this.loadMask.show();
|
||||
|
||||
this.iframe.src = '../../../vendor/ace/component/AceEditor.html?editorType=' + (window.SSE ? 'cell' : window.PE ? 'slide' : 'word');
|
||||
|
||||
var me = this;
|
||||
this._eventfunc = function(msg) {
|
||||
me._onMessage(msg);
|
||||
};
|
||||
this._updatebind = function() {
|
||||
me.updateTheme();
|
||||
};
|
||||
this._bindWindowEvents.call(this);
|
||||
},
|
||||
|
||||
_bindWindowEvents: function() {
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener("message", this._eventfunc, false)
|
||||
} else if (window.attachEvent) {
|
||||
window.attachEvent("onmessage", this._eventfunc);
|
||||
}
|
||||
Common.NotificationCenter.on('uitheme:changed', this._updatebind);
|
||||
},
|
||||
|
||||
_unbindWindowEvents: function() {
|
||||
if (window.removeEventListener) {
|
||||
window.removeEventListener("message", this._eventfunc)
|
||||
} else if (window.detachEvent) {
|
||||
window.detachEvent("onmessage", this._eventfunc);
|
||||
}
|
||||
Common.NotificationCenter.off('uitheme:changed', this._updatebind);
|
||||
},
|
||||
|
||||
_postMessage: function(wnd, msg) {
|
||||
if (wnd && wnd.postMessage && window.JSON) {
|
||||
wnd.postMessage(window.JSON.stringify(msg), "*");
|
||||
}
|
||||
},
|
||||
|
||||
_onMessage: function(msg) {
|
||||
var data = msg.data;
|
||||
if (Object.prototype.toString.apply(data) !== '[object String]' || !window.JSON) {
|
||||
return;
|
||||
}
|
||||
var cmd, handler;
|
||||
|
||||
try {
|
||||
cmd = window.JSON.parse(data)
|
||||
} catch(e) {
|
||||
cmd = '';
|
||||
}
|
||||
|
||||
if (cmd && cmd.referer == "ace-editor") {
|
||||
switch (cmd.command) {
|
||||
case 'changeValue':
|
||||
this.fireEvent('change', cmd.data);
|
||||
break;
|
||||
case 'aceEditorReady':
|
||||
this.fireEvent('ready', cmd.data);
|
||||
break;
|
||||
case 'mouseUp':
|
||||
case 'mouseMove':
|
||||
var offset = Common.Utils.getOffset(this.parentEl);
|
||||
var x = cmd.data.x * Common.Utils.zoom() + offset.left,
|
||||
y = cmd.data.y * Common.Utils.zoom() + offset.top;
|
||||
this.fireEvent(cmd.command.toLowerCase(), x, y);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_onLoad: function() {
|
||||
this.updateTheme();
|
||||
if (this.loadMask)
|
||||
this.loadMask.hide();
|
||||
},
|
||||
|
||||
setValue: function(value, readonly) {
|
||||
this._postMessage(this.iframe.contentWindow, {
|
||||
command: 'setValue',
|
||||
referer: 'ace-editor',
|
||||
data: {
|
||||
value: value,
|
||||
readonly: readonly
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
updateTheme: function() {
|
||||
this._postMessage(this.iframe.contentWindow, {
|
||||
command: 'setTheme',
|
||||
referer: 'ace-editor',
|
||||
data: Common.UI.Themes.getThemeColors()
|
||||
});
|
||||
},
|
||||
|
||||
disableDrop: function(disable) {
|
||||
this._postMessage(this.iframe.contentWindow, {
|
||||
command: 'disableDrop',
|
||||
referer: 'ace-editor',
|
||||
data: disable
|
||||
});
|
||||
},
|
||||
|
||||
destroyEditor: function() {
|
||||
this._unbindWindowEvents();
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -263,6 +263,7 @@ define([
|
||||
this.listenTo(view, 'dblclick',this.onDblClickItem);
|
||||
this.listenTo(view, 'select', this.onSelectItem);
|
||||
this.listenTo(view, 'tipchange', this.onChangeTip);
|
||||
this.listenTo(view, 'contextmenu', this.onContextMenuItem);
|
||||
|
||||
if (record.get('tip')) {
|
||||
var view_el = $(view.el);
|
||||
|
||||
@ -945,10 +945,11 @@ define([
|
||||
pluginVisible = me.checkPluginVersion(apiVersion, item.minVersion);
|
||||
|
||||
if (item.guid === "asc.{E6978D28-0441-4BD7-8346-82FAD68BCA3B}") {
|
||||
item.tab = {
|
||||
"id": "view",
|
||||
"separator": true
|
||||
}
|
||||
// item.tab = {
|
||||
// "id": "view",
|
||||
// "separator": true
|
||||
// }
|
||||
return; // hide macros plugin
|
||||
}
|
||||
|
||||
var props = {
|
||||
|
||||
@ -575,6 +575,14 @@ define([
|
||||
|
||||
toggleTheme: function () {
|
||||
this.setTheme( this.isDarkTheme() ? id_default_light_theme : id_default_dark_theme );
|
||||
},
|
||||
|
||||
getThemeColors: function() {
|
||||
const theme_id = window.uitheme.relevant_theme_id();
|
||||
const obj = get_current_theme_colors();
|
||||
obj.type = themes_map[theme_id].type;
|
||||
obj.name = theme_id;
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
})(Common.UI.Themes);
|
||||
|
||||
802
apps/common/main/lib/view/MacrosDialog.js
Normal file
@ -0,0 +1,802 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2024
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* MacrosDialog.js
|
||||
*
|
||||
* Created on 04.10.2024
|
||||
*
|
||||
*/
|
||||
|
||||
if (Common === undefined)
|
||||
var Common = {};
|
||||
|
||||
define([], function () {
|
||||
'use strict';
|
||||
Common.Views.MacrosDialog = Common.UI.Window.extend(_.extend({
|
||||
template:
|
||||
'<div class="content">' +
|
||||
'<div class="common_menu noselect">' +
|
||||
'<div id="menu_macros" class="menu_macros_long" <% if(!isFunctionsSupport){%> style="height: 100%;" <% } %>>' +
|
||||
'<div class="menu_header">' +
|
||||
'<label class="i18n header">Macros</label>' +
|
||||
'<div class="div_buttons">' +
|
||||
'<div id="btn-macros-run"></div>' +
|
||||
'<div id="btn-macros-add"></div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div id="list-macros"></div>' +
|
||||
'</div>' +
|
||||
'<div class="separator horizontal" <% if(!isFunctionsSupport){%> style="display: none;" <% } %> ></div>' +
|
||||
'<div id="menu_functions" <% if(!isFunctionsSupport){%> style="display: none;" <% } %> >' +
|
||||
'<div class="menu_header">' +
|
||||
'<label class="i18n header">Custom Functions</label>' +
|
||||
'<div id="btn-function-add"></div>' +
|
||||
'</div>' +
|
||||
'<div id="list-functions"></div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="separator vertical" style="position: relative"></div>' +
|
||||
'<div id="code-editor" class="invisible"></div>' +
|
||||
'</div>'+
|
||||
'<div class="separator horizontal" style="position: relative"></div>',
|
||||
|
||||
|
||||
initialize : function(options) {
|
||||
var _options = {},
|
||||
innerHeight = Math.max(Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top'), 350),
|
||||
innerWidth = Math.max(Common.Utils.innerWidth(), 600);
|
||||
|
||||
_.extend(_options, {
|
||||
id: 'macros-dialog',
|
||||
title: this.textTitle,
|
||||
header: true,
|
||||
help: true,
|
||||
width: Math.min(800, innerWidth),
|
||||
height: Math.min(512, innerHeight),
|
||||
minwidth: 600,
|
||||
minheight: 350,
|
||||
resizable: true,
|
||||
cls: 'modal-dlg invisible-borders',
|
||||
buttons: [{
|
||||
value: 'ok',
|
||||
caption: this.textSave
|
||||
}, 'cancel']
|
||||
}, options || {});
|
||||
this.api = options.api;
|
||||
|
||||
this.CurrentElementModeType = {
|
||||
CustomFunction : 0,
|
||||
Macros : 1
|
||||
};
|
||||
this._state = {
|
||||
isFunctionsSupport: !!window.SSE,
|
||||
macrosItemMenuOpen: null,
|
||||
functionItemMenuOpen: null,
|
||||
currentElementMode: this.CurrentElementModeType.Macros,
|
||||
currentValue: ''
|
||||
};
|
||||
|
||||
_options.tpl = _.template(this.template)({
|
||||
isFunctionsSupport: this._state.isFunctionsSupport,
|
||||
});
|
||||
|
||||
this.on('help', this.onHelp);
|
||||
|
||||
Common.UI.Window.prototype.initialize.call(this, _options);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
Common.UI.Window.prototype.render.call(this);
|
||||
|
||||
var me = this,
|
||||
$window = this.getChild();
|
||||
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||
|
||||
me.aceContainer = $window.find('#code-editor');
|
||||
|
||||
// this.loadMask = new Common.UI.LoadMask({owner: this.$window.find('.body')[0]});
|
||||
// this.loadMask.setTitle(this.textLoading);
|
||||
// this.loadMask.show();
|
||||
|
||||
me.createCodeEditor();
|
||||
me.renderAfterAceLoaded();
|
||||
},
|
||||
|
||||
renderAfterAceLoaded: function() {
|
||||
var me = this;
|
||||
this.btnMacrosRun = new Common.UI.Button({
|
||||
parentEl: $('#btn-macros-run'),
|
||||
cls: 'btn-toolbar borders--small',
|
||||
iconCls: 'icon toolbar__icon btn-run',
|
||||
hint: this.tipMacrosRun
|
||||
});
|
||||
this.btnMacrosAdd = new Common.UI.Button({
|
||||
parentEl: $('#btn-macros-add'),
|
||||
cls: 'btn-toolbar borders--small',
|
||||
iconCls: 'icon toolbar__icon btn-zoomup',
|
||||
hint: this.tipMacrosAdd
|
||||
}).on('click', _.bind(this.onCreateMacros, this));
|
||||
|
||||
this.listMacros = new Common.UI.ListView({
|
||||
el: $('#list-macros', this.$window),
|
||||
store: new Common.UI.DataViewStore(),
|
||||
simpleAddMode: true,
|
||||
itemTemplate: _.template([
|
||||
'<div class="listitem-autostart">',
|
||||
'<% if (autostart) { %>',
|
||||
'<span>(A)</span>',
|
||||
'<% } %>',
|
||||
'</div>',
|
||||
'<div id="<%= id %>" class="list-item" role="listitem"><%= Common.Utils.String.htmlEncode(name) %></div>',
|
||||
'<div class="listitem-icon toolbar__icon btn-more"></div>'
|
||||
].join(''))
|
||||
});
|
||||
this.listMacros.on('item:add', _.bind(this.onAddListItem, this));
|
||||
this.listMacros.on('item:click', _.bind(this.onClickListMacrosItem, this));
|
||||
this.listMacros.on('item:contextmenu', _.bind(this.onContextMenuListMacrosItem, this));
|
||||
this.listMacros.on('item:select', _.bind(this.onSelectListMacrosItem, this));
|
||||
this.setListMacros();
|
||||
|
||||
this.ctxMenuMacros = new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
additionalAlign: this.menuAddAlign,
|
||||
items: [
|
||||
new Common.UI.MenuItem({
|
||||
caption : this.textRun
|
||||
}).on('click', _.bind(this.onRunMacros, this)),
|
||||
new Common.UI.MenuItem({
|
||||
caption : this.textMakeAutostart
|
||||
}).on('click', _.bind(this.onMakeAutostartMacros, this)),
|
||||
new Common.UI.MenuItem({
|
||||
caption : this.textUnMakeAutostart
|
||||
}).on('click', _.bind(this.onUnMakeAutostartMacros, this)),
|
||||
new Common.UI.MenuItem({
|
||||
caption : this.textRename
|
||||
}).on('click', _.bind(this.onRenameMacros, this)),
|
||||
new Common.UI.MenuItem({
|
||||
caption : this.textDelete
|
||||
}).on('click', _.bind(this.onDeleteMacros, this)),
|
||||
new Common.UI.MenuItem({
|
||||
caption : this.textCopy
|
||||
}).on('click', _.bind(this.onCopyMacros, this)),
|
||||
]
|
||||
});
|
||||
this.ctxMenuMacros.on('hide:after', function() {
|
||||
me.listMacros.$el.find('.listitem-icon').removeClass('active');
|
||||
});
|
||||
|
||||
if(this._state.isFunctionsSupport) {
|
||||
this.btnFunctionAdd = new Common.UI.Button({
|
||||
parentEl: $('#btn-function-add'),
|
||||
cls: 'btn-toolbar borders--small',
|
||||
iconCls: 'icon toolbar__icon btn-zoomup',
|
||||
hint: this.tipFunctionAdd
|
||||
}).on('click', _.bind(this.onCreateFunction, this));
|
||||
|
||||
this.listFunctions = new Common.UI.ListView({
|
||||
el: $('#list-functions', this.$window),
|
||||
store: new Common.UI.DataViewStore(),
|
||||
tabindex: 1,
|
||||
cls: 'dbl-clickable',
|
||||
itemTemplate: _.template([
|
||||
'<div class="listitem-autostart"></div>',
|
||||
'<div id="<%= id %>" class="list-item" role="listitem"><%= Common.Utils.String.htmlEncode(name) %></div>',
|
||||
'<div class="listitem-icon toolbar__icon btn-more"></div>'
|
||||
].join(''))
|
||||
});
|
||||
this.listFunctions.on('item:add', _.bind(this.onAddListItem, this));
|
||||
this.listFunctions.on('item:click', _.bind(this.onClickListFunctionItem, this));
|
||||
this.listFunctions.on('item:contextmenu', _.bind(this.onContextMenuListFunctionItem, this));
|
||||
this.listFunctions.on('item:select', _.bind(this.onSelectListFunctionItem, this));
|
||||
this.setListFunctions();
|
||||
|
||||
this.ctxMenuFunction = new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
additionalAlign: this.menuAddAlign,
|
||||
items: [
|
||||
new Common.UI.MenuItem({
|
||||
caption : this.textRename
|
||||
}).on('click', _.bind(this.onRenameFunction, this)),
|
||||
new Common.UI.MenuItem({
|
||||
caption : this.textDelete
|
||||
}).on('click', _.bind(this.onDeleteFunction, this)),
|
||||
new Common.UI.MenuItem({
|
||||
caption : this.textCopy
|
||||
}).on('click', _.bind(this.onCopyFunction, this)),
|
||||
]
|
||||
});
|
||||
this.ctxMenuFunction.on('hide:after', function() {
|
||||
me.listFunctions.$el.find('.listitem-icon').removeClass('active');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
this.makeDragable();
|
||||
},
|
||||
|
||||
createCodeEditor: function() {
|
||||
var me = this;
|
||||
|
||||
this.codeEditor = new Common.UI.AceEditor({parentEl: '#code-editor'});
|
||||
this.codeEditor.on('ready', function() {
|
||||
me.codeEditor.updateTheme();
|
||||
me.codeEditor.setValue(me._state.currentValue);
|
||||
setTimeout(function() {
|
||||
me.aceContainer.removeClass('invisible');
|
||||
}, 10);
|
||||
// me.loadMask.hide();
|
||||
});
|
||||
this.codeEditor.on('change', function(value) {
|
||||
var selectedItem = me._state.currentElementMode === me.CurrentElementModeType.Macros
|
||||
? me.listMacros.getSelectedRec()
|
||||
: me.listFunctions.getSelectedRec();
|
||||
selectedItem && selectedItem.set('value', value);
|
||||
});
|
||||
this.codeEditor.on('mouseup', function(x, y) {
|
||||
if (me.binding.dragStop) me.binding.dragStop();
|
||||
if (me.binding.resizeStop) me.binding.resizeStop();
|
||||
});
|
||||
this.codeEditor.on('mousemove', function(x, y) {
|
||||
if (me.binding.drag) me.binding.drag({ pageX: x, pageY: y });
|
||||
if (me.binding.resize) me.binding.resize({ pageX: x, pageY: y });
|
||||
});
|
||||
},
|
||||
|
||||
setListMacros: function() {
|
||||
var me = this;
|
||||
var data = this.parseDataFromApi(this.api.pluginMethod_GetMacros());
|
||||
var macrosList = data.macrosArray;
|
||||
|
||||
var dataVBA = this.api.pluginMethod_GetVBAMacros();
|
||||
if (dataVBA && typeof dataVBA === 'string' && dataVBA.includes('<Module')) {
|
||||
var arr = dataVBA.split('<Module ').filter(function(el){return el.includes('Type="Procedural"') || el.includes('Type="Class"')});
|
||||
arr.forEach(function(el) {
|
||||
var start = el.indexOf('<SourceCode>') + 12;
|
||||
var end = el.indexOf('</SourceCode>', start);
|
||||
var macros = el.slice(start, end);
|
||||
|
||||
start = el.indexOf('Name="') + 6;
|
||||
end = el.indexOf('"', start);
|
||||
var name = el.slice(start, end);
|
||||
var index = macrosList.findIndex(function(macr){return macr.name == name});
|
||||
if (index == -1) {
|
||||
macros = macros.replace(/&/g,'&');
|
||||
macros = macros.replace(/</g,'<');
|
||||
macros = macros.replace(/>/g,'>');
|
||||
macros = macros.replace(/'/g,'\'');
|
||||
macros = macros.replace(/"/g,'"');
|
||||
macros = macros.replace(/Attribute [^\r\n]*\r\n/g, "");
|
||||
macrosList.push({
|
||||
guid: me.createGuid(),
|
||||
name: name,
|
||||
autostart: false,
|
||||
value: '(function()\n{\n\t/* Enter your code here. */\n})();\n\n/*\nExecution of VBA commands does not support.\n' + macros + '*/'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(macrosList.length > 0) {
|
||||
macrosList.forEach(function (macros) {
|
||||
macros.autostart = !!macros.autostart;
|
||||
});
|
||||
this.listMacros.store.reset(macrosList);
|
||||
var selectItem = this.listMacros.store.at(data.current);
|
||||
selectItem && this.listMacros.selectRecord(selectItem);
|
||||
} else {
|
||||
this.onCreateMacros();
|
||||
}
|
||||
},
|
||||
setListFunctions: function() {
|
||||
var data = this.parseDataFromApi(this.api.pluginMethod_GetCustomFunctions());
|
||||
var macrosList = data.macrosArray;
|
||||
this.listFunctions.store.reset(macrosList);
|
||||
},
|
||||
openContextMenu: function(elementMode, item, event) {
|
||||
var itemMenuOpen, ctxMenu, modeName;
|
||||
if(elementMode === this.CurrentElementModeType.Macros) {
|
||||
itemMenuOpen = this._state.macrosItemMenuOpen;
|
||||
ctxMenu = this.ctxMenuMacros;
|
||||
modeName = 'macros';
|
||||
} else if(elementMode === this.CurrentElementModeType.CustomFunction){
|
||||
itemMenuOpen = this._state.functionItemMenuOpen;
|
||||
ctxMenu = this.ctxMenuFunction;
|
||||
modeName = 'functions';
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (itemMenuOpen === item && ctxMenu.isVisible()) {
|
||||
ctxMenu.hide();
|
||||
return false;
|
||||
}
|
||||
|
||||
var currentTarget = $(event.currentTarget),
|
||||
parent = elementMode === this.CurrentElementModeType.Macros ? $('#menu_macros') : $('#menu_functions'),
|
||||
containerId = 'macros-dialog-ctx-' + modeName + '-container',
|
||||
menuContainer = parent.find('#' + containerId);
|
||||
|
||||
if (!ctxMenu.rendered) {
|
||||
if (menuContainer.length < 1) {
|
||||
menuContainer = $('<div id="'+ containerId+ '" style="position: absolute; z-index: 10000;"><div class="dropdown-toggle" data-toggle="dropdown"></div></div>', ctxMenu.id);
|
||||
parent.append(menuContainer);
|
||||
}
|
||||
ctxMenu.render(menuContainer);
|
||||
ctxMenu.cmpEl.attr({tabindex: "-1"});
|
||||
|
||||
ctxMenu.on('show:after', function(cmp) {
|
||||
if (cmp && cmp.menuAlignEl)
|
||||
cmp.menuAlignEl.toggleClass('over', true);
|
||||
}).on('hide:after', function(cmp) {
|
||||
if (cmp && cmp.menuAlignEl)
|
||||
cmp.menuAlignEl.toggleClass('over', false);
|
||||
});
|
||||
}
|
||||
|
||||
var menuContainerRect = Common.Utils.getBoundingClientRect(menuContainer[0]);
|
||||
|
||||
ctxMenu.menuAlignEl = currentTarget;
|
||||
ctxMenu.setOffset(event.clientX - menuContainerRect.x, -currentTarget.height()/2 - 3);
|
||||
ctxMenu.show();
|
||||
_.delay(function() {
|
||||
ctxMenu.cmpEl.focus();
|
||||
}, 10);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
return true;
|
||||
},
|
||||
openContextMenuMacros: function(macrosItem, event) {
|
||||
var isOpen = this.openContextMenu(this.CurrentElementModeType.Macros, macrosItem, event);
|
||||
if(isOpen) {
|
||||
this._state.macrosItemMenuOpen = macrosItem;
|
||||
this.ctxMenuMacros.items[1].setVisible(!macrosItem.get('autostart'));
|
||||
this.ctxMenuMacros.items[2].setVisible(macrosItem.get('autostart'));
|
||||
}
|
||||
},
|
||||
openContextMenuFunction: function(functionItem, event) {
|
||||
var isOpen = this.openContextMenu(this.CurrentElementModeType.CustomFunction, functionItem, event);
|
||||
if(isOpen) {
|
||||
this._state.functionItemMenuOpen = functionItem;
|
||||
}
|
||||
},
|
||||
openWindowRename: function() {
|
||||
var me = this;
|
||||
var windowSize = {
|
||||
width: 300,
|
||||
height: 90
|
||||
};
|
||||
var macrosWindowRect = Common.Utils.getBoundingClientRect(this.$window[0]);
|
||||
var selectedItem = me._state.currentElementMode === me.CurrentElementModeType.Macros
|
||||
? me.listMacros.getSelectedRec()
|
||||
: me.listFunctions.getSelectedRec();
|
||||
|
||||
(new Common.Views.TextInputDialog({
|
||||
value: selectedItem.get('name'),
|
||||
width: windowSize.width,
|
||||
height: windowSize.height,
|
||||
inputConfig: {
|
||||
allowBlank : false,
|
||||
validation: function(value) {
|
||||
return value.trim().length > 0 ? true : '';
|
||||
}
|
||||
},
|
||||
handler: function(result, value) {
|
||||
if (result == 'ok') {
|
||||
selectedItem.set('name', value.trim());
|
||||
}
|
||||
}
|
||||
})).show(
|
||||
macrosWindowRect.left + (macrosWindowRect.width - windowSize.width) / 2,
|
||||
macrosWindowRect.top + (macrosWindowRect.height - windowSize.height) / 2
|
||||
);
|
||||
},
|
||||
|
||||
makeDragable: function() {
|
||||
var me = this;
|
||||
var currentElement;
|
||||
var currentIndex = 0;
|
||||
var insertIndex;
|
||||
var macrosList = document.getElementById("list-macros");
|
||||
var functionList = document.getElementById("menu_functions");
|
||||
|
||||
function getInsertIndex(cursorPosition, currentElement, elements) {
|
||||
// cursorPosition = cursorPosition * ((1 + (1 - zoom)).toFixed(1));
|
||||
var currentIndex = elements.index(currentElement);
|
||||
var nextIndex = currentIndex;
|
||||
var currentElementCoord = Common.Utils.getBoundingClientRect(currentElement);
|
||||
var currentElementCenter = currentElementCoord.y + currentElementCoord.height * 0.45;
|
||||
if(cursorPosition > currentElementCenter) {
|
||||
nextIndex += 1;
|
||||
}
|
||||
return nextIndex
|
||||
}
|
||||
|
||||
function handleDragstart(list, e) {
|
||||
me.codeEditor.disableDrop(true);
|
||||
|
||||
var id = $(e.target).children('.list-item').attr('id');
|
||||
e.dataTransfer.setData("text/plain", id);
|
||||
e.dataTransfer.effectAllowed = "move";
|
||||
e.target.classList.add('dragged');
|
||||
currentIndex = list.store.indexOf(list.store.findWhere({ id: id }));
|
||||
e.target.click();
|
||||
}
|
||||
|
||||
function handleDragend(list, e) {
|
||||
me.codeEditor.disableDrop(false);
|
||||
|
||||
e.target.classList.remove('dragged');
|
||||
$('.dragHovered').removeClass("dragHovered");
|
||||
|
||||
if (currentIndex === insertIndex || insertIndex == null) return;
|
||||
|
||||
if (insertIndex === -1) insertIndex = list.store.length;
|
||||
if (currentIndex < insertIndex) insertIndex--;
|
||||
|
||||
var newStoreArr = list.store.models.slice();
|
||||
let tmp = newStoreArr.splice(currentIndex, 1)[0];
|
||||
newStoreArr.splice(insertIndex, 0, tmp);
|
||||
|
||||
list.store.reset(newStoreArr);
|
||||
currentIndex = 0;
|
||||
}
|
||||
|
||||
function handleDragover(list, elementModeType, e) {
|
||||
e.preventDefault();
|
||||
currentElement = e.target;
|
||||
let bDragAllowed = me._state.currentElementMode === elementModeType;
|
||||
e.dataTransfer.dropEffect = bDragAllowed ? "move" : "none";
|
||||
const isMoveable = currentElement.classList.contains('draggable');
|
||||
if (!isMoveable || !bDragAllowed)
|
||||
return;
|
||||
|
||||
insertIndex = getInsertIndex(e.clientY, currentElement, $(list).find('.item'));
|
||||
$('.dragHovered').removeClass("dragHovered")
|
||||
if(insertIndex < $(list).find('.item').length) {
|
||||
$(list).find('.item').last().removeClass(['dragHovered', 'last']);
|
||||
$(list).find('.item')[insertIndex].classList.add('dragHovered');
|
||||
} else {
|
||||
$(list).find('.item').last().addClass(['dragHovered', 'last']);
|
||||
}
|
||||
}
|
||||
|
||||
function handleDragleave(e) {
|
||||
if(e.fromElement) {
|
||||
if($(e.fromElement).attr('role') == 'list'
|
||||
|| $(e.fromElement).attr('role') == 'listitem'
|
||||
|| !!$(e.fromElement).parents('[role="listitem"]').length
|
||||
) return;
|
||||
|
||||
$('.dragHovered').removeClass("dragHovered");
|
||||
insertIndex = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
macrosList.addEventListener('dragstart', function(e) {
|
||||
handleDragstart(me.listMacros, e);
|
||||
});
|
||||
functionList.addEventListener('dragstart', function(e) {
|
||||
handleDragstart(me.listFunctions, e);
|
||||
});
|
||||
|
||||
macrosList.addEventListener('dragend', function(e) {
|
||||
handleDragend(me.listMacros, e);
|
||||
});
|
||||
functionList.addEventListener('dragend', function(e) {
|
||||
handleDragend(me.listFunctions, e);
|
||||
});
|
||||
|
||||
macrosList.addEventListener('dragover', function(e) {
|
||||
handleDragover(macrosList, me.CurrentElementModeType.Macros, e)
|
||||
});
|
||||
functionList.addEventListener('dragover', function(e) {
|
||||
handleDragover(functionList, me.CurrentElementModeType.CustomFunction, e)
|
||||
});
|
||||
|
||||
macrosList.addEventListener('dragleave', function(e) {
|
||||
handleDragleave(e);
|
||||
});
|
||||
functionList.addEventListener('dragleave', function(e) {
|
||||
handleDragleave(e);
|
||||
});
|
||||
},
|
||||
|
||||
parseDataFromApi: function(data) {
|
||||
var result = {
|
||||
macrosArray : [],
|
||||
current : -1
|
||||
};
|
||||
if (data) {
|
||||
try {
|
||||
result = JSON.parse(data);
|
||||
} catch (err) {
|
||||
result = {
|
||||
macrosArray: [],
|
||||
current: -1
|
||||
};
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
createGuid: function(a,b){
|
||||
for(b=a='';a++<36;b+=a*51&52?(a^15?8^Math.random()*(a^20?16:4):4).toString(16):'');
|
||||
return b
|
||||
},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
return [].concat(this.getFooterButtons());
|
||||
},
|
||||
|
||||
getDefaultFocusableComponent: function () {
|
||||
|
||||
},
|
||||
|
||||
close: function(suppressevent) {
|
||||
this.codeEditor.destroyEditor();
|
||||
Common.UI.Window.prototype.close.call(this, arguments);
|
||||
},
|
||||
_handleInput: function(state) {
|
||||
if (this.options.handler) {
|
||||
this.options.handler.call(this, this, state);
|
||||
}
|
||||
|
||||
if(state === 'ok') {
|
||||
this.api.pluginMethod_SetMacros(JSON.stringify({
|
||||
macrosArray: this.listMacros.store.models.map(function(item) {
|
||||
return {
|
||||
guid: item.get('guid'),
|
||||
name: item.get('name'),
|
||||
autostart: item.get('autostart'),
|
||||
value: item.get('value')
|
||||
}
|
||||
}),
|
||||
current: this.listMacros.store.indexOf(this.listMacros.getSelectedRec())
|
||||
}));
|
||||
if(this._state.isFunctionsSupport) {
|
||||
this.api.pluginMethod_SetCustomFunctions(JSON.stringify({
|
||||
macrosArray: this.listFunctions.store.models.map(function(item) {
|
||||
return {
|
||||
guid: item.get('guid'),
|
||||
name: item.get('name'),
|
||||
value: item.get('value')
|
||||
}
|
||||
})
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
this.close();
|
||||
},
|
||||
|
||||
onAddListItem: function(listView, itemView) {
|
||||
itemView.$el.attr('draggable', true);
|
||||
itemView.$el.addClass('draggable');
|
||||
},
|
||||
onCreateMacros: function() {
|
||||
var indexMax = 0;
|
||||
var macrosTextEn = 'Macros';
|
||||
var macrosTextTranslate = this.textMacros;
|
||||
this.listMacros.store.each(function(macros, index) {
|
||||
var macrosName = macros.get('name');
|
||||
if (0 == macrosName.indexOf(macrosTextEn))
|
||||
{
|
||||
var index = parseInt(macrosName.substr(macrosTextEn.length));
|
||||
if (!isNaN(index) && (indexMax < index))
|
||||
indexMax = index;
|
||||
}
|
||||
else if (0 == macrosName.indexOf(macrosTextTranslate))
|
||||
{
|
||||
var index = parseInt(macrosName.substr(macrosTextTranslate.length));
|
||||
if (!isNaN(index) && (indexMax < index))
|
||||
indexMax = index;
|
||||
}
|
||||
});
|
||||
indexMax++;
|
||||
this.listMacros.store.add({
|
||||
guid: this.createGuid(),
|
||||
name : (macrosTextTranslate + " " + indexMax),
|
||||
value : "(function()\n{\n})();",
|
||||
autostart: false
|
||||
});
|
||||
this.listMacros.selectRecord(this.listMacros.store.at(-1));
|
||||
},
|
||||
onClickListMacrosItem: function(listView, itemView, record, event) {
|
||||
if(!event) return;
|
||||
|
||||
var btn = $(event.target);
|
||||
if (btn && btn.hasClass('listitem-icon')) {
|
||||
itemView.$el.find('.listitem-icon').addClass('active');
|
||||
this.openContextMenuMacros(record, event);
|
||||
}
|
||||
},
|
||||
onContextMenuListMacrosItem: function(listView, itemView, record, event) {
|
||||
var me = this;
|
||||
this.listMacros.selectRecord(record);
|
||||
_.delay(function() {
|
||||
me.openContextMenuMacros(record, event);
|
||||
}, 10);
|
||||
},
|
||||
onSelectListMacrosItem: function(listView, itemView, record) {
|
||||
this._state.currentElementMode = this.CurrentElementModeType.Macros;
|
||||
this.codeEditor.setValue(record.get('value'));
|
||||
this._state.currentValue = record.get('value');
|
||||
|
||||
this.btnMacrosRun.setDisabled(false);
|
||||
this.listFunctions && this.listFunctions.deselectAll();
|
||||
},
|
||||
onRunMacros: function() {
|
||||
console.log('Run');
|
||||
},
|
||||
onMakeAutostartMacros: function() {
|
||||
if(!this._state.macrosItemMenuOpen) return;
|
||||
|
||||
this._state.macrosItemMenuOpen.set('autostart', true);
|
||||
},
|
||||
onUnMakeAutostartMacros: function() {
|
||||
if(!this._state.macrosItemMenuOpen) return;
|
||||
|
||||
this._state.macrosItemMenuOpen.set('autostart', false);
|
||||
},
|
||||
|
||||
onRenameMacros: function() {
|
||||
if(!this._state.macrosItemMenuOpen) return;
|
||||
|
||||
this.openWindowRename();
|
||||
},
|
||||
onRenameFunction: function() {
|
||||
if(!this._state.functionItemMenuOpen) return;
|
||||
|
||||
this.openWindowRename();
|
||||
},
|
||||
|
||||
onDeleteItem: function(list, item) {
|
||||
if(!item) return;
|
||||
|
||||
var deletedIndex = list.store.indexOf(item);
|
||||
list.store.remove(item);
|
||||
if(list.store.length > 0) {
|
||||
var selectedIndex = deletedIndex < list.store.length
|
||||
? deletedIndex
|
||||
: list.store.length - 1;
|
||||
list.selectByIndex(selectedIndex);
|
||||
} else {
|
||||
this.codeEditor.setValue('');
|
||||
this.btnMacrosRun.setDisabled(true);
|
||||
}
|
||||
},
|
||||
onDeleteMacros: function() {
|
||||
this.onDeleteItem(this.listMacros, this._state.macrosItemMenuOpen);
|
||||
},
|
||||
onDeleteFunction: function() {
|
||||
this.onDeleteItem(this.listFunctions, this._state.functionItemMenuOpen);
|
||||
},
|
||||
|
||||
onCopyItem: function(list, item) {
|
||||
list.store.add({
|
||||
guid: this.createGuid(),
|
||||
name: item.get('name') + '_copy',
|
||||
value: item.get('value'),
|
||||
autostart: item.get('autostart')
|
||||
});
|
||||
list.selectRecord(list.store.at(-1));
|
||||
},
|
||||
onCopyMacros: function() {
|
||||
this.onCopyItem(this.listMacros, this._state.macrosItemMenuOpen);
|
||||
},
|
||||
onCopyFunction: function() {
|
||||
this.onCopyItem(this.listFunctions, this._state.functionItemMenuOpen);
|
||||
},
|
||||
|
||||
|
||||
onCreateFunction: function() {
|
||||
var indexMax = 0;
|
||||
var macrosTextEn = 'Custom function';
|
||||
var macrosTextTranslate = this.textCustomFunction;
|
||||
this.listFunctions.store.each(function(macros, index) {
|
||||
var macrosName = macros.get('name');
|
||||
if (0 == macrosName.indexOf("Custom function"))
|
||||
{
|
||||
var index = parseInt(macrosName.substr(macrosTextEn.length));
|
||||
if (!isNaN(index) && (indexMax < index))
|
||||
indexMax = index;
|
||||
}
|
||||
else if (0 == macrosName.indexOf(macrosTextTranslate))
|
||||
{
|
||||
var index = parseInt(macrosName.substr(macrosTextTranslate.length));
|
||||
if (!isNaN(index) && (indexMax < index))
|
||||
indexMax = index;
|
||||
}
|
||||
});
|
||||
indexMax++;
|
||||
this.listFunctions.store.add({
|
||||
guid: this.createGuid(),
|
||||
name : (macrosTextTranslate + " " + indexMax),
|
||||
value : "(function()\n{\n\t/**\n\t * Function that returns the argument\n\t * @customfunction\n\t * @param {any} arg Any data.\n * @returns {any} The argumet of the function.\n\t*/\n\tfunction myFunction(arg) {\n\t return arg;\n\t}\n\tApi.AddCustomFunction(myFunction);\n})();"
|
||||
});
|
||||
this.listFunctions.selectRecord(this.listFunctions.store.at(-1));
|
||||
},
|
||||
onClickListFunctionItem: function(listView, itemView, record, event) {
|
||||
if(!event) return;
|
||||
|
||||
var btn = $(event.target);
|
||||
if (btn && btn.hasClass('listitem-icon')) {
|
||||
itemView.$el.find('.listitem-icon').addClass('active');
|
||||
this.openContextMenuFunction(record, event);
|
||||
}
|
||||
},
|
||||
onContextMenuListFunctionItem: function(listView, itemView, record, event) {
|
||||
var me = this;
|
||||
this.listFunctions.selectRecord(record);
|
||||
_.delay(function() {
|
||||
me.openContextMenuFunction(record, event);
|
||||
}, 10);
|
||||
},
|
||||
onSelectListFunctionItem: function(listView, itemView, record) {
|
||||
this._state.currentElementMode = this.CurrentElementModeType.CustomFunction;
|
||||
this.codeEditor.setValue(record.get('value'));
|
||||
|
||||
this.btnMacrosRun.setDisabled(true);
|
||||
|
||||
this.listMacros && this.listMacros.deselectAll();
|
||||
},
|
||||
|
||||
onHelp: function() {
|
||||
window.open('https://api.onlyoffice.com/plugin/macros', '_blank')
|
||||
},
|
||||
onBtnClick: function(event) {
|
||||
this._handleInput(event.currentTarget.attributes['result'].value);
|
||||
},
|
||||
// onPrimary: function() {
|
||||
// this.close();
|
||||
// return false;
|
||||
// },
|
||||
|
||||
|
||||
textTitle : 'Macros',
|
||||
textSave : 'Save',
|
||||
textMacros : 'Macros',
|
||||
textRun : 'Run',
|
||||
textUnMakeAutostart : 'Unmake autostart',
|
||||
textMakeAutostart : 'Make autostart',
|
||||
textRename : 'Rename',
|
||||
textDelete : 'Delete',
|
||||
textCopy : 'Copy',
|
||||
textCustomFunction : 'Custom function',
|
||||
textLoading : 'Loading...',
|
||||
tipMacrosRun : 'Run',
|
||||
tipMacrosAdd : 'Add macros',
|
||||
tipFunctionAdd : 'Add custom function',
|
||||
}, Common.Views.MacrosDialog || {}))
|
||||
});
|
||||
BIN
apps/common/main/resources/img/toolbar/1.25x/big/btn-macros.png
Normal file
|
After Width: | Height: | Size: 258 B |
BIN
apps/common/main/resources/img/toolbar/1.25x/btn-run.png
Normal file
|
After Width: | Height: | Size: 256 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/big/btn-macros.png
Normal file
|
After Width: | Height: | Size: 275 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/btn-run.png
Normal file
|
After Width: | Height: | Size: 302 B |
BIN
apps/common/main/resources/img/toolbar/1.75x/big/btn-macros.png
Normal file
|
After Width: | Height: | Size: 284 B |
BIN
apps/common/main/resources/img/toolbar/1.75x/btn-run.png
Normal file
|
After Width: | Height: | Size: 345 B |
BIN
apps/common/main/resources/img/toolbar/1x/big/btn-macros.png
Normal file
|
After Width: | Height: | Size: 240 B |
BIN
apps/common/main/resources/img/toolbar/1x/btn-run.png
Normal file
|
After Width: | Height: | Size: 234 B |
@ -0,0 +1,4 @@
|
||||
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M4 7h14v3h1V4a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h6v-1H4zm14-1H4V4h14z" fill="#000"/>
|
||||
<path d="M16 9H6v1h10zm-6 3H6v1h4zm-4 3h4v1H6zm14 10a2 2 0 0 0 2-2v-7h2a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2h-9a2 2 0 0 0-2 2v7h-2a1 1 0 0 0-1 1v1a2 2 0 0 0 2 2zm3-12a1 1 0 0 1 1 1v1h-2v-1.001a1 1 0 0 1 .998-.999zm-10 1a1 1 0 0 1 1-1h7.268a2 2 0 0 0-.268.998V23a1 1 0 0 1-1 1h-.001A1 1 0 0 1 19 23v-2h-6zm5.207 9.888.06.112H11a1 1 0 0 1-1-1v-1h8v1c0 .319.075.62.207.887" fill="#000"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 596 B |
3
apps/common/main/resources/img/toolbar/2.5x/btn-run.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m6 5.752 8.034 4.748L6 15.247zm-.246-1.307a.5.5 0 0 0-.754.43v11.248a.5.5 0 0 0 .754.43l9.518-5.623a.5.5 0 0 0 0-.86z" fill="#000"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 249 B |
BIN
apps/common/main/resources/img/toolbar/2x/big/btn-macros.png
Normal file
|
After Width: | Height: | Size: 402 B |
BIN
apps/common/main/resources/img/toolbar/2x/btn-run.png
Normal file
|
After Width: | Height: | Size: 403 B |
@ -318,4 +318,6 @@
|
||||
@canvas-scroll-arrow-hover: var(--canvas-scroll-arrow-hover);
|
||||
@canvas-scroll-thumb-hover: var(--canvas-scroll-thumb-hover);
|
||||
@canvas-scroll-thumb-border-hover: var(--canvas-scroll-thumb-border-hover);
|
||||
@canvas-scroll-thumb: var(--canvas-scroll-thumb);
|
||||
@canvas-scroll-thumb-pressed: var(--canvas-scroll-thumb-pressed);
|
||||
|
||||
|
||||
127
apps/common/main/resources/less/macros-dialog.less
Normal file
@ -0,0 +1,127 @@
|
||||
#macros-dialog {
|
||||
.body {
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
padding-top: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
height: calc(100% - 37px); // 37px - footer height
|
||||
|
||||
.common_menu {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
width: 30%;
|
||||
overflow: hidden;
|
||||
|
||||
#menu_macros {
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
#menu_functions {
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.menu_header {
|
||||
height: 26px;
|
||||
margin: 16px 12px 16px 12px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
label {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.div_buttons {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
#list-macros, #list-functions {
|
||||
height: calc(100% - 58px);
|
||||
padding: 2px 4px 4px 4px;
|
||||
|
||||
.listview {
|
||||
border: none;
|
||||
.item {
|
||||
display: flex;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 4px 8px 4px 0px;
|
||||
margin: 2px 0;
|
||||
border: none;
|
||||
cursor: default;
|
||||
&:not(:hover):not(.selected) {
|
||||
background-color: @background-toolbar-ie;
|
||||
background-color: @background-toolbar;
|
||||
}
|
||||
&.dragged {
|
||||
opacity: 0.6;
|
||||
}
|
||||
&.dragHovered:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background-color: @highlight-button-pressed-ie !important;
|
||||
background-color: @highlight-button-pressed !important;
|
||||
left: 0;
|
||||
}
|
||||
&.dragHovered.last:after {
|
||||
bottom: -2px;
|
||||
}
|
||||
&.dragHovered:not(.last):after {
|
||||
top: -2px;
|
||||
}
|
||||
|
||||
.listitem-autostart {
|
||||
font-size: 9px;
|
||||
width: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
flex: 1;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.listitem-icon {
|
||||
cursor: pointer;
|
||||
margin-left: 10px;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
line-height: 20px;
|
||||
border-radius: 2px;
|
||||
|
||||
&.active {
|
||||
background-color: @highlight-button-pressed-hover;
|
||||
}
|
||||
}
|
||||
&.selected {
|
||||
.listitem-icon {
|
||||
background-position-x: @button-small-active-icon-offset-x;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#code-editor {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -342,7 +342,7 @@
|
||||
scrollbar-arrow-color: #adadad;
|
||||
/*----------------------------------------------------------*/
|
||||
|
||||
scrollbar-color: var(--canvas-scroll-thumb) @canvas-background; //FireFox
|
||||
scrollbar-color: @canvas-scroll-thumb-pressed @canvas-scroll-thumb;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
height: 14px;
|
||||
|
||||
@ -3662,6 +3662,7 @@ define([
|
||||
me.toolbar.addTab(tab, $panel, 8);
|
||||
me.toolbar.setVisible('view', Common.UI.LayoutManager.isElementVisible('toolbar-view'));
|
||||
}
|
||||
config.isEdit && Array.prototype.push.apply(me.toolbar.lockControls, viewtab.getView('ViewTab').getButtons());
|
||||
},
|
||||
|
||||
onAppReady: function (config) {
|
||||
|
||||
@ -86,7 +86,8 @@ define([
|
||||
'zoom:topage': _.bind(this.onBtnZoomTo, this, 'topage'),
|
||||
'zoom:towidth': _.bind(this.onBtnZoomTo, this, 'towidth'),
|
||||
'rulers:change': _.bind(this.onChangeRulers, this),
|
||||
'darkmode:change': _.bind(this.onChangeDarkMode, this)
|
||||
'darkmode:change': _.bind(this.onChangeDarkMode, this),
|
||||
'macros:click': _.bind(this.onClickMacros, this)
|
||||
},
|
||||
'Toolbar': {
|
||||
'view:compact': _.bind(function (toolbar, state) {
|
||||
@ -328,6 +329,14 @@ define([
|
||||
Common.NotificationCenter.trigger('edit:complete', this.view);
|
||||
},
|
||||
|
||||
onClickMacros: function() {
|
||||
var me = this;
|
||||
var macrosWindow = new Common.Views.MacrosDialog({
|
||||
api: this.api,
|
||||
});
|
||||
macrosWindow.show();
|
||||
},
|
||||
|
||||
onChangeDarkMode: function (isdarkmode) {
|
||||
if (!this._darkModeTimer) {
|
||||
var me = this;
|
||||
@ -368,4 +377,4 @@ define([
|
||||
}
|
||||
|
||||
}, DE.Controllers.ViewTab || {}));
|
||||
});
|
||||
});
|
||||
|
||||
@ -95,6 +95,10 @@ define([
|
||||
'</div>' +
|
||||
'<div class="elset"></div>' +
|
||||
'</div>' +
|
||||
'<div class="separator long"></div>' +
|
||||
'<div class="group">' +
|
||||
'<span class="btn-slot text x-huge" id="slot-btn-macros"></span>' +
|
||||
'</div>' +
|
||||
'</section>';
|
||||
|
||||
return {
|
||||
@ -137,6 +141,9 @@ define([
|
||||
cmb.on('combo:focusin', _.bind(me.onComboOpen, this, false));
|
||||
cmb.on('show:after', _.bind(me.onComboOpen, this, true));
|
||||
});
|
||||
me.btnMacros.on('click', function () {
|
||||
me.fireEvent('macros:click');
|
||||
});
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
@ -260,6 +267,17 @@ define([
|
||||
});
|
||||
this.lockedControls.push(this.chRulers);
|
||||
|
||||
this.btnMacros = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'toolbar__icon btn-macros',
|
||||
lock: [_set.viewMode, _set.previewReviewMode, _set.viewFormMode, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.lostConnect, _set.disableOnStart],
|
||||
caption: this.textMacros,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: 'small'
|
||||
});
|
||||
this.lockedControls.push(this.btnMacros);
|
||||
|
||||
Common.Utils.lockControls(_set.disableOnStart, true, {array: this.lockedControls});
|
||||
Common.UI.LayoutManager.addControls(this.lockedControls);
|
||||
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
||||
@ -311,6 +329,7 @@ define([
|
||||
this.chStatusbar.render($host.find('#slot-chk-statusbar'));
|
||||
this.chToolbar.render($host.find('#slot-chk-toolbar'));
|
||||
this.chRulers.render($host.find('#slot-chk-rulers'));
|
||||
this.btnMacros.render($host.find('#slot-btn-macros'));
|
||||
this.chLeftMenu.render($host.find('#slot-chk-leftmenu'));
|
||||
this.chRightMenu.render($host.find('#slot-chk-rightmenu'));
|
||||
|
||||
@ -342,6 +361,7 @@ define([
|
||||
this.btnsFitToWidth.forEach(function (btn) {
|
||||
btn.updateHint(me.tipFitToWidth);
|
||||
});
|
||||
this.btnMacros.updateHint(this.tipMacros);
|
||||
|
||||
var value = Common.UI.LayoutManager.getInitValue('leftMenu');
|
||||
value = (value!==undefined) ? !value : false;
|
||||
@ -403,7 +423,9 @@ define([
|
||||
textRightMenu: 'Right panel',
|
||||
textTabStyle: 'Tab style',
|
||||
textFill: 'Fill',
|
||||
textLine: 'Line'
|
||||
textLine: 'Line',
|
||||
textMacros: 'Macros',
|
||||
tipMacros: 'Macros'
|
||||
}
|
||||
}()), DE.Views.ViewTab || {}));
|
||||
});
|
||||
});
|
||||
|
||||
@ -224,6 +224,8 @@ require([
|
||||
'common/main/lib/util/define',
|
||||
'common/main/lib/view/PdfSignDialog',
|
||||
'common/main/lib/view/DocumentPropertyDialog',
|
||||
'common/main/lib/view/MacrosDialog',
|
||||
'common/main/lib/component/AceEditor',
|
||||
|
||||
'documenteditor/main/app/view/FileMenuPanels',
|
||||
'documenteditor/main/app/view/DocumentHolderExt',
|
||||
|
||||
@ -29,6 +29,8 @@ require([
|
||||
'common/main/lib/view/DocumentHolderExt',
|
||||
'common/main/lib/view/PdfSignDialog',
|
||||
'common/main/lib/view/DocumentPropertyDialog',
|
||||
'common/main/lib/view/MacrosDialog',
|
||||
'common/main/lib/component/AceEditor',
|
||||
|
||||
'documenteditor/main/app/view/FileMenuPanels',
|
||||
'documenteditor/main/app/view/DocumentHolderExt',
|
||||
|
||||
@ -615,6 +615,20 @@
|
||||
"Common.Views.InsertTableDialog.txtTitle": "Table size",
|
||||
"Common.Views.InsertTableDialog.txtTitleSplit": "Split cell",
|
||||
"Common.Views.LanguageDialog.labelSelect": "Select document language",
|
||||
"Common.Views.MacrosDialog.textTitle": "Macros",
|
||||
"Common.Views.MacrosDialog.textSave": "Save",
|
||||
"Common.Views.MacrosDialog.textMacros": "Macros",
|
||||
"Common.Views.MacrosDialog.textRun": "Run",
|
||||
"Common.Views.MacrosDialog.textUnMakeAutostart": "Unmake autostart",
|
||||
"Common.Views.MacrosDialog.textMakeAutostart": "Make autostart",
|
||||
"Common.Views.MacrosDialog.textRename": "Rename",
|
||||
"Common.Views.MacrosDialog.textDelete": "Delete",
|
||||
"Common.Views.MacrosDialog.textCopy": "Copy",
|
||||
"Common.Views.MacrosDialog.textCustomFunction": "Custom function",
|
||||
"Common.Views.MacrosDialog.textLoading": "Loading...",
|
||||
"Common.Views.MacrosDialog.tipMacrosRun": "Run",
|
||||
"Common.Views.MacrosDialog.tipMacrosAdd": "Add macros",
|
||||
"Common.Views.MacrosDialog.tipFunctionAdd": "Add custom function",
|
||||
"Common.Views.OpenDialog.closeButtonText": "Close file",
|
||||
"Common.Views.OpenDialog.txtEncoding": "Encoding ",
|
||||
"Common.Views.OpenDialog.txtIncorrectPwd": "Password is incorrect.",
|
||||
@ -3644,6 +3658,8 @@
|
||||
"DE.Views.ViewTab.tipFitToWidth": "Fit to width",
|
||||
"DE.Views.ViewTab.tipHeadings": "Headings",
|
||||
"DE.Views.ViewTab.tipInterfaceTheme": "Interface theme",
|
||||
"DE.Views.ViewTab.textMacros": "Macros",
|
||||
"DE.Views.ViewTab.tipMacros": "Macros",
|
||||
"DE.Views.WatermarkSettingsDialog.textAuto": "Auto",
|
||||
"DE.Views.WatermarkSettingsDialog.textBold": "Bold",
|
||||
"DE.Views.WatermarkSettingsDialog.textColor": "Text color",
|
||||
|
||||
@ -128,6 +128,7 @@
|
||||
@import "../../../../common/main/resources/less/hint-manager.less";
|
||||
@import "../../../../common/main/resources/less/bigscaling.less";
|
||||
@import "../../../../common/main/resources/less/updown-picker.less";
|
||||
@import "../../../../common/main/resources/less/macros-dialog.less";
|
||||
|
||||
// App
|
||||
// --------------------------------------------------
|
||||
|
||||
@ -111,7 +111,8 @@ define([
|
||||
'gridlines:snap': _.bind(this.onGridlinesSnap, this),
|
||||
'gridlines:spacing': _.bind(this.onGridlinesSpacing, this),
|
||||
'gridlines:custom': _.bind(this.onGridlinesCustom, this),
|
||||
'gridlines:aftershow': _.bind(this.onGridlinesAfterShow, this)
|
||||
'gridlines:aftershow': _.bind(this.onGridlinesAfterShow, this),
|
||||
'macros:click': _.bind(this.onClickMacros, this)
|
||||
},
|
||||
'Toolbar': {
|
||||
'view:compact': _.bind(function (toolbar, state) {
|
||||
@ -384,6 +385,14 @@ define([
|
||||
}
|
||||
},
|
||||
|
||||
onClickMacros: function() {
|
||||
var me = this;
|
||||
var macrosWindow = new Common.Views.MacrosDialog({
|
||||
api: this.api,
|
||||
});
|
||||
macrosWindow.show();
|
||||
},
|
||||
|
||||
onLockViewProps: function(lock) {
|
||||
this._state.lock_viewProps = lock;
|
||||
Common.Utils.InternalSettings.set("pe-lock-view-props", lock);
|
||||
@ -428,4 +437,4 @@ define([
|
||||
}
|
||||
|
||||
}, PE.Controllers.ViewTab || {}));
|
||||
});
|
||||
});
|
||||
|
||||
@ -101,6 +101,10 @@ define([
|
||||
'<span class="btn-slot text" id="slot-chk-rightmenu"></span>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="separator long"></div>' +
|
||||
'<div class="group">' +
|
||||
'<span class="btn-slot text x-huge" id="slot-btn-macros"></span>' +
|
||||
'</div>' +
|
||||
'</section>';
|
||||
return {
|
||||
options: {},
|
||||
@ -182,6 +186,9 @@ define([
|
||||
me.chRightMenu.on('change', _.bind(function (checkbox, state) {
|
||||
me.fireEvent('rightmenu:hide', [me.chRightMenu, state === 'checked']);
|
||||
}, me));
|
||||
me.btnMacros.on('click', function () {
|
||||
me.fireEvent('macros:click');
|
||||
});
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
@ -376,6 +383,17 @@ define([
|
||||
dataHintOffset: 'small'
|
||||
});
|
||||
this.lockedControls.push(this.chLeftMenu);
|
||||
|
||||
this.btnMacros = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'toolbar__icon btn-macros',
|
||||
lock: [_set.lostConnect, _set.disableOnStart],
|
||||
caption: this.textMacros,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: 'small'
|
||||
});
|
||||
this.lockedControls.push(this.btnMacros);
|
||||
Common.UI.LayoutManager.addControls(this.lockedControls);
|
||||
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
||||
},
|
||||
@ -405,6 +423,7 @@ define([
|
||||
this.btnGridlines.render($host.find('#slot-btn-gridlines'));
|
||||
this.chLeftMenu.render($host.find('#slot-chk-leftmenu'));
|
||||
this.chRightMenu.render($host.find('#slot-chk-rightmenu'));
|
||||
this.btnMacros.render($host.find('#slot-btn-macros'));
|
||||
return this.$el;
|
||||
},
|
||||
|
||||
@ -420,7 +439,8 @@ define([
|
||||
me.btnInterfaceTheme.updateHint(me.tipInterfaceTheme);
|
||||
me.btnGuides.updateHint(me.tipGuides);
|
||||
me.btnGridlines.updateHint(me.tipGridlines);
|
||||
|
||||
me.btnMacros.updateHint(me.tipMacros);
|
||||
|
||||
me.btnGuides.setMenu( new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
items: [
|
||||
@ -614,7 +634,9 @@ define([
|
||||
tipSlideMaster: 'Slide master',
|
||||
textTabStyle: 'Tab style',
|
||||
textFill: 'Fill',
|
||||
textLine: 'Line'
|
||||
textLine: 'Line',
|
||||
textMacros: 'Macros',
|
||||
tipMacros: 'Macros'
|
||||
}
|
||||
}()), PE.Views.ViewTab || {}));
|
||||
});
|
||||
});
|
||||
|
||||
@ -220,7 +220,9 @@ require([
|
||||
'common/main/lib/view/SignDialog',
|
||||
'common/main/lib/view/ListSettingsDialog',
|
||||
'common/main/lib/view/DocumentPropertyDialog',
|
||||
|
||||
'common/main/lib/view/MacrosDialog',
|
||||
'common/main/lib/component/AceEditor',
|
||||
|
||||
'presentationeditor/main/app/view/FileMenuPanels',
|
||||
'presentationeditor/main/app/view/DocumentHolderExt',
|
||||
'presentationeditor/main/app/view/ParagraphSettingsAdvanced',
|
||||
|
||||
@ -26,7 +26,9 @@ require([
|
||||
'common/main/lib/view/SignDialog',
|
||||
'common/main/lib/view/ListSettingsDialog',
|
||||
'common/main/lib/view/DocumentPropertyDialog',
|
||||
|
||||
'common/main/lib/view/MacrosDialog',
|
||||
'common/main/lib/component/AceEditor',
|
||||
|
||||
'presentationeditor/main/app/view/FileMenuPanels',
|
||||
'presentationeditor/main/app/view/DocumentHolderExt',
|
||||
'presentationeditor/main/app/view/ParagraphSettingsAdvanced',
|
||||
|
||||
@ -716,6 +716,20 @@
|
||||
"Common.Views.ListSettingsDialog.txtSymbol": "Symbol",
|
||||
"Common.Views.ListSettingsDialog.txtTitle": "List settings",
|
||||
"Common.Views.ListSettingsDialog.txtType": "Type",
|
||||
"Common.Views.MacrosDialog.textTitle": "Macros",
|
||||
"Common.Views.MacrosDialog.textSave": "Save",
|
||||
"Common.Views.MacrosDialog.textMacros": "Macros",
|
||||
"Common.Views.MacrosDialog.textRun": "Run",
|
||||
"Common.Views.MacrosDialog.textUnMakeAutostart": "Unmake autostart",
|
||||
"Common.Views.MacrosDialog.textMakeAutostart": "Make autostart",
|
||||
"Common.Views.MacrosDialog.textRename": "Rename",
|
||||
"Common.Views.MacrosDialog.textDelete": "Delete",
|
||||
"Common.Views.MacrosDialog.textCopy": "Copy",
|
||||
"Common.Views.MacrosDialog.textCustomFunction": "Custom function",
|
||||
"Common.Views.MacrosDialog.textLoading": "Loading...",
|
||||
"Common.Views.MacrosDialog.tipMacrosRun": "Run",
|
||||
"Common.Views.MacrosDialog.tipMacrosAdd": "Add macros",
|
||||
"Common.Views.MacrosDialog.tipFunctionAdd": "Add custom function",
|
||||
"Common.Views.OpenDialog.closeButtonText": "Close file",
|
||||
"Common.Views.OpenDialog.txtEncoding": "Encoding ",
|
||||
"Common.Views.OpenDialog.txtIncorrectPwd": "Password is incorrect.",
|
||||
@ -2935,5 +2949,7 @@
|
||||
"PE.Views.ViewTab.tipInterfaceTheme": "Interface theme",
|
||||
"PE.Views.ViewTab.tipNormal": "Normal",
|
||||
"PE.Views.ViewTab.tipSlideMaster": "Slide master",
|
||||
"PE.Views.Toolbar.textTabDesign": "Design"
|
||||
"PE.Views.Toolbar.textTabDesign": "Design",
|
||||
"PE.Views.ViewTab.textMacros": "Macros",
|
||||
"PE.Views.ViewTab.tipMacros": "Macros"
|
||||
}
|
||||
|
||||
@ -127,6 +127,7 @@
|
||||
@import "../../../../common/main/resources/less/bigscaling.less";
|
||||
@import "../../../../common/main/resources/less/updown-picker.less";
|
||||
@import "../../../../common/main/resources/less/calendar.less";
|
||||
@import "../../../../common/main/resources/less/macros-dialog.less";
|
||||
|
||||
// App
|
||||
// --------------------------------------------------
|
||||
@ -276,4 +277,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,7 +99,8 @@ define([
|
||||
'viewtab:openview': this.onOpenView,
|
||||
'viewtab:createview': this.onCreateView,
|
||||
'viewtab:manager': this.onOpenManager,
|
||||
'viewtab:viewmode': this.onPreviewMode
|
||||
'viewtab:viewmode': this.onPreviewMode,
|
||||
'macros:click': this.onClickMacros
|
||||
},
|
||||
'Statusbar': {
|
||||
'sheet:changed': this.onApiSheetChanged.bind(this),
|
||||
@ -311,6 +312,14 @@ define([
|
||||
this.api && this.api.asc_SetSheetViewType(value);
|
||||
},
|
||||
|
||||
onClickMacros: function() {
|
||||
var me = this;
|
||||
var macrosWindow = new Common.Views.MacrosDialog({
|
||||
api: this.api,
|
||||
});
|
||||
macrosWindow.show();
|
||||
},
|
||||
|
||||
onApiUpdateSheetViewType: function(index) {
|
||||
if (this.view && this.api && index === this.api.asc_getActiveWorksheetIndex()) {
|
||||
var value = this.api.asc_GetSheetViewType(index);
|
||||
@ -321,4 +330,4 @@ define([
|
||||
|
||||
|
||||
}, SSE.Controllers.ViewTab || {}));
|
||||
});
|
||||
});
|
||||
|
||||
@ -112,6 +112,10 @@ define([
|
||||
'<span class="btn-slot text" id="slot-chk-rightmenu"></span>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="separator long"></div>' +
|
||||
'<div class="group">' +
|
||||
'<span class="btn-slot text x-huge" id="slot-btn-macros"></span>' +
|
||||
'</div>' +
|
||||
'</section>';
|
||||
|
||||
function setEvents() {
|
||||
@ -166,6 +170,9 @@ define([
|
||||
me.chRightMenu.on('change', _.bind(function (checkbox, state) {
|
||||
me.fireEvent('rightmenu:hide', [me.chRightMenu, state === 'checked']);
|
||||
}, me));
|
||||
me.btnMacros.on('click', function () {
|
||||
me.fireEvent('macros:click');
|
||||
});
|
||||
me.btnViewNormal && me.btnViewNormal.on('click', function (btn, e) {
|
||||
btn.pressed && me.fireEvent('viewtab:viewmode', [Asc.c_oAscESheetViewType.normal]);
|
||||
});
|
||||
@ -377,6 +384,17 @@ define([
|
||||
dataHintOffset: 'small'
|
||||
});
|
||||
this.lockedControls.push(this.chLeftMenu);
|
||||
|
||||
this.btnMacros = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'toolbar__icon btn-macros',
|
||||
lock: [_set.selRangeEdit, _set.editFormula, _set.lostConnect, _set.disableOnStart],
|
||||
caption: this.textMacros,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: 'small'
|
||||
});
|
||||
this.lockedControls.push(this.btnMacros);
|
||||
Common.UI.LayoutManager.addControls(this.lockedControls);
|
||||
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
||||
},
|
||||
@ -407,6 +425,7 @@ define([
|
||||
this.chZeros && this.chZeros.render($host.find('#slot-chk-zeros'));
|
||||
this.chLeftMenu.render($host.find('#slot-chk-leftmenu'));
|
||||
this.chRightMenu.render($host.find('#slot-chk-rightmenu'));
|
||||
this.btnMacros.render($host.find('#slot-btn-macros'));
|
||||
this.btnViewNormal && this.btnViewNormal.render($host.find('#slot-btn-view-normal'));
|
||||
this.btnViewPageBreak && this.btnViewPageBreak.render($host.find('#slot-btn-view-pagebreak'));
|
||||
return this.$el;
|
||||
@ -427,7 +446,7 @@ define([
|
||||
me.btnCreateView.updateHint(me.tipCreate);
|
||||
me.btnCloseView.updateHint(me.tipClose);
|
||||
}
|
||||
|
||||
me.btnMacros.updateHint(me.tipMacros);
|
||||
me.btnInterfaceTheme.updateHint(me.tipInterfaceTheme);
|
||||
|
||||
if (config.isEdit) {
|
||||
@ -674,7 +693,9 @@ define([
|
||||
tipViewPageBreak: 'See where the page breaks will appear when your document is printed',
|
||||
textTabStyle: 'Tab style',
|
||||
textFill: 'Fill',
|
||||
textLine: 'Line'
|
||||
textLine: 'Line',
|
||||
textMacros: 'Macros',
|
||||
tipMacros: 'Macros'
|
||||
}
|
||||
}()), SSE.Views.ViewTab || {}));
|
||||
});
|
||||
|
||||
@ -219,7 +219,9 @@ require([
|
||||
'common/main/lib/view/SignDialog',
|
||||
'common/main/lib/view/SignSettingsDialog',
|
||||
'common/main/lib/view/DocumentPropertyDialog',
|
||||
|
||||
'common/main/lib/view/MacrosDialog',
|
||||
'common/main/lib/component/AceEditor',
|
||||
|
||||
'spreadsheeteditor/main/app/view/FileMenuPanels',
|
||||
'spreadsheeteditor/main/app/view/DocumentHolderExt',
|
||||
'spreadsheeteditor/main/app/view/PivotShowDetailDialog',
|
||||
|
||||
@ -25,7 +25,9 @@ require([
|
||||
'common/main/lib/view/SignDialog',
|
||||
'common/main/lib/view/SignSettingsDialog',
|
||||
'common/main/lib/view/DocumentPropertyDialog',
|
||||
|
||||
'common/main/lib/view/MacrosDialog',
|
||||
'common/main/lib/component/AceEditor',
|
||||
|
||||
'spreadsheeteditor/main/app/view/FileMenuPanels',
|
||||
'spreadsheeteditor/main/app/view/DocumentHolderExt',
|
||||
'spreadsheeteditor/main/app/view/PivotShowDetailDialog',
|
||||
|
||||
@ -545,6 +545,20 @@
|
||||
"Common.Views.ListSettingsDialog.txtSymbol": "Symbol",
|
||||
"Common.Views.ListSettingsDialog.txtTitle": "List settings",
|
||||
"Common.Views.ListSettingsDialog.txtType": "Type",
|
||||
"Common.Views.MacrosDialog.textTitle": "Macros",
|
||||
"Common.Views.MacrosDialog.textSave": "Save",
|
||||
"Common.Views.MacrosDialog.textMacros": "Macros",
|
||||
"Common.Views.MacrosDialog.textRun": "Run",
|
||||
"Common.Views.MacrosDialog.textUnMakeAutostart": "Unmake autostart",
|
||||
"Common.Views.MacrosDialog.textMakeAutostart": "Make autostart",
|
||||
"Common.Views.MacrosDialog.textRename": "Rename",
|
||||
"Common.Views.MacrosDialog.textDelete": "Delete",
|
||||
"Common.Views.MacrosDialog.textCopy": "Copy",
|
||||
"Common.Views.MacrosDialog.textCustomFunction": "Custom function",
|
||||
"Common.Views.MacrosDialog.textLoading": "Loading...",
|
||||
"Common.Views.MacrosDialog.tipMacrosRun": "Run",
|
||||
"Common.Views.MacrosDialog.tipMacrosAdd": "Add macros",
|
||||
"Common.Views.MacrosDialog.tipFunctionAdd": "Add custom function",
|
||||
"Common.Views.OpenDialog.closeButtonText": "Close file",
|
||||
"Common.Views.OpenDialog.textInvalidRange": "Invalid cells range",
|
||||
"Common.Views.OpenDialog.textSelectData": "Select data",
|
||||
@ -4481,6 +4495,8 @@
|
||||
"SSE.Views.ViewTab.tipViewPageBreak": "See where the page breaks will appear when your document is printed",
|
||||
"SSE.Views.ViewTab.txtViewNormal": "Normal",
|
||||
"SSE.Views.ViewTab.txtViewPageBreak": "Page Break Preview",
|
||||
"SSE.Views.ViewTab.textMacros": "Macros",
|
||||
"SSE.Views.ViewTab.tipMacros": "Macros",
|
||||
"SSE.Views.WatchDialog.closeButtonText": "Close",
|
||||
"SSE.Views.WatchDialog.textAdd": "Add watch",
|
||||
"SSE.Views.WatchDialog.textBook": "Book",
|
||||
|
||||
@ -127,6 +127,7 @@
|
||||
@import "../../../../common/main/resources/less/history.less";
|
||||
@import "../../../../common/main/resources/less/bigscaling.less";
|
||||
@import "../../../../common/main/resources/less/updown-picker.less";
|
||||
@import "../../../../common/main/resources/less/macros-dialog.less";
|
||||
|
||||
// App
|
||||
// --------------------------------------------------
|
||||
@ -203,7 +204,7 @@
|
||||
//-moz-animation: flickerAnimation 2s infinite ease-in-out;
|
||||
//-o-animation: flickerAnimation 2s infinite ease-in-out;
|
||||
//animation: flickerAnimation 2s infinite ease-in-out;
|
||||
|
||||
|
||||
> .columns {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@ -219,4 +220,4 @@
|
||||
width: 25px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -336,6 +336,7 @@ module.exports = function(grunt) {
|
||||
doRegisterTask('fetch');
|
||||
doRegisterTask('es6-promise');
|
||||
doRegisterTask('common-embed');
|
||||
doRegisterTask('ace');
|
||||
doRegisterTask('requirejs', function(defaultConfig, packageFile) {
|
||||
return {
|
||||
terser: {
|
||||
@ -819,6 +820,7 @@ module.exports = function(grunt) {
|
||||
grunt.registerTask('deploy-bootstrap', ['bootstrap-init', 'clean', 'copy']);
|
||||
grunt.registerTask('deploy-requirejs', ['requirejs-init', 'clean', 'terser']);
|
||||
grunt.registerTask('deploy-es6-promise', ['es6-promise-init', 'clean', 'copy']);
|
||||
grunt.registerTask('deploy-ace', ['ace-init', 'clean', 'copy']);
|
||||
grunt.registerTask('deploy-common-embed', ['common-embed-init', 'clean', 'copy']);
|
||||
|
||||
grunt.registerTask('deploy-app-main', ['prebuild-icons-sprite', 'main-app-init', 'clean:prebuild', 'imagemin', 'less',
|
||||
|
||||
@ -253,6 +253,19 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"ace": {
|
||||
"clean": [
|
||||
"../deploy/web-apps/vendor/ace"
|
||||
],
|
||||
"copy": {
|
||||
"script": {
|
||||
"expand": true,
|
||||
"cwd": "../vendor/ace",
|
||||
"src": "**",
|
||||
"dest": "../deploy/web-apps/vendor/ace"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tasks": {
|
||||
"deploy": [
|
||||
"increment-build",
|
||||
@ -268,7 +281,8 @@
|
||||
"deploy-iscroll",
|
||||
"deploy-fetch",
|
||||
"deploy-es6-promise",
|
||||
"deploy-common-embed"
|
||||
"deploy-common-embed",
|
||||
"deploy-ace"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
23
vendor/ace/ace.js
vendored
Normal file
145
vendor/ace/component/AceEditor.html
vendored
Normal file
@ -0,0 +1,145 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>CODE EDITOR</title>
|
||||
<style type="text/css">
|
||||
#editor {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.ace_content {
|
||||
background: #fff;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.ace_layer.ace_gutter-layer.ace_folding-enabled {
|
||||
color: #444;
|
||||
}
|
||||
.ace_scroller {
|
||||
border-left: none;
|
||||
}
|
||||
.ace_cursor {
|
||||
color: #444 !important;
|
||||
}
|
||||
.ace_dark.ace_editor, .ace_dark .ace_content, .ace_dark .ace_layer.ace_gutter-layer {
|
||||
background-color: #333;
|
||||
}
|
||||
.ace_dark .ace_content, .ace_dark .ace_layer.ace_gutter-layer, .ace_dark .ace_cursor {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
.ace-chrome .ace_marker-layer .ace_selected-word {
|
||||
background: rgb(250, 250, 255, 0.3) !important;
|
||||
border: 1px solid rgb(200, 200, 250);
|
||||
}
|
||||
.ace_active-line, .ace_gutter-active-line, .ace_gutter-active-line-bg {
|
||||
border-bottom: 1px solid;
|
||||
border-top: 1px solid;
|
||||
border-color: #eee !important;
|
||||
background-color: #fff !important;
|
||||
}
|
||||
.oo_highlight {
|
||||
background-color: #555 !important;
|
||||
}
|
||||
.ace_line-hover, .ace_autocomplete .ace_active-line {
|
||||
background-color: #e0e0e0 !important;
|
||||
border: none !important;
|
||||
}
|
||||
.ace_completion-highlight {
|
||||
color: #0000ff !important;
|
||||
text-shadow: 0 0 0.01em;
|
||||
}
|
||||
.ace_dark .ace_completion-highlight {
|
||||
color: #4FC1FF !important;
|
||||
}
|
||||
.Ace-Tern-farg {
|
||||
color: gray;
|
||||
}
|
||||
.Ace-Tern-farg-current {
|
||||
color: gray;
|
||||
}
|
||||
.Ace-Tern-type {
|
||||
color: #569CD6;
|
||||
}
|
||||
.Ace-Tern-jsdoc-param-name {
|
||||
color: gray;
|
||||
}
|
||||
.ace_gutter, .gutter_bg {
|
||||
background: #fff !important;
|
||||
}
|
||||
.Ace-Tern-jsdoc-tag {
|
||||
color: #FF5E5C;
|
||||
}
|
||||
.Ace-Tern-farg-current-description {
|
||||
color : #FFFFFF;
|
||||
}
|
||||
.Ace-Tern-farg-current-name {
|
||||
color : white;
|
||||
}
|
||||
.Ace-Tern-tooltip, .Ace-Tern-jsdoc-param-description {
|
||||
color: #444;
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
.Ace-Tern-tooltip {
|
||||
font-size: 11px;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
border-top: 1px solid #dfdfdf;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
bottom: 0;
|
||||
left: 0 !important;
|
||||
top: initial !important;
|
||||
}
|
||||
.Ace-Tern-tooltip .Ace-Tern-tooltip-boxclose {
|
||||
color: #444 !important;
|
||||
opacity: 0.7;
|
||||
}
|
||||
.Ace-Tern-tooltip .Ace-Tern-tooltip-boxclose:hover {
|
||||
opacity: 1;
|
||||
background: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ace_autocomplete {
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175) !important;
|
||||
scrollbar-color: #adadad #f7f7f7;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="editor"></div>
|
||||
|
||||
<script src="../ace.js"></script>
|
||||
<script src="../ext-language_tools.js"></script>
|
||||
|
||||
<!-- code -->
|
||||
<script>
|
||||
function getUrlParams() {
|
||||
var e,
|
||||
a = /\+/g, // Regex for replacing addition symbol with a space
|
||||
r = /([^&=]+)=?([^&]*)/g,
|
||||
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
|
||||
q = window.location.search.substring(1),
|
||||
urlParams = {};
|
||||
|
||||
while (e = r.exec(q))
|
||||
urlParams[d(e[1])] = d(e[2]);
|
||||
|
||||
return urlParams;
|
||||
}
|
||||
|
||||
var params = getUrlParams();
|
||||
window.editorType = params["editorType"]; // word/cell/slide
|
||||
</script>
|
||||
<script src="AceEditorCode.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
190
vendor/ace/component/AceEditor.js
vendored
Normal file
@ -0,0 +1,190 @@
|
||||
(function(window, document) {
|
||||
/*
|
||||
* config = {
|
||||
* editorType: 'cell'/'slide'/'word'
|
||||
* events: {
|
||||
* onChangeValue // text in editor is changed
|
||||
* onEditorReady // editor is ready for use
|
||||
* onMouseUp
|
||||
* onMouseMove
|
||||
* onLoad // frame with editor is loaded
|
||||
* }
|
||||
* }
|
||||
* */
|
||||
|
||||
window.AceEditor = function(placeholderId, config) {
|
||||
var _self = this,
|
||||
_config = config || {},
|
||||
parentEl = document.getElementById(placeholderId),
|
||||
iframe;
|
||||
|
||||
var _setValue = function(value, readonly) {
|
||||
_postMessage(iframe.contentWindow, {
|
||||
command: 'setValue',
|
||||
referer: 'ace-editor',
|
||||
data: {
|
||||
value: value,
|
||||
readonly: readonly
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _updateTheme = function(type, colors) {
|
||||
_postMessage(iframe.contentWindow, {
|
||||
command: 'setTheme',
|
||||
referer: 'ace-editor',
|
||||
data: {
|
||||
type: type,
|
||||
colors: colors
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _disableDrop = function(disable) {
|
||||
_postMessage(iframe.contentWindow, {
|
||||
command: 'disableDrop',
|
||||
referer: 'ace-editor',
|
||||
data: disable
|
||||
});
|
||||
};
|
||||
|
||||
var _destroyEditor = function() {
|
||||
if (iframe) {
|
||||
_msgDispatcher && _msgDispatcher.unbindEvents();
|
||||
iframe.parentNode && iframe.parentNode.removeChild(iframe);
|
||||
}
|
||||
};
|
||||
|
||||
var _onMessage = function(msg) {
|
||||
var data = msg.data;
|
||||
if (Object.prototype.toString.apply(data) !== '[object String]' || !window.JSON) {
|
||||
return;
|
||||
}
|
||||
var cmd, handler;
|
||||
|
||||
try {
|
||||
cmd = window.JSON.parse(data)
|
||||
} catch(e) {
|
||||
cmd = '';
|
||||
}
|
||||
|
||||
if (cmd && cmd.referer == "ace-editor") {
|
||||
var events = _config.events || {},
|
||||
handler;
|
||||
data = {};
|
||||
switch (cmd.command) {
|
||||
case 'changeValue':
|
||||
handler = events['onChangeValue'];
|
||||
data = cmd.data;
|
||||
break;
|
||||
case 'aceEditorReady':
|
||||
handler = events['onEditorReady'];
|
||||
data = cmd.data;
|
||||
break;
|
||||
case 'mouseUp':
|
||||
case 'mouseMove':
|
||||
handler = events[cmd.command==='mouseUp' ? 'onMouseUp' : 'onMouseMove'];
|
||||
var rect = parentEl.getBoundingClientRect(),
|
||||
offset = {
|
||||
top: rect.top + window.pageYOffset,
|
||||
left: rect.left + window.pageXOffset
|
||||
};
|
||||
data = [cmd.data.x + offset.left, cmd.data.y + offset.top]
|
||||
break;
|
||||
}
|
||||
if (handler && typeof handler == "function") {
|
||||
res = handler.call(_self, {target: _self, data: data});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var _onLoad = function() {
|
||||
var handler = (_config.events || {})['onLoad'];
|
||||
if (handler && typeof handler == "function") {
|
||||
res = handler.call(_self);
|
||||
}
|
||||
};
|
||||
|
||||
if (parentEl) {
|
||||
iframe = createIframe(_config);
|
||||
iframe.onload = _onLoad;
|
||||
var _msgDispatcher = new MessageDispatcher(_onMessage, this);
|
||||
parentEl.appendChild(iframe);
|
||||
}
|
||||
|
||||
return {
|
||||
setValue: _setValue, // string // set text to editor
|
||||
disableDrop: _disableDrop, // true/false // disable/enable drop elements to editor
|
||||
destroyEditor: _destroyEditor,
|
||||
updateTheme: _updateTheme // type: 'dark'/'light',
|
||||
// colors: {'text-normal': '', 'icon-normal': '', 'background-normal': '', 'background-toolbar': '', 'highlight-button-hover': '',
|
||||
// 'canvas-background': '', 'border-divider': '', 'canvas-scroll-thumb-pressed': '', 'canvas-scroll-thumb': ''}
|
||||
}
|
||||
}
|
||||
|
||||
function getBasePath() {
|
||||
var scripts = document.getElementsByTagName('script'),
|
||||
match;
|
||||
|
||||
for (var i = scripts.length - 1; i >= 0; i--) {
|
||||
match = scripts[i].src.match(/(.*)AceEditor.js/i);
|
||||
if (match) {
|
||||
return match[1];
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function createIframe(config) {
|
||||
iframe = document.createElement("iframe");
|
||||
iframe.width = '100%';
|
||||
iframe.height = '100%';
|
||||
iframe.align = "top";
|
||||
iframe.frameBorder = 0;
|
||||
iframe.scrolling = "no";
|
||||
iframe.src = getBasePath() + 'AceEditor.html' + (config.editorType ? '?editorType=' + config.editorType : '');
|
||||
|
||||
return iframe;
|
||||
}
|
||||
|
||||
function _postMessage(wnd, msg) {
|
||||
if (wnd && wnd.postMessage && window.JSON) {
|
||||
wnd.postMessage(window.JSON.stringify(msg), "*");
|
||||
}
|
||||
}
|
||||
|
||||
MessageDispatcher = function(fn, scope) {
|
||||
var _fn = fn,
|
||||
_scope = scope || window,
|
||||
eventFn = function(msg) {
|
||||
_fn.call(_scope, msg);
|
||||
};
|
||||
|
||||
var _bindEvents = function() {
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener("message", eventFn, false)
|
||||
}
|
||||
else if (window.attachEvent) {
|
||||
window.attachEvent("onmessage", eventFn);
|
||||
}
|
||||
};
|
||||
|
||||
var _unbindEvents = function() {
|
||||
if (window.removeEventListener) {
|
||||
window.removeEventListener("message", eventFn, false)
|
||||
}
|
||||
else if (window.detachEvent) {
|
||||
window.detachEvent("onmessage", eventFn);
|
||||
}
|
||||
};
|
||||
|
||||
_bindEvents.call(this);
|
||||
|
||||
return {
|
||||
unbindEvents: _unbindEvents
|
||||
}
|
||||
};
|
||||
|
||||
})(window, document);
|
||||
299
vendor/ace/component/AceEditorCode.js
vendored
Normal file
@ -0,0 +1,299 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2024
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
window.initCounter = 0;
|
||||
|
||||
function on_init_server(type)
|
||||
{
|
||||
if (type === (window.initCounter & type))
|
||||
return;
|
||||
window.initCounter |= type;
|
||||
if (window.initCounter === 3)
|
||||
{
|
||||
load_library("onlyoffice", "../libs/" + window.editorType + "/api.js");
|
||||
_postMessage({
|
||||
command: 'aceEditorReady',
|
||||
referer: 'ace-editor'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function load_library(name, url)
|
||||
{
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", url, true);
|
||||
xhr.onreadystatechange = function()
|
||||
{
|
||||
if (xhr.readyState == 4)
|
||||
{
|
||||
var EditSession = ace.require("ace/edit_session").EditSession;
|
||||
var editDoc = new EditSession(xhr.responseText, "ace/mode/javascript");
|
||||
editor.ternServer.addDoc(name, editDoc);
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
var editor = ace.edit("editor");
|
||||
editor.session.setMode("ace/mode/javascript");
|
||||
editor.container.style.lineHeight = "20px";
|
||||
editor.setValue("");
|
||||
|
||||
editor.getSession().setUseWrapMode(true);
|
||||
editor.getSession().setWrapLimitRange(null, null);
|
||||
editor.setShowPrintMargin(false);
|
||||
editor.$blockScrolling = Infinity;
|
||||
|
||||
ace.config.loadModule('ace/ext/tern', function () {
|
||||
editor.setOptions({
|
||||
enableTern: {
|
||||
defs: ['browser', 'ecma5'],
|
||||
plugins: { doc_comment: { fullDocs: true } },
|
||||
useWorker: !!window.Worker,
|
||||
switchToDoc: function (name, start) {},
|
||||
startedCb: function () {
|
||||
on_init_server(1);
|
||||
},
|
||||
},
|
||||
enableSnippets: false,
|
||||
// tooltipContainer: '#code-editor'
|
||||
});
|
||||
});
|
||||
|
||||
if (!window.isIE) {
|
||||
ace.config.loadModule('ace/ext/language_tools', function () {
|
||||
editor.setOptions({
|
||||
enableBasicAutocompletion: false,
|
||||
enableLiveAutocompletion: true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
ace.config.loadModule('ace/ext/html_beautify', function (beautify) {
|
||||
editor.setOptions({
|
||||
autoBeautify: true,
|
||||
htmlBeautify: true,
|
||||
});
|
||||
window.beautifyOptions = beautify.options;
|
||||
});
|
||||
|
||||
var _postMessage = function(msg) {
|
||||
window.parent && window.JSON && window.parent.postMessage(window.JSON.stringify(msg), "*");
|
||||
};
|
||||
|
||||
(function (window, undefined) {
|
||||
var _dropDisabled = undefined;
|
||||
|
||||
editor.getSession().on('change', function() {
|
||||
if (window.isDisable) return;
|
||||
_postMessage({
|
||||
command: 'changeValue',
|
||||
data: editor.getValue(),
|
||||
referer: 'ace-editor'
|
||||
});
|
||||
});
|
||||
|
||||
on_init_server(2);
|
||||
|
||||
var editorSetValue = function(data) {
|
||||
window.isDisable = true;
|
||||
editor.setValue(data.value || '');
|
||||
editor.setReadOnly(!!data.readonly);
|
||||
if (!data.readonly) {
|
||||
editor.focus();
|
||||
editor.selection.clearSelection();
|
||||
editor.scrollToRow(0);
|
||||
}
|
||||
window.isDisable = false;
|
||||
};
|
||||
|
||||
var editorDisableDrop = function(disable) {
|
||||
if (_dropDisabled===undefined) {
|
||||
let el = document.getElementById('editor');
|
||||
el.ondrop = function(e) {
|
||||
if (!_dropDisabled) return;
|
||||
if (e && e.preventDefault)
|
||||
e.preventDefault();
|
||||
return false;
|
||||
};
|
||||
el.ondragenter = function(e) {
|
||||
if (!_dropDisabled) return;
|
||||
if (e && e.preventDefault)
|
||||
e.preventDefault();
|
||||
return false;
|
||||
};
|
||||
el.ondragover = function(e) {
|
||||
if (!_dropDisabled) return;
|
||||
if (e && e.preventDefault)
|
||||
e.preventDefault();
|
||||
if (e && e.dataTransfer)
|
||||
e.dataTransfer.dropEffect = "none";
|
||||
return false;
|
||||
};
|
||||
}
|
||||
_dropDisabled = disable;
|
||||
};
|
||||
|
||||
var fillDefaultColors = function(colors) {
|
||||
if (colors.type==='dark') {
|
||||
var defColors = {'text-normal': 'rgba(255, 255, 255, 0.8)', 'icon-normal': 'rgba(255, 255, 255, 0.8)', 'background-normal': '#333', 'background-toolbar': '#404040', 'highlight-button-hover': '#555',
|
||||
'canvas-background': '#555', 'border-divider': '#505050', 'canvas-scroll-thumb-pressed': '#adadad', 'canvas-scroll-thumb': '#404040'},
|
||||
hasOwnProps = false;
|
||||
for (var color in defColors) {
|
||||
if (colors.hasOwnProperty(color)) {
|
||||
hasOwnProps = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasOwnProps) {
|
||||
for (var color in defColors) {
|
||||
colors[color] = defColors[color];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var onThemeChanged = function(colors) {
|
||||
if (!colors) return;
|
||||
|
||||
let styles = document.querySelectorAll("style"),
|
||||
i = 0;
|
||||
if (styles) {
|
||||
while (i < styles.length) {
|
||||
if (styles[i].id === 'ace-chrome' || styles[i].id === 'ace-custom-theme') {
|
||||
styles[i].parentNode.removeChild(styles[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
fillDefaultColors(colors);
|
||||
|
||||
var _css = '';
|
||||
if (colors['text-normal'])
|
||||
_css += '.ace_content, .ace_layer.ace_gutter-layer.ace_folding-enabled, .ace_cursor, .Ace-Tern-tooltip, .Ace-Tern-jsdoc-param-description { color: ' + colors['text-normal'] + ' !important; }';
|
||||
|
||||
if (colors['icon-normal'])
|
||||
_css += '.Ace-Tern-tooltip .Ace-Tern-tooltip-boxclose { color: ' + colors['icon-normal'] + ' !important; }';
|
||||
|
||||
if (colors['background-normal']) {
|
||||
_css += '.ace_editor, .ace_content, .ace_gutter, .gutter_bg { background: ' + colors['background-normal'] + ' !important; }';
|
||||
_css += '.ace_active-line, .ace_gutter-active-line, .ace_gutter-active-line-bg { background-color: ' + colors['background-normal'] + ' !important; }';
|
||||
}
|
||||
|
||||
if (colors['background-toolbar'])
|
||||
_css += '.Ace-Tern-tooltip, .Ace-Tern-jsdoc-param-description { background-color: ' + colors['background-toolbar'] + ' !important; }';
|
||||
|
||||
if (colors['highlight-button-hover'])
|
||||
_css += '.ace_line-hover, .ace_autocomplete .ace_active-line { background-color: ' + colors['highlight-button-hover'] + ' !important; }';
|
||||
|
||||
if (colors['canvas-background'])
|
||||
_css += '.ace_active-line, .ace_gutter-active-line, .ace_gutter-active-line-bg { border-color: ' + colors['canvas-background'] + ' !important; }';
|
||||
|
||||
if (colors['border-divider'])
|
||||
_css += '.Ace-Tern-tooltip { border-color: ' + colors['border-divider'] + ' !important; }';
|
||||
|
||||
if (colors['canvas-scroll-thumb-pressed'] && colors['canvas-scroll-thumb'])
|
||||
_css += '.ace_autocomplete { scrollbar-color: ' + colors['canvas-scroll-thumb-pressed'] + ' ' + colors['canvas-scroll-thumb'] + ' !important; }';
|
||||
|
||||
if (_css) {
|
||||
var style = document.createElement('style');
|
||||
style.id = 'ace-custom-theme';
|
||||
style.type = 'text/css';
|
||||
style.innerHTML = _css;
|
||||
document.getElementsByTagName('head')[0].appendChild(style);
|
||||
}
|
||||
|
||||
if (colors.type === 'dark')
|
||||
editor.setTheme("ace/theme/vs-dark");
|
||||
else
|
||||
editor.setTheme("ace/theme/vs-light");
|
||||
|
||||
};
|
||||
|
||||
var _onMessage = function(msg) {
|
||||
var data = msg.data;
|
||||
if (Object.prototype.toString.apply(data) !== '[object String]' || !window.JSON) {
|
||||
return;
|
||||
}
|
||||
var cmd, handler;
|
||||
|
||||
try {
|
||||
cmd = window.JSON.parse(data)
|
||||
} catch(e) {
|
||||
cmd = '';
|
||||
}
|
||||
|
||||
if (cmd && cmd.referer == "ace-editor") {
|
||||
if (cmd.command==='setValue') {
|
||||
editorSetValue(cmd.data);
|
||||
} else if (cmd.command==='setTheme') {
|
||||
onThemeChanged(cmd.data);
|
||||
}else if (cmd.command==='disableDrop') {
|
||||
editorDisableDrop(cmd.data);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var fn = function(e) { _onMessage(e); };
|
||||
|
||||
var onMouseUp = function(e) {
|
||||
_postMessage({
|
||||
command: 'mouseUp',
|
||||
data: {
|
||||
x: (undefined === e.clientX) ? e.pageX : e.clientX,
|
||||
y: (undefined === e.clientY) ? e.pageY : e.clientY
|
||||
},
|
||||
referer: 'ace-editor'
|
||||
});
|
||||
};
|
||||
|
||||
var onMouseMove = function(e) {
|
||||
_postMessage({
|
||||
command: 'mouseMove',
|
||||
data: {
|
||||
x: (undefined === e.clientX) ? e.pageX : e.clientX,
|
||||
y: (undefined === e.clientY) ? e.pageY : e.clientY
|
||||
},
|
||||
referer: 'ace-editor'
|
||||
});
|
||||
};
|
||||
|
||||
if (window.attachEvent) {
|
||||
window.attachEvent('onmessage', fn);
|
||||
window.attachEvent("onmouseup", onMouseUp);
|
||||
window.attachEvent("onmousemove", onMouseMove);
|
||||
} else {
|
||||
window.addEventListener('message', fn, false);
|
||||
window.addEventListener("mouseup", onMouseUp, false);
|
||||
window.addEventListener("mousemove", onMouseMove, false);
|
||||
}
|
||||
})(window, undefined);
|
||||
94
vendor/ace/component/example.html
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<title>Example</title>
|
||||
<style type="text/css" media="screen">
|
||||
body {
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
#iframeEditor {
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 30%;
|
||||
right: 0;
|
||||
}
|
||||
#editorLog {
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 70%;
|
||||
overflow: hidden;
|
||||
|
||||
border-right-color: #CBCBCB;
|
||||
border-right-style: solid;
|
||||
border-right-width: 1px;
|
||||
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="editorLog"></div>
|
||||
<div id="iframeEditor"></div>
|
||||
<script type="text/javascript" src="AceEditor.js"></script>
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
||||
var aceEditor;
|
||||
|
||||
var onChangeValue = function (event) {
|
||||
document.getElementById('editorLog').innerText = event.data;
|
||||
console.log("onChangeValue");
|
||||
};
|
||||
|
||||
var onEditorReady = function (event) {
|
||||
console.log("onEditorReady");
|
||||
aceEditor.setValue('//Welcome!\n');
|
||||
aceEditor.disableDrop(true);
|
||||
aceEditor.updateTheme('dark' /* 'dark' or 'light' */, {
|
||||
// 'text-normal': '', 'icon-normal': '', 'background-normal': '', 'background-toolbar': '', 'highlight-button-hover': '',
|
||||
// 'canvas-background': '', 'border-divider': '', 'canvas-scroll-thumb-pressed': '', 'canvas-scroll-thumb': ''
|
||||
} // theme colors (optional)
|
||||
);
|
||||
};
|
||||
|
||||
var onMouseUp = function (event) {
|
||||
console.log("onMouseUp");
|
||||
};
|
||||
|
||||
var onMouseMove = function (event) {
|
||||
console.log("onMouseMove");
|
||||
};
|
||||
|
||||
var onLoad = function (event) {
|
||||
console.log("onLoad");
|
||||
};
|
||||
|
||||
var config = {
|
||||
editorType: 'word',
|
||||
events: {
|
||||
onChangeValue: onChangeValue,
|
||||
onEditorReady: onEditorReady,
|
||||
onMouseUp: onMouseUp,
|
||||
onMouseMove: onMouseMove,
|
||||
onLoad: onLoad
|
||||
}
|
||||
};
|
||||
|
||||
aceEditor = new window.AceEditor("iframeEditor", config);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
1
vendor/ace/custom/readme.txt
vendored
Normal file
@ -0,0 +1 @@
|
||||
replace the worker-html.js in the directory above this with this file to make the html mode worker lint javascript instead of html (it will lint javascript inside of script tags)
|
||||
21032
vendor/ace/custom/worker-html.js
vendored
Normal file
8
vendor/ace/ext-beautify.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function i(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../token_iterator").TokenIterator;t.singletonTags=["area","base","br","col","command","embed","hr","html","img","input","keygen","link","meta","param","source","track","wbr"],t.blockTags=["article","aside","blockquote","body","div","dl","fieldset","footer","form","head","header","html","nav","ol","p","script","section","style","table","tbody","tfoot","thead","ul"],t.formatOptions={lineBreaksAfterCommasInCurlyBlock:!0},t.beautify=function(e){var n=new r(e,0,0),s=n.getCurrentToken(),o=e.getTabString(),u=t.singletonTags,a=t.blockTags,f=t.formatOptions||{},l,c=!1,h=!1,p=!1,d="",v="",m="",g=0,y=0,b=0,w=0,E=0,S=0,x=0,T,N=0,C=0,k=[],L=!1,A,O=!1,M=!1,_=!1,D=!1,P={0:0},H=[],B=!1,j=function(){l&&l.value&&l.type!=="string.regexp"&&(l.value=l.value.replace(/^\s*/,""))},F=function(){var e=d.length-1;for(;;){if(e==0)break;if(d[e]!==" ")break;e-=1}d=d.slice(0,e+1)},I=function(){d=d.trimRight(),c=!1};while(s!==null){N=n.getCurrentTokenRow(),k=n.$rowTokens,l=n.stepForward();if(typeof s!="undefined"){v=s.value,E=0,_=m==="style"||e.$modeId==="ace/mode/css",i(s,"tag-open")?(M=!0,l&&(D=a.indexOf(l.value)!==-1),v==="</"&&(D&&!c&&C<1&&C++,_&&(C=1),E=1,D=!1)):i(s,"tag-close")?M=!1:i(s,"comment.start")?D=!0:i(s,"comment.end")&&(D=!1),!M&&!C&&s.type==="paren.rparen"&&s.value.substr(0,1)==="}"&&C++,N!==T&&(C=N,T&&(C-=T));if(C){I();for(;C>0;C--)d+="\n";c=!0,!i(s,"comment")&&!s.type.match(/^(comment|string)$/)&&(v=v.trimLeft())}if(v){s.type==="keyword"&&v.match(/^(if|else|elseif|for|foreach|while|switch)$/)?(H[g]=v,j(),p=!0,v.match(/^(else|elseif)$/)&&d.match(/\}[\s]*$/)&&(I(),h=!0)):s.type==="paren.lparen"?(j(),v.substr(-1)==="{"&&(p=!0,O=!1,M||(C=1)),v.substr(0,1)==="{"&&(h=!0,d.substr(-1)!=="["&&d.trimRight().substr(-1)==="["?(I(),h=!1):d.trimRight().substr(-1)===")"?I():F())):s.type==="paren.rparen"?(E=1,v.substr(0,1)==="}"&&(H[g-1]==="case"&&E++,d.trimRight().substr(-1)==="{"?I():(h=!0,_&&(C+=2))),v.substr(0,1)==="]"&&d.substr(-1)!=="}"&&d.trimRight().substr(-1)==="}"&&(h=!1,w++,I()),v.substr(0,1)===")"&&d.substr(-1)!=="("&&d.trimRight().substr(-1)==="("&&(h=!1,w++,I()),F()):s.type!=="keyword.operator"&&s.type!=="keyword"||!v.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)?s.type==="punctuation.operator"&&v===";"?(I(),j(),p=!0,_&&C++):s.type==="punctuation.operator"&&v.match(/^(:|,)$/)?(I(),j(),v.match(/^(,)$/)&&x>0&&S===0&&f.lineBreaksAfterCommasInCurlyBlock?C++:(p=!0,c=!1)):s.type==="support.php_tag"&&v==="?>"&&!c?(I(),h=!0):i(s,"attribute-name")&&d.substr(-1).match(/^\s$/)?h=!0:i(s,"attribute-equals")?(F(),j()):i(s,"tag-close")?(F(),v==="/>"&&(h=!0)):s.type==="keyword"&&v.match(/^(case|default)$/)&&B&&(E=1):(I(),j(),h=!0,p=!0);if(c&&(!s.type.match(/^(comment)$/)||!!v.substr(0,1).match(/^[/#]$/))&&(!s.type.match(/^(string)$/)||!!v.substr(0,1).match(/^['"@]$/))){w=b;if(g>y){w++;for(A=g;A>y;A--)P[A]=w}else g<y&&(w=P[g]);y=g,b=w,E&&(w-=E),O&&!S&&(w++,O=!1);for(A=0;A<w;A++)d+=o}s.type==="keyword"&&v.match(/^(case|default)$/)?B===!1&&(H[g]=v,g++,B=!0):s.type==="keyword"&&v.match(/^(break)$/)&&H[g-1]&&H[g-1].match(/^(case|default)$/)&&(g--,B=!1),s.type==="paren.lparen"&&(S+=(v.match(/\(/g)||[]).length,x+=(v.match(/\{/g)||[]).length,g+=v.length),s.type==="keyword"&&v.match(/^(if|else|elseif|for|while)$/)?(O=!0,S=0):!S&&v.trim()&&s.type!=="comment"&&(O=!1);if(s.type==="paren.rparen"){S-=(v.match(/\)/g)||[]).length,x-=(v.match(/\}/g)||[]).length;for(A=0;A<v.length;A++)g--,v.substr(A,1)==="}"&&H[g]==="case"&&g--}s.type=="text"&&(v=v.replace(/\s+$/," ")),h&&!c&&(F(),d.substr(-1)!=="\n"&&(d+=" ")),d+=v,p&&(d+=" "),c=!1,h=!1,p=!1;if(i(s,"tag-close")&&(D||a.indexOf(m)!==-1)||i(s,"doctype")&&v===">")D&&l&&l.value==="</"?C=-1:C=1;l&&u.indexOf(l.value)===-1&&(i(s,"tag-open")&&v==="</"?g--:i(s,"tag-open")&&v==="<"?g++:i(s,"tag-close")&&v==="/>"&&g--),i(s,"tag-name")&&(m=v),T=N}}s=l}d=d.trim(),e.doc.setValue(d)},t.commands=[{name:"beautify",description:"Format selection (Beautify)",exec:function(e){t.beautify(e.session)},bindKey:"Ctrl-Shift-B"}]}); (function() {
|
||||
ace.require(["ace/ext/beautify"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
541
vendor/ace/ext-chromevox.js
vendored
Normal file
@ -0,0 +1,541 @@
|
||||
ace.define("ace/ext/chromevox",["require","exports","module","ace/editor","ace/config"], function(require, exports, module) {
|
||||
var cvoxAce = {};
|
||||
cvoxAce.SpeechProperty;
|
||||
cvoxAce.Cursor;
|
||||
cvoxAce.Token;
|
||||
cvoxAce.Annotation;
|
||||
var CONSTANT_PROP = {
|
||||
'rate': 0.8,
|
||||
'pitch': 0.4,
|
||||
'volume': 0.9
|
||||
};
|
||||
var DEFAULT_PROP = {
|
||||
'rate': 1,
|
||||
'pitch': 0.5,
|
||||
'volume': 0.9
|
||||
};
|
||||
var ENTITY_PROP = {
|
||||
'rate': 0.8,
|
||||
'pitch': 0.8,
|
||||
'volume': 0.9
|
||||
};
|
||||
var KEYWORD_PROP = {
|
||||
'rate': 0.8,
|
||||
'pitch': 0.3,
|
||||
'volume': 0.9
|
||||
};
|
||||
var STORAGE_PROP = {
|
||||
'rate': 0.8,
|
||||
'pitch': 0.7,
|
||||
'volume': 0.9
|
||||
};
|
||||
var VARIABLE_PROP = {
|
||||
'rate': 0.8,
|
||||
'pitch': 0.8,
|
||||
'volume': 0.9
|
||||
};
|
||||
var DELETED_PROP = {
|
||||
'punctuationEcho': 'none',
|
||||
'relativePitch': -0.6
|
||||
};
|
||||
var ERROR_EARCON = 'ALERT_NONMODAL';
|
||||
var MODE_SWITCH_EARCON = 'ALERT_MODAL';
|
||||
var NO_MATCH_EARCON = 'INVALID_KEYPRESS';
|
||||
var INSERT_MODE_STATE = 'insertMode';
|
||||
var COMMAND_MODE_STATE = 'start';
|
||||
|
||||
var REPLACE_LIST = [
|
||||
{
|
||||
substr: ';',
|
||||
newSubstr: ' semicolon '
|
||||
},
|
||||
{
|
||||
substr: ':',
|
||||
newSubstr: ' colon '
|
||||
}
|
||||
];
|
||||
var Command = {
|
||||
SPEAK_ANNOT: 'annots',
|
||||
SPEAK_ALL_ANNOTS: 'all_annots',
|
||||
TOGGLE_LOCATION: 'toggle_location',
|
||||
SPEAK_MODE: 'mode',
|
||||
SPEAK_ROW_COL: 'row_col',
|
||||
TOGGLE_DISPLACEMENT: 'toggle_displacement',
|
||||
FOCUS_TEXT: 'focus_text'
|
||||
};
|
||||
var KEY_PREFIX = 'CONTROL + SHIFT ';
|
||||
cvoxAce.editor = null;
|
||||
var lastCursor = null;
|
||||
var annotTable = {};
|
||||
var shouldSpeakRowLocation = false;
|
||||
var shouldSpeakDisplacement = false;
|
||||
var changed = false;
|
||||
var vimState = null;
|
||||
var keyCodeToShortcutMap = {};
|
||||
var cmdToShortcutMap = {};
|
||||
var getKeyShortcutString = function(keyCode) {
|
||||
return KEY_PREFIX + String.fromCharCode(keyCode);
|
||||
};
|
||||
var isVimMode = function() {
|
||||
var keyboardHandler = cvoxAce.editor.keyBinding.getKeyboardHandler();
|
||||
return keyboardHandler.$id === 'ace/keyboard/vim';
|
||||
};
|
||||
var getCurrentToken = function(cursor) {
|
||||
return cvoxAce.editor.getSession().getTokenAt(cursor.row, cursor.column + 1);
|
||||
};
|
||||
var getCurrentLine = function(cursor) {
|
||||
return cvoxAce.editor.getSession().getLine(cursor.row);
|
||||
};
|
||||
var onRowChange = function(currCursor) {
|
||||
if (annotTable[currCursor.row]) {
|
||||
cvox.Api.playEarcon(ERROR_EARCON);
|
||||
}
|
||||
if (shouldSpeakRowLocation) {
|
||||
cvox.Api.stop();
|
||||
speakChar(currCursor);
|
||||
speakTokenQueue(getCurrentToken(currCursor));
|
||||
speakLine(currCursor.row, 1);
|
||||
} else {
|
||||
speakLine(currCursor.row, 0);
|
||||
}
|
||||
};
|
||||
var isWord = function(cursor) {
|
||||
var line = getCurrentLine(cursor);
|
||||
var lineSuffix = line.substr(cursor.column - 1);
|
||||
if (cursor.column === 0) {
|
||||
lineSuffix = ' ' + line;
|
||||
}
|
||||
var firstWordRegExp = /^\W(\w+)/;
|
||||
var words = firstWordRegExp.exec(lineSuffix);
|
||||
return words !== null;
|
||||
};
|
||||
var rules = {
|
||||
'constant': {
|
||||
prop: CONSTANT_PROP
|
||||
},
|
||||
'entity': {
|
||||
prop: ENTITY_PROP
|
||||
},
|
||||
'keyword': {
|
||||
prop: KEYWORD_PROP
|
||||
},
|
||||
'storage': {
|
||||
prop: STORAGE_PROP
|
||||
},
|
||||
'variable': {
|
||||
prop: VARIABLE_PROP
|
||||
},
|
||||
'meta': {
|
||||
prop: DEFAULT_PROP,
|
||||
replace: [
|
||||
{
|
||||
substr: '</',
|
||||
newSubstr: ' closing tag '
|
||||
},
|
||||
{
|
||||
substr: '/>',
|
||||
newSubstr: ' close tag '
|
||||
},
|
||||
{
|
||||
substr: '<',
|
||||
newSubstr: ' tag start '
|
||||
},
|
||||
{
|
||||
substr: '>',
|
||||
newSubstr: ' tag end '
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
var DEFAULT_RULE = {
|
||||
prop: DEFAULT_RULE
|
||||
};
|
||||
var expand = function(value, replaceRules) {
|
||||
var newValue = value;
|
||||
for (var i = 0; i < replaceRules.length; i++) {
|
||||
var replaceRule = replaceRules[i];
|
||||
var regexp = new RegExp(replaceRule.substr, 'g');
|
||||
newValue = newValue.replace(regexp, replaceRule.newSubstr);
|
||||
}
|
||||
return newValue;
|
||||
};
|
||||
var mergeTokens = function(tokens, start, end) {
|
||||
var newToken = {};
|
||||
newToken.value = '';
|
||||
newToken.type = tokens[start].type;
|
||||
for (var j = start; j < end; j++) {
|
||||
newToken.value += tokens[j].value;
|
||||
}
|
||||
return newToken;
|
||||
};
|
||||
var mergeLikeTokens = function(tokens) {
|
||||
if (tokens.length <= 1) {
|
||||
return tokens;
|
||||
}
|
||||
var newTokens = [];
|
||||
var lastLikeIndex = 0;
|
||||
for (var i = 1; i < tokens.length; i++) {
|
||||
var lastLikeToken = tokens[lastLikeIndex];
|
||||
var currToken = tokens[i];
|
||||
if (getTokenRule(lastLikeToken) !== getTokenRule(currToken)) {
|
||||
newTokens.push(mergeTokens(tokens, lastLikeIndex, i));
|
||||
lastLikeIndex = i;
|
||||
}
|
||||
}
|
||||
newTokens.push(mergeTokens(tokens, lastLikeIndex, tokens.length));
|
||||
return newTokens;
|
||||
};
|
||||
var isRowWhiteSpace = function(row) {
|
||||
var line = cvoxAce.editor.getSession().getLine(row);
|
||||
var whiteSpaceRegexp = /^\s*$/;
|
||||
return whiteSpaceRegexp.exec(line) !== null;
|
||||
};
|
||||
var speakLine = function(row, queue) {
|
||||
var tokens = cvoxAce.editor.getSession().getTokens(row);
|
||||
if (tokens.length === 0 || isRowWhiteSpace(row)) {
|
||||
cvox.Api.playEarcon('EDITABLE_TEXT');
|
||||
return;
|
||||
}
|
||||
tokens = mergeLikeTokens(tokens);
|
||||
var firstToken = tokens[0];
|
||||
tokens = tokens.filter(function(token) {
|
||||
return token !== firstToken;
|
||||
});
|
||||
speakToken_(firstToken, queue);
|
||||
tokens.forEach(speakTokenQueue);
|
||||
};
|
||||
var speakTokenFlush = function(token) {
|
||||
speakToken_(token, 0);
|
||||
};
|
||||
var speakTokenQueue = function(token) {
|
||||
speakToken_(token, 1);
|
||||
};
|
||||
var getTokenRule = function(token) {
|
||||
if (!token || !token.type) {
|
||||
return;
|
||||
}
|
||||
var split = token.type.split('.');
|
||||
if (split.length === 0) {
|
||||
return;
|
||||
}
|
||||
var type = split[0];
|
||||
var rule = rules[type];
|
||||
if (!rule) {
|
||||
return DEFAULT_RULE;
|
||||
}
|
||||
return rule;
|
||||
};
|
||||
var speakToken_ = function(token, queue) {
|
||||
var rule = getTokenRule(token);
|
||||
var value = expand(token.value, REPLACE_LIST);
|
||||
if (rule.replace) {
|
||||
value = expand(value, rule.replace);
|
||||
}
|
||||
cvox.Api.speak(value, queue, rule.prop);
|
||||
};
|
||||
var speakChar = function(cursor) {
|
||||
var line = getCurrentLine(cursor);
|
||||
cvox.Api.speak(line[cursor.column], 1);
|
||||
};
|
||||
var speakDisplacement = function(lastCursor, currCursor) {
|
||||
var line = getCurrentLine(currCursor);
|
||||
var displace = line.substring(lastCursor.column, currCursor.column);
|
||||
displace = displace.replace(/ /g, ' space ');
|
||||
cvox.Api.speak(displace);
|
||||
};
|
||||
var speakCharOrWordOrLine = function(lastCursor, currCursor) {
|
||||
if (Math.abs(lastCursor.column - currCursor.column) !== 1) {
|
||||
var currLineLength = getCurrentLine(currCursor).length;
|
||||
if (currCursor.column === 0 || currCursor.column === currLineLength) {
|
||||
speakLine(currCursor.row, 0);
|
||||
return;
|
||||
}
|
||||
if (isWord(currCursor)) {
|
||||
cvox.Api.stop();
|
||||
speakTokenQueue(getCurrentToken(currCursor));
|
||||
return;
|
||||
}
|
||||
}
|
||||
speakChar(currCursor);
|
||||
};
|
||||
var onColumnChange = function(lastCursor, currCursor) {
|
||||
if (!cvoxAce.editor.selection.isEmpty()) {
|
||||
speakDisplacement(lastCursor, currCursor);
|
||||
cvox.Api.speak('selected', 1);
|
||||
}
|
||||
else if (shouldSpeakDisplacement) {
|
||||
speakDisplacement(lastCursor, currCursor);
|
||||
} else {
|
||||
speakCharOrWordOrLine(lastCursor, currCursor);
|
||||
}
|
||||
};
|
||||
var onCursorChange = function(evt) {
|
||||
if (changed) {
|
||||
changed = false;
|
||||
return;
|
||||
}
|
||||
var currCursor = cvoxAce.editor.selection.getCursor();
|
||||
if (currCursor.row !== lastCursor.row) {
|
||||
onRowChange(currCursor);
|
||||
} else {
|
||||
onColumnChange(lastCursor, currCursor);
|
||||
}
|
||||
lastCursor = currCursor;
|
||||
};
|
||||
var onSelectionChange = function(evt) {
|
||||
if (cvoxAce.editor.selection.isEmpty()) {
|
||||
cvox.Api.speak('unselected');
|
||||
}
|
||||
};
|
||||
var onChange = function(evt) {
|
||||
var data = evt.data;
|
||||
switch (data.action) {
|
||||
case 'removeText':
|
||||
cvox.Api.speak(data.text, 0, DELETED_PROP);
|
||||
changed = true;
|
||||
break;
|
||||
case 'insertText':
|
||||
cvox.Api.speak(data.text, 0);
|
||||
changed = true;
|
||||
break;
|
||||
}
|
||||
};
|
||||
var isNewAnnotation = function(annot) {
|
||||
var row = annot.row;
|
||||
var col = annot.column;
|
||||
return !annotTable[row] || !annotTable[row][col];
|
||||
};
|
||||
var populateAnnotations = function(annotations) {
|
||||
annotTable = {};
|
||||
for (var i = 0; i < annotations.length; i++) {
|
||||
var annotation = annotations[i];
|
||||
var row = annotation.row;
|
||||
var col = annotation.column;
|
||||
if (!annotTable[row]) {
|
||||
annotTable[row] = {};
|
||||
}
|
||||
annotTable[row][col] = annotation;
|
||||
}
|
||||
};
|
||||
var onAnnotationChange = function(evt) {
|
||||
var annotations = cvoxAce.editor.getSession().getAnnotations();
|
||||
var newAnnotations = annotations.filter(isNewAnnotation);
|
||||
if (newAnnotations.length > 0) {
|
||||
cvox.Api.playEarcon(ERROR_EARCON);
|
||||
}
|
||||
populateAnnotations(annotations);
|
||||
};
|
||||
var speakAnnot = function(annot) {
|
||||
var annotText = annot.type + ' ' + annot.text + ' on ' +
|
||||
rowColToString(annot.row, annot.column);
|
||||
annotText = annotText.replace(';', 'semicolon');
|
||||
cvox.Api.speak(annotText, 1);
|
||||
};
|
||||
var speakAnnotsByRow = function(row) {
|
||||
var annots = annotTable[row];
|
||||
for (var col in annots) {
|
||||
speakAnnot(annots[col]);
|
||||
}
|
||||
};
|
||||
var rowColToString = function(row, col) {
|
||||
return 'row ' + (row + 1) + ' column ' + (col + 1);
|
||||
};
|
||||
var speakCurrRowAndCol = function() {
|
||||
cvox.Api.speak(rowColToString(lastCursor.row, lastCursor.column));
|
||||
};
|
||||
var speakAllAnnots = function() {
|
||||
for (var row in annotTable) {
|
||||
speakAnnotsByRow(row);
|
||||
}
|
||||
};
|
||||
var speakMode = function() {
|
||||
if (!isVimMode()) {
|
||||
return;
|
||||
}
|
||||
switch (cvoxAce.editor.keyBinding.$data.state) {
|
||||
case INSERT_MODE_STATE:
|
||||
cvox.Api.speak('Insert mode');
|
||||
break;
|
||||
case COMMAND_MODE_STATE:
|
||||
cvox.Api.speak('Command mode');
|
||||
break;
|
||||
}
|
||||
};
|
||||
var toggleSpeakRowLocation = function() {
|
||||
shouldSpeakRowLocation = !shouldSpeakRowLocation;
|
||||
if (shouldSpeakRowLocation) {
|
||||
cvox.Api.speak('Speak location on row change enabled.');
|
||||
} else {
|
||||
cvox.Api.speak('Speak location on row change disabled.');
|
||||
}
|
||||
};
|
||||
var toggleSpeakDisplacement = function() {
|
||||
shouldSpeakDisplacement = !shouldSpeakDisplacement;
|
||||
if (shouldSpeakDisplacement) {
|
||||
cvox.Api.speak('Speak displacement on column changes.');
|
||||
} else {
|
||||
cvox.Api.speak('Speak current character or word on column changes.');
|
||||
}
|
||||
};
|
||||
var onKeyDown = function(evt) {
|
||||
if (evt.ctrlKey && evt.shiftKey) {
|
||||
var shortcut = keyCodeToShortcutMap[evt.keyCode];
|
||||
if (shortcut) {
|
||||
shortcut.func();
|
||||
}
|
||||
}
|
||||
};
|
||||
var onChangeStatus = function(evt, editor) {
|
||||
if (!isVimMode()) {
|
||||
return;
|
||||
}
|
||||
var state = editor.keyBinding.$data.state;
|
||||
if (state === vimState) {
|
||||
return;
|
||||
}
|
||||
switch (state) {
|
||||
case INSERT_MODE_STATE:
|
||||
cvox.Api.playEarcon(MODE_SWITCH_EARCON);
|
||||
cvox.Api.setKeyEcho(true);
|
||||
break;
|
||||
case COMMAND_MODE_STATE:
|
||||
cvox.Api.playEarcon(MODE_SWITCH_EARCON);
|
||||
cvox.Api.setKeyEcho(false);
|
||||
break;
|
||||
}
|
||||
vimState = state;
|
||||
};
|
||||
var contextMenuHandler = function(evt) {
|
||||
var cmd = evt.detail['customCommand'];
|
||||
var shortcut = cmdToShortcutMap[cmd];
|
||||
if (shortcut) {
|
||||
shortcut.func();
|
||||
cvoxAce.editor.focus();
|
||||
}
|
||||
};
|
||||
var initContextMenu = function() {
|
||||
var ACTIONS = SHORTCUTS.map(function(shortcut) {
|
||||
return {
|
||||
desc: shortcut.desc + getKeyShortcutString(shortcut.keyCode),
|
||||
cmd: shortcut.cmd
|
||||
};
|
||||
});
|
||||
var body = document.querySelector('body');
|
||||
body.setAttribute('contextMenuActions', JSON.stringify(ACTIONS));
|
||||
body.addEventListener('ATCustomEvent', contextMenuHandler, true);
|
||||
};
|
||||
var onFindSearchbox = function(evt) {
|
||||
if (evt.match) {
|
||||
speakLine(lastCursor.row, 0);
|
||||
} else {
|
||||
cvox.Api.playEarcon(NO_MATCH_EARCON);
|
||||
}
|
||||
};
|
||||
var focus = function() {
|
||||
cvoxAce.editor.focus();
|
||||
};
|
||||
var SHORTCUTS = [
|
||||
{
|
||||
keyCode: 49,
|
||||
func: function() {
|
||||
speakAnnotsByRow(lastCursor.row);
|
||||
},
|
||||
cmd: Command.SPEAK_ANNOT,
|
||||
desc: 'Speak annotations on line'
|
||||
},
|
||||
{
|
||||
keyCode: 50,
|
||||
func: speakAllAnnots,
|
||||
cmd: Command.SPEAK_ALL_ANNOTS,
|
||||
desc: 'Speak all annotations'
|
||||
},
|
||||
{
|
||||
keyCode: 51,
|
||||
func: speakMode,
|
||||
cmd: Command.SPEAK_MODE,
|
||||
desc: 'Speak Vim mode'
|
||||
},
|
||||
{
|
||||
keyCode: 52,
|
||||
func: toggleSpeakRowLocation,
|
||||
cmd: Command.TOGGLE_LOCATION,
|
||||
desc: 'Toggle speak row location'
|
||||
},
|
||||
{
|
||||
keyCode: 53,
|
||||
func: speakCurrRowAndCol,
|
||||
cmd: Command.SPEAK_ROW_COL,
|
||||
desc: 'Speak row and column'
|
||||
},
|
||||
{
|
||||
keyCode: 54,
|
||||
func: toggleSpeakDisplacement,
|
||||
cmd: Command.TOGGLE_DISPLACEMENT,
|
||||
desc: 'Toggle speak displacement'
|
||||
},
|
||||
{
|
||||
keyCode: 55,
|
||||
func: focus,
|
||||
cmd: Command.FOCUS_TEXT,
|
||||
desc: 'Focus text'
|
||||
}
|
||||
];
|
||||
var onFocus = function() {
|
||||
cvoxAce.editor = editor;
|
||||
editor.getSession().selection.on('changeCursor', onCursorChange);
|
||||
editor.getSession().selection.on('changeSelection', onSelectionChange);
|
||||
editor.getSession().on('change', onChange);
|
||||
editor.getSession().on('changeAnnotation', onAnnotationChange);
|
||||
editor.on('changeStatus', onChangeStatus);
|
||||
editor.on('findSearchBox', onFindSearchbox);
|
||||
editor.container.addEventListener('keydown', onKeyDown);
|
||||
|
||||
lastCursor = editor.selection.getCursor();
|
||||
};
|
||||
var init = function(editor) {
|
||||
onFocus();
|
||||
SHORTCUTS.forEach(function(shortcut) {
|
||||
keyCodeToShortcutMap[shortcut.keyCode] = shortcut;
|
||||
cmdToShortcutMap[shortcut.cmd] = shortcut;
|
||||
});
|
||||
|
||||
editor.on('focus', onFocus);
|
||||
if (isVimMode()) {
|
||||
cvox.Api.setKeyEcho(false);
|
||||
}
|
||||
initContextMenu();
|
||||
};
|
||||
function cvoxApiExists() {
|
||||
return (typeof(cvox) !== 'undefined') && cvox && cvox.Api;
|
||||
}
|
||||
var tries = 0;
|
||||
var MAX_TRIES = 15;
|
||||
function watchForCvoxLoad(editor) {
|
||||
if (cvoxApiExists()) {
|
||||
init(editor);
|
||||
} else {
|
||||
tries++;
|
||||
if (tries >= MAX_TRIES) {
|
||||
return;
|
||||
}
|
||||
window.setTimeout(watchForCvoxLoad, 500, editor);
|
||||
}
|
||||
}
|
||||
|
||||
var Editor = require('../editor').Editor;
|
||||
require('../config').defineOptions(Editor.prototype, 'editor', {
|
||||
enableChromevoxEnhancements: {
|
||||
set: function(val) {
|
||||
if (val) {
|
||||
watchForCvoxLoad(this);
|
||||
}
|
||||
},
|
||||
value: true // turn it on by default or check for window.cvox
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/chromevox"], function() {});
|
||||
})();
|
||||
|
||||
8
vendor/ace/ext-code_lens.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/ext/code_lens",["require","exports","module","ace/line_widgets","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/editor","ace/config"],function(e,t,n){"use strict";function u(e){var t=e.$textLayer,n=t.$lenses;n&&n.forEach(function(e){e.remove()}),t.$lenses=null}function a(e,t){var n=e&t.CHANGE_LINES||e&t.CHANGE_FULL||e&t.CHANGE_SCROLL||e&t.CHANGE_TEXT;if(!n)return;var r=t.session,i=t.session.lineWidgets,s=t.$textLayer,a=s.$lenses;if(!i){a&&u(t);return}var f=t.$textLayer.$lines.cells,l=t.layerConfig,c=t.$padding;a||(a=s.$lenses=[]);var h=0;for(var p=0;p<f.length;p++){var d=f[p].row,v=i[d],m=v&&v.lenses;if(!m||!m.length)continue;var g=a[h];g||(g=a[h]=o.buildDom(["div",{"class":"ace_codeLens"}],t.container)),g.style.height=l.lineHeight+"px",h++;for(var y=0;y<m.length;y++){var b=g.childNodes[2*y];b||(y!=0&&g.appendChild(o.createTextNode("\u00a0|\u00a0")),b=o.buildDom(["a"],g)),b.textContent=m[y].title,b.lensCommand=m[y]}while(g.childNodes.length>2*y-1)g.lastChild.remove();var w=t.$cursorLayer.getPixelPosition({row:d,column:0},!0).top-l.lineHeight*v.rowsAbove-l.offset;g.style.top=w+"px";var E=t.gutterWidth,S=r.getLine(d).search(/\S|$/);S==-1&&(S=0),E+=S*l.characterWidth,g.style.paddingLeft=c+E+"px"}while(h<a.length)a.pop().remove()}function f(e){if(!e.lineWidgets)return;var t=e.widgetManager;e.lineWidgets.forEach(function(e){e&&e.lenses&&t.removeLineWidget(e)})}function l(e){e.codeLensProviders=[],e.renderer.on("afterRender",a),e.$codeLensClickHandler||(e.$codeLensClickHandler=function(t){var n=t.target.lensCommand;if(!n)return;e.execCommand(n.id,n.arguments),e._emit("codeLensClick",t)},i.addListener(e.container,"click",e.$codeLensClickHandler,e)),e.$updateLenses=function(){function o(){var r=n.selection.cursor,i=n.documentToScreenRow(r),o=n.getScrollTop(),u=t.setLenses(n,s),a=n.$undoManager&&n.$undoManager.$lastDelta;if(a&&a.action=="remove"&&a.lines.length>1)return;var f=n.documentToScreenRow(r),l=e.renderer.layerConfig.lineHeight,c=n.getScrollTop()+(f-i)*l;u==0&&o<l/4&&o>-l/4&&(c=-l),n.setScrollTop(c)}var n=e.session;if(!n)return;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var i=e.codeLensProviders.length,s=[];e.codeLensProviders.forEach(function(e){e.provideCodeLenses(n,function(e,t){if(e)return;t.forEach(function(e){s.push(e)}),i--,i==0&&o()})})};var n=s.delayedCall(e.$updateLenses);e.$updateLensesOnInput=function(){n.delay(250)},e.on("input",e.$updateLensesOnInput)}function c(e){e.off("input",e.$updateLensesOnInput),e.renderer.off("afterRender",a),e.$codeLensClickHandler&&e.container.removeEventListener("click",e.$codeLensClickHandler)}var r=e("../line_widgets").LineWidgets,i=e("../lib/event"),s=e("../lib/lang"),o=e("../lib/dom");t.setLenses=function(e,t){var n=Number.MAX_VALUE;return f(e),t&&t.forEach(function(t){var r=t.start.row,i=t.start.column,s=e.lineWidgets&&e.lineWidgets[r];if(!s||!s.lenses)s=e.widgetManager.$registerLineWidget({rowCount:1,rowsAbove:1,row:r,column:i,lenses:[]});s.lenses.push(t.command),r<n&&(n=r)}),e._emit("changeFold",{data:{start:{row:n}}}),n},t.registerCodeLensProvider=function(e,t){e.setOption("enableCodeLens",!0),e.codeLensProviders.push(t),e.$updateLensesOnInput()},t.clear=function(e){t.setLenses(e,null)};var h=e("../editor").Editor;e("../config").defineOptions(h.prototype,"editor",{enableCodeLens:{set:function(e){e?l(this):c(this)}}}),o.importCssString("\n.ace_codeLens {\n position: absolute;\n color: #aaa;\n font-size: 88%;\n background: inherit;\n width: 100%;\n display: flex;\n align-items: flex-end;\n pointer-events: none;\n}\n.ace_codeLens > a {\n cursor: pointer;\n pointer-events: auto;\n}\n.ace_codeLens > a:hover {\n color: #0000ff;\n text-decoration: underline;\n}\n.ace_dark > .ace_codeLens > a:hover {\n color: #4e94ce;\n}\n","codelense.css",!1)}); (function() {
|
||||
ace.require(["ace/ext/code_lens"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/ext-command_bar.js
vendored
Normal file
8
vendor/ace/ext-elastic_tabstops_lite.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"],function(e,t,n){"use strict";var r=function(){function e(e){this.$editor=e;var t=this,n=[],r=!1;this.onAfterExec=function(){r=!1,t.processRows(n),n=[]},this.onExec=function(){r=!0},this.onChange=function(e){r&&(n.indexOf(e.start.row)==-1&&n.push(e.start.row),e.end.row!=e.start.row&&n.push(e.end.row))}}return e.prototype.processRows=function(e){this.$inChange=!0;var t=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(t.indexOf(i)>-1)continue;var s=this.$findCellWidthsForBlock(i),o=this.$setBlockCellWidthsToMax(s.cellWidths),u=s.firstRow;for(var a=0,f=o.length;a<f;a++){var l=o[a];t.push(u),this.$adjustRow(u,l),u++}}this.$inChange=!1},e.prototype.$findCellWidthsForBlock=function(e){var t=[],n,r=e;while(r>=0){n=this.$cellWidthsForRow(r);if(n.length==0)break;t.unshift(n),r--}var i=r+1;r=e;var s=this.$editor.session.getLength();while(r<s-1){r++,n=this.$cellWidthsForRow(r);if(n.length==0)break;t.push(n)}return{cellWidths:t,firstRow:i}},e.prototype.$cellWidthsForRow=function(e){var t=this.$selectionColumnsForRow(e),n=[-1].concat(this.$tabsForRow(e)),r=n.map(function(e){return 0}).slice(1),i=this.$editor.session.getLine(e);for(var s=0,o=n.length-1;s<o;s++){var u=n[s]+1,a=n[s+1],f=this.$rightmostSelectionInCell(t,a),l=i.substring(u,a);r[s]=Math.max(l.replace(/\s+$/g,"").length,f-u)}return r},e.prototype.$selectionColumnsForRow=function(e){var t=[],n=this.$editor.getCursorPosition();return this.$editor.session.getSelection().isEmpty()&&e==n.row&&t.push(n.column),t},e.prototype.$setBlockCellWidthsToMax=function(e){var t=!0,n,r,i,s=this.$izip_longest(e);for(var o=0,u=s.length;o<u;o++){var a=s[o];if(!a.push){console.error(a);continue}a.push(NaN);for(var f=0,l=a.length;f<l;f++){var c=a[f];t&&(n=f,i=0,t=!1);if(isNaN(c)){r=f;for(var h=n;h<r;h++)e[h][o]=i;t=!0}i=Math.max(i,c)}}return e},e.prototype.$rightmostSelectionInCell=function(e,t){var n=0;if(e.length){var r=[];for(var i=0,s=e.length;i<s;i++)e[i]<=t?r.push(i):r.push(0);n=Math.max.apply(Math,r)}return n},e.prototype.$tabsForRow=function(e){var t=[],n=this.$editor.session.getLine(e),r=/\t/g,i;while((i=r.exec(n))!=null)t.push(i.index);return t},e.prototype.$adjustRow=function(e,t){var n=this.$tabsForRow(e);if(n.length==0)return;var r=0,i=-1,s=this.$izip(t,n);for(var o=0,u=s.length;o<u;o++){var a=s[o][0],f=s[o][1];i+=1+a,f+=r;var l=i-f;if(l==0)continue;var c=this.$editor.session.getLine(e).substr(0,f),h=c.replace(/\s*$/g,""),p=c.length-h.length;l>0&&(this.$editor.session.getDocument().insertInLine({row:e,column:f+1},Array(l+1).join(" ")+" "),this.$editor.session.getDocument().removeInLine(e,f,f+1),r+=l),l<0&&p>=-l&&(this.$editor.session.getDocument().removeInLine(e,f+l,f),r+=l)}},e.prototype.$izip_longest=function(e){if(!e[0])return[];var t=e[0].length,n=e.length;for(var r=1;r<n;r++){var i=e[r].length;i>t&&(t=i)}var s=[];for(var o=0;o<t;o++){var u=[];for(var r=0;r<n;r++)e[r][o]===""?u.push(NaN):u.push(e[r][o]);s.push(u)}return s},e.prototype.$izip=function(e,t){var n=e.length>=t.length?t.length:e.length,r=[];for(var i=0;i<n;i++){var s=[e[i],t[i]];r.push(s)}return r},e}();t.ElasticTabstopsLite=r;var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{useElasticTabstops:{set:function(e){e?(this.elasticTabstops||(this.elasticTabstops=new r(this)),this.commands.on("afterExec",this.elasticTabstops.onAfterExec),this.commands.on("exec",this.elasticTabstops.onExec),this.on("change",this.elasticTabstops.onChange)):this.elasticTabstops&&(this.commands.removeListener("afterExec",this.elasticTabstops.onAfterExec),this.commands.removeListener("exec",this.elasticTabstops.onExec),this.removeListener("change",this.elasticTabstops.onChange))}}})}); (function() {
|
||||
ace.require(["ace/ext/elastic_tabstops_lite"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/ext-emmet.js
vendored
Normal file
8
vendor/ace/ext-error_marker.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
; (function() {
|
||||
ace.require(["ace/ext/error_marker"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/ext-hardwrap.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/ext/hardwrap",["require","exports","module","ace/range","ace/editor","ace/config"],function(e,t,n){"use strict";function i(e,t){function m(e,t,n){if(e.length<t)return;var r=e.slice(0,t),i=e.slice(t),s=/^(?:(\s+)|(\S+)(\s+))/.exec(i),o=/(?:(\s+)|(\s+)(\S+))$/.exec(r),u=0,a=0;o&&!o[2]&&(u=t-o[1].length,a=t),s&&!s[2]&&(u||(u=t),a=t+s[1].length);if(u)return{start:u,end:a};if(o&&o[2]&&o.index>n)return{start:o.index,end:o.index+o[2].length};if(s&&s[2])return u=t+s[2].length,{start:u,end:u+s[3].length}}var n=t.column||e.getOption("printMarginColumn"),i=t.allowMerge!=0,s=Math.min(t.startRow,t.endRow),o=Math.max(t.startRow,t.endRow),u=e.session;while(s<=o){var a=u.getLine(s);if(a.length>n){var f=m(a,n,5);if(f){var l=/^\s*/.exec(a)[0];u.replace(new r(s,f.start,s,f.end),"\n"+l)}o++}else if(i&&/\S/.test(a)&&s!=o){var c=u.getLine(s+1);if(c&&/\S/.test(c)){var h=a.replace(/\s+$/,""),p=c.replace(/^\s+/,""),d=h+" "+p,f=m(d,n,5);if(f&&f.start>h.length||d.length<n){var v=new r(s,h.length,s+1,c.length-p.length);u.replace(v," "),s--,o--}else h.length<a.length&&u.remove(new r(s,h.length,s,a.length))}}s++}}function s(e){if(e.command.name=="insertstring"&&/\S/.test(e.args)){var t=e.editor,n=t.selection.cursor;if(n.column<=t.renderer.$printMarginColumn)return;var r=t.session.$undoManager.$lastDelta;i(t,{startRow:n.row,endRow:n.row,allowMerge:!1}),r!=t.session.$undoManager.$lastDelta&&t.session.markUndoGroup()}}var r=e("../range").Range,o=e("../editor").Editor;e("../config").defineOptions(o.prototype,"editor",{hardWrap:{set:function(e){e?this.commands.on("afterExec",s):this.commands.off("afterExec",s)},value:!1}}),t.hardWrap=i}); (function() {
|
||||
ace.require(["ace/ext/hardwrap"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
4779
vendor/ace/ext-html_beautify.js
vendored
Normal file
8
vendor/ace/ext-inline_autocomplete.js
vendored
Normal file
8
vendor/ace/ext-keybinding_menu.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/ext/menu_tools/settings_menu.css",["require","exports","module"],function(e,t,n){n.exports="#ace_settingsmenu, #kbshortcutmenu {\n background-color: #F7F7F7;\n color: black;\n box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\n padding: 1em 0.5em 2em 1em;\n overflow: auto;\n position: absolute;\n margin: 0;\n bottom: 0;\n right: 0;\n top: 0;\n z-index: 9991;\n cursor: default;\n}\n\n.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\n box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\n background-color: rgba(255, 255, 255, 0.6);\n color: black;\n}\n\n.ace_optionsMenuEntry:hover {\n background-color: rgba(100, 100, 100, 0.1);\n transition: all 0.3s\n}\n\n.ace_closeButton {\n background: rgba(245, 146, 146, 0.5);\n border: 1px solid #F48A8A;\n border-radius: 50%;\n padding: 7px;\n position: absolute;\n right: -8px;\n top: -8px;\n z-index: 100000;\n}\n.ace_closeButton{\n background: rgba(245, 146, 146, 0.9);\n}\n.ace_optionsMenuKey {\n color: darkslateblue;\n font-weight: bold;\n}\n.ace_optionsMenuCommand {\n color: darkcyan;\n font-weight: normal;\n}\n.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {\n vertical-align: middle;\n}\n\n.ace_optionsMenuEntry button[ace_selected_button=true] {\n background: #e7e7e7;\n box-shadow: 1px 0px 2px 0px #adadad inset;\n border-color: #adadad;\n}\n.ace_optionsMenuEntry button {\n background: white;\n border: 1px solid lightgray;\n margin: 0px;\n}\n.ace_optionsMenuEntry button:hover{\n background: #f0f0f0;\n}"}),ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom","ace/ext/menu_tools/settings_menu.css"],function(e,t,n){"use strict";var r=e("../../lib/dom"),i=e("./settings_menu.css");r.importCssString(i,"settings_menu.css",!1),n.exports.overlayPage=function(t,n,r){function o(e){e.keyCode===27&&u()}function u(){if(!i)return;document.removeEventListener("keydown",o),i.parentNode.removeChild(i),t&&t.focus(),i=null,r&&r()}function a(e){s=e,e&&(i.style.pointerEvents="none",n.style.pointerEvents="auto")}var i=document.createElement("div"),s=!1;return i.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; "+(t?"background-color: rgba(0, 0, 0, 0.3);":""),i.addEventListener("click",function(e){s||u()}),document.addEventListener("keydown",o),n.addEventListener("click",function(e){e.stopPropagation()}),i.appendChild(n),document.body.appendChild(i),t&&t.blur(),{close:u,setIgnoreFocusOut:a}}}),ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../../lib/keys");n.exports.getEditorKeybordShortcuts=function(e){var t=r.KEY_MODS,n=[],i={};return e.keyBinding.$handlers.forEach(function(e){var t=e.commandKeyBinding;for(var r in t){var s=r.replace(/(^|-)\w/g,function(e){return e.toUpperCase()}),o=t[r];Array.isArray(o)||(o=[o]),o.forEach(function(e){typeof e!="string"&&(e=e.name),i[e]?i[e].key+="|"+s:(i[e]={key:s,command:e},n.push(i[e]))})}}),n}}),ace.define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"],function(e,t,n){"use strict";function i(t){if(!document.getElementById("kbshortcutmenu")){var n=e("./menu_tools/overlay_page").overlayPage,r=e("./menu_tools/get_editor_keyboard_shortcuts").getEditorKeybordShortcuts,i=r(t),s=document.createElement("div"),o=i.reduce(function(e,t){return e+'<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'+t.command+"</span> : "+'<span class="ace_optionsMenuKey">'+t.key+"</span></div>"},"");s.id="kbshortcutmenu",s.innerHTML="<h1>Keyboard Shortcuts</h1>"+o+"</div>",n(t,s)}}var r=e("../editor").Editor;n.exports.init=function(e){r.prototype.showKeyboardShortcuts=function(){i(this)},e.commands.addCommands([{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e,t){e.showKeyboardShortcuts()}}])}}); (function() {
|
||||
ace.require(["ace/ext/keybinding_menu"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/ext-language_tools.js
vendored
Normal file
8
vendor/ace/ext-linking.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"],function(e,t,n){function i(e){var n=e.editor,r=e.getAccelKey();if(r){var n=e.editor,i=e.getDocumentPosition(),s=n.session,o=s.getTokenAt(i.row,i.column);t.previousLinkingHover&&t.previousLinkingHover!=o&&n._emit("linkHoverOut"),n._emit("linkHover",{position:i,token:o}),t.previousLinkingHover=o}else t.previousLinkingHover&&(n._emit("linkHoverOut"),t.previousLinkingHover=!1)}function s(e){var t=e.getAccelKey(),n=e.getButton();if(n==0&&t){var r=e.editor,i=e.getDocumentPosition(),s=r.session,o=s.getTokenAt(i.row,i.column);r._emit("linkClick",{position:i,token:o})}}var r=e("../editor").Editor;e("../config").defineOptions(r.prototype,"editor",{enableLinking:{set:function(e){e?(this.on("click",s),this.on("mousemove",i)):(this.off("click",s),this.off("mousemove",i))},value:!1}}),t.previousLinkingHover=!1}); (function() {
|
||||
ace.require(["ace/ext/linking"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/ext-modelist.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/ext/modelist",["require","exports","module"],function(e,t,n){"use strict";function i(e){var t=a.text,n=e.split(/[\/\\]/).pop();for(var i=0;i<r.length;i++)if(r[i].supportsFile(n)){t=r[i];break}return t}var r=[],s=function(){function e(e,t,n){this.name=e,this.caption=t,this.mode="ace/mode/"+e,this.extensions=n;var r;/\^/.test(n)?r=n.replace(/\|(\^)?/g,function(e,t){return"$|"+(t?"^":"^.*\\.")})+"$":r="^.*\\.("+n+")$",this.extRe=new RegExp(r,"gi")}return e.prototype.supportsFile=function(e){return e.match(this.extRe)},e}(),o={ABAP:["abap"],ABC:["abc"],ActionScript:["as"],ADA:["ada|adb"],Alda:["alda"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],Apex:["apex|cls|trigger|tgr"],AQL:["aql"],AsciiDoc:["asciidoc|adoc"],ASL:["dsl|asl|asl.json"],Assembly_ARM32:["s"],Assembly_x86:["asm|a"],Astro:["astro"],AutoHotKey:["ahk"],BatchFile:["bat|cmd"],BibTeX:["bib"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp|ino"],C9Search:["c9search_results"],Cirru:["cirru|cr"],Clojure:["clj|cljs"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm|cfc"],Crystal:["cr"],CSharp:["cs"],Csound_Document:["csd"],Csound_Orchestra:["orc"],Csound_Score:["sco"],CSS:["css"],Curly:["curly"],Cuttlefish:["conf"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Django:["djt|html.djt|dj.html|djhtml"],Dockerfile:["^Dockerfile"],Dot:["dot"],Drools:["drl"],Edifact:["edi"],Eiffel:["e|ge"],EJS:["ejs"],Elixir:["ex|exs"],Elm:["elm"],Erlang:["erl|hrl"],Flix:["flix"],Forth:["frt|fs|ldr|fth|4th"],Fortran:["f|f90"],FSharp:["fsi|fs|ml|mli|fsx|fsscript"],FSL:["fsl"],FTL:["ftl"],Gcode:["gcode"],Gherkin:["feature"],Gitignore:["^.gitignore"],Glsl:["glsl|frag|vert"],Gobstones:["gbs"],golang:["go"],GraphQLSchema:["gql"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],Haskell_Cabal:["cabal"],haXe:["hx"],Hjson:["hjson"],HTML:["html|htm|xhtml|we|wpy"],HTML_Elixir:["eex|html.eex"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Io:["io"],Ion:["ion"],Jack:["jack"],Jade:["jade|pug"],Java:["java"],JavaScript:["js|jsm|cjs|mjs"],JEXL:["jexl"],JSON:["json"],JSON5:["json5"],JSONiq:["jq"],JSP:["jsp"],JSSM:["jssm|jssm_state"],JSX:["jsx"],Julia:["jl"],Kotlin:["kt|kts"],LaTeX:["tex|latex|ltx|bib"],Latte:["latte"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],Log:["log"],LogiQL:["logic|lql"],Logtalk:["lgt"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],Mask:["mask"],MATLAB:["matlab"],Maze:["mz"],MediaWiki:["wiki|mediawiki"],MEL:["mel"],MIPS:["s|asm"],MIXAL:["mixal"],MUSHCode:["mc|mush"],MySQL:["mysql"],Nasal:["nas"],Nginx:["nginx|conf"],Nim:["nim"],Nix:["nix"],NSIS:["nsi|nsh"],Nunjucks:["nunjucks|nunjs|nj|njk"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Odin:["odin"],PartiQL:["partiql|pql"],Pascal:["pas|p"],Perl:["pl|pm"],pgSQL:["pgsql"],PHP:["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],PHP_Laravel_blade:["blade.php"],Pig:["pig"],PLSQL:["plsql"],Powershell:["ps1"],Praat:["praat|praatscript|psc|proc"],Prisma:["prisma"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],PRQL:["prql"],Puppet:["epp|pp"],Python:["py"],QML:["qml"],R:["r"],Raku:["raku|rakumod|rakutest|p6|pl6|pm6"],Razor:["cshtml|asp"],RDoc:["Rd"],Red:["red|reds"],RHTML:["Rhtml"],Robot:["robot|resource"],RST:["rst"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SaC:["sac"],SASS:["sass"],SCAD:["scad"],Scala:["scala|sbt"],Scheme:["scm|sm|rkt|oak|scheme"],Scrypt:["scrypt"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Slim:["slim|skim"],Smarty:["smarty|tpl"],Smithy:["smithy"],snippets:["snippets"],Soy_Template:["soy"],Space:["space"],SPARQL:["rq"],SQL:["sql"],SQLServer:["sqlserver"],Stylus:["styl|stylus"],SVG:["svg"],Swift:["swift"],Tcl:["tcl"],Terraform:["tf","tfvars","terragrunt"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],TSX:["tsx"],Turtle:["ttl"],Twig:["twig|swig"],Typescript:["ts|mts|cts|typescript|str"],Vala:["vala"],VBScript:["vbs|vb"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],VHDL:["vhd|vhdl"],Visualforce:["vfp|component|page"],Vue:["vue"],Wollok:["wlk|wpgm|wtest"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],XQuery:["xq"],YAML:["yaml|yml"],Zeek:["zeek|bro"],Zig:["zig"]},u={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C and C++",Csound_Document:"Csound Document",Csound_Orchestra:"Csound",Csound_Score:"Csound Score",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",HTML_Elixir:"HTML (Elixir)",FTL:"FreeMarker",PHP_Laravel_blade:"PHP (Blade Template)",Perl6:"Perl 6",AutoHotKey:"AutoHotkey / AutoIt"},a={};for(var f in o){var l=o[f],c=(u[f]||f).replace(/_/g," "),h=f.toLowerCase(),p=new s(h,c,l[0]);a[h]=p,r.push(p)}n.exports={getModeForPath:i,modes:r,modesByName:a}}); (function() {
|
||||
ace.require(["ace/ext/modelist"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
502
vendor/ace/ext-old_ie.js
vendored
Normal file
@ -0,0 +1,502 @@
|
||||
ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var dom = require("../lib/dom");
|
||||
var lang = require("../lib/lang");
|
||||
var event = require("../lib/event");
|
||||
var searchboxCss = "\
|
||||
.ace_search {\
|
||||
background-color: #ddd;\
|
||||
border: 1px solid #cbcbcb;\
|
||||
border-top: 0 none;\
|
||||
max-width: 325px;\
|
||||
overflow: hidden;\
|
||||
margin: 0;\
|
||||
padding: 4px;\
|
||||
padding-right: 6px;\
|
||||
padding-bottom: 0;\
|
||||
position: absolute;\
|
||||
top: 0px;\
|
||||
z-index: 99;\
|
||||
white-space: normal;\
|
||||
}\
|
||||
.ace_search.left {\
|
||||
border-left: 0 none;\
|
||||
border-radius: 0px 0px 5px 0px;\
|
||||
left: 0;\
|
||||
}\
|
||||
.ace_search.right {\
|
||||
border-radius: 0px 0px 0px 5px;\
|
||||
border-right: 0 none;\
|
||||
right: 0;\
|
||||
}\
|
||||
.ace_search_form, .ace_replace_form {\
|
||||
border-radius: 3px;\
|
||||
border: 1px solid #cbcbcb;\
|
||||
float: left;\
|
||||
margin-bottom: 4px;\
|
||||
overflow: hidden;\
|
||||
}\
|
||||
.ace_search_form.ace_nomatch {\
|
||||
outline: 1px solid red;\
|
||||
}\
|
||||
.ace_search_field {\
|
||||
background-color: white;\
|
||||
color: black;\
|
||||
border-right: 1px solid #cbcbcb;\
|
||||
border: 0 none;\
|
||||
-webkit-box-sizing: border-box;\
|
||||
-moz-box-sizing: border-box;\
|
||||
box-sizing: border-box;\
|
||||
float: left;\
|
||||
height: 22px;\
|
||||
outline: 0;\
|
||||
padding: 0 7px;\
|
||||
width: 214px;\
|
||||
margin: 0;\
|
||||
}\
|
||||
.ace_searchbtn,\
|
||||
.ace_replacebtn {\
|
||||
background: #fff;\
|
||||
border: 0 none;\
|
||||
border-left: 1px solid #dcdcdc;\
|
||||
cursor: pointer;\
|
||||
float: left;\
|
||||
height: 22px;\
|
||||
margin: 0;\
|
||||
position: relative;\
|
||||
}\
|
||||
.ace_searchbtn:last-child,\
|
||||
.ace_replacebtn:last-child {\
|
||||
border-top-right-radius: 3px;\
|
||||
border-bottom-right-radius: 3px;\
|
||||
}\
|
||||
.ace_searchbtn:disabled {\
|
||||
background: none;\
|
||||
cursor: default;\
|
||||
}\
|
||||
.ace_searchbtn {\
|
||||
background-position: 50% 50%;\
|
||||
background-repeat: no-repeat;\
|
||||
width: 27px;\
|
||||
}\
|
||||
.ace_searchbtn.prev {\
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); \
|
||||
}\
|
||||
.ace_searchbtn.next {\
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); \
|
||||
}\
|
||||
.ace_searchbtn_close {\
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\
|
||||
border-radius: 50%;\
|
||||
border: 0 none;\
|
||||
color: #656565;\
|
||||
cursor: pointer;\
|
||||
float: right;\
|
||||
font: 16px/16px Arial;\
|
||||
height: 14px;\
|
||||
margin: 5px 1px 9px 5px;\
|
||||
padding: 0;\
|
||||
text-align: center;\
|
||||
width: 14px;\
|
||||
}\
|
||||
.ace_searchbtn_close:hover {\
|
||||
background-color: #656565;\
|
||||
background-position: 50% 100%;\
|
||||
color: white;\
|
||||
}\
|
||||
.ace_replacebtn.prev {\
|
||||
width: 54px\
|
||||
}\
|
||||
.ace_replacebtn.next {\
|
||||
width: 27px\
|
||||
}\
|
||||
.ace_button {\
|
||||
margin-left: 2px;\
|
||||
cursor: pointer;\
|
||||
-webkit-user-select: none;\
|
||||
-moz-user-select: none;\
|
||||
-o-user-select: none;\
|
||||
-ms-user-select: none;\
|
||||
user-select: none;\
|
||||
overflow: hidden;\
|
||||
opacity: 0.7;\
|
||||
border: 1px solid rgba(100,100,100,0.23);\
|
||||
padding: 1px;\
|
||||
-moz-box-sizing: border-box;\
|
||||
box-sizing: border-box;\
|
||||
color: black;\
|
||||
}\
|
||||
.ace_button:hover {\
|
||||
background-color: #eee;\
|
||||
opacity:1;\
|
||||
}\
|
||||
.ace_button:active {\
|
||||
background-color: #ddd;\
|
||||
}\
|
||||
.ace_button.checked {\
|
||||
border-color: #3399ff;\
|
||||
opacity:1;\
|
||||
}\
|
||||
.ace_search_options{\
|
||||
margin-bottom: 3px;\
|
||||
text-align: right;\
|
||||
-webkit-user-select: none;\
|
||||
-moz-user-select: none;\
|
||||
-o-user-select: none;\
|
||||
-ms-user-select: none;\
|
||||
user-select: none;\
|
||||
}";
|
||||
var HashHandler = require("../keyboard/hash_handler").HashHandler;
|
||||
var keyUtil = require("../lib/keys");
|
||||
|
||||
dom.importCssString(searchboxCss, "ace_searchbox");
|
||||
|
||||
var html = '<div class="ace_search right">\
|
||||
<button type="button" action="hide" class="ace_searchbtn_close"></button>\
|
||||
<div class="ace_search_form">\
|
||||
<input class="ace_search_field" placeholder="Search for" spellcheck="false"></input>\
|
||||
<button type="button" action="findNext" class="ace_searchbtn next"></button>\
|
||||
<button type="button" action="findPrev" class="ace_searchbtn prev"></button>\
|
||||
<button type="button" action="findAll" class="ace_searchbtn" title="Alt-Enter">All</button>\
|
||||
</div>\
|
||||
<div class="ace_replace_form">\
|
||||
<input class="ace_search_field" placeholder="Replace with" spellcheck="false"></input>\
|
||||
<button type="button" action="replaceAndFindNext" class="ace_replacebtn">Replace</button>\
|
||||
<button type="button" action="replaceAll" class="ace_replacebtn">All</button>\
|
||||
</div>\
|
||||
<div class="ace_search_options">\
|
||||
<span action="toggleRegexpMode" class="ace_button" title="RegExp Search">.*</span>\
|
||||
<span action="toggleCaseSensitive" class="ace_button" title="CaseSensitive Search">Aa</span>\
|
||||
<span action="toggleWholeWords" class="ace_button" title="Whole Word Search">\\b</span>\
|
||||
</div>\
|
||||
</div>'.replace(/>\s+/g, ">");
|
||||
|
||||
var SearchBox = function(editor, range, showReplaceForm) {
|
||||
var div = dom.createElement("div");
|
||||
div.innerHTML = html;
|
||||
this.element = div.firstChild;
|
||||
|
||||
this.$init();
|
||||
this.setEditor(editor);
|
||||
};
|
||||
|
||||
(function() {
|
||||
this.setEditor = function(editor) {
|
||||
editor.searchBox = this;
|
||||
editor.container.appendChild(this.element);
|
||||
this.editor = editor;
|
||||
};
|
||||
|
||||
this.$initElements = function(sb) {
|
||||
this.searchBox = sb.querySelector(".ace_search_form");
|
||||
this.replaceBox = sb.querySelector(".ace_replace_form");
|
||||
this.searchOptions = sb.querySelector(".ace_search_options");
|
||||
this.regExpOption = sb.querySelector("[action=toggleRegexpMode]");
|
||||
this.caseSensitiveOption = sb.querySelector("[action=toggleCaseSensitive]");
|
||||
this.wholeWordOption = sb.querySelector("[action=toggleWholeWords]");
|
||||
this.searchInput = this.searchBox.querySelector(".ace_search_field");
|
||||
this.replaceInput = this.replaceBox.querySelector(".ace_search_field");
|
||||
};
|
||||
|
||||
this.$init = function() {
|
||||
var sb = this.element;
|
||||
|
||||
this.$initElements(sb);
|
||||
|
||||
var _this = this;
|
||||
event.addListener(sb, "mousedown", function(e) {
|
||||
setTimeout(function(){
|
||||
_this.activeInput.focus();
|
||||
}, 0);
|
||||
event.stopPropagation(e);
|
||||
});
|
||||
event.addListener(sb, "click", function(e) {
|
||||
var t = e.target || e.srcElement;
|
||||
var action = t.getAttribute("action");
|
||||
if (action && _this[action])
|
||||
_this[action]();
|
||||
else if (_this.$searchBarKb.commands[action])
|
||||
_this.$searchBarKb.commands[action].exec(_this);
|
||||
event.stopPropagation(e);
|
||||
});
|
||||
|
||||
event.addCommandKeyListener(sb, function(e, hashId, keyCode) {
|
||||
var keyString = keyUtil.keyCodeToString(keyCode);
|
||||
var command = _this.$searchBarKb.findKeyCommand(hashId, keyString);
|
||||
if (command && command.exec) {
|
||||
command.exec(_this);
|
||||
event.stopEvent(e);
|
||||
}
|
||||
});
|
||||
|
||||
this.$onChange = lang.delayedCall(function() {
|
||||
_this.find(false, false);
|
||||
});
|
||||
|
||||
event.addListener(this.searchInput, "input", function() {
|
||||
_this.$onChange.schedule(20);
|
||||
});
|
||||
event.addListener(this.searchInput, "focus", function() {
|
||||
_this.activeInput = _this.searchInput;
|
||||
_this.searchInput.value && _this.highlight();
|
||||
});
|
||||
event.addListener(this.replaceInput, "focus", function() {
|
||||
_this.activeInput = _this.replaceInput;
|
||||
_this.searchInput.value && _this.highlight();
|
||||
});
|
||||
};
|
||||
this.$closeSearchBarKb = new HashHandler([{
|
||||
bindKey: "Esc",
|
||||
name: "closeSearchBar",
|
||||
exec: function(editor) {
|
||||
editor.searchBox.hide();
|
||||
}
|
||||
}]);
|
||||
this.$searchBarKb = new HashHandler();
|
||||
this.$searchBarKb.bindKeys({
|
||||
"Ctrl-f|Command-f": function(sb) {
|
||||
var isReplace = sb.isReplace = !sb.isReplace;
|
||||
sb.replaceBox.style.display = isReplace ? "" : "none";
|
||||
sb.searchInput.focus();
|
||||
},
|
||||
"Ctrl-H|Command-Option-F": function(sb) {
|
||||
sb.replaceBox.style.display = "";
|
||||
sb.replaceInput.focus();
|
||||
},
|
||||
"Ctrl-G|Command-G": function(sb) {
|
||||
sb.findNext();
|
||||
},
|
||||
"Ctrl-Shift-G|Command-Shift-G": function(sb) {
|
||||
sb.findPrev();
|
||||
},
|
||||
"esc": function(sb) {
|
||||
setTimeout(function() { sb.hide();});
|
||||
},
|
||||
"Return": function(sb) {
|
||||
if (sb.activeInput == sb.replaceInput)
|
||||
sb.replace();
|
||||
sb.findNext();
|
||||
},
|
||||
"Shift-Return": function(sb) {
|
||||
if (sb.activeInput == sb.replaceInput)
|
||||
sb.replace();
|
||||
sb.findPrev();
|
||||
},
|
||||
"Alt-Return": function(sb) {
|
||||
if (sb.activeInput == sb.replaceInput)
|
||||
sb.replaceAll();
|
||||
sb.findAll();
|
||||
},
|
||||
"Tab": function(sb) {
|
||||
(sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus();
|
||||
}
|
||||
});
|
||||
|
||||
this.$searchBarKb.addCommands([{
|
||||
name: "toggleRegexpMode",
|
||||
bindKey: {win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/"},
|
||||
exec: function(sb) {
|
||||
sb.regExpOption.checked = !sb.regExpOption.checked;
|
||||
sb.$syncOptions();
|
||||
}
|
||||
}, {
|
||||
name: "toggleCaseSensitive",
|
||||
bindKey: {win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I"},
|
||||
exec: function(sb) {
|
||||
sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked;
|
||||
sb.$syncOptions();
|
||||
}
|
||||
}, {
|
||||
name: "toggleWholeWords",
|
||||
bindKey: {win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W"},
|
||||
exec: function(sb) {
|
||||
sb.wholeWordOption.checked = !sb.wholeWordOption.checked;
|
||||
sb.$syncOptions();
|
||||
}
|
||||
}]);
|
||||
|
||||
this.$syncOptions = function() {
|
||||
dom.setCssClass(this.regExpOption, "checked", this.regExpOption.checked);
|
||||
dom.setCssClass(this.wholeWordOption, "checked", this.wholeWordOption.checked);
|
||||
dom.setCssClass(this.caseSensitiveOption, "checked", this.caseSensitiveOption.checked);
|
||||
this.find(false, false);
|
||||
};
|
||||
|
||||
this.highlight = function(re) {
|
||||
this.editor.session.highlight(re || this.editor.$search.$options.re);
|
||||
this.editor.renderer.updateBackMarkers()
|
||||
};
|
||||
this.find = function(skipCurrent, backwards, preventScroll) {
|
||||
var range = this.editor.find(this.searchInput.value, {
|
||||
skipCurrent: skipCurrent,
|
||||
backwards: backwards,
|
||||
wrap: true,
|
||||
regExp: this.regExpOption.checked,
|
||||
caseSensitive: this.caseSensitiveOption.checked,
|
||||
wholeWord: this.wholeWordOption.checked,
|
||||
preventScroll: preventScroll
|
||||
});
|
||||
var noMatch = !range && this.searchInput.value;
|
||||
dom.setCssClass(this.searchBox, "ace_nomatch", noMatch);
|
||||
this.editor._emit("findSearchBox", { match: !noMatch });
|
||||
this.highlight();
|
||||
};
|
||||
this.findNext = function() {
|
||||
this.find(true, false);
|
||||
};
|
||||
this.findPrev = function() {
|
||||
this.find(true, true);
|
||||
};
|
||||
this.findAll = function(){
|
||||
var range = this.editor.findAll(this.searchInput.value, {
|
||||
regExp: this.regExpOption.checked,
|
||||
caseSensitive: this.caseSensitiveOption.checked,
|
||||
wholeWord: this.wholeWordOption.checked
|
||||
});
|
||||
var noMatch = !range && this.searchInput.value;
|
||||
dom.setCssClass(this.searchBox, "ace_nomatch", noMatch);
|
||||
this.editor._emit("findSearchBox", { match: !noMatch });
|
||||
this.highlight();
|
||||
this.hide();
|
||||
};
|
||||
this.replace = function() {
|
||||
if (!this.editor.getReadOnly())
|
||||
this.editor.replace(this.replaceInput.value);
|
||||
};
|
||||
this.replaceAndFindNext = function() {
|
||||
if (!this.editor.getReadOnly()) {
|
||||
this.editor.replace(this.replaceInput.value);
|
||||
this.findNext()
|
||||
}
|
||||
};
|
||||
this.replaceAll = function() {
|
||||
if (!this.editor.getReadOnly())
|
||||
this.editor.replaceAll(this.replaceInput.value);
|
||||
};
|
||||
|
||||
this.hide = function() {
|
||||
this.element.style.display = "none";
|
||||
this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb);
|
||||
this.editor.focus();
|
||||
};
|
||||
this.show = function(value, isReplace) {
|
||||
this.element.style.display = "";
|
||||
this.replaceBox.style.display = isReplace ? "" : "none";
|
||||
|
||||
this.isReplace = isReplace;
|
||||
|
||||
if (value)
|
||||
this.searchInput.value = value;
|
||||
|
||||
this.find(false, false, true);
|
||||
|
||||
this.searchInput.focus();
|
||||
this.searchInput.select();
|
||||
|
||||
this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb);
|
||||
};
|
||||
|
||||
this.isFocused = function() {
|
||||
var el = document.activeElement;
|
||||
return el == this.searchInput || el == this.replaceInput;
|
||||
}
|
||||
}).call(SearchBox.prototype);
|
||||
|
||||
exports.SearchBox = SearchBox;
|
||||
|
||||
exports.Search = function(editor, isReplace) {
|
||||
var sb = editor.searchBox || new SearchBox(editor);
|
||||
sb.show(editor.session.getTextRange(), isReplace);
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/ext/old_ie",["require","exports","module","ace/lib/useragent","ace/tokenizer","ace/ext/searchbox","ace/mode/text"], function(require, exports, module) {
|
||||
"use strict";
|
||||
var MAX_TOKEN_COUNT = 1000;
|
||||
var useragent = require("../lib/useragent");
|
||||
var TokenizerModule = require("../tokenizer");
|
||||
|
||||
function patch(obj, name, regexp, replacement) {
|
||||
eval("obj['" + name + "']=" + obj[name].toString().replace(
|
||||
regexp, replacement
|
||||
));
|
||||
}
|
||||
|
||||
if (useragent.isIE && useragent.isIE < 10 && window.top.document.compatMode === "BackCompat")
|
||||
useragent.isOldIE = true;
|
||||
|
||||
if (typeof document != "undefined" && !document.documentElement.querySelector) {
|
||||
useragent.isOldIE = true;
|
||||
var qs = function(el, selector) {
|
||||
if (selector.charAt(0) == ".") {
|
||||
var classNeme = selector.slice(1);
|
||||
} else {
|
||||
var m = selector.match(/(\w+)=(\w+)/);
|
||||
var attr = m && m[1];
|
||||
var attrVal = m && m[2];
|
||||
}
|
||||
for (var i = 0; i < el.all.length; i++) {
|
||||
var ch = el.all[i];
|
||||
if (classNeme) {
|
||||
if (ch.className.indexOf(classNeme) != -1)
|
||||
return ch;
|
||||
} else if (attr) {
|
||||
if (ch.getAttribute(attr) == attrVal)
|
||||
return ch;
|
||||
}
|
||||
}
|
||||
};
|
||||
var sb = require("./searchbox").SearchBox.prototype;
|
||||
patch(
|
||||
sb, "$initElements",
|
||||
/([^\s=]*).querySelector\((".*?")\)/g,
|
||||
"qs($1, $2)"
|
||||
);
|
||||
}
|
||||
|
||||
var compliantExecNpcg = /()??/.exec("")[1] === undefined;
|
||||
if (compliantExecNpcg)
|
||||
return;
|
||||
var proto = TokenizerModule.Tokenizer.prototype;
|
||||
TokenizerModule.Tokenizer_orig = TokenizerModule.Tokenizer;
|
||||
proto.getLineTokens_orig = proto.getLineTokens;
|
||||
|
||||
patch(
|
||||
TokenizerModule, "Tokenizer",
|
||||
"ruleRegExps.push(adjustedregex);\n",
|
||||
function(m) {
|
||||
return m + '\
|
||||
if (state[i].next && RegExp(adjustedregex).test(""))\n\
|
||||
rule._qre = RegExp(adjustedregex, "g");\n\
|
||||
';
|
||||
}
|
||||
);
|
||||
TokenizerModule.Tokenizer.prototype = proto;
|
||||
patch(
|
||||
proto, "getLineTokens",
|
||||
/if \(match\[i \+ 1\] === undefined\)\s*continue;/,
|
||||
"if (!match[i + 1]) {\n\
|
||||
if (value)continue;\n\
|
||||
var qre = state[mapping[i]]._qre;\n\
|
||||
if (!qre) continue;\n\
|
||||
qre.lastIndex = lastIndex;\n\
|
||||
if (!qre.exec(line) || qre.lastIndex != lastIndex)\n\
|
||||
continue;\n\
|
||||
}"
|
||||
);
|
||||
|
||||
patch(
|
||||
require("../mode/text").Mode.prototype, "getTokenizer",
|
||||
/Tokenizer/,
|
||||
"TokenizerModule.Tokenizer"
|
||||
);
|
||||
|
||||
useragent.isOldIE = true;
|
||||
|
||||
});
|
||||
(function() {
|
||||
ace.require(["ace/ext/old_ie"], function() {});
|
||||
})();
|
||||
|
||||
8
vendor/ace/ext-options.js
vendored
Normal file
8
vendor/ace/ext-prompt.js
vendored
Normal file
8
vendor/ace/ext-rtl.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/ext/rtl",["require","exports","module","ace/editor","ace/config"],function(e,t,n){"use strict";function s(e,t){var n=t.getSelection().lead;t.session.$bidiHandler.isRtlLine(n.row)&&n.column===0&&(t.session.$bidiHandler.isMoveLeftOperation&&n.row>0?t.getSelection().moveCursorTo(n.row-1,t.session.getLine(n.row-1).length):t.getSelection().isEmpty()?n.column+=1:n.setPosition(n.row,n.column+1))}function o(e){e.editor.session.$bidiHandler.isMoveLeftOperation=/gotoleft|selectleft|backspace|removewordleft/.test(e.command.name)}function u(e,t){var n=t.session;n.$bidiHandler.currentRow=null;if(n.$bidiHandler.isRtlLine(e.start.row)&&e.action==="insert"&&e.lines.length>1)for(var r=e.start.row;r<e.end.row;r++)n.getLine(r+1).charAt(0)!==n.$bidiHandler.RLE&&(n.doc.$lines[r+1]=n.$bidiHandler.RLE+n.getLine(r+1))}function a(e,t){var n=t.session,r=n.$bidiHandler,i=t.$textLayer.$lines.cells,s=t.layerConfig.width-t.layerConfig.padding+"px";i.forEach(function(e){var t=e.element.style;r&&r.isRtlLine(e.row)?(t.direction="rtl",t.textAlign="right",t.width=s):(t.direction="",t.textAlign="",t.width="")})}function f(e){function n(e){var t=e.element.style;t.direction=t.textAlign=t.width=""}var t=e.$textLayer.$lines;t.cells.forEach(n),t.cellCache.forEach(n)}var r=[{name:"leftToRight",bindKey:{win:"Ctrl-Alt-Shift-L",mac:"Command-Alt-Shift-L"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!1)},readOnly:!0},{name:"rightToLeft",bindKey:{win:"Ctrl-Alt-Shift-R",mac:"Command-Alt-Shift-R"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!0)},readOnly:!0}],i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{rtlText:{set:function(e){e?(this.on("change",u),this.on("changeSelection",s),this.renderer.on("afterRender",a),this.commands.on("exec",o),this.commands.addCommands(r)):(this.off("change",u),this.off("changeSelection",s),this.renderer.off("afterRender",a),this.commands.off("exec",o),this.commands.removeCommands(r),f(this.renderer)),this.renderer.updateFull()}},rtl:{set:function(e){this.session.$bidiHandler.$isRtl=e,e?(this.setOption("rtlText",!1),this.renderer.on("afterRender",a),this.session.$bidiHandler.seenBidi=!0):(this.renderer.off("afterRender",a),f(this.renderer)),this.renderer.updateFull()}}})}); (function() {
|
||||
ace.require(["ace/ext/rtl"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/ext-searchbox.js
vendored
Normal file
8
vendor/ace/ext-settings_menu.js
vendored
Normal file
8
vendor/ace/ext-simple_tokenizer.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/ext/simple_tokenizer",["require","exports","module","ace/tokenizer","ace/layer/text_util"],function(e,t,n){"use strict";function o(e,t){var n=new s(e,new r(t.getRules())),o=[];for(var u=0;u<n.getLength();u++){var a=n.getTokens(u);o.push(a.map(function(e){return{className:i(e.type)?undefined:"ace_"+e.type.replace(/\./g," ace_"),value:e.value}}))}return o}var r=e("../tokenizer").Tokenizer,i=e("../layer/text_util").isTextToken,s=function(){function e(e,t){this._lines=e.split(/\r\n|\r|\n/),this._states=[],this._tokenizer=t}return e.prototype.getTokens=function(e){var t=this._lines[e],n=this._states[e-1],r=this._tokenizer.getLineTokens(t,n);return this._states[e]=r.state,r.tokens},e.prototype.getLength=function(){return this._lines.length},e}();n.exports={tokenize:o}}); (function() {
|
||||
ace.require(["ace/ext/simple_tokenizer"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/ext-spellcheck.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"],function(e,t,n){"use strict";var r=e("../lib/event");t.contextMenuHandler=function(e){var t=e.target,n=t.textInput.getElement();if(!t.selection.isEmpty())return;var i=t.getCursorPosition(),s=t.session.getWordRange(i.row,i.column),o=t.session.getTextRange(s);t.session.tokenRe.lastIndex=0;if(!t.session.tokenRe.test(o))return;var u="\x01\x01",a=o+" "+u;n.value=a,n.setSelectionRange(o.length,o.length+1),n.setSelectionRange(0,0),n.setSelectionRange(0,o.length);var f=!1;r.addListener(n,"keydown",function l(){r.removeListener(n,"keydown",l),f=!0}),t.textInput.setInputHandler(function(e){if(e==a)return"";if(e.lastIndexOf(a,0)===0)return e.slice(a.length);if(e.substr(n.selectionEnd)==a)return e.slice(0,-a.length);if(e.slice(-2)==u){var r=e.slice(0,-2);if(r.slice(-1)==" ")return f?r.substring(0,n.selectionEnd):(r=r.slice(0,-1),t.session.replace(s,r),"")}return e})};var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{spellcheck:{set:function(e){var n=this.textInput.getElement();n.spellcheck=!!e,e?this.on("nativecontextmenu",t.contextMenuHandler):this.removeListener("nativecontextmenu",t.contextMenuHandler)},value:!0}})}); (function() {
|
||||
ace.require(["ace/ext/spellcheck"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/ext-split.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./editor").Editor,u=e("./virtual_renderer").VirtualRenderer,a=e("./edit_session").EditSession,f;f=function(e,t,n){this.BELOW=1,this.BESIDE=0,this.$container=e,this.$theme=t,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(n||1),this.$cEditor=this.$editors[0],this.on("focus",function(e){this.$cEditor=e}.bind(this))},function(){r.implement(this,s),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new o(new u(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e==this.$splits)return;if(e>this.$splits){while(this.$splits<this.$editors.length&&this.$splits<e)t=this.$editors[this.$splits],this.$container.appendChild(t.container),t.setFontSize(this.$fontSize),this.$splits++;while(this.$splits<e)this.$createEditor(),this.$splits++}else while(this.$splits>e)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach(function(t){t.setTheme(e)})},this.setKeyboardHandler=function(e){this.$editors.forEach(function(t){t.setKeyboardHandler(e)})},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach(function(t){t.setFontSize(e)})},this.$cloneSession=function(e){var t=new a(e.getDocument(),e.getMode()),n=e.getUndoManager();return t.setUndoManager(n),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var n;t==null?n=this.$cEditor:n=this.$editors[t];var r=this.$editors.some(function(t){return t.session===e});return r&&(e=this.$cloneSession(e)),n.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){if(this.$orientation==e)return;this.$orientation=e,this.resize()},this.resize=function(){var e=this.$container.clientWidth,t=this.$container.clientHeight,n;if(this.$orientation==this.BESIDE){var r=e/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=r+"px",n.container.style.top="0px",n.container.style.left=i*r+"px",n.container.style.height=t+"px",n.resize()}else{var s=t/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=e+"px",n.container.style.top=i*s+"px",n.container.style.left="0px",n.container.style.height=s+"px",n.resize()}}}.call(f.prototype),t.Split=f}),ace.define("ace/ext/split",["require","exports","module","ace/split"],function(e,t,n){"use strict";n.exports=e("../split")}); (function() {
|
||||
ace.require(["ace/ext/split"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/ext-static_highlight.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/ext/static-css",["require","exports","module"],function(e,t,n){n.exports=".ace_static_highlight {\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', 'Droid Sans Mono', monospace;\n font-size: 12px;\n white-space: pre-wrap\n}\n\n.ace_static_highlight .ace_gutter {\n width: 2em;\n text-align: right;\n padding: 0 3px 0 0;\n margin-right: 3px;\n contain: none;\n}\n\n.ace_static_highlight.ace_show_gutter .ace_line {\n padding-left: 2.6em;\n}\n\n.ace_static_highlight .ace_line { position: relative; }\n\n.ace_static_highlight .ace_gutter-cell {\n -moz-user-select: -moz-none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n top: 0;\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n\n.ace_static_highlight .ace_gutter-cell:before {\n content: counter(ace_line, decimal);\n counter-increment: ace_line;\n}\n.ace_static_highlight {\n counter-reset: ace_line;\n}\n"}),ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/ext/static-css","ace/config","ace/lib/dom","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../edit_session").EditSession,i=e("../layer/text").Text,s=e("./static-css"),o=e("../config"),u=e("../lib/dom"),a=e("../lib/lang").escapeHTML,f=function(){function e(e){this.className,this.type=e,this.style={},this.textContent=""}return e.prototype.cloneNode=function(){return this},e.prototype.appendChild=function(e){this.textContent+=e.toString()},e.prototype.toString=function(){var e=[];if(this.type!="fragment"){e.push("<",this.type),this.className&&e.push(" class='",this.className,"'");var t=[];for(var n in this.style)t.push(n,":",this.style[n]);t.length&&e.push(" style='",t.join(""),"'"),e.push(">")}return this.textContent&&e.push(this.textContent),this.type!="fragment"&&e.push("</",this.type,">"),e.join("")},e}(),l={createTextNode:function(e,t){return a(e)},createElement:function(e){return new f(e)},createFragment:function(){return new f("fragment")}},c=function(){this.config={},this.dom=l};c.prototype=i.prototype;var h=function(e,t,n){var r=e.className.match(/lang-(\w+)/),i=t.mode||r&&"ace/mode/"+r[1];if(!i)return!1;var s=t.theme||"ace/theme/textmate",o="",a=[];if(e.firstElementChild){var f=0;for(var l=0;l<e.childNodes.length;l++){var c=e.childNodes[l];c.nodeType==3?(f+=c.data.length,o+=c.data):a.push(f,c)}}else o=e.textContent,t.trim&&(o=o.trim());h.render(o,i,s,t.firstLineNumber,!t.showGutter,function(t){u.importCssString(t.css,"ace_highlight",!0),e.innerHTML=t.html;var r=e.firstChild.firstChild;for(var i=0;i<a.length;i+=2){var s=t.session.doc.indexToPosition(a[i]),o=a[i+1],f=r.children[s.row];f&&f.appendChild(o)}n&&n()})};h.render=function(e,t,n,i,s,u){function c(){var r=h.renderSync(e,t,n,i,s);return u?u(r):r}var a=1,f=r.prototype.$modes;typeof n=="string"&&(a++,o.loadModule(["theme",n],function(e){n=e,--a||c()}));var l;return t&&typeof t=="object"&&!t.getTokenizer&&(l=t,t=l.path),typeof t=="string"&&(a++,o.loadModule(["mode",t],function(e){if(!f[t]||l)f[t]=new e.Mode(l);t=f[t],--a||c()})),--a||c()},h.renderSync=function(e,t,n,i,o){i=parseInt(i||1,10);var u=new r("");u.setUseWorker(!1),u.setMode(t);var a=new c;a.setSession(u),Object.keys(a.$tabStrings).forEach(function(e){if(typeof a.$tabStrings[e]=="string"){var t=l.createFragment();t.textContent=a.$tabStrings[e],a.$tabStrings[e]=t}}),u.setValue(e);var f=u.getLength(),h=l.createElement("div");h.className=n.cssClass;var p=l.createElement("div");p.className="ace_static_highlight"+(o?"":" ace_show_gutter"),p.style["counter-reset"]="ace_line "+(i-1);for(var d=0;d<f;d++){var v=l.createElement("div");v.className="ace_line";if(!o){var m=l.createElement("span");m.className="ace_gutter ace_gutter-cell",m.textContent="",v.appendChild(m)}a.$renderLine(v,d,!1),v.textContent+="\n",p.appendChild(v)}return h.appendChild(p),{css:s+n.cssText,html:h.toString(),session:u}},n.exports=h,n.exports.highlight=h}); (function() {
|
||||
ace.require(["ace/ext/static_highlight"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/ext-statusbar.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=function(){function e(e,t){this.element=r.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var n=i.delayedCall(function(){this.updateStatus(e)}.bind(this)).schedule.bind(null,100);e.on("changeStatus",n),e.on("changeSelection",n),e.on("keyboardActivity",n)}return e.prototype.updateStatus=function(e){function n(e,n){e&&t.push(e,n||"|")}var t=[];n(e.keyBinding.getStatusText(e)),e.commands.recording&&n("REC");var r=e.selection,i=r.lead;if(!r.isEmpty()){var s=e.getSelectionRange();n("("+(s.end.row-s.start.row)+":"+(s.end.column-s.start.column)+")"," ")}n(i.row+":"+i.column," "),r.rangeCount&&n("["+r.rangeCount+"]"," "),t.pop(),this.element.textContent=t.join("")},e}();t.StatusBar=s}); (function() {
|
||||
ace.require(["ace/ext/statusbar"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
4111
vendor/ace/ext-tern.js
vendored
Normal file
8
vendor/ace/ext-textarea.js
vendored
Normal file
8
vendor/ace/ext-themelist.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/ext/themelist",["require","exports","module"],function(e,t,n){"use strict";var r=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub Light Default"],["GitHub (Legacy)","github","light"],["IPlastic"],["Solarized Light"],["TextMate"],["Tomorrow"],["XCode"],["Kuroir"],["KatzenMilch"],["SQL Server","sqlserver","light"],["CloudEditor","cloud_editor","light"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Dracula","","dark"],["Cobalt","cobalt","dark"],["Gruvbox","gruvbox","dark"],["Green on Black","gob","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Nord Dark","nord_dark","dark"],["One Dark","one_dark","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"],["GitHub Dark","github_dark","dark"],["CloudEditor Dark","cloud_editor_dark","dark"]];t.themesByName={},t.themes=r.map(function(e){var n=e[1]||e[0].replace(/ /g,"_").toLowerCase(),r={caption:e[0],theme:"ace/theme/"+n,isDark:e[2]=="dark",name:n};return t.themesByName[n]=r,r})}); (function() {
|
||||
ace.require(["ace/ext/themelist"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/ext-whitespace.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang");t.$detectIndentation=function(e,t){function c(e){var t=0;for(var r=e;r<n.length;r+=e)t+=n[r]||0;return t}var n=[],r=[],i=0,s=0,o=Math.min(e.length,1e3);for(var u=0;u<o;u++){var a=e[u];if(!/^\s*[^*+\-\s]/.test(a))continue;if(a[0]==" ")i++,s=-Number.MAX_VALUE;else{var f=a.match(/^ */)[0].length;if(f&&a[f]!=" "){var l=f-s;l>0&&!(s%l)&&!(f%l)&&(r[l]=(r[l]||0)+1),n[f]=(n[f]||0)+1}s=f}while(u<o&&a[a.length-1]=="\\")a=e[u++]}var h=r.reduce(function(e,t){return e+t},0),p={score:0,length:0},d=0;for(var u=1;u<12;u++){var v=c(u);u==1?(d=v,v=n[1]?.9:.8,n.length||(v=0)):v/=d,r[u]&&(v+=r[u]/h),v>p.score&&(p={score:v,length:u})}if(p.score&&p.score>1.4)var m=p.length;if(i>d+1){if(m==1||d<i/4||p.score<1.8)m=undefined;return{ch:" ",length:m}}if(d>i+1)return{ch:" ",length:m}},t.detectIndentation=function(e){var n=e.getLines(0,1e3),r=t.$detectIndentation(n)||{};return r.ch&&e.setUseSoftTabs(r.ch==" "),r.length&&e.setTabSize(r.length),r},t.trimTrailingSpace=function(e,t){var n=e.getDocument(),r=n.getAllLines(),i=t&&t.trimEmpty?-1:0,s=[],o=-1;t&&t.keepCursorPosition&&(e.selection.rangeCount?e.selection.rangeList.ranges.forEach(function(e,t,n){var r=n[t+1];if(r&&r.cursor.row==e.cursor.row)return;s.push(e.cursor)}):s.push(e.selection.getCursor()),o=0);var u=s[o]&&s[o].row;for(var a=0,f=r.length;a<f;a++){var l=r[a],c=l.search(/\s+$/);a==u&&(c<s[o].column&&c>i&&(c=s[o].column),o++,u=s[o]?s[o].row:-1),c>i&&n.removeInLine(a,c,l.length)}},t.convertIndentation=function(e,t,n){var i=e.getTabString()[0],s=e.getTabSize();n||(n=s),t||(t=i);var o=t==" "?t:r.stringRepeat(t,n),u=e.doc,a=u.getAllLines(),f={},l={};for(var c=0,h=a.length;c<h;c++){var p=a[c],d=p.match(/^\s*/)[0];if(d){var v=e.$getStringScreenWidth(d)[0],m=Math.floor(v/s),g=v%s,y=f[m]||(f[m]=r.stringRepeat(o,m));y+=l[g]||(l[g]=r.stringRepeat(" ",g)),y!=d&&(u.removeInLine(c,0,d.length),u.insertInLine({row:c,column:0},y))}}e.setTabSize(n),e.setUseSoftTabs(t==" ")},t.$parseStringArg=function(e){var t={};/t/.test(e)?t.ch=" ":/s/.test(e)&&(t.ch=" ");var n=e.match(/\d+/);return n&&(t.length=parseInt(n[0],10)),t},t.$parseArg=function(e){return e?typeof e=="string"?t.$parseStringArg(e):typeof e.text=="string"?t.$parseStringArg(e.text):e:{}},t.commands=[{name:"detectIndentation",description:"Detect indentation from content",exec:function(e){t.detectIndentation(e.session)}},{name:"trimTrailingSpace",description:"Trim trailing whitespace",exec:function(e,n){t.trimTrailingSpace(e.session,n)}},{name:"convertIndentation",description:"Convert indentation to ...",exec:function(e,n){var r=t.$parseArg(n);t.convertIndentation(e.session,r.ch,r.length)}},{name:"setIndentation",description:"Set indentation",exec:function(e,n){var r=t.$parseArg(n);r.length&&e.session.setTabSize(r.length),r.ch&&e.session.setUseSoftTabs(r.ch==" ")}}]}); (function() {
|
||||
ace.require(["ace/ext/whitespace"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/keybinding-emacs.js
vendored
Normal file
8
vendor/ace/keybinding-sublime.js
vendored
Normal file
8
vendor/ace/keybinding-vim.js
vendored
Normal file
8
vendor/ace/keybinding-vscode.js
vendored
Normal file
10706
vendor/ace/libs/cell/api.js
vendored
Normal file
4233
vendor/ace/libs/slide/api.js
vendored
Normal file
8295
vendor/ace/libs/word/api.js
vendored
Normal file
8
vendor/ace/mode-abap.js
vendored
Normal file
8
vendor/ace/mode-abc.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/mode/abc_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:["zupfnoter.information.comment.line.percentage","information.keyword","in formation.keyword.embedded"],regex:"(%%%%)(hn\\.[a-z]*)(.*)",comment:"Instruction Comment"},{token:["information.comment.line.percentage","information.keyword.embedded"],regex:"(%%)(.*)",comment:"Instruction Comment"},{token:"comment.line.percentage",regex:"%.*",comment:"Comments"},{token:"barline.keyword.operator",regex:"[\\[:]*[|:][|\\]:]*(?:\\[?[0-9]+)?|\\[[0-9]+",comment:"Bar lines"},{token:["information.keyword.embedded","information.argument.string.unquoted"],regex:"(\\[[A-Za-z]:)([^\\]]*\\])",comment:"embedded Header lines"},{token:["information.keyword","information.argument.string.unquoted"],regex:"^([A-Za-z]:)([^%\\\\]*)",comment:"Header lines"},{token:["text","entity.name.function","string.unquoted","text"],regex:"(\\[)([A-Z]:)(.*?)(\\])",comment:"Inline fields"},{token:["accent.constant.language","pitch.constant.numeric","duration.constant.numeric"],regex:"([\\^=_]*)([A-Ga-gz][,']*)([0-9]*/*[><0-9]*)",comment:"Notes"},{token:"zupfnoter.jumptarget.string.quoted",regex:'[\\"!]\\^\\:.*?[\\"!]',comment:"Zupfnoter jumptarget"},{token:"zupfnoter.goto.string.quoted",regex:'[\\"!]\\^\\@.*?[\\"!]',comment:"Zupfnoter goto"},{token:"zupfnoter.annotation.string.quoted",regex:'[\\"!]\\^\\!.*?[\\"!]',comment:"Zupfnoter annoation"},{token:"zupfnoter.annotationref.string.quoted",regex:'[\\"!]\\^\\#.*?[\\"!]',comment:"Zupfnoter annotation reference"},{token:"chordname.string.quoted",regex:'[\\"!]\\^.*?[\\"!]',comment:"abc chord"},{token:"string.quoted",regex:'[\\"!].*?[\\"!]',comment:"abc annotation"}]},this.normalizeRules()};s.metaData={fileTypes:["abc"],name:"ABC",scopeName:"text.abcnotation"},r.inherits(s,i),t.ABCHighlightRules=s}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++n<s){t=e.getLine(n);var f=u.exec(t);if(!f)continue;f[1]?a--:a++;if(!a)break}var l=n;if(l>o)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/abc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/abc_highlight_rules","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./abc_highlight_rules").ABCHighlightRules,o=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart="%",this.$id="ace/mode/abc",this.snippetFileId="ace/snippets/abc"}.call(u.prototype),t.Mode=u}); (function() {
|
||||
ace.require(["ace/mode/abc"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/mode-actionscript.js
vendored
Normal file
8
vendor/ace/mode-ada.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/mode/ada_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="abort|else|new|return|abs|elsif|not|reverse|abstract|end|null|accept|entry|select|access|exception|of|separate|aliased|exit|or|some|all|others|subtype|and|for|out|synchronized|array|function|overriding|at|tagged|generic|package|task|begin|goto|pragma|terminate|body|private|then|if|procedure|type|case|in|protected|constant|interface|until||is|raise|use|declare|range|delay|limited|record|when|delta|loop|rem|while|digits|renames|with|do|mod|requeue|xor",t="true|false|null",n="count|min|max|avg|sum|rank|now|coalesce|main",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]}};r.inherits(s,i),t.AdaHighlightRules=s}),ace.define("ace/mode/ada",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ada_highlight_rules","ace/range"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./ada_highlight_rules").AdaHighlightRules,o=e("../range").Range,u=function(){this.HighlightRules=s,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart="--",this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var o=t.match(/^.*(begin|loop|then|is|do)\s*$/);o&&(r+=n)}return r},this.checkOutdent=function(e,t,n){var r=t+n;return r.match(/^\s*(begin|end)$/)?!0:!1},this.autoOutdent=function(e,t,n){var r=t.getLine(n),i=t.getLine(n-1),s=this.$getIndent(i).length,u=this.$getIndent(r).length;if(u<=s)return;t.outdentRows(new o(n,0,n+2,0))},this.$id="ace/mode/ada"}.call(u.prototype),t.Mode=u}); (function() {
|
||||
ace.require(["ace/mode/ada"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/mode-alda.js
vendored
Normal file
8
vendor/ace/mode-apache_conf.js
vendored
Normal file
8
vendor/ace/mode-apex.js
vendored
Normal file
8
vendor/ace/mode-applescript.js
vendored
Normal file
8
vendor/ace/mode-aql.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/mode/aql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="for|return|filter|search|sort|limit|let|collect|asc|desc|in|into|insert|update|remove|replace|upsert|options|with|and|or|not|distinct|graph|shortest_path|outbound|inbound|any|all|none|at least|aggregate|like|k_shortest_paths|k_paths|all_shortest_paths|prune|window",t="true|false",n="to_bool|to_number|to_string|to_array|to_list|is_null|is_bool|is_number|is_string|is_array|is_list|is_object|is_document|is_datestring|typename|json_stringify|json_parse|concat|concat_separator|char_length|lower|upper|substring|left|right|trim|reverse|contains|log|log2|log10|exp|exp2|sin|cos|tan|asin|acos|atan|atan2|radians|degrees|pi|regex_test|regex_replace|like|floor|ceil|round|abs|rand|sqrt|pow|length|count|min|max|average|avg|sum|product|median|variance_population|variance_sample|variance|percentile|bit_and|bit_or|bit_xor|bit_negate|bit_test|bit_popcount|bit_shift_left|bit_shift_right|bit_construct|bit_deconstruct|bit_to_string|bit_from_string|first|last|unique|outersection|interleave|in_range|jaccard|matches|merge|merge_recursive|has|attributes|keys|values|unset|unset_recursive|keep|keep_recursive|near|within|within_rectangle|is_in_polygon|distance|fulltext|stddev_sample|stddev_population|stddev|slice|nth|position|contains_array|translate|zip|call|apply|push|append|pop|shift|unshift|remove_value|remove_values|remove_nth|replace_nth|date_now|date_timestamp|date_iso8601|date_dayofweek|date_year|date_month|date_day|date_hour|date_minute|date_second|date_millisecond|date_dayofyear|date_isoweek|date_isoweekyear|date_leapyear|date_quarter|date_days_in_month|date_trunc|date_round|date_add|date_subtract|date_diff|date_compare|date_format|date_utctolocal|date_localtoutc|date_timezone|date_timezones|fail|passthru|v8|sleep|schema_get|schema_validate|shard_id|call_greenspun|version|noopt|noeval|not_null|first_list|first_document|parse_identifier|current_user|current_database|collection_count|pregel_result|collections|document|decode_rev|range|union|union_distinct|minus|intersection|flatten|is_same_collection|check_document|ltrim|rtrim|find_first|find_last|split|substitute|ipv4_to_number|ipv4_from_number|is_ipv4|md5|sha1|sha512|crc32|fnv64|hash|random_token|to_base64|to_hex|encode_uri_component|soundex|assert|warn|is_key|sorted|sorted_unique|count_distinct|count_unique|levenshtein_distance|levenshtein_match|regex_matches|regex_split|ngram_match|ngram_similarity|ngram_positional_similarity|uuid|tokens|exists|starts_with|phrase|min_match|bm25|tfidf|boost|analyzer|cosine_similarity|decay_exp|decay_gauss|decay_linear|l1_distance|l2_distance|minhash|minhash_count|minhash_error|minhash_match|geo_point|geo_multipoint|geo_polygon|geo_multipolygon|geo_linestring|geo_multilinestring|geo_contains|geo_intersects|geo_equals|geo_distance|geo_area|geo_in_range",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"//.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]},this.normalizeRules()};r.inherits(s,i),t.AqlHighlightRules=s}),ace.define("ace/mode/aql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/aql_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./aql_highlight_rules").AqlHighlightRules,o=function(){this.HighlightRules=s,this.$behaviour=this.$defaultBehaviour};r.inherits(o,i),function(){this.lineCommentStart="//",this.$id="ace/mode/aql"}.call(o.prototype),t.Mode=o}); (function() {
|
||||
ace.require(["ace/mode/aql"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/mode-asciidoc.js
vendored
Normal file
8
vendor/ace/mode-asl.js
vendored
Normal file
8
vendor/ace/mode-assembly_arm32.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/mode/assembly_arm32_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"keyword.control.assembly",regex:"\\b(?:cpsid|cpsie|cps|setend|(?:srs|rfe)(?:ia|ib|da|db|fd|ed|fa|ea)|bkpt|nop|pld|cdp2|mrc2|mrrc2|mcr2|mcrr2|ldc2|stc2|(?:add|adc|sub|sbc|rsb|rsc|mul|mla|umull|umlal|smull|smlal|mvn|and|eor|orr|bic)(?:eq|ne|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al)?s?|(?:(?:q|qd)?(?:add|sub)|umaal|smul(?:b|t)(?:b|t)|smulw(?:b|t)|smla(?:b|t)(?:b|t)|smlaw(?:b|t)|smlal(?:b|t)(?:b|t)|smuadx?|smladx?|smlaldx?|smusdx?|smlsdx?|smlsldx?|smmulr?|smmlar?|smmlsr?|mia|miaph|mia(?:b|t)(?:b|t)|clz|(?:s|q|sh|u|uq|uh)(?:add16|sub16|add8|sub8|addsubx|subaddx)|usad8|usada8|mrs|msr|mra|mar|cpy|tst|teq|cmp|cmn|ssat|ssat16|usat|usat16|pkhbt|pkhtb|sxth|sxtb16|sxtb|uxth|uxtb16|uxtb|sxtah|sxtab16|sxtab|uxtah|uxtab16|uxtab|rev|rev16|revsh|sel|b|bl|bx|blx|bxj|swi|svc|ldrex|strex|cdp|mrc|mrrc|mcr|mcrr|ldc|stc)(?:eq|ne|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al)?|ldr(?:eq|ne|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al)?(?:t|b|bt|sb|h|sh|d)?|str(?:eq|ne|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al)?(?:t|b|bt|h|d)?|(?:ldm|stm)(?:eq|ne|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al)?(?:ia|ib|da|db|fd|ed|fa|ea)|swp(?:eq|ne|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al)?b?|mov(?:t|w)?)\\b",caseInsensitive:!0},{token:"variable.parameter.register.assembly",regex:"\\b(?:r0|r1|r2|r3|r4|r5|r6|r7|r8|r9|r10|r11|r12|r13|r14|r15|fp|ip|sp|lr|pc|cpsr|spsr|c|f|s|x|lsl|lsr|asr|ror|rrx)\\b",caseInsensitive:!0},{token:"constant.character.hexadecimal.assembly",regex:"#0x[A-F0-9]+",caseInsensitive:!0},{token:"constant.character.decimal.assembly",regex:"#[0-9]+"},{token:"string.assembly",regex:/'([^\\']|\\.)*'/},{token:"string.assembly",regex:/"([^\\"]|\\.)*"/},{token:"support.function.directive.assembly",regex:"(?:.section|.global|.text|.asciz|.asciiz|.ascii|.align|.byte|.end|.data|.equ|.extern|.include)"},{token:"entity.name.function.assembly",regex:"^\\s*%%[\\w.]+?:$"},{token:"entity.name.function.assembly",regex:"^\\s*%\\$[\\w.]+?:$"},{token:"entity.name.function.assembly",regex:"^[\\w.]+?:"},{token:"entity.name.function.assembly",regex:"^[\\w.]+?\\b"},{token:"comment.assembly",regex:"\\/\\*",next:"comment"},{token:"comment.assembly",regex:"(?:;|//|@).*$"}],comment:[{token:"comment.assembly",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]},this.normalizeRules()};s.metaData={fileTypes:["s"],name:"Assembly ARM32",scopeName:"source.assembly"},r.inherits(s,i),t.AssemblyARM32HighlightRules=s}),ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.commentBlock=function(e,t){var n=/\S/,r=e.getLine(t),i=r.search(n);if(i==-1||r[i]!="#")return;var o=r.length,u=e.getLength(),a=t,f=t;while(++t<u){r=e.getLine(t);var l=r.search(n);if(l==-1)continue;if(r[l]!="#")break;f=t}if(f>a){var c=e.getLine(f).length;return new s(a,o,f,c)}},this.getFoldWidgetRange=function(e,t,n){var r=this.indentationBlock(e,n);if(r)return r;r=this.commentBlock(e,n);if(r)return r},this.getFoldWidget=function(e,t,n){var r=e.getLine(n),i=r.search(/\S/),s=e.getLine(n+1),o=e.getLine(n-1),u=o.search(/\S/),a=s.search(/\S/);if(i==-1)return e.foldWidgets[n-1]=u!=-1&&u<a?"start":"","";if(u==-1){if(i==a&&r[i]=="#"&&s[i]=="#")return e.foldWidgets[n-1]="",e.foldWidgets[n+1]="","start"}else if(u==i&&r[i]=="#"&&o[i]=="#"&&e.getLine(n-2).search(/\S/)==-1)return e.foldWidgets[n-1]="start",e.foldWidgets[n+1]="","";return u!=-1&&u<i?e.foldWidgets[n-1]="start":e.foldWidgets[n-1]="",i<a?"start":""}}.call(o.prototype)}),ace.define("ace/mode/assembly_arm32",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/assembly_arm32_highlight_rules","ace/mode/folding/coffee"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./assembly_arm32_highlight_rules").AssemblyARM32HighlightRules,o=e("./folding/coffee").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart=[";"],this.blockComment={start:"/*",end:"*/"},this.$id="ace/mode/assembly_arm32"}.call(u.prototype),t.Mode=u}); (function() {
|
||||
ace.require(["ace/mode/assembly_arm32"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
8
vendor/ace/mode-assembly_x86.js
vendored
Normal file
8
vendor/ace/mode-astro.js
vendored
Normal file
8
vendor/ace/mode-autohotkey.js
vendored
Normal file
8
vendor/ace/mode-batchfile.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ace.define("ace/mode/batchfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"keyword.command.dosbatch",regex:"\\b(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\\b",caseInsensitive:!0},{token:"keyword.control.statement.dosbatch",regex:"\\b(?:goto|call|exit)\\b",caseInsensitive:!0},{token:"keyword.control.conditional.if.dosbatch",regex:"\\bif\\s+not\\s+(?:exist|defined|errorlevel|cmdextversion)\\b",caseInsensitive:!0},{token:"keyword.control.conditional.dosbatch",regex:"\\b(?:if|else)\\b",caseInsensitive:!0},{token:"keyword.control.repeat.dosbatch",regex:"\\bfor\\b",caseInsensitive:!0},{token:"keyword.operator.dosbatch",regex:"\\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b"},{token:["doc.comment","comment"],regex:"(?:^|\\b)(rem)($|\\s.*$)",caseInsensitive:!0},{token:"comment.line.colons.dosbatch",regex:"::.*$"},{include:"variable"},{token:"punctuation.definition.string.begin.shell",regex:'"',push:[{token:"punctuation.definition.string.end.shell",regex:'"',next:"pop"},{include:"variable"},{defaultToken:"string.quoted.double.dosbatch"}]},{token:"keyword.operator.pipe.dosbatch",regex:"[|]"},{token:"keyword.operator.redirect.shell",regex:"&>|\\d*>&\\d*|\\d*(?:>>|>|<)|\\d*<&|\\d*<>"}],variable:[{token:"constant.numeric",regex:"%%\\w+|%[*\\d]|%\\w+%"},{token:"constant.numeric",regex:"%~\\d+"},{token:["markup.list","constant.other","markup.list"],regex:"(%)(\\w+)(%?)"}]},this.normalizeRules()};s.metaData={name:"Batch File",scopeName:"source.dosbatch",fileTypes:["bat"]},r.inherits(s,i),t.BatchFileHighlightRules=s}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++n<s){t=e.getLine(n);var f=u.exec(t);if(!f)continue;f[1]?a--:a++;if(!a)break}var l=n;if(l>o)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/batchfile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/batchfile_highlight_rules","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./batchfile_highlight_rules").BatchFileHighlightRules,o=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart="::",this.blockComment="",this.$id="ace/mode/batchfile"}.call(u.prototype),t.Mode=u}); (function() {
|
||||
ace.require(["ace/mode/batchfile"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||