initial commit 2

This commit is contained in:
equippedcoding-master
2025-09-17 15:19:57 -05:00
parent e2c98790b2
commit 1c59875b8a
55391 changed files with 15 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
<IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# RewriteBase /
# RewriteRule ^index\.php$ - [L]
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule . /portal/admin/index.php [L]
</IfModule>
@@ -0,0 +1,4 @@
module.exports = function () {
const project = this.project
return []
}
@@ -0,0 +1,4 @@
module.exports = function (task) {
const project = this.project
return []
}
@@ -0,0 +1,82 @@
keepEmptyPriority: true
code:
include_lists:
- TODO
- DOING
- DONE
- PLANNING
- FIXME
- ARCHIVE
- HACK
- CHANGED
- XXX
- IDEA
- NOTE
- REVIEW
lists:
- filter: 'dueDate < "${tomorrow at 6AM}" AND list != DONE +dueDate +order'
hidden: true
id: 3mctvhlelurh1cda
name: What's Due?
- hidden: false
name: NOTE
id: 3mctvhlelurh1cdb
- hidden: false
name: TODO
id: 3mctvhlelurh1cdc
- hidden: false
name: DOING
id: 3mctvhlelurh1cdd
- hidden: false
ignore: true
name: DONE
id: 3mctvhlelurh1cde
- filter: 'completedDate > "${14 days ago}" -completed'
hidden: false
id: 3mctvhlelurh1cdf
name: Recently Completed
settings:
'0': object Object
openIn: default
editorTheme: blackboard
journalType: Folder
journalPath: imdone-tasks
appendNewCardsTo: imdone-tasks.md
newCardSyntax: HASHTAG
replaceSpacesWith: '-'
plugins:
devMode: false
journalTemplate: null
theme: dark
markdownOnly: !<tag:yaml.org,2002:js/undefined> ''
customOpenIn: ''
filteredLists:
'0':
filter: 'due < "${tomorrow at 6AM}" AND list != DONE +dueDate +order'
name: What's Due?
'1':
filter: 'completedDate > "${7 days ago}" -completed'
name: Recently Completed
name: appfactory
views: []
cards:
colors: []
template: |
<!--
created:${timestamp}
-->
trackChanges: false
metaNewLine: true
addCompletedMeta: true
addCheckBoxTasks: false
doneList: DONE
taskPrefix: '##'
tagPrefix: '#'
metaSep: ':'
orderMeta: true
maxLines: 6
addNewCardsToTop: true
showTagsAndMeta: true
defaultList: TODO
computed: !<tag:yaml.org,2002:js/undefined> ''
@@ -0,0 +1,80 @@
module.exports = function ({ line, source, totals }) {
const emoji = {
due: dueEmoji(totals),
recent: recentEmoji(totals),
wip: wipEmoji(totals),
chart: EMOJI.CHART
}
return {
date: `${new Date().toISOString().substring(0, 10)}`,
timestamp: `${new Date().toISOString()}`,
sourceLink: `[${source.path}:${line}](${source.path}:${line})`,
cardTotal: cardTotal(totals),
emoji,
icons
}
}
const icons = {
filter: `<span class="icon is-small fa-xs"><svg aria-hidden="true" focusable="false" data-prefix="fa" data-icon="search" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-search fa-w-16"><path fill="currentColor" d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z" class=""></path></svg></span><span data-v-fd981bec="" class="icon is-small fa-xs"><svg aria-hidden="true" focusable="false" data-prefix="fa" data-icon="chevron-down" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="svg-inline--fa fa-chevron-down fa-w-14"><path fill="currentColor" d="M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z" class=""></path></svg></span>`
,openFile: `<span class="icon is-medium"><svg version="1.1" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" class="octicon octicon-link"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></span>`
,kebab: `<span class="icon is-medium"><svg version="1.1" width="3" height="16" viewBox="0 0 3 16" aria-hidden="true" class="octicon octicon-kebab-vertical"><path data-v-5bf4cb66="" fill-rule="evenodd" d="M0 2.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0zm0 5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0zM1.5 14a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"></path></svg></span>`
,clone: `<span class="icon copy-button is-medium" style=""><svg aria-hidden="true" focusable="false" data-prefix="fa" data-icon="clone" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-clone fa-w-16 fa-lg"><path fill="currentColor" d="M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z" class=""></path></svg></span>`
,editCard: `<span class="icon is-medium"><svg version="1.1" width="14" height="16" viewBox="0 0 14 16" aria-hidden="true" class="octicon octicon-pencil"><path fill-rule="evenodd" d="M0 12v3h3l8-8-3-3-8 8zm3 2H1v-2h1v1h1v1zm10.3-9.3L12 6 9 3l1.3-1.3a.996.996 0 0 1 1.41 0l1.59 1.59c.39.39.39 1.02 0 1.41z"></path></svg></span>`
}
const EMOJI = {
BAD: ':rotating_light:',
GREAT: ':rocket:',
SLEEP: ':sleeping:',
GOOD: ':2nd_place_medal:',
CHART: '<span style="font-size: 1.5em;">:chart:</span>'
}
function formatEmoji(emoji) {
return `<span style="font-size: 1.5em;">${emoji}</span>`
}
function dueEmoji(totals) {
const due = totals["What's Due?"]
let emoji = EMOJI.GOOD
if (due >= 3) {
emoji = EMOJI.BAD
} else if (due === 0) {
emoji = EMOJI.GREAT
}
return formatEmoji(emoji)
}
function recentEmoji(totals) {
const recentlyCompleted = totals['Recently Completed']
let emoji = EMOJI.GOOD
if (recentlyCompleted >= 3) {
emoji = EMOJI.GREAT
} else if (recentlyCompleted === 0) {
emoji = EMOJI.BAD
}
return formatEmoji(emoji)
}
function wipEmoji(totals) {
const doing = totals['DOING']
let emoji = EMOJI.GOOD
if (doing >= 3) {
emoji = EMOJI.BAD
} else if (doing === 0) {
emoji = EMOJI.SLEEP
} else if (doing === 1) {
emoji = EMOJI.GREAT
}
return formatEmoji(emoji)
}
function cardTotal(totals) {
let count = 0
Object.keys(totals).forEach((list) => {
count += totals[list]
})
return count
}
@@ -0,0 +1,3 @@
.obsidian
.trash
.imdone/plugins
@@ -0,0 +1,32 @@
// AFSEvents
(function(factory) {
var root = typeof self == 'object' && self.self === self && self || typeof global == 'object' && global.global === global && global;
if (typeof define === 'function' && define.amd) {
define(['jquery'],function($) {return factory($); });
} else if (typeof exports !== 'undefined') {
module.exports = factory();
} else {
root.AFSAccount = factory();// browser global.
}
})(function($) {
class AFSAccount {
constructor(member, auth_user, managed_domain, app) {
this.member = member;
this.auth_user = auth_user;
this.app = app;
this.managed_domain = managed_domain;
}
getAccount() {
return this.account;
}
}
return AFSAccount;
});// !!!END!!!
@@ -0,0 +1,169 @@
(function(factory) {
var root = typeof self == 'object' && self.self === self && self || typeof global == 'object' && global.global === global && global;
if (typeof define === 'function' && define.amd) {
define([],function() {return factory(); });
} else if (typeof exports !== 'undefined') {
module.exports = factory();
} else {
root.AFSAnalytics = factory();// browser global.
}
})(function() {
class AFSAnalytics {
constructor(app,managed_domain) {
const self = this;
self.app = app;
self.managed_domain = managed_domain;
self.data = {};
self.data.hits = {};
self.DATA_KEY = "afsanalytics";
self.events = {
NORMAL: "normal",
ACTION: "action"
}
self.init = function(config){ self.config = config; };
return self;
}
SetupAnalytics(){
let app = this.app;
app.extra.analytics = _analytics.init({
app:"appfactorystudio",
version: 100,
debug: true,
plugins: []
});
function buildAnalyticsPayload(payload,app,cb){
payload.reference_num = `ana_${app.utils.randomGenerator(22).toUpperCase()}`;
let senddata = {
analytics_update: true,
data: JSON.stringify(payload)
};
$.post(app.extra.url,senddata,function(resp){
if(cb!=undefined) cb(JSON.parse(resp));
});
}
app.extra.analytics.on('track', ({ payload }) => {
// console.log(payload);
buildAnalyticsPayload(payload,app,function(res){
});
});
app.extra.analytics.on('page', ({ payload }) => {
// console.log(payload);
buildAnalyticsPayload(payload,app,function(res){
});
});
// Fire callback with 1st, 2nd or 3rd argument
app.extra.analytics.page({
referrer: document.referrer,
page_name: mypage,
category: "page",
reference_num: `ana_${app.utils.randomGenerator(32).toUpperCase()}`
},({ payload }) => {
// console.log(payload)
});
}
init(){
app.extra.analytics = _analytics.init({
// app: app.extra.config.configurations.settings[""],
app:"cradle2careertx",
version: 100,
debug: true,
plugins: []
});
function buildAnalyticsPayload(payload,app,cb){
payload.reference_num = `ana_${app.utils.randomGenerator(22).toUpperCase()}`;
let senddata = {
analytics_update: true,
data: JSON.stringify(payload)
};
$.post(app.extra.url,senddata,function(resp){
if(cb!=undefined) cb(JSON.parse(resp));
});
}
app.extra.analytics.on('track', ({ payload }) => {
console.log(payload);
buildAnalyticsPayload(payload,app,function(res){
});
});
app.extra.analytics.on('page', ({ payload }) => {
console.log(payload);
buildAnalyticsPayload(payload,app,function(res){
});
});
// Fire callback with 1st, 2nd or 3rd argument
app.extra.analytics.page({
referrer: document.referrer,
page_name: mypage,
category: "page",
reference_num: `ana_${app.utils.randomGenerator(32).toUpperCase()}`
},({ payload }) => {
console.log(payload)
});
app.extra.analytics.track('donation_start', {
date: moment().format('LLL'),
page_name: mypage,
category: "donations"
});
}
send(event,catagory,data,cb){
const self = this;
let senddata = {
save_analytics: true,
reference_num: `ana_${self.app.utils.randomGenerator(22).toUpperCase()}`,
event: event,
category: catagory,
jsontext: JSON.stringify(data)
};
$.post(self.app.extra.url,senddata,function(resp){
if(cb!=undefined) cb(resp);
});
}
setUrl(url) { this.url = url; }
hit(category) {
let self = this;
if (self.data.hits[category] == undefined) {
self.data.hits[category] = [];
}
self.data.hits[category].push(1);
}
save2client() {
let self = this;
sessionStorage.setItem(self.DATA_KEY, JSON.stringify(self.data));
}
save2server() {
let self = this;
$.post(self.url, {
save_analytics: true,
data: JSON.stringify(self.data)
}, function (resp) {
});
}
}
return AFSAnalytics;
});// !!!END!!!
@@ -0,0 +1,5 @@
@@ -0,0 +1,58 @@
function AFSDashboardAPI(){
this._props_ = {};
this.html = [];
this.objs = {};
this._props_.routes = [];
}
AFSDashboardAPI.prototype = {
init: function(url, api, cb){
let self = this;
let data = {};
data[api] = true;
$.post(url,data,function(resp){
let obj = JSON.parse(resp);
self.html = obj.html;
self.routes = obj.routes;
if(cb!=undefined) cb(obj);
});
},
getRoutes: function(){
return this.routes;
},
getListener: function(id){
let self = this;
return self.objs[id];
},
setListener: function(id,obj){
let self = this;
self.objs[id] = obj;
},
appendStyleToHead: function(template_elements){
var self = this;
var css = template_elements["style"];//'h1 { background: red; }',
var head = document.head || document.getElementsByTagName('head')[0],
style = document.createElement('style');
head.appendChild(style);
style.type = 'text/css';
if (style.styleSheet){
// This is required for IE8 and below.
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
},
};
@@ -0,0 +1,228 @@
// AFSEvents
(function(factory) {
var root = typeof self == 'object' && self.self === self && self || typeof global == 'object' && global.global === global && global;
if (typeof define === 'function' && define.amd) {
define([],function() {return factory(); });
} else if (typeof exports !== 'undefined') {
module.exports = factory();
} else {
root.AFSDocuments = factory();// browser global.
}
})(function() {
function AFSDocuments(documents, app, managed_domain){
this.files = documents;
this.app = app;
this.managed_domain = managed_domain;
}
AFSDocuments.prototype = {
setDocuments: function(documents){
this.files = documents;
},
upload: function(file,catogery,jsondata,app){
let self = this;
return new Promise((resolve,reject) => {
// self.app = app;
let ref_num = "doc"+self.app.utils.numberId(12).toLowerCase();
let gen_nam = "d"+self.app.utils.randomGenerator(12) + "." + file.name.split('.').pop();
let content_type = self.getMimiType(file.name);
// let urlparams = `/portal/admin/core/api/php/request.php?getdoc=true&ref=${ref_num}&name=${gen_nam}&content_type=${content_type}`;
let urlparams = `/portal/api/data/downloads?getdoc=true&ref=${ref_num}&name=${gen_nam}&content_type=${content_type}`;
let doc_url = self.app.extra.config.managed_domain.Address + urlparams;
let fileobj = self._NewFileObject(
file.name,
gen_nam,
file.size,
file.type,
new Date().toLocaleString(),
"/mnt/"+self.app.extra.config.managed_domain.SystemUser+"/modules/documents",
doc_url,
ref_num,
catogery,
jsondata);
// console.log(fileobj);
let formData = new FormData();
formData.append("fileuploadUrl", file);
formData.append("datauploadUrl", JSON.stringify(fileobj));
let req = new XMLHttpRequest();
req.addEventListener('progress', function(e) {
var done = e.position || e.loaded, total = e.totalSize || e.total;
// console.log('---progress: ' + (Math.floor(done/total*1000)/10) + '%');
}, false);
if ( req.upload ) {
// self.upload_in_progress = true;
req.upload.onprogress = function(e) {
var done = e.position || e.loaded, total = e.totalSize || e.total;
// console.log(' req.upload progress: ' + done + ' / ' + total + ' = ' + (Math.floor(done/total*1000)/10) + '%');
};
}
req.onreadystatechange = function(e) {
if ( 4 == this.readyState ) {
// console.log(e.target.responseText)
// if(cb!=undefined){
console.log(self);
self.files.push(fileobj);
return resolve(fileobj,e.target.responseText,e);
// }
}
// return reject(fileobj,e);
};
// TODO_3: api changeof uploads
let requesturl = app.extra.url;
// let requesturl = app.extra.config.managed_domain + "/portal/api/data/upload"
req.open("POST", requesturl);
req.send(formData);
});
},
_UploadDocument: function(file,obj,app,cb){
},
_NewFileObject: function(on,gn,fs,ft,ud,loc,url,ref,cat,jsondata){
return {
"original_name": on,
"generated_name": gn,
"file_size": fs,
"file_type": ft,
"upload_date": ud,
"directory": loc,
"url": url,
"reference_num": ref,
"catagory": cat,
"json": jsondata
}
},
upload2: function(cb){
let formData = new FormData();
// these values are switched
let datauploadUrl = "datauploadUrl";//sponsorship.json.request.dataupload;
let fileuploadUrl = "fileuploadUrl";//sponsorship.json.request.fileupload;
formData.append(fileuploadUrl, file);
formData.append(datauploadUrl, JSON.stringify(obj));
let req = new XMLHttpRequest();
req.addEventListener('progress', function(e) {
var done = e.position || e.loaded, total = e.totalSize || e.total;
// console.log('---progress: ' + (Math.floor(done/total*1000)/10) + '%');
}, false);
if ( req.upload ) {
// self.upload_in_progress = true;
req.upload.onprogress = function(e) {
var done = e.position || e.loaded, total = e.totalSize || e.total;
console.log(' req.upload progress: ' + done + ' / ' + total + ' = ' + (Math.floor(done/total*1000)/10) + '%');
};
}
req.onreadystatechange = function(e) {
if ( 4 == this.readyState ) {
// console.log(e.target.responseText)
if(cb!=undefined){
return cb(e.target.responseText,e);
}
}
};
let requesturl = app.extra.url;// afsconfig.managed_domain.Address + "/" + sponsorship.json.request.url
req.open("POST", requesturl);
req.send(formData);
},
getDocument: function(generated_name){
let self = this;
let selectDoc = null;
console.log(typeof generated_name);
for (let i = 0; i < self.files.length; i++) {
const document = self.files[i];
if(typeof generated_name==='string'){
if(document.generated_name==generated_name){
selectDoc = document;
break;
}
}else if(typeof generated_name==='number'){
if(document.id==generated_name){
selectDoc = document;
break;
}
}
}
return selectDoc;
},
getMimiType: function(filename){
let self = this;
let ext = filename.split('.').pop();
let mimitype = self.getMimiTypes()[ext];
if(mimitype==undefined){
mimitype = "text/plain";
}
return mimitype;
},
getMimiTypes: function(){
return {
"gif": "image/gif",
"jpeg": "image/jpeg",
"jpg": "image/jpeg",
"png": "image/png",
"apng": "image/apng",
"svg": "image/svg+xml",
"tif": "image/tiff",
"tiff": "image/tiff",
"pdf": "application/pdf",
"xml": "application/xml",
"zip": "application/zip",
"7z": "application/x-7z-compressed",
"txt": "text/plain",
"mpeg": "video/mpeg",
"json": "application/json",
"mp3": "audio/mpeg",
"gzip": "application/gzip",
"doc": "application/msword",
"docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"csv": "text/csv",
"bmp": "image/bmp",
"bzip": "application/x-bzip",
"bzip2": "application/x-bzip2",
"ppt": "application/vnd.ms-powerpoint",
"pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
"ttf": "font/ttf",
"wav": "audio/wav",
"weba": "audio/webm",
"webm": "video/webm",
"webp": "image/webp",
"woff": "font/woff",
"woff2": "font/woff2",
"xhtml": "application/xhtml+xml",
"xls": "application/vnd.ms-excel",
"xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"ogx": "application/ogg",
"ogv": "video/ogg",
"oga": "audio/ogg",
"ico": "image/vnd.microsoft.icon",
"html": "text/html",
"epub": "application/epub+zip",
"avif": "image/avif"
}
}
};
return AFSDocuments;
});// !!!END!!!
@@ -0,0 +1,100 @@
(function(factory) {
var root = typeof self == 'object' && self.self === self && self || typeof global == 'object' && global.global === global && global;
if (typeof define === 'function' && define.amd) {
define([],function() {return factory(); });
} else if (typeof exports !== 'undefined') {
module.exports = AFSDonations;
} else {
root.AFSDonations = factory();// browser global.
}
})(function() {
function AFSDonations(){
}
AFSDonations.prototype = {
donate: function(){}
}
function __initialize_paypal(paypalContainerId, self){
self.afspayments.service.paypal().setupCheckout({
container_id: paypalContainerId,
options: {
appendNow: false,
paypal_error_message: "Sorry, your transaction could not be processed, please try again.",
showPaypalButton: true,
showPaypalForm: true,
billingAddressEnabled: false,
billingAddressNameEnabled: false,
onSubmit: {
showButton: true,
id: "donation_submit_button"
}
},
validation_callback: function(){ return {pass: true}; },
validate_price_callback: function(){
return {
pass:true,
value: self.sponsorship.json.form.selected_level.price
};
},
success_callback: function(orderData){
console.log(orderData);
self.sponsorship.json.order_data = orderData.processor_data;
let acct_password = "";
let acct_name = "";
console.log(self.sponsorship.json.variables);
for(let i=0; i < self.sponsorship.json.variables.length; i++){
if(self.sponsorship.json.variables[i]['name'] == "response_password"){
acct_password = self.sponsorship.json.variables[i]['value'];
}
// if(self.sponsorship.json.variables[i]['name'] == "response_email"){
// acct_name = self.sponsorship.json.variables[i]['value'];
// }
}
acct_name = self.sponsorship.json.reference_acct;
removeFormDataObject(self);
addSystemNeededVariables(self);
variableReplacement(self);
var mydata = {
new_sponsorship: true,
category: self.sponsorship.json.category,
reference_num: self.sponsorship.json.reference_num,
reference_abbr: self.sponsorship.json.reference_abbr,
reference_acct: self.sponsorship.json.reference_acct,
acct_name: acct_name,
password_hash: acct_password,
acct_email: self.sponsorship.json.reference_acct,
quick_view_token: self.sponsorship.json.quick_view_token,
domain: JSON.stringify(self.domain),
json: JSON.stringify(self.sponsorship.json)
};
console.log(mydata);
console.log(self.sponsorship);
$.post('../../core/php/request.php',mydata,function(e){
console.log(e);
});
},
error_callback: function(err){
console.log(err);
},
success_content: function(orderData){
return self.variablesReplace(self.sponsorship.json.success_message,"hash");
}
});
}// end gl_process_payment_sponsorship
return AFSDonations;
});// !!!END!!!
@@ -0,0 +1,28 @@
// AFSEvents
(function(factory) {
var root = typeof self == 'object' && self.self === self && self || typeof global == 'object' && global.global === global && global;
if (typeof define === 'function' && define.amd) {
define([],function() {return factory(); });
} else if (typeof exports !== 'undefined') {
module.exports = factory();
} else {
root.AFSEmail = factory();// browser global.
}
})(function() {
function AFSEmail(accounts, app, managed_domain){
this.accounts = accounts;
this.app = app;
this.managed_domain = managed_domain;
}
AFSEmail.prototype = {
getAccounts: function(){
return this.accounts;
}
};
return AFSEmail;
});// !!!END!!!
@@ -0,0 +1,23 @@
// AFSEvents
(function(factory) {
var root = typeof self == 'object' && self.self === self && self || typeof global == 'object' && global.global === global && global;
if (typeof define === 'function' && define.amd) {
define(['jquery'],function($) {return factory($); });
} else if (typeof exports !== 'undefined') {
module.exports = factory();
} else {
root.AFSEvents = factory();// browser global.
}
})(function($) {
function AFSEvents(){
}
AFSEvents.prototype = {
};
return AFSEvents;
});// !!!END!!!
@@ -0,0 +1,12 @@
// afsnotificationmanager
// afspayments
// afssponsorship
// afsdonations
// afsforms
// afsspinner
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,239 @@
(function(factory) {
var root = typeof self == 'object' && self.self === self && self || typeof global == 'object' && global.global === global && global;
if (typeof define === 'function' && define.amd) {
define([],function() { return factory();});
} else if (typeof exports !== 'undefined') {
module.exports = factory();
} else {
root.AFSNotificationsManager = factory();
}
})(function() {
function AFSNotificationsManager(app){
this.notifications = app.extra.sponsorships;
this.app = app;
this._run_update_callback = null;
}
AFSNotificationsManager.prototype = {
onUpdate: function(cb){
this._run_update_callback = cb;
},
append: function(type,id){
let self = this;
let category = [];
for(let i=0; i < self.notifications.length; i++){
// console.log(self.notifications[i].category + " - " + stype);
// if(self.notifications[i].category == type){
category.push(self.notifications[i]);
// }
}
// mmmmm
console.log(category);
let listhtml = "";
let ids = [];
self.selected_sponsorship = null;
function get_span_status(_status, _status0, _status1, _status2){
let status = "";
let id = "";
if(_status==0){
id = _status0;
status = `<span id="${_status0}" class="badge bg-primary rounded-pill">Pending</span>`;
}else if(_status==1){
id = _status1;
status = `<span id="${_status1}" class="badge bg-primary rounded-pill">Active</span>`;
}else if(_status==2){
id = _status2;
status = `<span id="${_status2}" class="badge bg-primary rounded-pill">Denied</span>`;
}
return {
status:status,
id:id
};
}
for(let i=0; i < category.length; i++){
let temp = category[i];
// console.log(temp)
let _status0 = "m"+self.app.utils.randomGenerator(12);
let _status1 = "m"+self.app.utils.randomGenerator(12);
let _status2 = "m"+self.app.utils.randomGenerator(12);
let status = get_span_status(temp.json.account.status, _status0, _status1, _status2);
let id = "m"+self.app.utils.randomGenerator(22);
listhtml += list2(id,temp.json.reference_num, status.status);
ids.push({id:id, current: status.id, category: temp, _status0 , _status1, _status2});
}
let ullist_html = ullist1(listhtml);
$("#"+id).append(ullist_html);
for(let i=0; i < ids.length; i++){
$("#"+ids[i].id).on('click',function(e){
e.preventDefault();
self.selected_sponsorship = ids[i].category;
let _new_selected_status = -1;
let status = "";
if(self.selected_sponsorship.json.account.status==0){
status = "Pending";
}else if(self.selected_sponsorship.json.account.status==1){
status = "Active";
}if(self.selected_sponsorship.json.account.status==2){
status = "Denied";
}
let inputId = "m"+self.app.utils.randomGenerator(12);
let pendingId = "m"+self.app.utils.randomGenerator(12);
let activeId = "m"+self.app.utils.randomGenerator(12);
let deniedId = "m"+self.app.utils.randomGenerator(12);
let saveId = "m"+self.app.utils.randomGenerator(12);
let labels = "";
// createFormLabel(label)
for(let n=0; n < self.selected_sponsorship.json.variables.length; n++){
let variable = self.selected_sponsorship.json.variables[n];
if(variable.name=="paypal_gross_amount"){
labels += createFormLabel("Gross Amount: " + variable.value);
}
if(variable.name=="paypal_net_amount"){
labels += createFormLabel("Gross Amount: " + variable.value);
}
if(variable.name=="paypal_paypal_fee"){
labels += createFormLabel("Gross Amount: " + variable.value);
}
}
let body = createFormBody(labels,inputId,pendingId,activeId,deniedId,status);
let title = self.selected_sponsorship.json.reference_num;
let m = createModal(title,body,saveId);
$("#modal_main_container").empty();
$("#modal_main_container").append(m);
setTimeout(() => {
// console.log(document.getElementById("modal_main_container"));
const myModal = new bootstrap.Modal('#exampleModal');
myModal.show();
$("#"+saveId).on('click',function(e){
e.preventDefault();
console.log(_new_selected_status);
if(_new_selected_status!=-1){
self.selected_sponsorship.json.account.status = _new_selected_status;
if(self._run_update_callback!=null){
self._run_update_callback(self.selected_sponsorship, function(resp){
// console.log(resp);
myModal.toggle();
let newspan = get_span_status(self.selected_sponsorship.json.account.status, ids[i]._status0, ids[i]._status1, ids[i]._status2);
let span = document.getElementById(ids[i].current);
let parent = span.parentNode;
span.parentNode.removeChild(span);
$(parent).append(newspan.status);
ids[i].current = newspan.id;
});
}
}
});
$("#"+pendingId).on('click',function(e){
e.preventDefault();
document.getElementById(inputId).value = "Pending";
_new_selected_status = 0;
});
$("#"+activeId).on('click',function(e){
e.preventDefault();
document.getElementById(inputId).value = "Active";
_new_selected_status = 1;
});
$("#"+deniedId).on('click',function(e){
e.preventDefault();
document.getElementById(inputId).value = "Denied";
_new_selected_status = 2;
});
},500);
});
}
function createFormLabel(label){
return `
<div class="input-group mb-1">
<label for="exampleInputEmail1" class="form-label">${label}</label>
</div>
`;
}
function createFormBody(labels,inputId,pendingId,activeId,deniedId,value){
return `
<form>
<div class="input-group mb-3">
<button class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">Status</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" id="${pendingId}" href="#">Pending</a></li>
<li><a class="dropdown-item" id="${activeId}" href="#">Active</a></li>
<li><a class="dropdown-item" id="${deniedId}" href="#">Denied</a></li>
</ul>
<input type="text" id="${inputId}" class="form-control" value="${value}" aria-label="" disabled>
</div>
<h3 class="mt-5">Receipt</h3>
${labels}
</form>
`;
}
function createModal(title,body,saveId){
return `
<!-- Scrollable modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable">
<div class="modal-content" style="min-height:700px">
<div class="modal-header">
<h1 class="modal-title fs-5" id="exampleModalLabel">${title}</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
${body}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" id="${saveId}" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
`;
}
function ullist1(list){
return `
<ul class="list-group">
${list}
</ul>
`;
}
function list2(id,label,pending){
return `
<li id="${id}" style="cursor:pointer;" class="list-group-item d-flex justify-content-between align-items-center">
${label}
${pending}
</li>
`;
}
}
}
return AFSNotificationsManager;
});// !!!END!!!
@@ -0,0 +1,334 @@
(function(factory) {
var root = typeof self == 'object' && self.self === self && self || typeof global == 'object' && global.global === global && global;
if (typeof define === 'function' && define.amd) {
define([],function() {return factory(); });
} else if (typeof exports !== 'undefined') {
module.exports = factory();
} else {
root.AFSNotifications = factory();
}
})(function() {
class AFSNotifications {
constructor(notifications, app, managed_domain) {
const self = this;
self.notifications = notifications;
self.app = app;
self.managed_domain = managed_domain;
self.watchIntervalId = null;
self._start_date = "";
self._end_date = "";
}
stopWatching(){
let self = this;
if(self.watchIntervalId!=null){
clearInterval(self.watchIntervalId);
}
}
startWatching(){
let self = this;
let PRINT_OUT = false;
function getLatestDate(notifications) {
let latestDate = null;
let notificationObj = null;
for (const notification of notifications) {
let date = new Date(notification.date);
if (!latestDate || date > latestDate) {
notificationObj = notification;
}
}
return notificationObj;
}
function getDateTime(daysAgo){
let currentdate = new Date();
return currentdate.getFullYear() + "-"
+ (currentdate.getMonth()+1) + "-"
+ (currentdate.getDate()-daysAgo) + " "
+ currentdate.getHours() + ":"
+ currentdate.getMinutes() + ":"
+ currentdate.getSeconds();
}
function getDateTimeAgo(date,daysAgo,minutesAgo,hoursAgo){
let currentdate = new Date(date);
return currentdate.getFullYear() + "-"
+ (currentdate.getMonth()+1) + "-"
+ (currentdate.getDate()+daysAgo) + " "
+ (currentdate.getHours()+hoursAgo) + ":"
+ (currentdate.getMinutes()+minutesAgo) + ":"
+ currentdate.getSeconds();
}
function updateNotificationsArray(resp,self){
let concat_noti = [];
for (let i = 0; i < resp.notifications.length; i++) {
const notification1 = resp.notifications[i]
let doesExist = false;
for (let n = 0; n < self.notifications.length; n++) {
const notification2 = self.notifications[n];
if(notification1.reference_num==notification2.reference_num){
doesExist = true;
break;
}
}
if(doesExist==false){
concat_noti.push(notification1);
}
}
self.notifications = self.notifications.concat(concat_noti);
}
function setupDates(self){
const latest = getLatestDate(self.notifications);
self._end_date = getDateTime(0);
// console.log(latest);
if(latest==undefined || latest==null){
self._start_date = getDateTime(30);
if(PRINT_OUT)
console.log(self._start_date + " | " + self._end_date);
}else{
let newdate = getDateTimeAgo(latest.date,0,5,0);
self._start_date = newdate;
if(PRINT_OUT){
console.log("------------------------------------------------------------------");
console.log(latest);
console.log(self._start_date + " | " + self._end_date + " | " + latest.date + " | " + newdate);
console.log("------------------------------------------------------------------");
}
}
}
setupDates(self);
self.watchIntervalId = setInterval(function(){
var timestamp = Date.parse(self._start_date);
if (isNaN(timestamp) == false) {
var d = new Date(timestamp);
// console.log("is valid");
}else{
// console.log("is invalid");
return;
}
if(self._start_date=="" || self._start_date==undefined || self._start_date==null){
return;
}
if(self._end_date=="" || self._end_date==undefined || self._end_date==null){
return;
}
let send = {
admin_notifications_check_new_otifications: true,
data: JSON.stringify({
get_archived: false,
start_date : self._start_date,
end_date : self._end_date,
category: "none"
})
}
$.post(self.app.extra.url,send,function(resp){
resp = JSON.parse(resp);
// console.log(resp);
updateNotificationsArray(resp,self);
setupDates(self);
if(resp.notifications.length > 0){
if(PRINT_OUT){
console.log("==========================================================");
console.log(resp);
console.log("appending new notifications");
console.log("==========================================================");
}
self.appendDashboardNotifications();
}
});
},10000);
}
initServer(member, auth_user, managed_domain, app){
this.member = member;
this.auth_user = auth_user;
this.app = app;
this.managed_domain = managed_domain;
return this;
}
sendNotification(category,title,description,data,cb){
const self = this;
console.log(self.app)
$.post(self.app.extra.url,{
add_notification: true,
category: category,
title: title,
description: description,
jsontext: JSON.stringify(data),
reference_num: "sub"+self.app.utils.randomGenerator(12).toLowerCase()
},function(resp1){
if(cb!=undefined) cb(resp1);
});
}
getAccount() {
return this.account;
}
appendDashboardNotifications(){
let self = this;
let app = self.app;
function _html_notify_star(id,filled){
if(filled){
return `
<a href="#" id="${id}" class="filled_star list-group-item-actions show">
<svg xmlns="http://www.w3.org/2000/svg" class="icon text-yellow" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"></path></svg>
</a>
`
}else{
return `
<a href="#" id="${id}" class="empty_star list-group-item-actions">
<svg xmlns="http://www.w3.org/2000/svg" class="icon text-muted" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"></path></svg>
</a>
`;
}
}
function _html_notify_item(title,titleId,description,favIconId,icon_html,app){
let item = app.extra.config.html.frame_notif_list_item;
let variables = [
{"name":"title_link_id", "value":titleId},
{"name":"link_title", "value":title},
{"name":"star_icon", "value":icon_html},
{"name":"description", "value":description},
{"name":"fav_icon_id", "value":favIconId}
];
return app.utils.variablesReplace(item, variables);
}
function add_notify_icon_listener(obj,app){
$(`#${obj.star_id}`).on("click",function(e){
e.preventDefault();
const index = obj.index;
let star = _html_notify_star(obj.star_id,false);
if($(`#${obj.star_id}`).hasClass('empty_star')){
star = _html_notify_star(obj.star_id,true);
self.notifications[index].favorite = 1;
}else{
star = _html_notify_star(obj.star_id,true);
self.notifications[index].favorite = 0;
}
update_notification(self.notifications[index], app);
$(`#${obj.fav_id}`).empty();
$(`#${obj.fav_id}`).append(star);
add_notify_icon_listener(obj,app);
});
}
function add_notify_link_listener(obj,app){
$(`#${obj.title_id}`).on("click",function(e){
e.preventDefault();
app.extra.views.main_view.render('notifications');
});
}
let ids = [];
let items = "";
let array = self.notifications.reverse();
for (let i = 0; i < array.length; i++) {
if(array[i].viewed==1) continue;
if(array[i].viewed==0){
$(".notifications_badge").addClass("bg-red");
}
let notification = array[i];
let starId = "m"+app.utils.randomGenerator(12);
let titleId = "m"+app.utils.randomGenerator(12);
let favId = "m"+app.utils.randomGenerator(12);
let is_fav = (notification.favorite==0) ? false : true;
let star = _html_notify_star(starId,is_fav);
let item = _html_notify_item(
notification.title + " - " + notification.reference_num,
titleId,
notification.description,
favId,
star,
app);
items += item;
ids.push({ index:i, obj:notification, fav_id: favId, star_id: starId, title_id: titleId });
}
$(".main_notification_list_group").empty();
$(".main_notification_list_group").append(items);
for (let i = 0; i < ids.length; i++) {
add_notify_icon_listener(ids[i], app);
add_notify_link_listener(ids[i], app);
}
}
update_notification(notification,cb){
let self = this;
let senddata = {
"update_notification" : true,
"category" : notification.category,
"title" : notification.title,
"description" : notification.description,
"viewed" : notification.viewed,
"archived" : notification.archived,
"favorite" : notification.favorite,
"jsontext" : JSON.stringify(notification.json)
}
$.post(self.app.extra.url,senddata,function(resp){
// console.log(resp);
resp = JSON.parse(resp);
if(cb!=undefined) cb(resp);
});
}
SetupDashboardNotifications(){
let self = this;
function prevent_notification_panel_from_closing(){
$(".main_show_notifications").on("click",function(e){
e.preventDefault();
e.stopPropagation();
});
$(".mynotifycard").on("click",function(e){
e.preventDefault();
e.stopPropagation();
});
}
prevent_notification_panel_from_closing();
self.appendDashboardNotifications();
$(".main_clear_notifications_link").on("click",function(e){
e.preventDefault();
$(".main_notification_list_group").empty();
$(".notifications_badge").removeClass("bg-red");
// console.log(self.notifications);
for (let i = 0; i < self.notifications.length; i++) {
self.notifications[i].viewed = 1;
}
// update that notifications have been viewed when cleared
setTimeout(() => {
let senddata = {
update_notifications: true,
notifications: JSON.stringify(self.notifications)
};
$.post(self.app.extra.url,senddata,function(resp){
console.log(JSON.parse(resp));
});
},500);
});
$(".frame_notification_link").on("click",function(e){
e.preventDefault();
self.app.extra.views.main_view.render('notifications');
});
}
}
return AFSNotifications;
});// !!!END!!!
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,23 @@
(function(factory) {
var root = typeof self == 'object' && self.self === self && self || typeof global == 'object' && global.global === global && global;
if (typeof define === 'function' && define.amd) {
console.log("appfactory - amd condition");
define([],function() {
return {};
});
} else if (typeof exports !== 'undefined') {
// Next for Node.js or CommonJS. jQuery may not be needed as a module.
// console.log("appfactory - nodejs condition");
// let AFSPlugins = factory();
// module.exports = ApplicationContextManager;
} else {
// Finally, as a browser global.
// console.log("appfactory - browser condition");
// root.ApplicationContextManager = factory();
}
})(function() {
return RUN()
});// !!!END!!!
@@ -0,0 +1,22 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.AFSSdk = factory()
}(this, (function () { //'use strict';
// cp -rf /home/appfactorystudio/websites/www15/portal/admin/core/api/js/appfactory/afssdk.js /home/appfactorystudio/websites/sdk/js
class AFSSdk {
init(){
console.log("working...");
}
}
return AFSSdk;
})));
@@ -0,0 +1,605 @@
(function(){
let spinners = [];
function AFSSpin(opts){
let self = this;
self.spinner_id = "";
self.id = opts.id;
self.width = opts.width;
self.height = opts.height;
self.spin_color = (opts.spin_color==undefined) ? "#1c87c9" : opts.spin_color;
self.spin_color_bg = (opts.spin_color_bg==undefined) ? "#fff" : opts.spin_color_bg;
self.bg_color = (opts.bg_color==undefined) ? "grey" : opts.bg_color;
self.opacity = (opts.opacity==undefined) ? ".35" : opts.opacity;
self.top = (opts.top==undefined) ? "0px" : opts.top;
self.left = (opts.left==undefined) ? "0px" : opts.left;
self.mt = (opts.mt==undefined) ? "0px" : opts.mt;
}
AFSSpin.prototype = {
hide: function(){
let self = this;
document.getElementById(self.spinner_id).remove();
},
show: function(){
let self = this;
self._appendStyles(self.id,self.opacity,
self.width,
self.height,
self.top,
self.left,
self.bg_color,self.spin_color,self.spin_color_bg,self.mt);
},
_appendStyles: function(appendto,opacity,w,h,t,l,bg_color,spin_color,spin_color_bg,mt){
let self = this;
if(document.getElementById("afs_spinner_styles")==null){
let css = mycss(opacity,w,h,t,l,bg_color,spin_color,spin_color_bg,mt),
head = document.head || document.getElementsByTagName('head')[0],
style = document.createElement('style');
style.id = "afs_spinner_styles";
style.innerHTML = css;
head.appendChild(style);
}
let id = "m"+self.___filenameGenerator(12);
self.spinner_id = id;
spinners.push(id);
let spinner = self.convertStringToHTMLNode(`
<div id="${id}">
<div style="position:relative;height:100%;width:100%;" class="">
<div class="afsspin-box"></div>
</div>
<div style="position:relative;height:100%;width:100%;" class="">
<div class="afsspin"></div>
</div>
</div>
`);
// document.getElementById(appendto).classList.add('spinner-overlay');
document.getElementById(appendto).prepend(spinner);
return new AFSSpin(id);
},
___filenameGenerator: function(len){
var text = "";
var possible = "abcdefghijklmnopqrstuvwxyz0123456789";
for( var i=0; i < len; i++ )
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
},
convertStringToHTMLNode: function(string){
if(typeof string === "object") return string;
var xmlString = string,
parser = new DOMParser(),
doc = parser.parseFromString(xmlString, "text/html");
var frag = document.createDocumentFragment();
if(doc.body!=undefined){
for(var i=0;i<doc.body.childNodes.length;i++){
frag.appendChild(doc.body.childNodes[i].cloneNode(true));
}
}
return frag.cloneNode(true);
}
};
AFSSpinner = {
create: function(id,opacity,width,height,top,left,spin_color,spin_color_bg,mt){
return new AFSSpin(id,opacity,width,height,top,left,spin_color,spin_color_bg,mt);
},
showFullScreen: function(show,opts){
if(opts==undefined){
opts = {};
if(opts.auto_remove_time==undefined){
opts.auto_remove_time = 500000;
}
}
let css = fullscreen_css();
if(document.getElementById("afs_full_screen_loader")==undefined){
let html = `
<div id="afs_full_screen_loader" style="display:none">
<style>${css}</style>
<div class="afsloading">Loading&#8230;</div>
</di>
`;
$("body").append(html);
}
if(show){
$("#afs_full_screen_loader").css({display:"block"});
}else{
$("#afs_full_screen_loader").css({display:"none"});
}
}
};
function mycss(opacity,w,h,t,l,bg_color,spin_color,spin_color_bg,mt){
return `
.spinner-overlay {
/* overflow: hidden; */
padding: 0;
}
.afsspin-box::before {
content: "";
top: ${t};
left: ${l};
position: absolute;
background-color: ${bg_color};
width: ${w};
height: ${h};
opacity: ${opacity};
}
.afsspin::before {
animation: 1.5s linear infinite spinner12;
animation-play-state: inherit;
/* border: solid 5px #cfd0d1; */
border: solid 5px ${spin_color_bg};
border-bottom-color: ${spin_color};
border-radius: 50%;
content: "";
height: 40px;
position: absolute;
/* top: 10%;
left: 10%; */
transform: translate3d(-50%, -50%, 0);
width: 40px;
will-change: transform;
/* background-color: #aa21ff; */
/* width: 300px; */
/* min-height: 300px; */
/* padding: 5px; */
display: flex;
justify-content: center;
align-items: center;
/* position the div in center */
/* position: absolute; */
top: 50%;
left: 50%;
/* transform: translate(-50%, -50%); */
margin-top: ${mt};
}
@keyframes spinner12 {
0% {
transform: translate3d(-50%, -50%, 0) rotate(0deg);
}
100% {
transform: translate3d(-50%, -50%, 0) rotate(360deg);
}
}
`;
}
function fullscreen_css(){
return `
/* Absolute Center Spinner */
.afsloading {
position: fixed;
z-index: 10000;
height: 2em;
width: 2em;
overflow: show;
margin: auto;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
/* Transparent Overlay */
.afsloading:before {
content: '';
display: block;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: radial-gradient(rgba(20, 20, 20,.8), rgba(0, 0, 0, .8));
background: -webkit-radial-gradient(rgba(20, 20, 20,.8), rgba(0, 0, 0,.8));
}
/* :not(:required) hides these rules from IE9 and below */
.afsloading:not(:required) {
/* hide "loading..." text */
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.afsloading:not(:required):after {
content: '';
display: block;
font-size: 10px;
width: 1em;
height: 1em;
margin-top: -0.5em;
-webkit-animation: spinner 150ms infinite linear;
-moz-animation: spinner 150ms infinite linear;
-ms-animation: spinner 150ms infinite linear;
-o-animation: spinner 150ms infinite linear;
animation: spinner 150ms infinite linear;
border-radius: 0.5em;
-webkit-box-shadow: rgba(255,255,255, 0.75) 1.5em 0 0 0, rgba(255,255,255, 0.75) 1.1em 1.1em 0 0, rgba(255,255,255, 0.75) 0 1.5em 0 0, rgba(255,255,255, 0.75) -1.1em 1.1em 0 0, rgba(255,255,255, 0.75) -1.5em 0 0 0, rgba(255,255,255, 0.75) -1.1em -1.1em 0 0, rgba(255,255,255, 0.75) 0 -1.5em 0 0, rgba(255,255,255, 0.75) 1.1em -1.1em 0 0;
box-shadow: rgba(255,255,255, 0.75) 1.5em 0 0 0, rgba(255,255,255, 0.75) 1.1em 1.1em 0 0, rgba(255,255,255, 0.75) 0 1.5em 0 0, rgba(255,255,255, 0.75) -1.1em 1.1em 0 0, rgba(255,255,255, 0.75) -1.5em 0 0 0, rgba(255,255,255, 0.75) -1.1em -1.1em 0 0, rgba(255,255,255, 0.75) 0 -1.5em 0 0, rgba(255,255,255, 0.75) 1.1em -1.1em 0 0;
}
/* Animation */
@-webkit-keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-moz-keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-o-keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
`;
}
function mycss1(){
return `
.spinner-1 {
width: 50px;
aspect-ratio: 1;
border-radius: 50%;
padding: 6px;
background:
conic-gradient(from 135deg at top,currentColor 90deg, #0000 0) 0 calc(50% - 4px)/17px 8.5px,
radial-gradient(farthest-side at bottom left,#0000 calc(100% - 6px),currentColor calc(100% - 5px) 99%,#0000) top right/50% 50% content-box content-box,
radial-gradient(farthest-side at top ,#0000 calc(100% - 6px),currentColor calc(100% - 5px) 99%,#0000) bottom /100% 50% content-box content-box;
background-repeat: no-repeat;
animation: s1 1s infinite linear;
}
@keyframes s1{
100%{transform: rotate(1turn)}
}
.spinner-2 {
width: 50px;
aspect-ratio: 1;
display: grid;
}
.spinner-2::before,
.spinner-2::after {
content:"";
grid-area: 1/1;
--c: radial-gradient(farthest-side,#25b09b 92%,#0000);
background:
var(--c) 50% 0,
var(--c) 50% 100%,
var(--c) 100% 50%,
var(--c) 0 50%;
background-size: 12px 12px;
background-repeat: no-repeat;
animation: s2 1s infinite;
}
.spinner-2::before {
margin: 4px;
filter: hue-rotate(45deg);
background-size: 8px 8px;
animation-timing-function: linear
}
@keyframes s2{
100%{transform: rotate(.5turn)}
}
.spinner-3 {
width: 50px;
aspect-ratio: 1;
border-radius: 50%;
background:
radial-gradient(farthest-side,#ffa516 94%,#0000) top/8px 8px no-repeat,
conic-gradient(#0000 30%,#ffa516);
-webkit-mask: radial-gradient(farthest-side,#0000 calc(100% - 8px),#000 0);
animation: s3 1s infinite linear;
}
@keyframes s3{
100%{transform: rotate(1turn)}
}
.spinner-4 {
width: 50px;
aspect-ratio: 1;
display: grid;
animation: s4 4s infinite;
}
.spinner-4::before,
.spinner-4::after {
content: "";
grid-area: 1/1;
border: 8px solid;
border-radius: 50%;
border-color: red red #0000 #0000;
mix-blend-mode: darken;
animation: s4 1s infinite linear;
}
.spinner-4::after {
border-color: #0000 #0000 blue blue;
animation-direction: reverse;
}
@keyframes s4{
100%{transform: rotate(1turn)}
}
.spinner-5 {
width: 50px;
aspect-ratio: 1;
display: grid;
border:4px solid #0000;
border-radius: 50%;
border-right-color: #25b09b;
animation: s5 1s infinite linear;
}
.spinner-5::before,
.spinner-5::after {
content: "";
grid-area: 1/1;
margin: 2px;
border: inherit;
border-radius: 50%;
animation: s5 2s infinite;
}
.spinner-5::after {
margin: 8px;
animation-duration: 3s;
}
@keyframes s5{
100%{transform: rotate(1turn)}
}
.spinner-6 {
width: 50px;
aspect-ratio: 1;
display: grid;
border: 4px solid #0000;
border-radius: 50%;
border-color: #ccc #0000;
animation: s6 1s infinite linear;
}
.spinner-6::before,
.spinner-6::after {
content: "";
grid-area: 1/1;
margin: 2px;
border: inherit;
border-radius: 50%;
}
.spinner-6::before {
border-color: #f03355 #0000;
animation: inherit;
animation-duration: .5s;
animation-direction: reverse;
}
.spinner-6::after {
margin: 8px;
}
@keyframes s6 {
100%{transform: rotate(1turn)}
}
.spinner-7 {
width: 70px;
aspect-ratio: 1;
background:
radial-gradient(farthest-side,#ffa516 90%,#0000) center/16px 16px,
radial-gradient(farthest-side,green 90%,#0000) bottom/12px 12px;
background-repeat: no-repeat;
animation: s7 1s infinite linear;
position: relative;
}
.spinner-7::before {
content:"";
position: absolute;
width: 8px;
aspect-ratio: 1;
inset: auto 0 16px;
margin: auto;
background: #ccc;
border-radius: 50%;
transform-origin: 50% calc(100% + 10px);
animation: inherit;
animation-duration: 0.5s;
}
@keyframes s7 {
100%{transform: rotate(1turn)}
}
.spinner-8 {
width: 50px;
aspect-ratio: 1;
--c: radial-gradient(farthest-side,#514b82 92%,#0000);
background:
var(--c) 50% 0,
var(--c) 50% 100%,
var(--c) 100% 50%,
var(--c) 0 50%;
background-size: 10px 10px;
background-repeat: no-repeat;
animation: s8 1s infinite;
position: relative;
}
.spinner-8::before {
content:"";
position: absolute;
inset:0;
margin: 3px;
background: repeating-conic-gradient(#0000 0 35deg,#514b82 0 90deg);
-webkit-mask: radial-gradient(farthest-side,#0000 calc(100% - 3px),#000 0);
border-radius: 50%;
}
@keyframes s8 {
100%{transform: rotate(.5turn)}
}
.spinner-9 {
width: 50px;
aspect-ratio: 1;
display: grid;
color: #854f1d;
background: radial-gradient(farthest-side, currentColor calc(100% - 6px),#0000 calc(100% - 5px) 0);
-webkit-mask: radial-gradient(farthest-side,#0000 calc(100% - 13px),#000 calc(100% - 12px));
border-radius: 50%;
animation: s9 2s infinite linear;
}
.spinner-9::before,
.spinner-9::after {
content: "";
grid-area: 1/1;
background:
linear-gradient(currentColor 0 0) center,
linear-gradient(currentColor 0 0) center;
background-size: 100% 10px,10px 100%;
background-repeat: no-repeat;
}
.spinner-9::after {
transform: rotate(45deg);
}
@keyframes s9 {
100%{transform: rotate(1turn)}
}
.spinner-10 {
width: 50px;
aspect-ratio: 1;
border-radius: 50%;
border: 8px solid #514b82;
animation:
s10-1 0.8s infinite linear alternate,
s10-2 1.6s infinite linear;
}
@keyframes s10-1{
0% {clip-path: polygon(50% 50%,0 0, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0% )}
12.5% {clip-path: polygon(50% 50%,0 0, 50% 0%, 100% 0%, 100% 0%, 100% 0%, 100% 0% )}
25% {clip-path: polygon(50% 50%,0 0, 50% 0%, 100% 0%, 100% 100%, 100% 100%, 100% 100% )}
50% {clip-path: polygon(50% 50%,0 0, 50% 0%, 100% 0%, 100% 100%, 50% 100%, 0% 100% )}
62.5% {clip-path: polygon(50% 50%,100% 0, 100% 0%, 100% 0%, 100% 100%, 50% 100%, 0% 100% )}
75% {clip-path: polygon(50% 50%,100% 100%, 100% 100%, 100% 100%, 100% 100%, 50% 100%, 0% 100% )}
100% {clip-path: polygon(50% 50%,50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 0% 100% )}
}
@keyframes s10-2{
0% {transform:scaleY(1) rotate(0deg)}
49.99%{transform:scaleY(1) rotate(135deg)}
50% {transform:scaleY(-1) rotate(0deg)}
100% {transform:scaleY(-1) rotate(-135deg)}
}
/**/
body {
display: grid;
grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
grid-auto-rows: 130px;
place-items:center;
}
* {
box-sizing: border-box;
}
`;
}
window.AFSSpinner = AFSSpinner;
})();
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,454 @@
// AFSSubscriber
(function(factory) {
var root = typeof self == 'object' && self.self === self && self || typeof global == 'object' && global.global === global && global;
if (typeof define === 'function' && define.amd) {
define([],function() {return factory(); });
} else if (typeof exports !== 'undefined') {
module.exports = factory();
} else {
root.AFSSubscriber = factory();// browser global.
}
})(function() {
class Subscriber {
constructor(email,name,phone,app){
this.email = email;
this.name = name;
this.phone = phone;
this.catalogs = [];
this.app = app;
this.reference_num = "s"+ this.app.utils.numberId(21);
}
setCatalogs(catalogs){
this.catalogs = catalogs;
}
buildSubscriber(){
let self = this;
let catalogs = [];
for (let i = 0; i < self.catalogs.length; i++) {
const catalog = self.catalogs[i];
catalogs.push({
"reference_num": catalog.reference_num,
"active": true
});
}
return {
email: self.email,
reference_num: self.reference_num,
json: {
phone: self.phone,
name: (self.name==undefined) ? "" : self.name,
catalogs: catalogs
},
date: moment().format('LLL')
};
}
addCatalog(catalog){
let self = this;
self.catalogs.push(catalog);
}
getCatalogs(){ return this.catalogs; }
}
class AFSSubscriber {
constructor(app, managed_domain) {
const self = this;
self.app = app;
self.managed_domain = managed_domain;
self.catalogs = null;
self.subscriber = {};
self._props_ = {
"has_been_updated": []
};
}
requestCatalogs(cb){
let self = this;
$.post(self.app.extra.url,{
"client_subscriber_get_catalogs": true,
"token": self.app.extra.token
},function(resp){
resp = JSON.parse(resp);
if(resp.message!=undefined && resp.message=="request_failure"){
return;
}
// console.log(resp);
self.catalogs = resp.catalogs;
if(cb!=undefined) cb();
});
}
/**
*
* app.extra.config.configurations.subscriber
*
* @returns array
*/
getCatalogs() {
return this.catalogs;
}
/**
* Get catalog by reference_num or the index within the subscribers array.
* can return null.
*
* @param {string|number} index - The index or reference_num
* @returns object | null app.extra.config.configurations.subscriber[catalog].json
*/
getCatalog(index) {
const self = this;
let saveindex = -1;
if(typeof index === 'number'){
if(self._exist_catalog(index)){
return self.getCatalogs()[index];
}else{
return null;
}
}
if(typeof index === 'string'){
for (let i = 0; i < self.getCatalogs().length; i++) {
if(self.getCatalogs().reference_num==index){
saveindex = i;
break;
}
}
}
if(saveindex==-1){
return null;
}else{
return self.getCatalogs()[saveindex].json;
}
}
initializeSubscriber(email,name,phone){
return new Subscriber(email,name,phone,this.app);
}
addCatalogSubscriber(catalog,subscriber){
subscriber.addCatalog(catalog);
}
createSubscriber(sub,cb,sendresponse){
let self = this;
if(sub.getCatalogs().length==0) return;
if(sendresponse==undefined) sendresponse = true;
let email_response = structuredClone(self.app.extra.config.configurations.subscriber[1].json.mail_handlers.email_response);
// const settings = self.app.extra.config.configurations.settings[0].json;
// let sysVars = self.app.extra.extras.SetupSystemVariables(self.app);
let sysVars = [];
sysVars.push({
name: "email",
value: sub.email
});
sysVars.push({
name: "manage_subscription_link",
value: self.app.extra.config.managed_domain.Address + `/portal/pages/subscriber/manage.php?email=${sub.email}&reference_num=${sub.reference_num}`
});
email_response.emails = [sub.email];
email_response.variables.client = [structuredClone(email_response.variables.client)];
email_response.variables.schema = [structuredClone(email_response.variables.schema)];
email_response.variables.system = [structuredClone(self.app.extra.extras.SetupSystemVariables(self.app, email_response))];
let subBuild = sub.buildSubscriber();
console.log(subBuild);
$.post(self.app.extra.url,{
client_subscriber_add_subscriber: true,
token: self.app.extra.token,
subscriber: JSON.stringify(subBuild),
response: JSON.stringify(email_response),
sendresponse: sendresponse,
},function(resp1){
resp1 = JSON.parse(resp1);
if(cb!=undefined) cb(resp1);
});
}
/**
* Check if catalog exist in array given index.
*
* @param {number} index
* @returns
*/
_exist_catalog(index){
const self = this;
if(typeof self.app.extra.config.configurations.subscriber[index] === 'undefined') {
return false;
}
else {
return true;
}
}
_markForUpdate(){}
updateSubscriberConfiguration(provider,cb1){
const self = this;
let updates = self._props_.has_been_updated;
let catalogs = [];
for (let i = 0; i < updates.length; i++) {
const element = updates[i];
const catalog = self.getCatalog(element.catalog_reference_num);
if(catalog==null){
console.log(`Catalog ${element.catalog_reference_num} does not exist`);
continue;
}
catalogs.push(catalog);
}
let email_response = structuredClone(self.app.extra.config.configurations.subscriber[1].json.mail_handlers.email_response);
// const settings = self.app.extra.config.configurations.settings[0].json;
// let sysVars = self.app.extra.extras.SetupSystemVariables(self.app);
let sysVars = [];
sysVars.push({
name: "email",
value: provider.email
});
sysVars.push({
name: "subscription_manage_button_link",
value: self.app.extra.config.managed_domain.Address + `/portal/pages/subscriber/manage.php?email=${provider.email}&reference_num=${provider.reference_num}`
});
email_response.emails = [provider.email];
email_response.variables.client = [structuredClone(email_response.variables.client)];
email_response.variables.schema = [structuredClone(email_response.variables.schema)];
email_response.variables.system = [structuredClone(email_response.variables.system)];
// console.log(sysVars);
// console.log(provider);
// console.log(catalogs);
// if(catalogs.length==0) return;
// $.post(self.app.extra.url,{
// add_subscriber: true,
// catalogs: JSON.stringify(catalogs),
// response: JSON.stringify(email_response)
// },function(resp1){
// self.clear();
// if(cb1!=undefined) cb1(catalogs,resp1);
// });
}
deleteAllSubscribers(){
for (let i = 0; i < app.extra.config.configurations.subscriber.length; i++) {
app.extra.config.configurations.subscriber[i] = [];
let senddata ={
configurations_update:true,
mysql_id: app.extra.config.configurations.subscriber[i].json.mysql_id,
data: JSON.stringify(app.extra.config.configurations.subscriber[i].json)
}
$.post(app.extra.url,senddata,function(resp){
console.log(resp)
});
}
}
sendConfirmationEmail(email,cb){
// const self = this;
// const list = [];
// const updates = self._props_.has_been_updated;
// for (let i = 0; i < updates.length; i++) {
// const catalog = self.getCatalog(updates[i].catalog_reference_num);
// if(catalog==null) continue;
// list.push(catalog.display_name);
// }
// const data = {
// subscriber_confirm_subscribed: true,
// catalog_display_names: JSON.stringify(list),
// email: email
// };
// $.post(self.app.url,data,function(resp){
// if(cb!=undefined) cb(resp);
// });
}
clear(){
this._props_.has_been_updated = [];
}
setGlobalConfig(id,obj,catalog){
if(catalog.catalogs_config==undefined){
catalog.catalogs_config = _daultCatalogsConfig(app,this);
}
if(id=="from_email"){
catalog
.catalogs_config
.subscriber_confirmation_email
.email_response
.from = obj;
return catalog;
}
return catalog;
}
sync(){
_daultCatalogsConfig(self);
}
getDefaultEditorJSObject() {
return _getDefaultEditorJSObject(this);
}
getEmailEditorDefault(header, statement) {
return _getDefaultEditorEmailJSObject(header, statement, this);
}
addCatalogSubscriber2(catalog,subscriber){
const self = this;
const cfn = catalog.reference_num;
if(self.getCatalog(cfn)!=null){
if(self.getCatalog(cfn)!=null){
_addorupdateCatalogSubscriber(subscriber, cfn, self);
}else{
console.log(`[]: catalog ${cfn} not found`);
}
}else{
console.log(`[]: catalog ${cfn} not found`);
}
}
}
function _addorupdateCatalogSubscriber(new_subscriber, cfn, self){
if(self.getCatalog(cfn).subscribers==undefined || self.getCatalog(cfn).subscribers.length==0){
self.getCatalog(cfn).subscribers = [new_subscriber];
}
let found = false;
for (let n = 0; n < self.getCatalog(cfn).subscribers.length; n++) {
const subscriber = self.getCatalog(cfn).subscribers[n];
if(subscriber.email==new_subscriber.email){
found = true;
self.getCatalog(cfn).subscribers[n].active = true;
self._props_.has_been_updated.push({ catalog_reference_num: self.getCatalog(cfn).reference_num });
break;
}
}
if(found==false){
console.log(new_subscriber);
self.getCatalog(cfn).subscribers.push(new_subscriber);
self._props_.has_been_updated.push({ catalog_reference_num: self.getCatalog(cfn).reference_num });
}
}
function _daultCatalogsConfig(self){
let catalogs_config = {
"catalog_refs": [],
"subscriber_confirmation_email":{
"on": false,
"email_response":{
"title":"",
"body":"",
"subject":"",
"email":"",
"template":"_email_alert",
"from":"no-reply",
"image": "",
"footer":""
},
}
};
return catalogs_config;
}
function _getDefaultEditorJSObject(self){
return {
"time": 1707596804161,
"blocks": [
{
"id": "zcKCF1S7X8",
"type": "header",
"data": {
"text": "Example Header",
"level": 1
}
},
{
"id": "b6ji-DvaKb",
"type": "paragraph",
"data": {
"text": "Hey. Meet the new Editor. On this page you can see it in action — try to edit this text. Source code of the page contains the example of connection and configuration."
}
},
{
"id": "SSBSguGvP7",
"type": "list",
"data": {
"style": "unordered",
"items": [
{
"content": "It is a block-styled editor",
"items": []
},
{
"content": "It returns clean data output in JSON",
"items": []
},
{
"content": "Designed to be extendable and pluggable with a simple API",
"items": []
}
]
}
},
{
"id": "H9LWKQ3NYd",
"type": "delimiter",
"data": {}
}
],
"version": "2.29.0"
}
}
function _getDefaultEditorEmailJSObject(header,statement,self){
return {
"time": 1707596804161,
"blocks": [
{
"id": "zcKCF1S7X8",
"type": "header",
"data": {
"text": header,
"level": 1
}
},
{
"id": "b6ji-DvaKb",
"type": "paragraph",
"data": {
"text": statement
}
}
],
"version": "2.29.0"
}
}
return AFSSubscriber;
});// !!!END!!!
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,237 @@
(function(factory) {
// Establish the root object, `window` (`self`) in the browser, or `global` on the server.
// We use `self` instead of `window` for `WebWorker` support.
let root = typeof self == 'object' && self.self === self && self || typeof global == 'object' && global.global === global && global;
if (typeof define === 'function' && define.amd) {
console.log("appfactory - amd condition");
define([],function() {
return factory();
});
// Next for Node.js or CommonJS. jQuery may not be needed as a module.
} else if (typeof exports !== 'undefined') {
console.log("appfactory - nodejs condition");
let ApplicationContextManager = factory();
module.exports = ApplicationContextManager;
// Finally, as a browser global.
} else {
console.log("appfactory - browser condition");
let $ = root.jQuery || root.Zepto || root.ender || root.$;
root.ApplicationContextManager = factory();
}
})(function() {
//console.log(root);console.log($);console.log(b);console.log(_);console.log(bootstrap);console.log(fetchjsonp);
return RUN();
});// !!!END!!!
function RUN(){
class ViewComponent {
constructor(opts) {
const self = this;
self._opts = (opts == undefined) ? {} : opts;
self._props_._container = new ContainerComponent();
self._props_._views = [];
self._props_._current_view = null;
self._props_._render_opts = { params: null, opts: null };
self.getHtml = function (inner) {
return self._props_._container.getHtml(inner);
};
}
newSubView(opts, body, init) {
let self = this;
opts = self._convert_to_afsopts(opts, body, init);
self._print_newSubView_errors(opts);
self._props_._views.push(opts);
if (opts.init != undefined && opts.init == true) {
self._build_view(opts);
self._props_._current_view = opts.id;
}
return this;
}
render(id, params, renderOpts) {
let self = this;
renderOpts = (renderOpts) ? renderOpts : {};
let viewOpts = null;
for (let i = 0; i < self._props_._views.length; i++) {
if (id == self._props_._views[i].id) { viewOpts = self._props_._views[i]; break; }
}
// console.log(self._props_._current_view + " - "+ id);
if (viewOpts == null) { console.warn("No subview: " + id); return; }
$("#view_events_element").trigger("view_enter_afs", "options");
let cont = document.getElementById(self.getId());
if (cont == null && renderOpts.container != undefined) {
self._props_._current_view = "";
}
if (self._props_._current_view != id) {
self._props_._current_view = id;
self._props_._render_opts = { params: params, opts: renderOpts };
// console.log(renderOpts)
// console.log(self._props_)
// console.log(self._opts)
// if(self._opts.parent!=undefined){
// let parent = self._opts.parent;
// parent.view.render(parent.id,self._props_._render_opts);
// }
self._build_view(viewOpts, renderOpts);
}
}
_build_view(viewOpts, renderOpts) {
let self = this;
// xxxxxn
let body = null;
if ((viewOpts == null || viewOpts == undefined) || (viewOpts.body == null || viewOpts.body == undefined)) {
console.log("body undfined");
console.log(viewOpts);
body = buildBody({});
} else if (typeof viewOpts.body === 'function') {
body = viewOpts.body(self._props_._render_opts);
} else {
body = buildBody(viewOpts.body, self);
}
// xxxxxp
if (renderOpts != undefined && renderOpts.container != undefined) {
// self._props_._container.addElement(body,true);
let containerId = renderOpts.container;
document.getElementById(containerId).appendChild(body.cloneNode(true));
if (viewOpts.listener != undefined && typeof viewOpts.listener === 'function') {
viewOpts.listener(self._props_._render_opts);
}
} else {
if (body == undefined || body == null) {
console.log("body undefined:");
console.log(viewOpts);
body = "<div></div>";
}
self._props_._container.addComponent({
body: body,
listener: function () {
if (viewOpts.listener != undefined && typeof viewOpts.listener === 'function') {
viewOpts.listener(self._props_._render_opts);
}
}
}, true);
}
}
_print_newSubView_errors(opts) {
let self = this;
// no id error notice
if (opts.id == undefined) {
opts.id = 'p' + Utils.randomGenerator(12);
console.warn("View Component does not contain an id");
}
// repeat view error notice
for (var i = 0; i < self._props_._views.length; i++) {
if (opts.id == self._props_._views[i].id) {
console.error("Theres already a View Component with the id: " + opts.id);
break;
}
}
}
getContainerId() {
// 50505 - this is returning an html object
return this._props_._containers.getContainerId();
}
/**
* Convience method to render an index with in a view.
*
* @param {Number|String} - The index of the view or the string id of the view
@ @param {Object} - (optional) Options to give to the view renderer
*
*/
goTo(index, opts) {
ViewManager_goTo(index, opts, this);
}
// 333444 - ViewComponent
/**
* Go back 1 view
*
* @param {Object} - (optional) Options to pass to the view renderer
*
*/
back(opts) {
ViewManager_back(opts, this);
}
/**
* Go forward 1 view
*
* @param {Object} - (optional) Options to pass to the view renderer
*
*/
next(opts) {
ViewManager_next(opts, this);
}
/**
*
*/
getRouteFromId(id) {
return MultiView_getRouteFromId(id, this);
}
/**
*
*/
getCurrentViewInRoute() {
return MultiView_getCurrentViewInRoute(this);
}
/**
* @return {Component}
*/
getCurrentView() {
return this._props_._current_view;
}
/**
*
*/
getView(id) {
return MultiView_getView(id, this);
}
_convert_to_afsopts(opts, body, init) {
let self = this;
if (typeof opts === 'string' && body != undefined) {
let _id = opts;
opts = {
init: (init != undefined && typeof init === 'boolean') ? init : false,
id: _id,
body: body
};
} else if (typeof opts === 'boolean' && typeof body === 'string' && init != undefined) {
opts = {
init: init,
id: body,
body: init
};
}
return opts;
}
/** Checks if this view is routable.
*
* @return {Boolean} - Is this view routable
*/
isRoutable() {
return this._props_._is_routable;
}
}
}
@@ -0,0 +1,8 @@
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,99 @@
! function(e, t) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = e || self).edjsHTML = t()
}(this, (function() {
"use strict";
var e = ["left", "right", "center", "justify"],
t = {
delimiter: function() {
return "<br/>"
},
header: function(e) {
var t = e.data;
return "<h" + t.level + ">" + t.text + "</h" + t.level + ">"
},
paragraph: function(t) {
var r = t.data,
n = r.alignment || r.align;
return void 0 !== n && e.includes(n) ? '<p style="text-align:' + n + ';">' + r.text + "</p>" : "<p>" + r.text + "</p>"
},
list: function(e) {
var t = e.data,
r = "unordered" === t.style ? "ul" : "ol",
n = function(e, t) {
var r = e.map((function(e) {
if (!e.content && !e.items) return "<li>" + e + "</li>";
var r = "";
return e.items && (r = n(e.items, t)), e.content ? "<li> " + e.content + " </li>" + r : void 0
}));
return "<" + t + ">" + r.join("") + "</" + t + ">"
};
return n(t.items, r)
},
image: function(e) {
var t = e.data,
r = t.caption ? t.caption : "Image";
return '<img src="' + (t.file && t.file.url ? t.file.url : t.url) + '" alt="' + r + '" />'
},
quote: function(e) {
var t = e.data;
return "<blockquote>" + t.text + "</blockquote> - " + t.caption
},
code: function(e) {
return "<pre><code>" + e.data.code + "</code></pre>"
},
embed: function(e) {
var t = e.data;
switch (t.service) {
case "vimeo":
return '<iframe src="' + t.embed + '" height="' + t.height + '" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>';
case "youtube":
return '<iframe width="' + t.width + '" height="' + t.height + '" src="' + t.embed + '" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
default:
throw new Error("Only Youtube and Vime Embeds are supported right now.")
}
}
};
function r(e) {
return new Error(' The Parser function of type "' + e + '" is not defined. \n\n Define your custom parser functions as: https://github.com/pavittarx/editorjs-html#extend-for-custom-blocks ')
}
var n = function(e) {
void 0 === e && (e = {});
var i = Object.assign({}, t, e);
return {
parse: function(e) {
return e.blocks.map((function(e) {
return i[e.type] ? i[e.type](e) : r(e.type)
}))
},
parseBlock: function(e) {
return i[e.type] ? i[e.type](e) : r(e.type)
},
parseStrict: function(e) {
var t = e.blocks,
o = n(i).validate({
blocks: t
});
if (o.length) throw new Error("Parser Functions missing for blocks: " + o.toString());
for (var u = [], a = 0; a < t.length; a++) {
if (!i[t[a].type]) throw r(t[a].type);
u.push(i[t[a].type](t[a]))
}
return u
},
validate: function(e) {
var t = e.blocks.map((function(e) {
return e.type
})).filter((function(e, t, r) {
return r.indexOf(e) === t
})),
r = Object.keys(i);
return t.filter((function(e) {
return !r.includes(e)
}))
}
}
};
return n
}));
@@ -0,0 +1,138 @@
// https://github.com/camsong/fetch-jsonp
(function (global, factory) {
if (typeof define === 'function' && define.amd) {
define(['exports', 'module'], factory);
} else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
factory(exports, module);
} else {
var mod = {
exports: {}
};
factory(mod.exports, mod);
global.fetchJsonp = mod.exports;
}
})(this, function (exports, module) {
'use strict';
var defaultOptions = {
// TODO: fetch-jsonp - original value was 5 seconds 5000ms
timeout: 30000,
jsonpCallback: 'callback',
jsonpCallbackFunction: null
};
function generateCallbackFunction() {
return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);
}
function clearFunction(functionName) {
// IE8 throws an exception when you try to delete a property on window
// http://stackoverflow.com/a/1824228/751089
try {
delete window[functionName];
} catch (e) {
window[functionName] = undefined;
}
}
function removeScript(scriptId) {
var script = document.getElementById(scriptId);
if (script) {
document.getElementsByTagName('head')[0].removeChild(script);
}
}
function fetchJsonp(_url) {
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
// to avoid param reassign
var url = _url;
var timeout = options.timeout || defaultOptions.timeout;
var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;
var timeoutId = undefined;
return new Promise(function (resolve, reject) {
var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();
var scriptId = jsonpCallback + '_' + callbackFunction;
window[callbackFunction] = function (response) {
resolve({
ok: true,
// keep consistent with fetch API
json: function json() {
return Promise.resolve(response);
}
});
if (timeoutId) clearTimeout(timeoutId);
removeScript(scriptId);
clearFunction(callbackFunction);
};
// Check if the user set their own params, and if not add a ? to start a list of params
url += url.indexOf('?') === -1 ? '?' : '&';
var jsonpScript = document.createElement('script');
jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);
if (options.charset) {
jsonpScript.setAttribute('charset', options.charset);
}
if (options.nonce) {
jsonpScript.setAttribute('nonce', options.nonce);
}
if (options.referrerPolicy) {
jsonpScript.setAttribute('referrerPolicy', options.referrerPolicy);
}
jsonpScript.id = scriptId;
document.getElementsByTagName('head')[0].appendChild(jsonpScript);
timeoutId = setTimeout(function () {
reject(new Error('JSONP request to ' + _url + ' timed out'));
clearFunction(callbackFunction);
removeScript(scriptId);
window[callbackFunction] = function () {
clearFunction(callbackFunction);
};
}, timeout);
// Caught if got 404/500
jsonpScript.onerror = function () {
reject(new Error('JSONP request to ' + _url + ' failed'));
clearFunction(callbackFunction);
removeScript(scriptId);
if (timeoutId) clearTimeout(timeoutId);
};
});
}
// export as global function
/*
let local;
if (typeof global !== 'undefined') {
local = global;
} else if (typeof self !== 'undefined') {
local = self;
} else {
try {
local = Function('return this')();
} catch (e) {
throw new Error('polyfill failed because global object is unavailable in this environment');
}
}
local.fetchJsonp = fetchJsonp;
*/
module.exports = fetchJsonp;
});
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,106 @@
<?php
// create_email
// send_email
// get_all_type_email_accounts
class AppfactoryStudioAPI {
// Properties
public $name;
public $color;
// Methods
function set_name($name) {
$this->name = $name;
}
function get_name() {
return $this->name;
}
function testing(){
_testing();
}
function create_email($obj,$state){
return _create_email($obj,$state);
}
}
function _testing(){
echo "hello world";
}
function send_email($obj){
}
function send_email2($obj){
$username = Input::get("username");
$password = Input::get("password");
$type = Input::get("type");
$backupEmail = Input::get("backup_email");
$domain = Input::get("domain");
$url = "https://live1.appfactory.studio/plugins/app/php/server/request.php";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$headers = array(
"Accept: application/json",
"Content-Type: application/json",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$data = <<<DATA
{
"send_email": true,
"Customer": "Jason Sweet",
"Quantity": 1,
"Price": 18.00
}
DATA;
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$resp = curl_exec($curl);
curl_close($curl);
echo $resp;
}
// https://live1.appfactory.studio/plugins/app/php/server/request.php
function _create_email($obj,$state){
$obj = json_decode($obj,true);
$obj['create_email'] = true;
$url = "http://live1.appfactory.studio/plugins/app/php/server/request.php";
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($obj)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { /* Handle error */ $result = array("status" => "failure"); }
echo json_encode($result);
return $result;
}
function get_all_type_email_accounts(){
}
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,330 @@
ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator"], function(require, exports, module){// [WIP]
"use strict";
var TokenIterator = require("../token_iterator").TokenIterator;
function is(token, type) {
return token.type.lastIndexOf(type + ".xml") > -1;
}
exports.singletonTags = ["area", "base", "br", "col", "command", "embed", "hr", "html", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"];
exports.blockTags = ["article", "aside", "blockquote", "body", "div", "dl", "fieldset", "footer", "form", "head", "header", "html", "nav", "ol", "p", "script", "section", "style", "table", "tbody", "tfoot", "thead", "ul"];
exports.formatOptions = {
lineBreaksAfterCommasInCurlyBlock: true
};
exports.beautify = function (session) {
var iterator = new TokenIterator(session, 0, 0);
var token = iterator.getCurrentToken();
var tabString = session.getTabString();
var singletonTags = exports.singletonTags;
var blockTags = exports.blockTags;
var formatOptions = exports.formatOptions || {};
var nextToken;
var breakBefore = false;
var spaceBefore = false;
var spaceAfter = false;
var code = "";
var value = "";
var tagName = "";
var depth = 0;
var lastDepth = 0;
var lastIndent = 0;
var indent = 0;
var unindent = 0;
var roundDepth = 0;
var curlyDepth = 0;
var row;
var curRow = 0;
var rowsToAdd = 0;
var rowTokens = [];
var abort = false;
var i;
var indentNextLine = false;
var inTag = false;
var inCSS = false;
var inBlock = false;
var levels = { 0: 0 };
var parents = [];
var caseBody = false;
var trimNext = function () {
if (nextToken && nextToken.value && nextToken.type !== 'string.regexp')
nextToken.value = nextToken.value.replace(/^\s*/, "");
};
var trimLine = function () {
var end = code.length - 1;
while (true) {
if (end == 0)
break;
if (code[end] !== " ")
break;
end = end - 1;
}
code = code.slice(0, end + 1);
};
var trimCode = function () {
code = code.trimRight();
breakBefore = false;
};
while (token !== null) {
curRow = iterator.getCurrentTokenRow();
rowTokens = iterator.$rowTokens;
nextToken = iterator.stepForward();
if (typeof token !== "undefined") {
value = token.value;
unindent = 0;
inCSS = (tagName === "style" || session.$modeId === "ace/mode/css");
if (is(token, "tag-open")) {
inTag = true;
if (nextToken)
inBlock = (blockTags.indexOf(nextToken.value) !== -1);
if (value === "</") {
if (inBlock && !breakBefore && rowsToAdd < 1)
rowsToAdd++;
if (inCSS)
rowsToAdd = 1;
unindent = 1;
inBlock = false;
}
}
else if (is(token, "tag-close")) {
inTag = false;
}
else if (is(token, "comment.start")) {
inBlock = true;
}
else if (is(token, "comment.end")) {
inBlock = false;
}
if (!inTag && !rowsToAdd && token.type === "paren.rparen" && token.value.substr(0, 1) === "}") {
rowsToAdd++;
}
if (curRow !== row) {
rowsToAdd = curRow;
if (row)
rowsToAdd -= row;
}
if (rowsToAdd) {
trimCode();
for (; rowsToAdd > 0; rowsToAdd--)
code += "\n";
breakBefore = true;
if (!is(token, "comment") && !token.type.match(/^(comment|string)$/))
value = value.trimLeft();
}
if (value) {
if (token.type === "keyword" && value.match(/^(if|else|elseif|for|foreach|while|switch)$/)) {
parents[depth] = value;
trimNext();
spaceAfter = true;
if (value.match(/^(else|elseif)$/)) {
if (code.match(/\}[\s]*$/)) {
trimCode();
spaceBefore = true;
}
}
}
else if (token.type === "paren.lparen") {
trimNext();
if (value.substr(-1) === "{") {
spaceAfter = true;
indentNextLine = false;
if (!inTag)
rowsToAdd = 1;
}
if (value.substr(0, 1) === "{") {
spaceBefore = true;
if (code.substr(-1) !== '[' && code.trimRight().substr(-1) === '[') {
trimCode();
spaceBefore = false;
}
else if (code.trimRight().substr(-1) === ')') {
trimCode();
}
else {
trimLine();
}
}
}
else if (token.type === "paren.rparen") {
unindent = 1;
if (value.substr(0, 1) === "}") {
if (parents[depth - 1] === 'case')
unindent++;
if (code.trimRight().substr(-1) === '{') {
trimCode();
}
else {
spaceBefore = true;
if (inCSS)
rowsToAdd += 2;
}
}
if (value.substr(0, 1) === "]") {
if (code.substr(-1) !== '}' && code.trimRight().substr(-1) === '}') {
spaceBefore = false;
indent++;
trimCode();
}
}
if (value.substr(0, 1) === ")") {
if (code.substr(-1) !== '(' && code.trimRight().substr(-1) === '(') {
spaceBefore = false;
indent++;
trimCode();
}
}
trimLine();
}
else if ((token.type === "keyword.operator" || token.type === "keyword") && value.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)) {
trimCode();
trimNext();
spaceBefore = true;
spaceAfter = true;
}
else if (token.type === "punctuation.operator" && value === ';') {
trimCode();
trimNext();
spaceAfter = true;
if (inCSS)
rowsToAdd++;
}
else if (token.type === "punctuation.operator" && value.match(/^(:|,)$/)) {
trimCode();
trimNext();
if (value.match(/^(,)$/) && curlyDepth > 0 && roundDepth === 0 && formatOptions.lineBreaksAfterCommasInCurlyBlock) {
rowsToAdd++;
}
else {
spaceAfter = true;
breakBefore = false;
}
}
else if (token.type === "support.php_tag" && value === "?>" && !breakBefore) {
trimCode();
spaceBefore = true;
}
else if (is(token, "attribute-name") && code.substr(-1).match(/^\s$/)) {
spaceBefore = true;
}
else if (is(token, "attribute-equals")) {
trimLine();
trimNext();
}
else if (is(token, "tag-close")) {
trimLine();
if (value === "/>")
spaceBefore = true;
}
else if (token.type === "keyword" && value.match(/^(case|default)$/)) {
if (caseBody)
unindent = 1;
}
if (breakBefore && !(token.type.match(/^(comment)$/) && !value.substr(0, 1).match(/^[/#]$/)) && !(token.type.match(/^(string)$/) && !value.substr(0, 1).match(/^['"@]$/))) {
indent = lastIndent;
if (depth > lastDepth) {
indent++;
for (i = depth; i > lastDepth; i--)
levels[i] = indent;
}
else if (depth < lastDepth)
indent = levels[depth];
lastDepth = depth;
lastIndent = indent;
if (unindent)
indent -= unindent;
if (indentNextLine && !roundDepth) {
indent++;
indentNextLine = false;
}
for (i = 0; i < indent; i++)
code += tabString;
}
if (token.type === "keyword" && value.match(/^(case|default)$/)) {
if (caseBody === false) {
parents[depth] = value;
depth++;
caseBody = true;
}
}
else if (token.type === "keyword" && value.match(/^(break)$/)) {
if (parents[depth - 1] && parents[depth - 1].match(/^(case|default)$/)) {
depth--;
caseBody = false;
}
}
if (token.type === "paren.lparen") {
roundDepth += (value.match(/\(/g) || []).length;
curlyDepth += (value.match(/\{/g) || []).length;
depth += value.length;
}
if (token.type === "keyword" && value.match(/^(if|else|elseif|for|while)$/)) {
indentNextLine = true;
roundDepth = 0;
}
else if (!roundDepth && value.trim() && token.type !== "comment")
indentNextLine = false;
if (token.type === "paren.rparen") {
roundDepth -= (value.match(/\)/g) || []).length;
curlyDepth -= (value.match(/\}/g) || []).length;
for (i = 0; i < value.length; i++) {
depth--;
if (value.substr(i, 1) === '}' && parents[depth] === 'case') {
depth--;
}
}
}
if (token.type == "text")
value = value.replace(/\s+$/, " ");
if (spaceBefore && !breakBefore) {
trimLine();
if (code.substr(-1) !== "\n")
code += " ";
}
code += value;
if (spaceAfter)
code += " ";
breakBefore = false;
spaceBefore = false;
spaceAfter = false;
if ((is(token, "tag-close") && (inBlock || blockTags.indexOf(tagName) !== -1)) || (is(token, "doctype") && value === ">")) {
if (inBlock && nextToken && nextToken.value === "</")
rowsToAdd = -1;
else
rowsToAdd = 1;
}
if (nextToken && singletonTags.indexOf(nextToken.value) === -1) {
if (is(token, "tag-open") && value === "</") {
depth--;
}
else if (is(token, "tag-open") && value === "<") {
depth++;
}
else if (is(token, "tag-close") && value === "/>") {
depth--;
}
}
if (is(token, "tag-name")) {
tagName = value;
}
row = curRow;
}
}
token = nextToken;
}
code = code.trim();
session.doc.setValue(code);
};
exports.commands = [{
name: "beautify",
description: "Format selection (Beautify)",
exec: function (editor) {
exports.beautify(editor.session);
},
bindKey: "Ctrl-Shift-B"
}];
}); (function() {
ace.require(["ace/ext/beautify"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,202 @@
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(require, exports, module){"use strict";
var LineWidgets = require("../line_widgets").LineWidgets;
var event = require("../lib/event");
var lang = require("../lib/lang");
var dom = require("../lib/dom");
function clearLensElements(renderer) {
var textLayer = renderer.$textLayer;
var lensElements = textLayer.$lenses;
if (lensElements)
lensElements.forEach(function (el) { el.remove(); });
textLayer.$lenses = null;
}
function renderWidgets(changes, renderer) {
var changed = changes & renderer.CHANGE_LINES
|| changes & renderer.CHANGE_FULL
|| changes & renderer.CHANGE_SCROLL
|| changes & renderer.CHANGE_TEXT;
if (!changed)
return;
var session = renderer.session;
var lineWidgets = renderer.session.lineWidgets;
var textLayer = renderer.$textLayer;
var lensElements = textLayer.$lenses;
if (!lineWidgets) {
if (lensElements)
clearLensElements(renderer);
return;
}
var textCells = renderer.$textLayer.$lines.cells;
var config = renderer.layerConfig;
var padding = renderer.$padding;
if (!lensElements)
lensElements = textLayer.$lenses = [];
var index = 0;
for (var i = 0; i < textCells.length; i++) {
var row = textCells[i].row;
var widget = lineWidgets[row];
var lenses = widget && widget.lenses;
if (!lenses || !lenses.length)
continue;
var lensContainer = lensElements[index];
if (!lensContainer) {
lensContainer = lensElements[index]
= dom.buildDom(["div", { class: "ace_codeLens" }], renderer.container);
}
lensContainer.style.height = config.lineHeight + "px";
index++;
for (var j = 0; j < lenses.length; j++) {
var el = lensContainer.childNodes[2 * j];
if (!el) {
if (j != 0)
lensContainer.appendChild(dom.createTextNode("\xa0|\xa0"));
el = dom.buildDom(["a"], lensContainer);
}
el.textContent = lenses[j].title;
el.lensCommand = lenses[j];
}
while (lensContainer.childNodes.length > 2 * j - 1)
lensContainer.lastChild.remove();
var top = renderer.$cursorLayer.getPixelPosition({
row: row,
column: 0
}, true).top - config.lineHeight * widget.rowsAbove - config.offset;
lensContainer.style.top = top + "px";
var left = renderer.gutterWidth;
var indent = session.getLine(row).search(/\S|$/);
if (indent == -1)
indent = 0;
left += indent * config.characterWidth;
lensContainer.style.paddingLeft = padding + left + "px";
}
while (index < lensElements.length)
lensElements.pop().remove();
}
function clearCodeLensWidgets(session) {
if (!session.lineWidgets)
return;
var widgetManager = session.widgetManager;
session.lineWidgets.forEach(function (widget) {
if (widget && widget.lenses)
widgetManager.removeLineWidget(widget);
});
}
exports.setLenses = function (session, lenses) {
var firstRow = Number.MAX_VALUE;
clearCodeLensWidgets(session);
lenses && lenses.forEach(function (lens) {
var row = lens.start.row;
var column = lens.start.column;
var widget = session.lineWidgets && session.lineWidgets[row];
if (!widget || !widget.lenses) {
widget = session.widgetManager.$registerLineWidget({
rowCount: 1,
rowsAbove: 1,
row: row,
column: column,
lenses: []
});
}
widget.lenses.push(lens.command);
if (row < firstRow)
firstRow = row;
});
session._emit("changeFold", { data: { start: { row: firstRow } } });
return firstRow;
};
function attachToEditor(editor) {
editor.codeLensProviders = [];
editor.renderer.on("afterRender", renderWidgets);
if (!editor.$codeLensClickHandler) {
editor.$codeLensClickHandler = function (e) {
var command = e.target.lensCommand;
if (!command)
return;
editor.execCommand(command.id, command.arguments);
editor._emit("codeLensClick", e);
};
event.addListener(editor.container, "click", editor.$codeLensClickHandler, editor);
}
editor.$updateLenses = function () {
var session = editor.session;
if (!session)
return;
if (!session.widgetManager) {
session.widgetManager = new LineWidgets(session);
session.widgetManager.attach(editor);
}
var providersToWaitNum = editor.codeLensProviders.length;
var lenses = [];
editor.codeLensProviders.forEach(function (provider) {
provider.provideCodeLenses(session, function (err, payload) {
if (err)
return;
payload.forEach(function (lens) {
lenses.push(lens);
});
providersToWaitNum--;
if (providersToWaitNum == 0) {
applyLenses();
}
});
});
function applyLenses() {
var cursor = session.selection.cursor;
var oldRow = session.documentToScreenRow(cursor);
var scrollTop = session.getScrollTop();
var firstRow = exports.setLenses(session, lenses);
var lastDelta = session.$undoManager && session.$undoManager.$lastDelta;
if (lastDelta && lastDelta.action == "remove" && lastDelta.lines.length > 1)
return;
var row = session.documentToScreenRow(cursor);
var lineHeight = editor.renderer.layerConfig.lineHeight;
var top = session.getScrollTop() + (row - oldRow) * lineHeight;
if (firstRow == 0 && scrollTop < lineHeight / 4 && scrollTop > -lineHeight / 4) {
top = -lineHeight;
}
session.setScrollTop(top);
}
};
var updateLenses = lang.delayedCall(editor.$updateLenses);
editor.$updateLensesOnInput = function () {
updateLenses.delay(250);
};
editor.on("input", editor.$updateLensesOnInput);
}
function detachFromEditor(editor) {
editor.off("input", editor.$updateLensesOnInput);
editor.renderer.off("afterRender", renderWidgets);
if (editor.$codeLensClickHandler)
editor.container.removeEventListener("click", editor.$codeLensClickHandler);
}
exports.registerCodeLensProvider = function (editor, codeLensProvider) {
editor.setOption("enableCodeLens", true);
editor.codeLensProviders.push(codeLensProvider);
editor.$updateLensesOnInput();
};
exports.clear = function (session) {
exports.setLenses(session, null);
};
var Editor = require("../editor").Editor;
require("../config").defineOptions(Editor.prototype, "editor", {
enableCodeLens: {
set: function (val) {
if (val) {
attachToEditor(this);
}
else {
detachFromEditor(this);
}
}
}
});
dom.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", false);
}); (function() {
ace.require(["ace/ext/code_lens"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,457 @@
ace.define("ace/ext/command_bar",["require","exports","module","ace/tooltip","ace/lib/event_emitter","ace/lib/lang","ace/lib/dom","ace/lib/oop","ace/lib/useragent"], function(require, exports, module){var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var Tooltip = require("../tooltip").Tooltip;
var EventEmitter = require("../lib/event_emitter").EventEmitter;
var lang = require("../lib/lang");
var dom = require("../lib/dom");
var oop = require("../lib/oop");
var useragent = require("../lib/useragent");
var BUTTON_CLASS_NAME = 'command_bar_tooltip_button';
var VALUE_CLASS_NAME = 'command_bar_button_value';
var CAPTION_CLASS_NAME = 'command_bar_button_caption';
var KEYBINDING_CLASS_NAME = 'command_bar_keybinding';
var TOOLTIP_CLASS_NAME = 'command_bar_tooltip';
var MORE_OPTIONS_BUTTON_ID = 'MoreOptionsButton';
var defaultDelay = 100;
var defaultMaxElements = 4;
var minPosition = function (posA, posB) {
if (posB.row > posA.row) {
return posA;
}
else if (posB.row === posA.row && posB.column > posA.column) {
return posA;
}
return posB;
};
var keyDisplayMap = {
"Ctrl": { mac: "^" },
"Option": { mac: "⌥" },
"Command": { mac: "⌘" },
"Cmd": { mac: "⌘" },
"Shift": "⇧",
"Left": "←",
"Right": "→",
"Up": "↑",
"Down": "↓"
};
var CommandBarTooltip = /** @class */ (function () {
function CommandBarTooltip(parentNode, options) {
var e_1, _a;
options = options || {};
this.parentNode = parentNode;
this.tooltip = new Tooltip(this.parentNode);
this.moreOptions = new Tooltip(this.parentNode);
this.maxElementsOnTooltip = options.maxElementsOnTooltip || defaultMaxElements;
this.$alwaysShow = options.alwaysShow || false;
this.eventListeners = {};
this.elements = {};
this.commands = {};
this.tooltipEl = dom.buildDom(['div', { class: TOOLTIP_CLASS_NAME }], this.tooltip.getElement());
this.moreOptionsEl = dom.buildDom(['div', { class: TOOLTIP_CLASS_NAME + " tooltip_more_options" }], this.moreOptions.getElement());
this.$showTooltipTimer = lang.delayedCall(this.$showTooltip.bind(this), options.showDelay || defaultDelay);
this.$hideTooltipTimer = lang.delayedCall(this.$hideTooltip.bind(this), options.hideDelay || defaultDelay);
this.$tooltipEnter = this.$tooltipEnter.bind(this);
this.$onMouseMove = this.$onMouseMove.bind(this);
this.$onChangeScroll = this.$onChangeScroll.bind(this);
this.$onEditorChangeSession = this.$onEditorChangeSession.bind(this);
this.$scheduleTooltipForHide = this.$scheduleTooltipForHide.bind(this);
this.$preventMouseEvent = this.$preventMouseEvent.bind(this);
try {
for (var _b = __values(["mousedown", "mouseup", "click"]), _c = _b.next(); !_c.done; _c = _b.next()) {
var event = _c.value;
this.tooltip.getElement().addEventListener(event, this.$preventMouseEvent);
this.moreOptions.getElement().addEventListener(event, this.$preventMouseEvent);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
}
CommandBarTooltip.prototype.registerCommand = function (id, command) {
var registerForMainTooltip = Object.keys(this.commands).length < this.maxElementsOnTooltip;
if (!registerForMainTooltip && !this.elements[MORE_OPTIONS_BUTTON_ID]) {
this.$createCommand(MORE_OPTIONS_BUTTON_ID, {
name: "···",
exec: function () {
this.$shouldHideMoreOptions = false;
this.$setMoreOptionsVisibility(!this.isMoreOptionsShown());
}.bind(this),
type: "checkbox",
getValue: function () {
return this.isMoreOptionsShown();
}.bind(this),
enabled: true
}, true);
}
this.$createCommand(id, command, registerForMainTooltip);
if (this.isShown()) {
this.updatePosition();
}
};
CommandBarTooltip.prototype.isShown = function () {
return !!this.tooltip && this.tooltip.isOpen;
};
CommandBarTooltip.prototype.isMoreOptionsShown = function () {
return !!this.moreOptions && this.moreOptions.isOpen;
};
CommandBarTooltip.prototype.getAlwaysShow = function () {
return this.$alwaysShow;
};
CommandBarTooltip.prototype.setAlwaysShow = function (alwaysShow) {
this.$alwaysShow = alwaysShow;
this.$updateOnHoverHandlers(!this.$alwaysShow);
this._signal("alwaysShow", this.$alwaysShow);
};
CommandBarTooltip.prototype.attach = function (editor) {
if (!editor || (this.isShown() && this.editor === editor)) {
return;
}
this.detach();
this.editor = editor;
this.editor.on("changeSession", this.$onEditorChangeSession);
if (this.editor.session) {
this.editor.session.on("changeScrollLeft", this.$onChangeScroll);
this.editor.session.on("changeScrollTop", this.$onChangeScroll);
}
if (this.getAlwaysShow()) {
this.$showTooltip();
}
else {
this.$updateOnHoverHandlers(true);
}
};
CommandBarTooltip.prototype.updatePosition = function () {
if (!this.editor) {
return;
}
var renderer = this.editor.renderer;
var ranges;
if (this.editor.selection.getAllRanges) {
ranges = this.editor.selection.getAllRanges();
}
else {
ranges = [this.editor.getSelectionRange()];
}
if (!ranges.length) {
return;
}
var minPos = minPosition(ranges[0].start, ranges[0].end);
for (var i = 0, range; range = ranges[i]; i++) {
minPos = minPosition(minPos, minPosition(range.start, range.end));
}
var pos = renderer.$cursorLayer.getPixelPosition(minPos, true);
var tooltipEl = this.tooltip.getElement();
var screenWidth = window.innerWidth;
var screenHeight = window.innerHeight;
var rect = this.editor.container.getBoundingClientRect();
pos.top += rect.top - renderer.layerConfig.offset;
pos.left += rect.left + renderer.gutterWidth - renderer.scrollLeft;
var cursorVisible = pos.top >= rect.top && pos.top <= rect.bottom &&
pos.left >= rect.left + renderer.gutterWidth && pos.left <= rect.right;
if (!cursorVisible && this.isShown()) {
this.$hideTooltip();
return;
}
else if (cursorVisible && !this.isShown() && this.getAlwaysShow()) {
this.$showTooltip();
return;
}
var top = pos.top - tooltipEl.offsetHeight;
var left = Math.min(screenWidth - tooltipEl.offsetWidth, pos.left);
var tooltipFits = top >= 0 && top + tooltipEl.offsetHeight <= screenHeight &&
left >= 0 && left + tooltipEl.offsetWidth <= screenWidth;
if (!tooltipFits) {
this.$hideTooltip();
return;
}
this.tooltip.setPosition(left, top);
if (this.isMoreOptionsShown()) {
top = top + tooltipEl.offsetHeight;
left = this.elements[MORE_OPTIONS_BUTTON_ID].getBoundingClientRect().left;
var moreOptionsEl = this.moreOptions.getElement();
var screenHeight = window.innerHeight;
if (top + moreOptionsEl.offsetHeight > screenHeight) {
top -= tooltipEl.offsetHeight + moreOptionsEl.offsetHeight;
}
if (left + moreOptionsEl.offsetWidth > screenWidth) {
left = screenWidth - moreOptionsEl.offsetWidth;
}
this.moreOptions.setPosition(left, top);
}
};
CommandBarTooltip.prototype.update = function () {
Object.keys(this.elements).forEach(this.$updateElement.bind(this));
};
CommandBarTooltip.prototype.detach = function () {
this.tooltip.hide();
this.moreOptions.hide();
this.$updateOnHoverHandlers(false);
if (this.editor) {
this.editor.off("changeSession", this.$onEditorChangeSession);
if (this.editor.session) {
this.editor.session.off("changeScrollLeft", this.$onChangeScroll);
this.editor.session.off("changeScrollTop", this.$onChangeScroll);
}
}
this.$mouseInTooltip = false;
this.editor = null;
};
CommandBarTooltip.prototype.destroy = function () {
if (this.tooltip && this.moreOptions) {
this.detach();
this.tooltip.destroy();
this.moreOptions.destroy();
}
this.eventListeners = {};
this.commands = {};
this.elements = {};
this.tooltip = this.moreOptions = this.parentNode = null;
};
CommandBarTooltip.prototype.$createCommand = function (id, command, forMainTooltip) {
var parentEl = forMainTooltip ? this.tooltipEl : this.moreOptionsEl;
var keyParts = [];
var bindKey = command.bindKey;
if (bindKey) {
if (typeof bindKey === 'object') {
bindKey = useragent.isMac ? bindKey.mac : bindKey.win;
}
bindKey = bindKey.split("|")[0];
keyParts = bindKey.split("-");
keyParts = keyParts.map(function (key) {
if (keyDisplayMap[key]) {
if (typeof keyDisplayMap[key] === 'string') {
return keyDisplayMap[key];
}
else if (useragent.isMac && keyDisplayMap[key].mac) {
return keyDisplayMap[key].mac;
}
}
return key;
});
}
var buttonNode;
if (forMainTooltip && command.iconCssClass) {
buttonNode = [
'div',
{
class: ["ace_icon_svg", command.iconCssClass].join(" "),
"aria-label": command.name + " (" + command.bindKey + ")"
}
];
}
else {
buttonNode = [
['div', { class: VALUE_CLASS_NAME }],
['div', { class: CAPTION_CLASS_NAME }, command.name]
];
if (keyParts.length) {
buttonNode.push([
'div',
{ class: KEYBINDING_CLASS_NAME },
keyParts.map(function (keyPart) {
return ['div', keyPart];
})
]);
}
}
dom.buildDom(['div', { class: [BUTTON_CLASS_NAME, command.cssClass || ""].join(" "), ref: id }, buttonNode], parentEl, this.elements);
this.commands[id] = command;
var eventListener = function (e) {
if (this.editor) {
this.editor.focus();
}
this.$shouldHideMoreOptions = this.isMoreOptionsShown();
if (!this.elements[id].disabled && command.exec) {
command.exec(this.editor);
}
if (this.$shouldHideMoreOptions) {
this.$setMoreOptionsVisibility(false);
}
this.update();
e.preventDefault();
}.bind(this);
this.eventListeners[id] = eventListener;
this.elements[id].addEventListener('click', eventListener.bind(this));
this.$updateElement(id);
};
CommandBarTooltip.prototype.$setMoreOptionsVisibility = function (visible) {
if (visible) {
this.moreOptions.setTheme(this.editor.renderer.theme);
this.moreOptions.setClassName(TOOLTIP_CLASS_NAME + "_wrapper");
this.moreOptions.show();
this.update();
this.updatePosition();
}
else {
this.moreOptions.hide();
}
};
CommandBarTooltip.prototype.$onEditorChangeSession = function (e) {
if (e.oldSession) {
e.oldSession.off("changeScrollTop", this.$onChangeScroll);
e.oldSession.off("changeScrollLeft", this.$onChangeScroll);
}
this.detach();
};
CommandBarTooltip.prototype.$onChangeScroll = function () {
if (this.editor.renderer && (this.isShown() || this.getAlwaysShow())) {
this.editor.renderer.once("afterRender", this.updatePosition.bind(this));
}
};
CommandBarTooltip.prototype.$onMouseMove = function (e) {
if (this.$mouseInTooltip) {
return;
}
var cursorPosition = this.editor.getCursorPosition();
var cursorScreenPosition = this.editor.renderer.textToScreenCoordinates(cursorPosition.row, cursorPosition.column);
var lineHeight = this.editor.renderer.lineHeight;
var isInCurrentLine = e.clientY >= cursorScreenPosition.pageY && e.clientY < cursorScreenPosition.pageY + lineHeight;
if (isInCurrentLine) {
if (!this.isShown() && !this.$showTooltipTimer.isPending()) {
this.$showTooltipTimer.delay();
}
if (this.$hideTooltipTimer.isPending()) {
this.$hideTooltipTimer.cancel();
}
}
else {
if (this.isShown() && !this.$hideTooltipTimer.isPending()) {
this.$hideTooltipTimer.delay();
}
if (this.$showTooltipTimer.isPending()) {
this.$showTooltipTimer.cancel();
}
}
};
CommandBarTooltip.prototype.$preventMouseEvent = function (e) {
if (this.editor) {
this.editor.focus();
}
e.preventDefault();
};
CommandBarTooltip.prototype.$scheduleTooltipForHide = function () {
this.$mouseInTooltip = false;
this.$showTooltipTimer.cancel();
this.$hideTooltipTimer.delay();
};
CommandBarTooltip.prototype.$tooltipEnter = function () {
this.$mouseInTooltip = true;
if (this.$showTooltipTimer.isPending()) {
this.$showTooltipTimer.cancel();
}
if (this.$hideTooltipTimer.isPending()) {
this.$hideTooltipTimer.cancel();
}
};
CommandBarTooltip.prototype.$updateOnHoverHandlers = function (enableHover) {
var tooltipEl = this.tooltip.getElement();
var moreOptionsEl = this.moreOptions.getElement();
if (enableHover) {
if (this.editor) {
this.editor.on("mousemove", this.$onMouseMove);
this.editor.renderer.getMouseEventTarget().addEventListener("mouseout", this.$scheduleTooltipForHide, true);
}
tooltipEl.addEventListener('mouseenter', this.$tooltipEnter);
tooltipEl.addEventListener('mouseleave', this.$scheduleTooltipForHide);
moreOptionsEl.addEventListener('mouseenter', this.$tooltipEnter);
moreOptionsEl.addEventListener('mouseleave', this.$scheduleTooltipForHide);
}
else {
if (this.editor) {
this.editor.off("mousemove", this.$onMouseMove);
this.editor.renderer.getMouseEventTarget().removeEventListener("mouseout", this.$scheduleTooltipForHide, true);
}
tooltipEl.removeEventListener('mouseenter', this.$tooltipEnter);
tooltipEl.removeEventListener('mouseleave', this.$scheduleTooltipForHide);
moreOptionsEl.removeEventListener('mouseenter', this.$tooltipEnter);
moreOptionsEl.removeEventListener('mouseleave', this.$scheduleTooltipForHide);
}
};
CommandBarTooltip.prototype.$showTooltip = function () {
if (this.isShown()) {
return;
}
this.tooltip.setTheme(this.editor.renderer.theme);
this.tooltip.setClassName(TOOLTIP_CLASS_NAME + "_wrapper");
this.tooltip.show();
this.update();
this.updatePosition();
this._signal("show");
};
CommandBarTooltip.prototype.$hideTooltip = function () {
this.$mouseInTooltip = false;
if (!this.isShown()) {
return;
}
this.moreOptions.hide();
this.tooltip.hide();
this._signal("hide");
};
CommandBarTooltip.prototype.$updateElement = function (id) {
var command = this.commands[id];
if (!command) {
return;
}
var el = this.elements[id];
var commandEnabled = command.enabled;
if (typeof commandEnabled === 'function') {
commandEnabled = commandEnabled(this.editor);
}
if (typeof command.getValue === 'function') {
var value = command.getValue(this.editor);
if (command.type === 'text') {
el.textContent = value;
}
else if (command.type === 'checkbox') {
var domCssFn = value ? dom.addCssClass : dom.removeCssClass;
var isOnTooltip = el.parentElement === this.tooltipEl;
el.ariaChecked = value;
if (isOnTooltip) {
domCssFn(el, "ace_selected");
}
else {
el = el.querySelector("." + VALUE_CLASS_NAME);
domCssFn(el, "ace_checkmark");
}
}
}
if (commandEnabled && el.disabled) {
dom.removeCssClass(el, "ace_disabled");
el.ariaDisabled = el.disabled = false;
el.removeAttribute("disabled");
}
else if (!commandEnabled && !el.disabled) {
dom.addCssClass(el, "ace_disabled");
el.ariaDisabled = el.disabled = true;
el.setAttribute("disabled", "");
}
};
return CommandBarTooltip;
}());
oop.implement(CommandBarTooltip.prototype, EventEmitter);
dom.importCssString("\n.ace_tooltip.".concat(TOOLTIP_CLASS_NAME, "_wrapper {\n padding: 0;\n}\n\n.ace_tooltip .").concat(TOOLTIP_CLASS_NAME, " {\n padding: 1px 5px;\n display: flex;\n pointer-events: auto;\n}\n\n.ace_tooltip .").concat(TOOLTIP_CLASS_NAME, ".tooltip_more_options {\n padding: 1px;\n flex-direction: column;\n}\n\ndiv.").concat(BUTTON_CLASS_NAME, " {\n display: inline-flex;\n cursor: pointer;\n margin: 1px;\n border-radius: 2px;\n padding: 2px 5px;\n align-items: center;\n}\n\ndiv.").concat(BUTTON_CLASS_NAME, ".ace_selected,\ndiv.").concat(BUTTON_CLASS_NAME, ":hover:not(.ace_disabled) {\n background-color: rgba(0, 0, 0, 0.1);\n}\n\ndiv.").concat(BUTTON_CLASS_NAME, ".ace_disabled {\n color: #777;\n pointer-events: none;\n}\n\ndiv.").concat(BUTTON_CLASS_NAME, " .ace_icon_svg {\n height: 12px;\n background-color: #000;\n}\n\ndiv.").concat(BUTTON_CLASS_NAME, ".ace_disabled .ace_icon_svg {\n background-color: #777;\n}\n\n.").concat(TOOLTIP_CLASS_NAME, ".tooltip_more_options .").concat(BUTTON_CLASS_NAME, " {\n display: flex;\n}\n\n.").concat(TOOLTIP_CLASS_NAME, ".").concat(VALUE_CLASS_NAME, " {\n display: none;\n}\n\n.").concat(TOOLTIP_CLASS_NAME, ".tooltip_more_options .").concat(VALUE_CLASS_NAME, " {\n display: inline-block;\n width: 12px;\n}\n\n.").concat(CAPTION_CLASS_NAME, " {\n display: inline-block;\n}\n\n.").concat(KEYBINDING_CLASS_NAME, " {\n margin: 0 2px;\n display: inline-block;\n font-size: 8px;\n}\n\n.").concat(TOOLTIP_CLASS_NAME, ".tooltip_more_options .").concat(KEYBINDING_CLASS_NAME, " {\n margin-left: auto;\n}\n\n.").concat(KEYBINDING_CLASS_NAME, " div {\n display: inline-block;\n min-width: 8px;\n padding: 2px;\n margin: 0 1px;\n border-radius: 2px;\n background-color: #ccc;\n text-align: center;\n}\n\n.ace_dark.ace_tooltip .").concat(TOOLTIP_CLASS_NAME, " {\n background-color: #373737;\n color: #eee;\n}\n\n.ace_dark div.").concat(BUTTON_CLASS_NAME, ".ace_disabled {\n color: #979797;\n}\n\n.ace_dark div.").concat(BUTTON_CLASS_NAME, ".ace_selected,\n.ace_dark div.").concat(BUTTON_CLASS_NAME, ":hover:not(.ace_disabled) {\n background-color: rgba(255, 255, 255, 0.1);\n}\n\n.ace_dark div.").concat(BUTTON_CLASS_NAME, " .ace_icon_svg {\n background-color: #eee;\n}\n\n.ace_dark div.").concat(BUTTON_CLASS_NAME, ".ace_disabled .ace_icon_svg {\n background-color: #979797;\n}\n\n.ace_dark .").concat(BUTTON_CLASS_NAME, ".ace_disabled {\n color: #979797;\n}\n\n.ace_dark .").concat(KEYBINDING_CLASS_NAME, " div {\n background-color: #575757;\n}\n\n.ace_checkmark::before {\n content: '\u2713';\n}\n"), "commandbar.css", false);
exports.CommandBarTooltip = CommandBarTooltip;
exports.TOOLTIP_CLASS_NAME = TOOLTIP_CLASS_NAME;
exports.BUTTON_CLASS_NAME = BUTTON_CLASS_NAME;
}); (function() {
ace.require(["ace/ext/command_bar"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,227 @@
ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"], function(require, exports, module){"use strict";
var ElasticTabstopsLite = /** @class */ (function () {
function ElasticTabstopsLite(editor) {
this.$editor = editor;
var self = this;
var changedRows = [];
var recordChanges = false;
this.onAfterExec = function () {
recordChanges = false;
self.processRows(changedRows);
changedRows = [];
};
this.onExec = function () {
recordChanges = true;
};
this.onChange = function (delta) {
if (recordChanges) {
if (changedRows.indexOf(delta.start.row) == -1)
changedRows.push(delta.start.row);
if (delta.end.row != delta.start.row)
changedRows.push(delta.end.row);
}
};
}
ElasticTabstopsLite.prototype.processRows = function (rows) {
this.$inChange = true;
var checkedRows = [];
for (var r = 0, rowCount = rows.length; r < rowCount; r++) {
var row = rows[r];
if (checkedRows.indexOf(row) > -1)
continue;
var cellWidthObj = this.$findCellWidthsForBlock(row);
var cellWidths = this.$setBlockCellWidthsToMax(cellWidthObj.cellWidths);
var rowIndex = cellWidthObj.firstRow;
for (var w = 0, l = cellWidths.length; w < l; w++) {
var widths = cellWidths[w];
checkedRows.push(rowIndex);
this.$adjustRow(rowIndex, widths);
rowIndex++;
}
}
this.$inChange = false;
};
ElasticTabstopsLite.prototype.$findCellWidthsForBlock = function (row) {
var cellWidths = [], widths;
var rowIter = row;
while (rowIter >= 0) {
widths = this.$cellWidthsForRow(rowIter);
if (widths.length == 0)
break;
cellWidths.unshift(widths);
rowIter--;
}
var firstRow = rowIter + 1;
rowIter = row;
var numRows = this.$editor.session.getLength();
while (rowIter < numRows - 1) {
rowIter++;
widths = this.$cellWidthsForRow(rowIter);
if (widths.length == 0)
break;
cellWidths.push(widths);
}
return { cellWidths: cellWidths, firstRow: firstRow };
};
ElasticTabstopsLite.prototype.$cellWidthsForRow = function (row) {
var selectionColumns = this.$selectionColumnsForRow(row);
var tabs = [-1].concat(this.$tabsForRow(row));
var widths = tabs.map(function (el) { return 0; }).slice(1);
var line = this.$editor.session.getLine(row);
for (var i = 0, len = tabs.length - 1; i < len; i++) {
var leftEdge = tabs[i] + 1;
var rightEdge = tabs[i + 1];
var rightmostSelection = this.$rightmostSelectionInCell(selectionColumns, rightEdge);
var cell = line.substring(leftEdge, rightEdge);
widths[i] = Math.max(cell.replace(/\s+$/g, '').length, rightmostSelection - leftEdge);
}
return widths;
};
ElasticTabstopsLite.prototype.$selectionColumnsForRow = function (row) {
var selections = [], cursor = this.$editor.getCursorPosition();
if (this.$editor.session.getSelection().isEmpty()) {
if (row == cursor.row)
selections.push(cursor.column);
}
return selections;
};
ElasticTabstopsLite.prototype.$setBlockCellWidthsToMax = function (cellWidths) {
var startingNewBlock = true, blockStartRow, blockEndRow, maxWidth;
var columnInfo = this.$izip_longest(cellWidths);
for (var c = 0, l = columnInfo.length; c < l; c++) {
var column = columnInfo[c];
if (!column.push) {
console.error(column);
continue;
}
column.push(NaN);
for (var r = 0, s = column.length; r < s; r++) {
var width = column[r];
if (startingNewBlock) {
blockStartRow = r;
maxWidth = 0;
startingNewBlock = false;
}
if (isNaN(width)) {
blockEndRow = r;
for (var j = blockStartRow; j < blockEndRow; j++) {
cellWidths[j][c] = maxWidth;
}
startingNewBlock = true;
}
maxWidth = Math.max(maxWidth, width);
}
}
return cellWidths;
};
ElasticTabstopsLite.prototype.$rightmostSelectionInCell = function (selectionColumns, cellRightEdge) {
var rightmost = 0;
if (selectionColumns.length) {
var lengths = [];
for (var s = 0, length = selectionColumns.length; s < length; s++) {
if (selectionColumns[s] <= cellRightEdge)
lengths.push(s);
else
lengths.push(0);
}
rightmost = Math.max.apply(Math, lengths);
}
return rightmost;
};
ElasticTabstopsLite.prototype.$tabsForRow = function (row) {
var rowTabs = [], line = this.$editor.session.getLine(row), re = /\t/g, match;
while ((match = re.exec(line)) != null) {
rowTabs.push(match.index);
}
return rowTabs;
};
ElasticTabstopsLite.prototype.$adjustRow = function (row, widths) {
var rowTabs = this.$tabsForRow(row);
if (rowTabs.length == 0)
return;
var bias = 0, location = -1;
var expandedSet = this.$izip(widths, rowTabs);
for (var i = 0, l = expandedSet.length; i < l; i++) {
var w = expandedSet[i][0], it = expandedSet[i][1];
location += 1 + w;
it += bias;
var difference = location - it;
if (difference == 0)
continue;
var partialLine = this.$editor.session.getLine(row).substr(0, it);
var strippedPartialLine = partialLine.replace(/\s*$/g, "");
var ispaces = partialLine.length - strippedPartialLine.length;
if (difference > 0) {
this.$editor.session.getDocument().insertInLine({ row: row, column: it + 1 }, Array(difference + 1).join(" ") + "\t");
this.$editor.session.getDocument().removeInLine(row, it, it + 1);
bias += difference;
}
if (difference < 0 && ispaces >= -difference) {
this.$editor.session.getDocument().removeInLine(row, it + difference, it);
bias += difference;
}
}
};
ElasticTabstopsLite.prototype.$izip_longest = function (iterables) {
if (!iterables[0])
return [];
var longest = iterables[0].length;
var iterablesLength = iterables.length;
for (var i = 1; i < iterablesLength; i++) {
var iLength = iterables[i].length;
if (iLength > longest)
longest = iLength;
}
var expandedSet = [];
for (var l = 0; l < longest; l++) {
var set = [];
for (var i = 0; i < iterablesLength; i++) {
if (iterables[i][l] === "")
set.push(NaN);
else
set.push(iterables[i][l]);
}
expandedSet.push(set);
}
return expandedSet;
};
ElasticTabstopsLite.prototype.$izip = function (widths, tabs) {
var size = widths.length >= tabs.length ? tabs.length : widths.length;
var expandedSet = [];
for (var i = 0; i < size; i++) {
var set = [widths[i], tabs[i]];
expandedSet.push(set);
}
return expandedSet;
};
return ElasticTabstopsLite;
}());
exports.ElasticTabstopsLite = ElasticTabstopsLite;
var Editor = require("../editor").Editor;
require("../config").defineOptions(Editor.prototype, "editor", {
useElasticTabstops: {
set: function (val) {
if (val) {
if (!this.elasticTabstops)
this.elasticTabstops = new ElasticTabstopsLite(this);
this.commands.on("afterExec", this.elasticTabstops.onAfterExec);
this.commands.on("exec", this.elasticTabstops.onExec);
this.on("change", this.elasticTabstops.onChange);
}
else if (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;
}
});
})();
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,9 @@
; (function() {
ace.require(["ace/ext/error_marker"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,116 @@
ace.define("ace/ext/hardwrap",["require","exports","module","ace/range","ace/editor","ace/config"], function(require, exports, module){"use strict";
var Range = require("../range").Range;
function hardWrap(editor, options) {
var max = options.column || editor.getOption("printMarginColumn");
var allowMerge = options.allowMerge != false;
var row = Math.min(options.startRow, options.endRow);
var endRow = Math.max(options.startRow, options.endRow);
var session = editor.session;
while (row <= endRow) {
var line = session.getLine(row);
if (line.length > max) {
var space = findSpace(line, max, 5);
if (space) {
var indentation = /^\s*/.exec(line)[0];
session.replace(new Range(row, space.start, row, space.end), "\n" + indentation);
}
endRow++;
}
else if (allowMerge && /\S/.test(line) && row != endRow) {
var nextLine = session.getLine(row + 1);
if (nextLine && /\S/.test(nextLine)) {
var trimmedLine = line.replace(/\s+$/, "");
var trimmedNextLine = nextLine.replace(/^\s+/, "");
var mergedLine = trimmedLine + " " + trimmedNextLine;
var space = findSpace(mergedLine, max, 5);
if (space && space.start > trimmedLine.length || mergedLine.length < max) {
var replaceRange = new Range(row, trimmedLine.length, row + 1, nextLine.length - trimmedNextLine.length);
session.replace(replaceRange, " ");
row--;
endRow--;
}
else if (trimmedLine.length < line.length) {
session.remove(new Range(row, trimmedLine.length, row, line.length));
}
}
}
row++;
}
function findSpace(line, max, min) {
if (line.length < max)
return;
var before = line.slice(0, max);
var after = line.slice(max);
var spaceAfter = /^(?:(\s+)|(\S+)(\s+))/.exec(after);
var spaceBefore = /(?:(\s+)|(\s+)(\S+))$/.exec(before);
var start = 0;
var end = 0;
if (spaceBefore && !spaceBefore[2]) {
start = max - spaceBefore[1].length;
end = max;
}
if (spaceAfter && !spaceAfter[2]) {
if (!start)
start = max;
end = max + spaceAfter[1].length;
}
if (start) {
return {
start: start,
end: end
};
}
if (spaceBefore && spaceBefore[2] && spaceBefore.index > min) {
return {
start: spaceBefore.index,
end: spaceBefore.index + spaceBefore[2].length
};
}
if (spaceAfter && spaceAfter[2]) {
start = max + spaceAfter[2].length;
return {
start: start,
end: start + spaceAfter[3].length
};
}
}
}
function wrapAfterInput(e) {
if (e.command.name == "insertstring" && /\S/.test(e.args)) {
var editor = e.editor;
var cursor = editor.selection.cursor;
if (cursor.column <= editor.renderer.$printMarginColumn)
return;
var lastDelta = editor.session.$undoManager.$lastDelta;
hardWrap(editor, {
startRow: cursor.row, endRow: cursor.row,
allowMerge: false
});
if (lastDelta != editor.session.$undoManager.$lastDelta)
editor.session.markUndoGroup();
}
}
var Editor = require("../editor").Editor;
require("../config").defineOptions(Editor.prototype, "editor", {
hardWrap: {
set: function (val) {
if (val) {
this.commands.on("afterExec", wrapAfterInput);
}
else {
this.commands.off("afterExec", wrapAfterInput);
}
},
value: false
}
});
exports.hardWrap = hardWrap;
}); (function() {
ace.require(["ace/ext/hardwrap"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,133 @@
ace.define("ace/ext/menu_tools/settings_menu.css",["require","exports","module"], function(require, exports, module){module.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(require, exports, module){/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
'use strict';
var dom = require("../../lib/dom");
var cssText = require("./settings_menu.css");
dom.importCssString(cssText, "settings_menu.css", false);
module.exports.overlayPage = function overlayPage(editor, contentElement, callback) {
var closer = document.createElement('div');
var ignoreFocusOut = false;
function documentEscListener(e) {
if (e.keyCode === 27) {
close();
}
}
function close() {
if (!closer)
return;
document.removeEventListener('keydown', documentEscListener);
closer.parentNode.removeChild(closer);
if (editor) {
editor.focus();
}
closer = null;
callback && callback();
}
function setIgnoreFocusOut(ignore) {
ignoreFocusOut = ignore;
if (ignore) {
closer.style.pointerEvents = "none";
contentElement.style.pointerEvents = "auto";
}
}
closer.style.cssText = 'margin: 0; padding: 0; ' +
'position: fixed; top:0; bottom:0; left:0; right:0;' +
'z-index: 9990; ' +
(editor ? 'background-color: rgba(0, 0, 0, 0.3);' : '');
closer.addEventListener('click', function (e) {
if (!ignoreFocusOut) {
close();
}
});
document.addEventListener('keydown', documentEscListener);
contentElement.addEventListener('click', function (e) {
e.stopPropagation();
});
closer.appendChild(contentElement);
document.body.appendChild(closer);
if (editor) {
editor.blur();
}
return {
close: close,
setIgnoreFocusOut: setIgnoreFocusOut
};
};
});
ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"], function(require, exports, module){/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
"use strict";
var keys = require("../../lib/keys");
module.exports.getEditorKeybordShortcuts = function (editor) {
var KEY_MODS = keys.KEY_MODS;
var keybindings = [];
var commandMap = {};
editor.keyBinding.$handlers.forEach(function (handler) {
var ckb = handler.commandKeyBinding;
for (var i in ckb) {
var key = i.replace(/(^|-)\w/g, function (x) { return x.toUpperCase(); });
var commands = ckb[i];
if (!Array.isArray(commands))
commands = [commands];
commands.forEach(function (command) {
if (typeof command != "string")
command = command.name;
if (commandMap[command]) {
commandMap[command].key += "|" + key;
}
else {
commandMap[command] = { key: key, command: command };
keybindings.push(commandMap[command]);
}
});
}
});
return keybindings;
};
});
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(require, exports, module){/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
"use strict";
var Editor = require("../editor").Editor;
function showKeyboardShortcuts(editor) {
if (!document.getElementById('kbshortcutmenu')) {
var overlayPage = require('./menu_tools/overlay_page').overlayPage;
var getEditorKeybordShortcuts = require('./menu_tools/get_editor_keyboard_shortcuts').getEditorKeybordShortcuts;
var kb = getEditorKeybordShortcuts(editor);
var el = document.createElement('div');
var commands = kb.reduce(function (previous, current) {
return previous + '<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'
+ current.command + '</span> : '
+ '<span class="ace_optionsMenuKey">' + current.key + '</span></div>';
}, '');
el.id = 'kbshortcutmenu';
el.innerHTML = '<h1>Keyboard Shortcuts</h1>' + commands + '</div>';
overlayPage(editor, el);
}
}
module.exports.init = function (editor) {
Editor.prototype.showKeyboardShortcuts = function () {
showKeyboardShortcuts(this);
};
editor.commands.addCommands([{
name: "showKeyboardShortcuts",
bindKey: { win: "Ctrl-Alt-h", mac: "Command-Alt-h" },
exec: function (editor, line) {
editor.showKeyboardShortcuts();
}
}]);
};
}); (function() {
ace.require(["ace/ext/keybinding_menu"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,56 @@
ace.define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"], function(require, exports, module){var Editor = require("../editor").Editor;
require("../config").defineOptions(Editor.prototype, "editor", {
enableLinking: {
set: function (val) {
if (val) {
this.on("click", onClick);
this.on("mousemove", onMouseMove);
}
else {
this.off("click", onClick);
this.off("mousemove", onMouseMove);
}
},
value: false
}
});
exports.previousLinkingHover = false;
function onMouseMove(e) {
var editor = e.editor;
var ctrl = e.getAccelKey();
if (ctrl) {
var editor = e.editor;
var docPos = e.getDocumentPosition();
var session = editor.session;
var token = session.getTokenAt(docPos.row, docPos.column);
if (exports.previousLinkingHover && exports.previousLinkingHover != token) {
editor._emit("linkHoverOut");
}
editor._emit("linkHover", { position: docPos, token: token });
exports.previousLinkingHover = token;
}
else if (exports.previousLinkingHover) {
editor._emit("linkHoverOut");
exports.previousLinkingHover = false;
}
}
function onClick(e) {
var ctrl = e.getAccelKey();
var button = e.getButton();
if (button == 0 && ctrl) {
var editor = e.editor;
var docPos = e.getDocumentPosition();
var session = editor.session;
var token = session.getTokenAt(docPos.row, docPos.column);
editor._emit("linkClick", { position: docPos, token: token });
}
}
}); (function() {
ace.require(["ace/ext/linking"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,261 @@
ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module){"use strict";
var modes = [];
function getModeForPath(path) {
var mode = modesByName.text;
var fileName = path.split(/[\/\\]/).pop();
for (var i = 0; i < modes.length; i++) {
if (modes[i].supportsFile(fileName)) {
mode = modes[i];
break;
}
}
return mode;
}
var Mode = /** @class */ (function () {
function Mode(name, caption, extensions) {
this.name = name;
this.caption = caption;
this.mode = "ace/mode/" + name;
this.extensions = extensions;
var re;
if (/\^/.test(extensions)) {
re = extensions.replace(/\|(\^)?/g, function (a, b) {
return "$|" + (b ? "^" : "^.*\\.");
}) + "$";
}
else {
re = "^.*\\.(" + extensions + ")$";
}
this.extRe = new RegExp(re, "gi");
}
Mode.prototype.supportsFile = function (filename) {
return filename.match(this.extRe);
};
return Mode;
}());
var supportedModes = {
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_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|vue|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|jsx|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"],
Wollok: ["wlk|wpgm|wtest"],
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
XQuery: ["xq"],
YAML: ["yaml|yml"],
Zeek: ["zeek|bro"]
};
var nameOverrides = {
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"
};
var modesByName = {};
for (var name in supportedModes) {
var data = supportedModes[name];
var displayName = (nameOverrides[name] || name).replace(/_/g, " ");
var filename = name.toLowerCase();
var mode = new Mode(filename, displayName, data[0]);
modesByName[filename] = mode;
modes.push(mode);
}
module.exports = {
getModeForPath: getModeForPath,
modes: modes,
modesByName: modesByName
};
}); (function() {
ace.require(["ace/ext/modelist"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,761 @@
ace.define("ace/ext/menu_tools/settings_menu.css",["require","exports","module"], function(require, exports, module){module.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(require, exports, module){/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
'use strict';
var dom = require("../../lib/dom");
var cssText = require("./settings_menu.css");
dom.importCssString(cssText, "settings_menu.css", false);
module.exports.overlayPage = function overlayPage(editor, contentElement, callback) {
var closer = document.createElement('div');
var ignoreFocusOut = false;
function documentEscListener(e) {
if (e.keyCode === 27) {
close();
}
}
function close() {
if (!closer)
return;
document.removeEventListener('keydown', documentEscListener);
closer.parentNode.removeChild(closer);
if (editor) {
editor.focus();
}
closer = null;
callback && callback();
}
function setIgnoreFocusOut(ignore) {
ignoreFocusOut = ignore;
if (ignore) {
closer.style.pointerEvents = "none";
contentElement.style.pointerEvents = "auto";
}
}
closer.style.cssText = 'margin: 0; padding: 0; ' +
'position: fixed; top:0; bottom:0; left:0; right:0;' +
'z-index: 9990; ' +
(editor ? 'background-color: rgba(0, 0, 0, 0.3);' : '');
closer.addEventListener('click', function (e) {
if (!ignoreFocusOut) {
close();
}
});
document.addEventListener('keydown', documentEscListener);
contentElement.addEventListener('click', function (e) {
e.stopPropagation();
});
closer.appendChild(contentElement);
document.body.appendChild(closer);
if (editor) {
editor.blur();
}
return {
close: close,
setIgnoreFocusOut: setIgnoreFocusOut
};
};
});
ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module){"use strict";
var modes = [];
function getModeForPath(path) {
var mode = modesByName.text;
var fileName = path.split(/[\/\\]/).pop();
for (var i = 0; i < modes.length; i++) {
if (modes[i].supportsFile(fileName)) {
mode = modes[i];
break;
}
}
return mode;
}
var Mode = /** @class */ (function () {
function Mode(name, caption, extensions) {
this.name = name;
this.caption = caption;
this.mode = "ace/mode/" + name;
this.extensions = extensions;
var re;
if (/\^/.test(extensions)) {
re = extensions.replace(/\|(\^)?/g, function (a, b) {
return "$|" + (b ? "^" : "^.*\\.");
}) + "$";
}
else {
re = "^.*\\.(" + extensions + ")$";
}
this.extRe = new RegExp(re, "gi");
}
Mode.prototype.supportsFile = function (filename) {
return filename.match(this.extRe);
};
return Mode;
}());
var supportedModes = {
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_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|vue|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|jsx|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"],
Wollok: ["wlk|wpgm|wtest"],
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
XQuery: ["xq"],
YAML: ["yaml|yml"],
Zeek: ["zeek|bro"]
};
var nameOverrides = {
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"
};
var modesByName = {};
for (var name in supportedModes) {
var data = supportedModes[name];
var displayName = (nameOverrides[name] || name).replace(/_/g, " ");
var filename = name.toLowerCase();
var mode = new Mode(filename, displayName, data[0]);
modesByName[filename] = mode;
modes.push(mode);
}
module.exports = {
getModeForPath: getModeForPath,
modes: modes,
modesByName: modesByName
};
});
ace.define("ace/ext/themelist",["require","exports","module"], function(require, exports, module){/**
* Generates a list of themes available when ace was built.
* @fileOverview Generates a list of themes available when ace was built.
* @author <a href="mailto:matthewkastor@gmail.com">
* Matthew Christopher Kastor-Inare III </a><br />
* ☭ Hial Atropa!! ☭
*/
"use strict";
var themeData = [
["Chrome"],
["Clouds"],
["Crimson Editor"],
["Dawn"],
["Dreamweaver"],
["Eclipse"],
["GitHub"],
["IPlastic"],
["Solarized Light"],
["TextMate"],
["Tomorrow"],
["XCode"],
["Kuroir"],
["KatzenMilch"],
["SQL Server", "sqlserver", "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"]
];
exports.themesByName = {};
exports.themes = themeData.map(function (data) {
var name = data[1] || data[0].replace(/ /g, "_").toLowerCase();
var theme = {
caption: data[0],
theme: "ace/theme/" + name,
isDark: data[2] == "dark",
name: name
};
exports.themesByName[name] = theme;
return theme;
});
});
ace.define("ace/ext/options",["require","exports","module","ace/ext/menu_tools/overlay_page","ace/lib/dom","ace/lib/oop","ace/config","ace/lib/event_emitter","ace/ext/modelist","ace/ext/themelist"], function(require, exports, module){"use strict";
require("./menu_tools/overlay_page");
var dom = require("../lib/dom");
var oop = require("../lib/oop");
var config = require("../config");
var EventEmitter = require("../lib/event_emitter").EventEmitter;
var buildDom = dom.buildDom;
var modelist = require("./modelist");
var themelist = require("./themelist");
var themes = { Bright: [], Dark: [] };
themelist.themes.forEach(function (x) {
themes[x.isDark ? "Dark" : "Bright"].push({ caption: x.caption, value: x.theme });
});
var modes = modelist.modes.map(function (x) {
return { caption: x.caption, value: x.mode };
});
var optionGroups = {
Main: {
Mode: {
path: "mode",
type: "select",
items: modes
},
Theme: {
path: "theme",
type: "select",
items: themes
},
"Keybinding": {
type: "buttonBar",
path: "keyboardHandler",
items: [
{ caption: "Ace", value: null },
{ caption: "Vim", value: "ace/keyboard/vim" },
{ caption: "Emacs", value: "ace/keyboard/emacs" },
{ caption: "Sublime", value: "ace/keyboard/sublime" },
{ caption: "VSCode", value: "ace/keyboard/vscode" }
]
},
"Font Size": {
path: "fontSize",
type: "number",
defaultValue: 12,
defaults: [
{ caption: "12px", value: 12 },
{ caption: "24px", value: 24 }
]
},
"Soft Wrap": {
type: "buttonBar",
path: "wrap",
items: [
{ caption: "Off", value: "off" },
{ caption: "View", value: "free" },
{ caption: "margin", value: "printMargin" },
{ caption: "40", value: "40" }
]
},
"Cursor Style": {
path: "cursorStyle",
items: [
{ caption: "Ace", value: "ace" },
{ caption: "Slim", value: "slim" },
{ caption: "Smooth", value: "smooth" },
{ caption: "Smooth And Slim", value: "smooth slim" },
{ caption: "Wide", value: "wide" }
]
},
"Folding": {
path: "foldStyle",
items: [
{ caption: "Manual", value: "manual" },
{ caption: "Mark begin", value: "markbegin" },
{ caption: "Mark begin and end", value: "markbeginend" }
]
},
"Soft Tabs": [{
path: "useSoftTabs"
}, {
ariaLabel: "Tab Size",
path: "tabSize",
type: "number",
values: [2, 3, 4, 8, 16]
}],
"Overscroll": {
type: "buttonBar",
path: "scrollPastEnd",
items: [
{ caption: "None", value: 0 },
{ caption: "Half", value: 0.5 },
{ caption: "Full", value: 1 }
]
}
},
More: {
"Atomic soft tabs": {
path: "navigateWithinSoftTabs"
},
"Enable Behaviours": {
path: "behavioursEnabled"
},
"Wrap with quotes": {
path: "wrapBehavioursEnabled"
},
"Enable Auto Indent": {
path: "enableAutoIndent"
},
"Full Line Selection": {
type: "checkbox",
values: "text|line",
path: "selectionStyle"
},
"Highlight Active Line": {
path: "highlightActiveLine"
},
"Show Invisibles": {
path: "showInvisibles"
},
"Show Indent Guides": {
path: "displayIndentGuides"
},
"Highlight Indent Guides": {
path: "highlightIndentGuides"
},
"Persistent HScrollbar": {
path: "hScrollBarAlwaysVisible"
},
"Persistent VScrollbar": {
path: "vScrollBarAlwaysVisible"
},
"Animate scrolling": {
path: "animatedScroll"
},
"Show Gutter": {
path: "showGutter"
},
"Show Line Numbers": {
path: "showLineNumbers"
},
"Relative Line Numbers": {
path: "relativeLineNumbers"
},
"Fixed Gutter Width": {
path: "fixedWidthGutter"
},
"Show Print Margin": [{
path: "showPrintMargin"
}, {
ariaLabel: "Print Margin",
type: "number",
path: "printMarginColumn"
}],
"Indented Soft Wrap": {
path: "indentedSoftWrap"
},
"Highlight selected word": {
path: "highlightSelectedWord"
},
"Fade Fold Widgets": {
path: "fadeFoldWidgets"
},
"Use textarea for IME": {
path: "useTextareaForIME"
},
"Merge Undo Deltas": {
path: "mergeUndoDeltas",
items: [
{ caption: "Always", value: "always" },
{ caption: "Never", value: "false" },
{ caption: "Timed", value: "true" }
]
},
"Elastic Tabstops": {
path: "useElasticTabstops"
},
"Incremental Search": {
path: "useIncrementalSearch"
},
"Read-only": {
path: "readOnly"
},
"Copy without selection": {
path: "copyWithEmptySelection"
},
"Live Autocompletion": {
path: "enableLiveAutocompletion"
},
"Custom scrollbar": {
path: "customScrollbar"
},
"Use SVG gutter icons": {
path: "useSvgGutterIcons"
},
"Annotations for folded lines": {
path: "showFoldedAnnotations"
},
"Keyboard Accessibility Mode": {
path: "enableKeyboardAccessibility"
},
"Gutter tooltip follows mouse": {
path: "tooltipFollowsMouse",
defaultValue: true
}
}
};
var OptionPanel = /** @class */ (function () {
function OptionPanel(editor, element) {
this.editor = editor;
this.container = element || document.createElement("div");
this.groups = [];
this.options = {};
}
OptionPanel.prototype.add = function (config) {
if (config.Main)
oop.mixin(optionGroups.Main, config.Main);
if (config.More)
oop.mixin(optionGroups.More, config.More);
};
OptionPanel.prototype.render = function () {
this.container.innerHTML = "";
buildDom(["table", { role: "presentation", id: "controls" },
this.renderOptionGroup(optionGroups.Main),
["tr", null, ["td", { colspan: 2 },
["table", { role: "presentation", id: "more-controls" },
this.renderOptionGroup(optionGroups.More)
]
]],
["tr", null, ["td", { colspan: 2 }, "version " + config.version]]
], this.container);
};
OptionPanel.prototype.renderOptionGroup = function (group) {
return Object.keys(group).map(function (key, i) {
var item = group[key];
if (!item.position)
item.position = i / 10000;
if (!item.label)
item.label = key;
return item;
}).sort(function (a, b) {
return a.position - b.position;
}).map(function (item) {
return this.renderOption(item.label, item);
}, this);
};
OptionPanel.prototype.renderOptionControl = function (key, option) {
var self = this;
if (Array.isArray(option)) {
return option.map(function (x) {
return self.renderOptionControl(key, x);
});
}
var control;
var value = self.getOption(option);
if (option.values && option.type != "checkbox") {
if (typeof option.values == "string")
option.values = option.values.split("|");
option.items = option.values.map(function (v) {
return { value: v, name: v };
});
}
if (option.type == "buttonBar") {
control = ["div", { role: "group", "aria-labelledby": option.path + "-label" }, option.items.map(function (item) {
return ["button", {
value: item.value,
ace_selected_button: value == item.value,
'aria-pressed': value == item.value,
onclick: function () {
self.setOption(option, item.value);
var nodes = this.parentNode.querySelectorAll("[ace_selected_button]");
for (var i = 0; i < nodes.length; i++) {
nodes[i].removeAttribute("ace_selected_button");
nodes[i].setAttribute("aria-pressed", false);
}
this.setAttribute("ace_selected_button", true);
this.setAttribute("aria-pressed", true);
}
}, item.desc || item.caption || item.name];
})];
}
else if (option.type == "number") {
control = ["input", { type: "number", value: value || option.defaultValue, style: "width:3em", oninput: function () {
self.setOption(option, parseInt(this.value));
} }];
if (option.ariaLabel) {
control[1]["aria-label"] = option.ariaLabel;
}
else {
control[1].id = key;
}
if (option.defaults) {
control = [control, option.defaults.map(function (item) {
return ["button", { onclick: function () {
var input = this.parentNode.firstChild;
input.value = item.value;
input.oninput();
} }, item.caption];
})];
}
}
else if (option.items) {
var buildItems = function (items) {
return items.map(function (item) {
return ["option", { value: item.value || item.name }, item.desc || item.caption || item.name];
});
};
var items = Array.isArray(option.items)
? buildItems(option.items)
: Object.keys(option.items).map(function (key) {
return ["optgroup", { "label": key }, buildItems(option.items[key])];
});
control = ["select", { id: key, value: value, onchange: function () {
self.setOption(option, this.value);
} }, items];
}
else {
if (typeof option.values == "string")
option.values = option.values.split("|");
if (option.values)
value = value == option.values[1];
control = ["input", { type: "checkbox", id: key, checked: value || null, onchange: function () {
var value = this.checked;
if (option.values)
value = option.values[value ? 1 : 0];
self.setOption(option, value);
} }];
if (option.type == "checkedNumber") {
control = [control, []];
}
}
return control;
};
OptionPanel.prototype.renderOption = function (key, option) {
if (option.path && !option.onchange && !this.editor.$options[option.path])
return;
var path = Array.isArray(option) ? option[0].path : option.path;
this.options[path] = option;
var safeKey = "-" + path;
var safeId = path + "-label";
var control = this.renderOptionControl(safeKey, option);
return ["tr", { class: "ace_optionsMenuEntry" }, ["td",
["label", { for: safeKey, id: safeId }, key]
], ["td", control]];
};
OptionPanel.prototype.setOption = function (option, value) {
if (typeof option == "string")
option = this.options[option];
if (value == "false")
value = false;
if (value == "true")
value = true;
if (value == "null")
value = null;
if (value == "undefined")
value = undefined;
if (typeof value == "string" && parseFloat(value).toString() == value)
value = parseFloat(value);
if (option.onchange)
option.onchange(value);
else if (option.path)
this.editor.setOption(option.path, value);
this._signal("setOption", { name: option.path, value: value });
};
OptionPanel.prototype.getOption = function (option) {
if (option.getValue)
return option.getValue();
return this.editor.getOption(option.path);
};
return OptionPanel;
}());
oop.implement(OptionPanel.prototype, EventEmitter);
exports.OptionPanel = OptionPanel;
}); (function() {
ace.require(["ace/ext/options"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,120 @@
ace.define("ace/ext/rtl",["require","exports","module","ace/editor","ace/config"], function(require, exports, module){"use strict";
var commands = [{
name: "leftToRight",
bindKey: { win: "Ctrl-Alt-Shift-L", mac: "Command-Alt-Shift-L" },
exec: function (editor) {
editor.session.$bidiHandler.setRtlDirection(editor, false);
},
readOnly: true
}, {
name: "rightToLeft",
bindKey: { win: "Ctrl-Alt-Shift-R", mac: "Command-Alt-Shift-R" },
exec: function (editor) {
editor.session.$bidiHandler.setRtlDirection(editor, true);
},
readOnly: true
}];
var Editor = require("../editor").Editor;
require("../config").defineOptions(Editor.prototype, "editor", {
rtlText: {
set: function (val) {
if (val) {
this.on("change", onChange);
this.on("changeSelection", onChangeSelection);
this.renderer.on("afterRender", updateLineDirection);
this.commands.on("exec", onCommandEmitted);
this.commands.addCommands(commands);
}
else {
this.off("change", onChange);
this.off("changeSelection", onChangeSelection);
this.renderer.off("afterRender", updateLineDirection);
this.commands.off("exec", onCommandEmitted);
this.commands.removeCommands(commands);
clearTextLayer(this.renderer);
}
this.renderer.updateFull();
}
},
rtl: {
set: function (val) {
this.session.$bidiHandler.$isRtl = val;
if (val) {
this.setOption("rtlText", false);
this.renderer.on("afterRender", updateLineDirection);
this.session.$bidiHandler.seenBidi = true;
}
else {
this.renderer.off("afterRender", updateLineDirection);
clearTextLayer(this.renderer);
}
this.renderer.updateFull();
}
}
});
function onChangeSelection(e, editor) {
var lead = editor.getSelection().lead;
if (editor.session.$bidiHandler.isRtlLine(lead.row)) {
if (lead.column === 0) {
if (editor.session.$bidiHandler.isMoveLeftOperation && lead.row > 0) {
editor.getSelection().moveCursorTo(lead.row - 1, editor.session.getLine(lead.row - 1).length);
}
else {
if (editor.getSelection().isEmpty())
lead.column += 1;
else
lead.setPosition(lead.row, lead.column + 1);
}
}
}
}
function onCommandEmitted(commadEvent) {
commadEvent.editor.session.$bidiHandler.isMoveLeftOperation = /gotoleft|selectleft|backspace|removewordleft/.test(commadEvent.command.name);
}
function onChange(delta, editor) {
var session = editor.session;
session.$bidiHandler.currentRow = null;
if (session.$bidiHandler.isRtlLine(delta.start.row) && delta.action === 'insert' && delta.lines.length > 1) {
for (var row = delta.start.row; row < delta.end.row; row++) {
if (session.getLine(row + 1).charAt(0) !== session.$bidiHandler.RLE)
session.doc.$lines[row + 1] = session.$bidiHandler.RLE + session.getLine(row + 1);
}
}
}
function updateLineDirection(e, renderer) {
var session = renderer.session;
var $bidiHandler = session.$bidiHandler;
var cells = renderer.$textLayer.$lines.cells;
var width = renderer.layerConfig.width - renderer.layerConfig.padding + "px";
cells.forEach(function (cell) {
var style = cell.element.style;
if ($bidiHandler && $bidiHandler.isRtlLine(cell.row)) {
style.direction = "rtl";
style.textAlign = "right";
style.width = width;
}
else {
style.direction = "";
style.textAlign = "";
style.width = "";
}
});
}
function clearTextLayer(renderer) {
var lines = renderer.$textLayer.$lines;
lines.cells.forEach(clear);
lines.cellCache.forEach(clear);
function clear(cell) {
var style = cell.element.style;
style.direction = style.textAlign = style.width = "";
}
}
}); (function() {
ace.require(["ace/ext/rtl"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,342 @@
ace.define("ace/ext/searchbox-css",["require","exports","module"], function(require, exports, module){module.exports = "\n\n/* ------------------------------------------------------------------------------------------\n * Editor Search Form\n * --------------------------------------------------------------------------------------- */\n.ace_search {\n background-color: #ddd;\n color: #666;\n border: 1px solid #cbcbcb;\n border-top: 0 none;\n overflow: hidden;\n margin: 0;\n padding: 4px 6px 0 4px;\n position: absolute;\n top: 0;\n z-index: 99;\n white-space: normal;\n}\n.ace_search.left {\n border-left: 0 none;\n border-radius: 0px 0px 5px 0px;\n left: 0;\n}\n.ace_search.right {\n border-radius: 0px 0px 0px 5px;\n border-right: 0 none;\n right: 0;\n}\n\n.ace_search_form, .ace_replace_form {\n margin: 0 20px 4px 0;\n overflow: hidden;\n line-height: 1.9;\n}\n.ace_replace_form {\n margin-right: 0;\n}\n.ace_search_form.ace_nomatch {\n outline: 1px solid red;\n}\n\n.ace_search_field {\n border-radius: 3px 0 0 3px;\n background-color: white;\n color: black;\n border: 1px solid #cbcbcb;\n border-right: 0 none;\n outline: 0;\n padding: 0;\n font-size: inherit;\n margin: 0;\n line-height: inherit;\n padding: 0 6px;\n min-width: 17em;\n vertical-align: top;\n min-height: 1.8em;\n box-sizing: content-box;\n}\n.ace_searchbtn {\n border: 1px solid #cbcbcb;\n line-height: inherit;\n display: inline-block;\n padding: 0 6px;\n background: #fff;\n border-right: 0 none;\n border-left: 1px solid #dcdcdc;\n cursor: pointer;\n margin: 0;\n position: relative;\n color: #666;\n}\n.ace_searchbtn:last-child {\n border-radius: 0 3px 3px 0;\n border-right: 1px solid #cbcbcb;\n}\n.ace_searchbtn:disabled {\n background: none;\n cursor: default;\n}\n.ace_searchbtn:hover {\n background-color: #eef1f6;\n}\n.ace_searchbtn.prev, .ace_searchbtn.next {\n padding: 0px 0.7em\n}\n.ace_searchbtn.prev:after, .ace_searchbtn.next:after {\n content: \"\";\n border: solid 2px #888;\n width: 0.5em;\n height: 0.5em;\n border-width: 2px 0 0 2px;\n display:inline-block;\n transform: rotate(-45deg);\n}\n.ace_searchbtn.next:after {\n border-width: 0 2px 2px 0 ;\n}\n.ace_searchbtn_close {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\n border-radius: 50%;\n border: 0 none;\n color: #656565;\n cursor: pointer;\n font: 16px/16px Arial;\n padding: 0;\n height: 14px;\n width: 14px;\n top: 9px;\n right: 7px;\n position: absolute;\n}\n.ace_searchbtn_close:hover {\n background-color: #656565;\n background-position: 50% 100%;\n color: white;\n}\n\n.ace_button {\n margin-left: 2px;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -o-user-select: none;\n -ms-user-select: none;\n user-select: none;\n overflow: hidden;\n opacity: 0.7;\n border: 1px solid rgba(100,100,100,0.23);\n padding: 1px;\n box-sizing: border-box!important;\n color: black;\n}\n\n.ace_button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_button:active {\n background-color: #ddd;\n}\n\n.ace_button.checked {\n border-color: #3399ff;\n opacity:1;\n}\n\n.ace_search_options{\n margin-bottom: 3px;\n text-align: right;\n -webkit-user-select: none;\n -moz-user-select: none;\n -o-user-select: none;\n -ms-user-select: none;\n user-select: none;\n clear: both;\n}\n\n.ace_search_counter {\n float: left;\n font-family: arial;\n padding: 0 8px;\n}";
});
ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/ext/searchbox-css","ace/keyboard/hash_handler","ace/lib/keys","ace/config"], function(require, exports, module){"use strict";
var dom = require("../lib/dom");
var lang = require("../lib/lang");
var event = require("../lib/event");
var searchboxCss = require("./searchbox-css");
var HashHandler = require("../keyboard/hash_handler").HashHandler;
var keyUtil = require("../lib/keys");
var nls = require("../config").nls;
var MAX_COUNT = 999;
dom.importCssString(searchboxCss, "ace_searchbox", false);
var SearchBox = /** @class */ (function () {
function SearchBox(editor, range, showReplaceForm) {
var div = dom.createElement("div");
dom.buildDom(["div", { class: "ace_search right" },
["span", { action: "hide", class: "ace_searchbtn_close" }],
["div", { class: "ace_search_form" },
["input", { class: "ace_search_field", placeholder: nls("Search for"), spellcheck: "false" }],
["span", { action: "findPrev", class: "ace_searchbtn prev" }, "\u200b"],
["span", { action: "findNext", class: "ace_searchbtn next" }, "\u200b"],
["span", { action: "findAll", class: "ace_searchbtn", title: "Alt-Enter" }, nls("All")]
],
["div", { class: "ace_replace_form" },
["input", { class: "ace_search_field", placeholder: nls("Replace with"), spellcheck: "false" }],
["span", { action: "replaceAndFindNext", class: "ace_searchbtn" }, nls("Replace")],
["span", { action: "replaceAll", class: "ace_searchbtn" }, nls("All")]
],
["div", { class: "ace_search_options" },
["span", { action: "toggleReplace", class: "ace_button", title: nls("Toggle Replace mode"),
style: "float:left;margin-top:-2px;padding:0 5px;" }, "+"],
["span", { class: "ace_search_counter" }],
["span", { action: "toggleRegexpMode", class: "ace_button", title: nls("RegExp Search") }, ".*"],
["span", { action: "toggleCaseSensitive", class: "ace_button", title: nls("CaseSensitive Search") }, "Aa"],
["span", { action: "toggleWholeWords", class: "ace_button", title: nls("Whole Word Search") }, "\\b"],
["span", { action: "searchInSelection", class: "ace_button", title: nls("Search In Selection") }, "S"]
]
], div);
this.element = div.firstChild;
this.setSession = this.setSession.bind(this);
this.$init();
this.setEditor(editor);
dom.importCssString(searchboxCss, "ace_searchbox", editor.container);
}
SearchBox.prototype.setEditor = function (editor) {
editor.searchBox = this;
editor.renderer.scroller.appendChild(this.element);
this.editor = editor;
};
SearchBox.prototype.setSession = function (e) {
this.searchRange = null;
this.$syncOptions(true);
};
SearchBox.prototype.$initElements = function (sb) {
this.searchBox = sb.querySelector(".ace_search_form");
this.replaceBox = sb.querySelector(".ace_replace_form");
this.searchOption = sb.querySelector("[action=searchInSelection]");
this.replaceOption = sb.querySelector("[action=toggleReplace]");
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.searchCounter = sb.querySelector(".ace_search_counter");
};
SearchBox.prototype.$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();
});
};
SearchBox.prototype.setSearchRange = function (range) {
this.searchRange = range;
if (range) {
this.searchRangeMarker = this.editor.session.addMarker(range, "ace_active-line");
}
else if (this.searchRangeMarker) {
this.editor.session.removeMarker(this.searchRangeMarker);
this.searchRangeMarker = null;
}
};
SearchBox.prototype.$syncOptions = function (preventScroll) {
dom.setCssClass(this.replaceOption, "checked", this.searchRange);
dom.setCssClass(this.searchOption, "checked", this.searchOption.checked);
this.replaceOption.textContent = this.replaceOption.checked ? "-" : "+";
dom.setCssClass(this.regExpOption, "checked", this.regExpOption.checked);
dom.setCssClass(this.wholeWordOption, "checked", this.wholeWordOption.checked);
dom.setCssClass(this.caseSensitiveOption, "checked", this.caseSensitiveOption.checked);
var readOnly = this.editor.getReadOnly();
this.replaceOption.style.display = readOnly ? "none" : "";
this.replaceBox.style.display = this.replaceOption.checked && !readOnly ? "" : "none";
this.find(false, false, preventScroll);
};
SearchBox.prototype.highlight = function (re) {
this.editor.session.highlight(re || this.editor.$search.$options.re);
this.editor.renderer.updateBackMarkers();
};
SearchBox.prototype.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,
range: this.searchRange
});
var noMatch = !range && this.searchInput.value;
dom.setCssClass(this.searchBox, "ace_nomatch", noMatch);
this.editor._emit("findSearchBox", { match: !noMatch });
this.highlight();
this.updateCounter();
};
SearchBox.prototype.updateCounter = function () {
var editor = this.editor;
var regex = editor.$search.$options.re;
var all = 0;
var before = 0;
if (regex) {
var value = this.searchRange
? editor.session.getTextRange(this.searchRange)
: editor.getValue();
var offset = editor.session.doc.positionToIndex(editor.selection.anchor);
if (this.searchRange)
offset -= editor.session.doc.positionToIndex(this.searchRange.start);
var last = regex.lastIndex = 0;
var m;
while ((m = regex.exec(value))) {
all++;
last = m.index;
if (last <= offset)
before++;
if (all > MAX_COUNT)
break;
if (!m[0]) {
regex.lastIndex = last += 1;
if (last >= value.length)
break;
}
}
}
this.searchCounter.textContent = nls("$0 of $1", [before, (all > MAX_COUNT ? MAX_COUNT + "+" : all)]);
};
SearchBox.prototype.findNext = function () {
this.find(true, false);
};
SearchBox.prototype.findPrev = function () {
this.find(true, true);
};
SearchBox.prototype.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();
};
SearchBox.prototype.replace = function () {
if (!this.editor.getReadOnly())
this.editor.replace(this.replaceInput.value);
};
SearchBox.prototype.replaceAndFindNext = function () {
if (!this.editor.getReadOnly()) {
this.editor.replace(this.replaceInput.value);
this.findNext();
}
};
SearchBox.prototype.replaceAll = function () {
if (!this.editor.getReadOnly())
this.editor.replaceAll(this.replaceInput.value);
};
SearchBox.prototype.hide = function () {
this.active = false;
this.setSearchRange(null);
this.editor.off("changeSession", this.setSession);
this.element.style.display = "none";
this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb);
this.editor.focus();
};
SearchBox.prototype.show = function (value, isReplace) {
this.active = true;
this.editor.on("changeSession", this.setSession);
this.element.style.display = "";
this.replaceOption.checked = isReplace;
if (value)
this.searchInput.value = value;
this.searchInput.focus();
this.searchInput.select();
this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb);
this.$syncOptions(true);
};
SearchBox.prototype.isFocused = function () {
var el = document.activeElement;
return el == this.searchInput || el == this.replaceInput;
};
return SearchBox;
}());
var $searchBarKb = new HashHandler();
$searchBarKb.bindKeys({
"Ctrl-f|Command-f": function (sb) {
var isReplace = sb.isReplace = !sb.isReplace;
sb.replaceBox.style.display = isReplace ? "" : "none";
sb.replaceOption.checked = false;
sb.$syncOptions();
sb.searchInput.focus();
},
"Ctrl-H|Command-Option-F": function (sb) {
if (sb.editor.getReadOnly())
return;
sb.replaceOption.checked = true;
sb.$syncOptions();
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();
}
});
$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();
}
}, {
name: "toggleReplace",
exec: function (sb) {
sb.replaceOption.checked = !sb.replaceOption.checked;
sb.$syncOptions();
}
}, {
name: "searchInSelection",
exec: function (sb) {
sb.searchOption.checked = !sb.searchRange;
sb.setSearchRange(sb.searchOption.checked && sb.editor.getSelectionRange());
sb.$syncOptions();
}
}]);
var $closeSearchBarKb = new HashHandler([{
bindKey: "Esc",
name: "closeSearchBar",
exec: function (editor) {
editor.searchBox.hide();
}
}]);
SearchBox.prototype.$searchBarKb = $searchBarKb;
SearchBox.prototype.$closeSearchBarKb = $closeSearchBarKb;
exports.SearchBox = SearchBox;
exports.Search = function (editor, isReplace) {
var sb = editor.searchBox || new SearchBox(editor);
sb.show(editor.session.getTextRange(), isReplace);
};
}); (function() {
ace.require(["ace/ext/searchbox"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,783 @@
ace.define("ace/ext/menu_tools/settings_menu.css",["require","exports","module"], function(require, exports, module){module.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(require, exports, module){/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
'use strict';
var dom = require("../../lib/dom");
var cssText = require("./settings_menu.css");
dom.importCssString(cssText, "settings_menu.css", false);
module.exports.overlayPage = function overlayPage(editor, contentElement, callback) {
var closer = document.createElement('div');
var ignoreFocusOut = false;
function documentEscListener(e) {
if (e.keyCode === 27) {
close();
}
}
function close() {
if (!closer)
return;
document.removeEventListener('keydown', documentEscListener);
closer.parentNode.removeChild(closer);
if (editor) {
editor.focus();
}
closer = null;
callback && callback();
}
function setIgnoreFocusOut(ignore) {
ignoreFocusOut = ignore;
if (ignore) {
closer.style.pointerEvents = "none";
contentElement.style.pointerEvents = "auto";
}
}
closer.style.cssText = 'margin: 0; padding: 0; ' +
'position: fixed; top:0; bottom:0; left:0; right:0;' +
'z-index: 9990; ' +
(editor ? 'background-color: rgba(0, 0, 0, 0.3);' : '');
closer.addEventListener('click', function (e) {
if (!ignoreFocusOut) {
close();
}
});
document.addEventListener('keydown', documentEscListener);
contentElement.addEventListener('click', function (e) {
e.stopPropagation();
});
closer.appendChild(contentElement);
document.body.appendChild(closer);
if (editor) {
editor.blur();
}
return {
close: close,
setIgnoreFocusOut: setIgnoreFocusOut
};
};
});
ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module){"use strict";
var modes = [];
function getModeForPath(path) {
var mode = modesByName.text;
var fileName = path.split(/[\/\\]/).pop();
for (var i = 0; i < modes.length; i++) {
if (modes[i].supportsFile(fileName)) {
mode = modes[i];
break;
}
}
return mode;
}
var Mode = /** @class */ (function () {
function Mode(name, caption, extensions) {
this.name = name;
this.caption = caption;
this.mode = "ace/mode/" + name;
this.extensions = extensions;
var re;
if (/\^/.test(extensions)) {
re = extensions.replace(/\|(\^)?/g, function (a, b) {
return "$|" + (b ? "^" : "^.*\\.");
}) + "$";
}
else {
re = "^.*\\.(" + extensions + ")$";
}
this.extRe = new RegExp(re, "gi");
}
Mode.prototype.supportsFile = function (filename) {
return filename.match(this.extRe);
};
return Mode;
}());
var supportedModes = {
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_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|vue|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|jsx|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"],
Wollok: ["wlk|wpgm|wtest"],
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
XQuery: ["xq"],
YAML: ["yaml|yml"],
Zeek: ["zeek|bro"]
};
var nameOverrides = {
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"
};
var modesByName = {};
for (var name in supportedModes) {
var data = supportedModes[name];
var displayName = (nameOverrides[name] || name).replace(/_/g, " ");
var filename = name.toLowerCase();
var mode = new Mode(filename, displayName, data[0]);
modesByName[filename] = mode;
modes.push(mode);
}
module.exports = {
getModeForPath: getModeForPath,
modes: modes,
modesByName: modesByName
};
});
ace.define("ace/ext/themelist",["require","exports","module"], function(require, exports, module){/**
* Generates a list of themes available when ace was built.
* @fileOverview Generates a list of themes available when ace was built.
* @author <a href="mailto:matthewkastor@gmail.com">
* Matthew Christopher Kastor-Inare III </a><br />
* Hial Atropa!!
*/
"use strict";
var themeData = [
["Chrome"],
["Clouds"],
["Crimson Editor"],
["Dawn"],
["Dreamweaver"],
["Eclipse"],
["GitHub"],
["IPlastic"],
["Solarized Light"],
["TextMate"],
["Tomorrow"],
["XCode"],
["Kuroir"],
["KatzenMilch"],
["SQL Server", "sqlserver", "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"]
];
exports.themesByName = {};
exports.themes = themeData.map(function (data) {
var name = data[1] || data[0].replace(/ /g, "_").toLowerCase();
var theme = {
caption: data[0],
theme: "ace/theme/" + name,
isDark: data[2] == "dark",
name: name
};
exports.themesByName[name] = theme;
return theme;
});
});
ace.define("ace/ext/options",["require","exports","module","ace/ext/menu_tools/overlay_page","ace/lib/dom","ace/lib/oop","ace/config","ace/lib/event_emitter","ace/ext/modelist","ace/ext/themelist"], function(require, exports, module){"use strict";
require("./menu_tools/overlay_page");
var dom = require("../lib/dom");
var oop = require("../lib/oop");
var config = require("../config");
var EventEmitter = require("../lib/event_emitter").EventEmitter;
var buildDom = dom.buildDom;
var modelist = require("./modelist");
var themelist = require("./themelist");
var themes = { Bright: [], Dark: [] };
themelist.themes.forEach(function (x) {
themes[x.isDark ? "Dark" : "Bright"].push({ caption: x.caption, value: x.theme });
});
var modes = modelist.modes.map(function (x) {
return { caption: x.caption, value: x.mode };
});
var optionGroups = {
Main: {
Mode: {
path: "mode",
type: "select",
items: modes
},
Theme: {
path: "theme",
type: "select",
items: themes
},
"Keybinding": {
type: "buttonBar",
path: "keyboardHandler",
items: [
{ caption: "Ace", value: null },
{ caption: "Vim", value: "ace/keyboard/vim" },
{ caption: "Emacs", value: "ace/keyboard/emacs" },
{ caption: "Sublime", value: "ace/keyboard/sublime" },
{ caption: "VSCode", value: "ace/keyboard/vscode" }
]
},
"Font Size": {
path: "fontSize",
type: "number",
defaultValue: 12,
defaults: [
{ caption: "12px", value: 12 },
{ caption: "24px", value: 24 }
]
},
"Soft Wrap": {
type: "buttonBar",
path: "wrap",
items: [
{ caption: "Off", value: "off" },
{ caption: "View", value: "free" },
{ caption: "margin", value: "printMargin" },
{ caption: "40", value: "40" }
]
},
"Cursor Style": {
path: "cursorStyle",
items: [
{ caption: "Ace", value: "ace" },
{ caption: "Slim", value: "slim" },
{ caption: "Smooth", value: "smooth" },
{ caption: "Smooth And Slim", value: "smooth slim" },
{ caption: "Wide", value: "wide" }
]
},
"Folding": {
path: "foldStyle",
items: [
{ caption: "Manual", value: "manual" },
{ caption: "Mark begin", value: "markbegin" },
{ caption: "Mark begin and end", value: "markbeginend" }
]
},
"Soft Tabs": [{
path: "useSoftTabs"
}, {
ariaLabel: "Tab Size",
path: "tabSize",
type: "number",
values: [2, 3, 4, 8, 16]
}],
"Overscroll": {
type: "buttonBar",
path: "scrollPastEnd",
items: [
{ caption: "None", value: 0 },
{ caption: "Half", value: 0.5 },
{ caption: "Full", value: 1 }
]
}
},
More: {
"Atomic soft tabs": {
path: "navigateWithinSoftTabs"
},
"Enable Behaviours": {
path: "behavioursEnabled"
},
"Wrap with quotes": {
path: "wrapBehavioursEnabled"
},
"Enable Auto Indent": {
path: "enableAutoIndent"
},
"Full Line Selection": {
type: "checkbox",
values: "text|line",
path: "selectionStyle"
},
"Highlight Active Line": {
path: "highlightActiveLine"
},
"Show Invisibles": {
path: "showInvisibles"
},
"Show Indent Guides": {
path: "displayIndentGuides"
},
"Highlight Indent Guides": {
path: "highlightIndentGuides"
},
"Persistent HScrollbar": {
path: "hScrollBarAlwaysVisible"
},
"Persistent VScrollbar": {
path: "vScrollBarAlwaysVisible"
},
"Animate scrolling": {
path: "animatedScroll"
},
"Show Gutter": {
path: "showGutter"
},
"Show Line Numbers": {
path: "showLineNumbers"
},
"Relative Line Numbers": {
path: "relativeLineNumbers"
},
"Fixed Gutter Width": {
path: "fixedWidthGutter"
},
"Show Print Margin": [{
path: "showPrintMargin"
}, {
ariaLabel: "Print Margin",
type: "number",
path: "printMarginColumn"
}],
"Indented Soft Wrap": {
path: "indentedSoftWrap"
},
"Highlight selected word": {
path: "highlightSelectedWord"
},
"Fade Fold Widgets": {
path: "fadeFoldWidgets"
},
"Use textarea for IME": {
path: "useTextareaForIME"
},
"Merge Undo Deltas": {
path: "mergeUndoDeltas",
items: [
{ caption: "Always", value: "always" },
{ caption: "Never", value: "false" },
{ caption: "Timed", value: "true" }
]
},
"Elastic Tabstops": {
path: "useElasticTabstops"
},
"Incremental Search": {
path: "useIncrementalSearch"
},
"Read-only": {
path: "readOnly"
},
"Copy without selection": {
path: "copyWithEmptySelection"
},
"Live Autocompletion": {
path: "enableLiveAutocompletion"
},
"Custom scrollbar": {
path: "customScrollbar"
},
"Use SVG gutter icons": {
path: "useSvgGutterIcons"
},
"Annotations for folded lines": {
path: "showFoldedAnnotations"
},
"Keyboard Accessibility Mode": {
path: "enableKeyboardAccessibility"
},
"Gutter tooltip follows mouse": {
path: "tooltipFollowsMouse",
defaultValue: true
}
}
};
var OptionPanel = /** @class */ (function () {
function OptionPanel(editor, element) {
this.editor = editor;
this.container = element || document.createElement("div");
this.groups = [];
this.options = {};
}
OptionPanel.prototype.add = function (config) {
if (config.Main)
oop.mixin(optionGroups.Main, config.Main);
if (config.More)
oop.mixin(optionGroups.More, config.More);
};
OptionPanel.prototype.render = function () {
this.container.innerHTML = "";
buildDom(["table", { role: "presentation", id: "controls" },
this.renderOptionGroup(optionGroups.Main),
["tr", null, ["td", { colspan: 2 },
["table", { role: "presentation", id: "more-controls" },
this.renderOptionGroup(optionGroups.More)
]
]],
["tr", null, ["td", { colspan: 2 }, "version " + config.version]]
], this.container);
};
OptionPanel.prototype.renderOptionGroup = function (group) {
return Object.keys(group).map(function (key, i) {
var item = group[key];
if (!item.position)
item.position = i / 10000;
if (!item.label)
item.label = key;
return item;
}).sort(function (a, b) {
return a.position - b.position;
}).map(function (item) {
return this.renderOption(item.label, item);
}, this);
};
OptionPanel.prototype.renderOptionControl = function (key, option) {
var self = this;
if (Array.isArray(option)) {
return option.map(function (x) {
return self.renderOptionControl(key, x);
});
}
var control;
var value = self.getOption(option);
if (option.values && option.type != "checkbox") {
if (typeof option.values == "string")
option.values = option.values.split("|");
option.items = option.values.map(function (v) {
return { value: v, name: v };
});
}
if (option.type == "buttonBar") {
control = ["div", { role: "group", "aria-labelledby": option.path + "-label" }, option.items.map(function (item) {
return ["button", {
value: item.value,
ace_selected_button: value == item.value,
'aria-pressed': value == item.value,
onclick: function () {
self.setOption(option, item.value);
var nodes = this.parentNode.querySelectorAll("[ace_selected_button]");
for (var i = 0; i < nodes.length; i++) {
nodes[i].removeAttribute("ace_selected_button");
nodes[i].setAttribute("aria-pressed", false);
}
this.setAttribute("ace_selected_button", true);
this.setAttribute("aria-pressed", true);
}
}, item.desc || item.caption || item.name];
})];
}
else if (option.type == "number") {
control = ["input", { type: "number", value: value || option.defaultValue, style: "width:3em", oninput: function () {
self.setOption(option, parseInt(this.value));
} }];
if (option.ariaLabel) {
control[1]["aria-label"] = option.ariaLabel;
}
else {
control[1].id = key;
}
if (option.defaults) {
control = [control, option.defaults.map(function (item) {
return ["button", { onclick: function () {
var input = this.parentNode.firstChild;
input.value = item.value;
input.oninput();
} }, item.caption];
})];
}
}
else if (option.items) {
var buildItems = function (items) {
return items.map(function (item) {
return ["option", { value: item.value || item.name }, item.desc || item.caption || item.name];
});
};
var items = Array.isArray(option.items)
? buildItems(option.items)
: Object.keys(option.items).map(function (key) {
return ["optgroup", { "label": key }, buildItems(option.items[key])];
});
control = ["select", { id: key, value: value, onchange: function () {
self.setOption(option, this.value);
} }, items];
}
else {
if (typeof option.values == "string")
option.values = option.values.split("|");
if (option.values)
value = value == option.values[1];
control = ["input", { type: "checkbox", id: key, checked: value || null, onchange: function () {
var value = this.checked;
if (option.values)
value = option.values[value ? 1 : 0];
self.setOption(option, value);
} }];
if (option.type == "checkedNumber") {
control = [control, []];
}
}
return control;
};
OptionPanel.prototype.renderOption = function (key, option) {
if (option.path && !option.onchange && !this.editor.$options[option.path])
return;
var path = Array.isArray(option) ? option[0].path : option.path;
this.options[path] = option;
var safeKey = "-" + path;
var safeId = path + "-label";
var control = this.renderOptionControl(safeKey, option);
return ["tr", { class: "ace_optionsMenuEntry" }, ["td",
["label", { for: safeKey, id: safeId }, key]
], ["td", control]];
};
OptionPanel.prototype.setOption = function (option, value) {
if (typeof option == "string")
option = this.options[option];
if (value == "false")
value = false;
if (value == "true")
value = true;
if (value == "null")
value = null;
if (value == "undefined")
value = undefined;
if (typeof value == "string" && parseFloat(value).toString() == value)
value = parseFloat(value);
if (option.onchange)
option.onchange(value);
else if (option.path)
this.editor.setOption(option.path, value);
this._signal("setOption", { name: option.path, value: value });
};
OptionPanel.prototype.getOption = function (option) {
if (option.getValue)
return option.getValue();
return this.editor.getOption(option.path);
};
return OptionPanel;
}());
oop.implement(OptionPanel.prototype, EventEmitter);
exports.OptionPanel = OptionPanel;
});
ace.define("ace/ext/settings_menu",["require","exports","module","ace/ext/options","ace/ext/menu_tools/overlay_page","ace/editor"], function(require, exports, module){/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
"use strict";
var OptionPanel = require("./options").OptionPanel;
var overlayPage = require('./menu_tools/overlay_page').overlayPage;
function showSettingsMenu(editor) {
if (!document.getElementById('ace_settingsmenu')) {
var options = new OptionPanel(editor);
options.render();
options.container.id = "ace_settingsmenu";
overlayPage(editor, options.container);
options.container.querySelector("select,input,button,checkbox").focus();
}
}
module.exports.init = function () {
var Editor = require("../editor").Editor;
Editor.prototype.showSettingsMenu = function () {
showSettingsMenu(this);
};
};
}); (function() {
ace.require(["ace/ext/settings_menu"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,45 @@
ace.define("ace/ext/simple_tokenizer",["require","exports","module","ace/tokenizer","ace/layer/text_util"], function(require, exports, module){"use strict";
var Tokenizer = require("../tokenizer").Tokenizer;
var isTextToken = require("../layer/text_util").isTextToken;
var SimpleTokenizer = /** @class */ (function () {
function SimpleTokenizer(content, tokenizer) {
this._lines = content.split(/\r\n|\r|\n/);
this._states = [];
this._tokenizer = tokenizer;
}
SimpleTokenizer.prototype.getTokens = function (row) {
var line = this._lines[row];
var previousState = this._states[row - 1];
var data = this._tokenizer.getLineTokens(line, previousState);
this._states[row] = data.state;
return data.tokens;
};
SimpleTokenizer.prototype.getLength = function () {
return this._lines.length;
};
return SimpleTokenizer;
}());
function tokenize(content, highlightRules) {
var tokenizer = new SimpleTokenizer(content, new Tokenizer(highlightRules.getRules()));
var result = [];
for (var lineIndex = 0; lineIndex < tokenizer.getLength(); lineIndex++) {
var lineTokens = tokenizer.getTokens(lineIndex);
result.push(lineTokens.map(function (token) { return ({
className: isTextToken(token.type) ? undefined : "ace_" + token.type.replace(/\./g, " ace_"),
value: token.value
}); }));
}
return result;
}
module.exports = {
tokenize: tokenize
};
}); (function() {
ace.require(["ace/ext/simple_tokenizer"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,67 @@
ace.define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"], function(require, exports, module){"use strict";
var event = require("../lib/event");
exports.contextMenuHandler = function (e) {
var host = e.target;
var text = host.textInput.getElement();
if (!host.selection.isEmpty())
return;
var c = host.getCursorPosition();
var r = host.session.getWordRange(c.row, c.column);
var w = host.session.getTextRange(r);
host.session.tokenRe.lastIndex = 0;
if (!host.session.tokenRe.test(w))
return;
var PLACEHOLDER = "\x01\x01";
var value = w + " " + PLACEHOLDER;
text.value = value;
text.setSelectionRange(w.length, w.length + 1);
text.setSelectionRange(0, 0);
text.setSelectionRange(0, w.length);
var afterKeydown = false;
event.addListener(text, "keydown", function onKeydown() {
event.removeListener(text, "keydown", onKeydown);
afterKeydown = true;
});
host.textInput.setInputHandler(function (newVal) {
if (newVal == value)
return '';
if (newVal.lastIndexOf(value, 0) === 0)
return newVal.slice(value.length);
if (newVal.substr(text.selectionEnd) == value)
return newVal.slice(0, -value.length);
if (newVal.slice(-2) == PLACEHOLDER) {
var val = newVal.slice(0, -2);
if (val.slice(-1) == " ") {
if (afterKeydown)
return val.substring(0, text.selectionEnd);
val = val.slice(0, -1);
host.session.replace(r, val);
return "";
}
}
return newVal;
});
};
var Editor = require("../editor").Editor;
require("../config").defineOptions(Editor.prototype, "editor", {
spellcheck: {
set: function (val) {
var text = this.textInput.getElement();
text.spellcheck = !!val;
if (!val)
this.removeListener("nativecontextmenu", exports.contextMenuHandler);
else
this.on("nativecontextmenu", exports.contextMenuHandler);
},
value: true
}
});
}); (function() {
ace.require(["ace/ext/spellcheck"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,185 @@
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(require, exports, module){"use strict";
var oop = require("./lib/oop");
var lang = require("./lib/lang");
var EventEmitter = require("./lib/event_emitter").EventEmitter;
var Editor = require("./editor").Editor;
var Renderer = require("./virtual_renderer").VirtualRenderer;
var EditSession = require("./edit_session").EditSession;
var Split = function (container, theme, splits) {
this.BELOW = 1;
this.BESIDE = 0;
this.$container = container;
this.$theme = theme;
this.$splits = 0;
this.$editorCSS = "";
this.$editors = [];
this.$orientation = this.BESIDE;
this.setSplits(splits || 1);
this.$cEditor = this.$editors[0];
this.on("focus", function (editor) {
this.$cEditor = editor;
}.bind(this));
};
(function () {
oop.implement(this, EventEmitter);
this.$createEditor = function () {
var el = document.createElement("div");
el.className = this.$editorCSS;
el.style.cssText = "position: absolute; top:0px; bottom:0px";
this.$container.appendChild(el);
var editor = new Editor(new Renderer(el, this.$theme));
editor.on("focus", function () {
this._emit("focus", editor);
}.bind(this));
this.$editors.push(editor);
editor.setFontSize(this.$fontSize);
return editor;
};
this.setSplits = function (splits) {
var editor;
if (splits < 1) {
throw "The number of splits have to be > 0!";
}
if (splits == this.$splits) {
return;
}
else if (splits > this.$splits) {
while (this.$splits < this.$editors.length && this.$splits < splits) {
editor = this.$editors[this.$splits];
this.$container.appendChild(editor.container);
editor.setFontSize(this.$fontSize);
this.$splits++;
}
while (this.$splits < splits) {
this.$createEditor();
this.$splits++;
}
}
else {
while (this.$splits > splits) {
editor = this.$editors[this.$splits - 1];
this.$container.removeChild(editor.container);
this.$splits--;
}
}
this.resize();
};
this.getSplits = function () {
return this.$splits;
};
this.getEditor = function (idx) {
return this.$editors[idx];
};
this.getCurrentEditor = function () {
return this.$cEditor;
};
this.focus = function () {
this.$cEditor.focus();
};
this.blur = function () {
this.$cEditor.blur();
};
this.setTheme = function (theme) {
this.$editors.forEach(function (editor) {
editor.setTheme(theme);
});
};
this.setKeyboardHandler = function (keybinding) {
this.$editors.forEach(function (editor) {
editor.setKeyboardHandler(keybinding);
});
};
this.forEach = function (callback, scope) {
this.$editors.forEach(callback, scope);
};
this.$fontSize = "";
this.setFontSize = function (size) {
this.$fontSize = size;
this.forEach(function (editor) {
editor.setFontSize(size);
});
};
this.$cloneSession = function (session) {
var s = new EditSession(session.getDocument(), session.getMode());
var undoManager = session.getUndoManager();
s.setUndoManager(undoManager);
s.setTabSize(session.getTabSize());
s.setUseSoftTabs(session.getUseSoftTabs());
s.setOverwrite(session.getOverwrite());
s.setBreakpoints(session.getBreakpoints());
s.setUseWrapMode(session.getUseWrapMode());
s.setUseWorker(session.getUseWorker());
s.setWrapLimitRange(session.$wrapLimitRange.min, session.$wrapLimitRange.max);
s.$foldData = session.$cloneFoldData();
return s;
};
this.setSession = function (session, idx) {
var editor;
if (idx == null) {
editor = this.$cEditor;
}
else {
editor = this.$editors[idx];
}
var isUsed = this.$editors.some(function (editor) {
return editor.session === session;
});
if (isUsed) {
session = this.$cloneSession(session);
}
editor.setSession(session);
return session;
};
this.getOrientation = function () {
return this.$orientation;
};
this.setOrientation = function (orientation) {
if (this.$orientation == orientation) {
return;
}
this.$orientation = orientation;
this.resize();
};
this.resize = function () {
var width = this.$container.clientWidth;
var height = this.$container.clientHeight;
var editor;
if (this.$orientation == this.BESIDE) {
var editorWidth = width / this.$splits;
for (var i = 0; i < this.$splits; i++) {
editor = this.$editors[i];
editor.container.style.width = editorWidth + "px";
editor.container.style.top = "0px";
editor.container.style.left = i * editorWidth + "px";
editor.container.style.height = height + "px";
editor.resize();
}
}
else {
var editorHeight = height / this.$splits;
for (var i = 0; i < this.$splits; i++) {
editor = this.$editors[i];
editor.container.style.width = width + "px";
editor.container.style.top = i * editorHeight + "px";
editor.container.style.left = "0px";
editor.container.style.height = editorHeight + "px";
editor.resize();
}
}
};
}).call(Split.prototype);
exports.Split = Split;
});
ace.define("ace/ext/split",["require","exports","module","ace/split"], function(require, exports, module){"use strict";
module.exports = require("../split");
}); (function() {
ace.require(["ace/ext/split"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,184 @@
ace.define("ace/ext/static-css",["require","exports","module"], function(require, exports, module){module.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(require, exports, module){"use strict";
var EditSession = require("../edit_session").EditSession;
var TextLayer = require("../layer/text").Text;
var baseStyles = require("./static-css");
var config = require("../config");
var dom = require("../lib/dom");
var escapeHTML = require("../lib/lang").escapeHTML;
var Element = /** @class */ (function () {
function Element(type) {
this.type = type;
this.style = {};
this.textContent = "";
}
Element.prototype.cloneNode = function () {
return this;
};
Element.prototype.appendChild = function (child) {
this.textContent += child.toString();
};
Element.prototype.toString = function () {
var stringBuilder = [];
if (this.type != "fragment") {
stringBuilder.push("<", this.type);
if (this.className)
stringBuilder.push(" class='", this.className, "'");
var styleStr = [];
for (var key in this.style) {
styleStr.push(key, ":", this.style[key]);
}
if (styleStr.length)
stringBuilder.push(" style='", styleStr.join(""), "'");
stringBuilder.push(">");
}
if (this.textContent) {
stringBuilder.push(this.textContent);
}
if (this.type != "fragment") {
stringBuilder.push("</", this.type, ">");
}
return stringBuilder.join("");
};
return Element;
}());
var simpleDom = {
createTextNode: function (textContent, element) {
return escapeHTML(textContent);
},
createElement: function (type) {
return new Element(type);
},
createFragment: function () {
return new Element("fragment");
}
};
var SimpleTextLayer = function () {
this.config = {};
this.dom = simpleDom;
};
SimpleTextLayer.prototype = TextLayer.prototype;
var highlight = function (el, opts, callback) {
var m = el.className.match(/lang-(\w+)/);
var mode = opts.mode || m && ("ace/mode/" + m[1]);
if (!mode)
return false;
var theme = opts.theme || "ace/theme/textmate";
var data = "";
var nodes = [];
if (el.firstElementChild) {
var textLen = 0;
for (var i = 0; i < el.childNodes.length; i++) {
var ch = el.childNodes[i];
if (ch.nodeType == 3) {
textLen += ch.data.length;
data += ch.data;
}
else {
nodes.push(textLen, ch);
}
}
}
else {
data = el.textContent;
if (opts.trim)
data = data.trim();
}
highlight.render(data, mode, theme, opts.firstLineNumber, !opts.showGutter, function (highlighted) {
dom.importCssString(highlighted.css, "ace_highlight", true);
el.innerHTML = highlighted.html;
var container = el.firstChild.firstChild;
for (var i = 0; i < nodes.length; i += 2) {
var pos = highlighted.session.doc.indexToPosition(nodes[i]);
var node = nodes[i + 1];
var lineEl = container.children[pos.row];
lineEl && lineEl.appendChild(node);
}
callback && callback();
});
};
highlight.render = function (input, mode, theme, lineStart, disableGutter, callback) {
var waiting = 1;
var modeCache = EditSession.prototype.$modes;
if (typeof theme == "string") {
waiting++;
config.loadModule(['theme', theme], function (m) {
theme = m;
--waiting || done();
});
}
var modeOptions;
if (mode && typeof mode === "object" && !mode.getTokenizer) {
modeOptions = mode;
mode = modeOptions.path;
}
if (typeof mode == "string") {
waiting++;
config.loadModule(['mode', mode], function (m) {
if (!modeCache[mode] || modeOptions)
modeCache[mode] = new m.Mode(modeOptions);
mode = modeCache[mode];
--waiting || done();
});
}
function done() {
var result = highlight.renderSync(input, mode, theme, lineStart, disableGutter);
return callback ? callback(result) : result;
}
return --waiting || done();
};
highlight.renderSync = function (input, mode, theme, lineStart, disableGutter) {
lineStart = parseInt(lineStart || 1, 10);
var session = new EditSession("");
session.setUseWorker(false);
session.setMode(mode);
var textLayer = new SimpleTextLayer();
textLayer.setSession(session);
Object.keys(textLayer.$tabStrings).forEach(function (k) {
if (typeof textLayer.$tabStrings[k] == "string") {
var el = simpleDom.createFragment();
el.textContent = textLayer.$tabStrings[k];
textLayer.$tabStrings[k] = el;
}
});
session.setValue(input);
var length = session.getLength();
var outerEl = simpleDom.createElement("div");
outerEl.className = theme.cssClass;
var innerEl = simpleDom.createElement("div");
innerEl.className = "ace_static_highlight" + (disableGutter ? "" : " ace_show_gutter");
innerEl.style["counter-reset"] = "ace_line " + (lineStart - 1);
for (var ix = 0; ix < length; ix++) {
var lineEl = simpleDom.createElement("div");
lineEl.className = "ace_line";
if (!disableGutter) {
var gutterEl = simpleDom.createElement("span");
gutterEl.className = "ace_gutter ace_gutter-cell";
gutterEl.textContent = "";
lineEl.appendChild(gutterEl);
}
textLayer.$renderLine(lineEl, ix, false);
lineEl.textContent += "\n";
innerEl.appendChild(lineEl);
}
outerEl.appendChild(innerEl);
return {
css: baseStyles + theme.cssText,
html: outerEl.toString(),
session: session
};
};
module.exports = highlight;
module.exports.highlight = highlight;
}); (function() {
ace.require(["ace/ext/static_highlight"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,48 @@
ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"], function(require, exports, module){"use strict";
var dom = require("../lib/dom");
var lang = require("../lib/lang");
var StatusBar = /** @class */ (function () {
function StatusBar(editor, parentNode) {
this.element = dom.createElement("div");
this.element.className = "ace_status-indicator";
this.element.style.cssText = "display: inline-block;";
parentNode.appendChild(this.element);
var statusUpdate = lang.delayedCall(function () {
this.updateStatus(editor);
}.bind(this)).schedule.bind(null, 100);
editor.on("changeStatus", statusUpdate);
editor.on("changeSelection", statusUpdate);
editor.on("keyboardActivity", statusUpdate);
}
StatusBar.prototype.updateStatus = function (editor) {
var status = [];
function add(str, separator) {
str && status.push(str, separator || "|");
}
add(editor.keyBinding.getStatusText(editor));
if (editor.commands.recording)
add("REC");
var sel = editor.selection;
var c = sel.lead;
if (!sel.isEmpty()) {
var r = editor.getSelectionRange();
add("(" + (r.end.row - r.start.row) + ":" + (r.end.column - r.start.column) + ")", " ");
}
add(c.row + ":" + c.column, " ");
if (sel.rangeCount)
add("[" + sel.rangeCount + "]", " ");
status.pop();
this.element.textContent = status.join("");
};
return StatusBar;
}());
exports.StatusBar = StatusBar;
}); (function() {
ace.require(["ace/ext/statusbar"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,380 @@
ace.define("ace/ext/textarea",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/ace"], function(require, exports, module){"use strict";
var event = require("../lib/event");
var UA = require("../lib/useragent");
var ace = require("../ace");
module.exports = exports = ace;
var getCSSProperty = function (element, container, property) {
var ret = element.style[property];
if (!ret) {
if (window.getComputedStyle) {
ret = window.getComputedStyle(element, '').getPropertyValue(property);
}
else {
ret = element.currentStyle[property];
}
}
if (!ret || ret == 'auto' || ret == 'intrinsic') {
ret = container.style[property];
}
return ret;
};
function applyStyles(elm, styles) {
for (var style in styles) {
elm.style[style] = styles[style];
}
}
function setupContainer(element, getValue) {
if (element.type != 'textarea') {
throw new Error("Textarea required!");
}
var parentNode = element.parentNode;
var container = document.createElement('div');
var resizeEvent = function () {
var style = 'position:relative;';
[
'margin-top', 'margin-left', 'margin-right', 'margin-bottom'
].forEach(function (item) {
style += item + ':' +
getCSSProperty(element, container, item) + ';';
});
var width = getCSSProperty(element, container, 'width') || (element.clientWidth + "px");
var height = getCSSProperty(element, container, 'height') || (element.clientHeight + "px");
style += 'height:' + height + ';width:' + width + ';';
style += 'display:inline-block;';
container.setAttribute('style', style);
};
event.addListener(window, 'resize', resizeEvent);
resizeEvent();
parentNode.insertBefore(container, element.nextSibling);
while (parentNode !== document) {
if (parentNode.tagName.toUpperCase() === 'FORM') {
var oldSumit = parentNode.onsubmit;
parentNode.onsubmit = function (evt) {
element.value = getValue();
if (oldSumit) {
oldSumit.call(this, evt);
}
};
break;
}
parentNode = parentNode.parentNode;
}
return container;
}
exports.transformTextarea = function (element, options) {
var isFocused = element.autofocus || document.activeElement == element;
var session;
var container = setupContainer(element, function () {
return session.getValue();
});
element.style.display = 'none';
container.style.background = 'white';
var editorDiv = document.createElement("div");
applyStyles(editorDiv, {
top: "0px",
left: "0px",
right: "0px",
bottom: "0px",
border: "1px solid gray",
position: "absolute"
});
container.appendChild(editorDiv);
var settingOpener = document.createElement("div");
applyStyles(settingOpener, {
position: "absolute",
right: "0px",
bottom: "0px",
cursor: "nw-resize",
border: "solid 9px",
borderColor: "lightblue gray gray #ceade6",
zIndex: 101
});
var settingDiv = document.createElement("div");
var settingDivStyles = {
top: "0px",
left: "20%",
right: "0px",
bottom: "0px",
position: "absolute",
padding: "5px",
zIndex: 100,
color: "white",
display: "none",
overflow: "auto",
fontSize: "14px",
boxShadow: "-5px 2px 3px gray"
};
if (!UA.isOldIE) {
settingDivStyles.backgroundColor = "rgba(0, 0, 0, 0.6)";
}
else {
settingDivStyles.backgroundColor = "#333";
}
applyStyles(settingDiv, settingDivStyles);
container.appendChild(settingDiv);
options = options || exports.defaultOptions;
var editor = ace.edit(editorDiv);
session = editor.getSession();
session.setValue(element.value || element.innerHTML);
if (isFocused)
editor.focus();
container.appendChild(settingOpener);
setupApi(editor, editorDiv, settingDiv, ace, options);
setupSettingPanel(settingDiv, settingOpener, editor);
var state = "";
event.addListener(settingOpener, "mousemove", function (e) {
var rect = this.getBoundingClientRect();
var x = e.clientX - rect.left, y = e.clientY - rect.top;
if (x + y < (rect.width + rect.height) / 2) {
this.style.cursor = "pointer";
state = "toggle";
}
else {
state = "resize";
this.style.cursor = "nw-resize";
}
});
event.addListener(settingOpener, "mousedown", function (e) {
e.preventDefault();
if (state == "toggle") {
editor.setDisplaySettings();
return;
}
container.style.zIndex = 100000;
var rect = container.getBoundingClientRect();
var startX = rect.width + rect.left - e.clientX;
var startY = rect.height + rect.top - e.clientY;
event.capture(settingOpener, function (e) {
container.style.width = e.clientX - rect.left + startX + "px";
container.style.height = e.clientY - rect.top + startY + "px";
editor.resize();
}, function () { });
});
return editor;
};
function setupApi(editor, editorDiv, settingDiv, ace, options) {
function toBool(value) {
return value === "true" || value == true;
}
editor.setDisplaySettings = function (display) {
if (display == null)
display = settingDiv.style.display == "none";
if (display) {
settingDiv.style.display = "block";
settingDiv.hideButton.focus();
editor.on("focus", function onFocus() {
editor.removeListener("focus", onFocus);
settingDiv.style.display = "none";
});
}
else {
editor.focus();
}
};
editor.$setOption = editor.setOption;
editor.$getOption = editor.getOption;
editor.setOption = function (key, value) {
switch (key) {
case "mode":
editor.$setOption("mode", "ace/mode/" + value);
break;
case "theme":
editor.$setOption("theme", "ace/theme/" + value);
break;
case "keybindings":
switch (value) {
case "vim":
editor.setKeyboardHandler("ace/keyboard/vim");
break;
case "emacs":
editor.setKeyboardHandler("ace/keyboard/emacs");
break;
default:
editor.setKeyboardHandler(null);
}
break;
case "wrap":
case "fontSize":
editor.$setOption(key, value);
break;
default:
editor.$setOption(key, toBool(value));
}
};
editor.getOption = function (key) {
switch (key) {
case "mode":
return editor.$getOption("mode").substr("ace/mode/".length);
break;
case "theme":
return editor.$getOption("theme").substr("ace/theme/".length);
break;
case "keybindings":
var value = editor.getKeyboardHandler();
switch (value && value.$id) {
case "ace/keyboard/vim":
return "vim";
case "ace/keyboard/emacs":
return "emacs";
default:
return "ace";
}
break;
default:
return editor.$getOption(key);
}
};
editor.setOptions(options);
return editor;
}
function setupSettingPanel(settingDiv, settingOpener, editor) {
var BOOL = null;
var desc = {
mode: "Mode:",
wrap: "Soft Wrap:",
theme: "Theme:",
fontSize: "Font Size:",
showGutter: "Display Gutter:",
keybindings: "Keyboard",
showPrintMargin: "Show Print Margin:",
useSoftTabs: "Use Soft Tabs:",
showInvisibles: "Show Invisibles"
};
var optionValues = {
mode: {
text: "Plain",
javascript: "JavaScript",
xml: "XML",
html: "HTML",
css: "CSS",
scss: "SCSS",
python: "Python",
php: "PHP",
java: "Java",
ruby: "Ruby",
c_cpp: "C/C++",
coffee: "CoffeeScript",
json: "json",
perl: "Perl",
clojure: "Clojure",
ocaml: "OCaml",
csharp: "C#",
haxe: "haXe",
svg: "SVG",
textile: "Textile",
groovy: "Groovy",
liquid: "Liquid",
Scala: "Scala"
},
theme: {
clouds: "Clouds",
clouds_midnight: "Clouds Midnight",
cobalt: "Cobalt",
crimson_editor: "Crimson Editor",
dawn: "Dawn",
gob: "Green on Black",
eclipse: "Eclipse",
idle_fingers: "Idle Fingers",
kr_theme: "Kr Theme",
merbivore: "Merbivore",
merbivore_soft: "Merbivore Soft",
mono_industrial: "Mono Industrial",
monokai: "Monokai",
pastel_on_dark: "Pastel On Dark",
solarized_dark: "Solarized Dark",
solarized_light: "Solarized Light",
textmate: "Textmate",
twilight: "Twilight",
vibrant_ink: "Vibrant Ink"
},
showGutter: BOOL,
fontSize: {
"10px": "10px",
"11px": "11px",
"12px": "12px",
"14px": "14px",
"16px": "16px"
},
wrap: {
off: "Off",
40: "40",
80: "80",
free: "Free"
},
keybindings: {
ace: "ace",
vim: "vim",
emacs: "emacs"
},
showPrintMargin: BOOL,
useSoftTabs: BOOL,
showInvisibles: BOOL
};
var table = [];
table.push("<table><tr><th>Setting</th><th>Value</th></tr>");
function renderOption(builder, option, obj, cValue) {
if (!obj) {
builder.push("<input type='checkbox' title='", option, "' ", cValue + "" == "true" ? "checked='true'" : "", "'></input>");
return;
}
builder.push("<select title='" + option + "'>");
for (var value in obj) {
builder.push("<option value='" + value + "' ");
if (cValue == value) {
builder.push(" selected ");
}
builder.push(">", obj[value], "</option>");
}
builder.push("</select>");
}
for (var option in exports.defaultOptions) {
table.push("<tr><td>", desc[option], "</td>");
table.push("<td>");
renderOption(table, option, optionValues[option], editor.getOption(option));
table.push("</td></tr>");
}
table.push("</table>");
settingDiv.innerHTML = table.join("");
var onChange = function (e) {
var select = e.currentTarget;
editor.setOption(select.title, select.value);
};
var onClick = function (e) {
var cb = e.currentTarget;
editor.setOption(cb.title, cb.checked);
};
var selects = settingDiv.getElementsByTagName("select");
for (var i = 0; i < selects.length; i++)
selects[i].onchange = onChange;
var cbs = settingDiv.getElementsByTagName("input");
for (var i = 0; i < cbs.length; i++)
cbs[i].onclick = onClick;
var button = document.createElement("input");
button.type = "button";
button.value = "Hide";
event.addListener(button, "click", function () {
editor.setDisplaySettings(false);
});
settingDiv.appendChild(button);
settingDiv.hideButton = button;
}
exports.defaultOptions = {
mode: "javascript",
theme: "textmate",
wrap: "off",
fontSize: "12px",
showGutter: "false",
keybindings: "ace",
showPrintMargin: "false",
useSoftTabs: "true",
showInvisibles: "false"
};
}); (function() {
ace.require(["ace/ext/textarea"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,71 @@
ace.define("ace/ext/themelist",["require","exports","module"], function(require, exports, module){/**
* Generates a list of themes available when ace was built.
* @fileOverview Generates a list of themes available when ace was built.
* @author <a href="mailto:matthewkastor@gmail.com">
* Matthew Christopher Kastor-Inare III </a><br />
* Hial Atropa!!
*/
"use strict";
var themeData = [
["Chrome"],
["Clouds"],
["Crimson Editor"],
["Dawn"],
["Dreamweaver"],
["Eclipse"],
["GitHub"],
["IPlastic"],
["Solarized Light"],
["TextMate"],
["Tomorrow"],
["XCode"],
["Kuroir"],
["KatzenMilch"],
["SQL Server", "sqlserver", "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"]
];
exports.themesByName = {};
exports.themes = themeData.map(function (data) {
var name = data[1] || data[0].replace(/ /g, "_").toLowerCase();
var theme = {
caption: data[0],
theme: "ace/theme/" + name,
isDark: data[2] == "dark",
name: name
};
exports.themesByName[name] = theme;
return theme;
});
}); (function() {
ace.require(["ace/ext/themelist"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,192 @@
ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"], function(require, exports, module){"use strict";
var lang = require("../lib/lang");
exports.$detectIndentation = function (lines, fallback) {
var stats = [];
var changes = [];
var tabIndents = 0;
var prevSpaces = 0;
var max = Math.min(lines.length, 1000);
for (var i = 0; i < max; i++) {
var line = lines[i];
if (!/^\s*[^*+\-\s]/.test(line))
continue;
if (line[0] == "\t") {
tabIndents++;
prevSpaces = -Number.MAX_VALUE;
}
else {
var spaces = line.match(/^ */)[0].length;
if (spaces && line[spaces] != "\t") {
var diff = spaces - prevSpaces;
if (diff > 0 && !(prevSpaces % diff) && !(spaces % diff))
changes[diff] = (changes[diff] || 0) + 1;
stats[spaces] = (stats[spaces] || 0) + 1;
}
prevSpaces = spaces;
}
while (i < max && line[line.length - 1] == "\\")
line = lines[i++];
}
function getScore(indent) {
var score = 0;
for (var i = indent; i < stats.length; i += indent)
score += stats[i] || 0;
return score;
}
var changesTotal = changes.reduce(function (a, b) { return a + b; }, 0);
var first = { score: 0, length: 0 };
var spaceIndents = 0;
for (var i = 1; i < 12; i++) {
var score = getScore(i);
if (i == 1) {
spaceIndents = score;
score = stats[1] ? 0.9 : 0.8;
if (!stats.length)
score = 0;
}
else
score /= spaceIndents;
if (changes[i])
score += changes[i] / changesTotal;
if (score > first.score)
first = { score: score, length: i };
}
if (first.score && first.score > 1.4)
var tabLength = first.length;
if (tabIndents > spaceIndents + 1) {
if (tabLength == 1 || spaceIndents < tabIndents / 4 || first.score < 1.8)
tabLength = undefined;
return { ch: "\t", length: tabLength };
}
if (spaceIndents > tabIndents + 1)
return { ch: " ", length: tabLength };
};
exports.detectIndentation = function (session) {
var lines = session.getLines(0, 1000);
var indent = exports.$detectIndentation(lines) || {};
if (indent.ch)
session.setUseSoftTabs(indent.ch == " ");
if (indent.length)
session.setTabSize(indent.length);
return indent;
};
exports.trimTrailingSpace = function (session, options) {
var doc = session.getDocument();
var lines = doc.getAllLines();
var min = options && options.trimEmpty ? -1 : 0;
var cursors = [], ci = -1;
if (options && options.keepCursorPosition) {
if (session.selection.rangeCount) {
session.selection.rangeList.ranges.forEach(function (x, i, ranges) {
var next = ranges[i + 1];
if (next && next.cursor.row == x.cursor.row)
return;
cursors.push(x.cursor);
});
}
else {
cursors.push(session.selection.getCursor());
}
ci = 0;
}
var cursorRow = cursors[ci] && cursors[ci].row;
for (var i = 0, l = lines.length; i < l; i++) {
var line = lines[i];
var index = line.search(/\s+$/);
if (i == cursorRow) {
if (index < cursors[ci].column && index > min)
index = cursors[ci].column;
ci++;
cursorRow = cursors[ci] ? cursors[ci].row : -1;
}
if (index > min)
doc.removeInLine(i, index, line.length);
}
};
exports.convertIndentation = function (session, ch, len) {
var oldCh = session.getTabString()[0];
var oldLen = session.getTabSize();
if (!len)
len = oldLen;
if (!ch)
ch = oldCh;
var tab = ch == "\t" ? ch : lang.stringRepeat(ch, len);
var doc = session.doc;
var lines = doc.getAllLines();
var cache = {};
var spaceCache = {};
for (var i = 0, l = lines.length; i < l; i++) {
var line = lines[i];
var match = line.match(/^\s*/)[0];
if (match) {
var w = session.$getStringScreenWidth(match)[0];
var tabCount = Math.floor(w / oldLen);
var reminder = w % oldLen;
var toInsert = cache[tabCount] || (cache[tabCount] = lang.stringRepeat(tab, tabCount));
toInsert += spaceCache[reminder] || (spaceCache[reminder] = lang.stringRepeat(" ", reminder));
if (toInsert != match) {
doc.removeInLine(i, 0, match.length);
doc.insertInLine({ row: i, column: 0 }, toInsert);
}
}
}
session.setTabSize(len);
session.setUseSoftTabs(ch == " ");
};
exports.$parseStringArg = function (text) {
var indent = {};
if (/t/.test(text))
indent.ch = "\t";
else if (/s/.test(text))
indent.ch = " ";
var m = text.match(/\d+/);
if (m)
indent.length = parseInt(m[0], 10);
return indent;
};
exports.$parseArg = function (arg) {
if (!arg)
return {};
if (typeof arg == "string")
return exports.$parseStringArg(arg);
if (typeof arg.text == "string")
return exports.$parseStringArg(arg.text);
return arg;
};
exports.commands = [{
name: "detectIndentation",
description: "Detect indentation from content",
exec: function (editor) {
exports.detectIndentation(editor.session);
}
}, {
name: "trimTrailingSpace",
description: "Trim trailing whitespace",
exec: function (editor, args) {
exports.trimTrailingSpace(editor.session, args);
}
}, {
name: "convertIndentation",
description: "Convert indentation to ...",
exec: function (editor, arg) {
var indent = exports.$parseArg(arg);
exports.convertIndentation(editor.session, indent.ch, indent.length);
}
}, {
name: "setIndentation",
description: "Set indentation",
exec: function (editor, arg) {
var indent = exports.$parseArg(arg);
indent.length && editor.session.setTabSize(indent.length);
indent.ch && editor.session.setUseSoftTabs(indent.ch == " ");
}
}];
}); (function() {
ace.require(["ace/ext/whitespace"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,409 @@
ace.define("ace/keyboard/sublime",["require","exports","module","ace/keyboard/hash_handler"], function(require, exports, module){"use strict";
var HashHandler = require("../keyboard/hash_handler").HashHandler;
function moveBySubWords(editor, direction, extend) {
var selection = editor.selection;
var row = selection.lead.row;
var column = selection.lead.column;
var line = editor.session.getLine(row);
if (!line[column + direction]) {
var method = (extend ? "selectWord" : "moveCursorShortWord")
+ (direction == 1 ? "Right" : "Left");
return editor.selection[method]();
}
if (direction == -1)
column--;
while (line[column]) {
var type = getType(line[column]) + getType(line[column + direction]);
column += direction;
if (direction == 1) {
if (type == "WW" && getType(line[column + 1]) == "w")
break;
}
else {
if (type == "wW") {
if (getType(line[column - 1]) == "W") {
column -= 1;
break;
}
else {
continue;
}
}
if (type == "Ww")
break;
}
if (/w[s_oW]|_[sWo]|o[s_wW]|s[W]|W[so]/.test(type))
break;
}
if (direction == -1)
column++;
if (extend)
editor.selection.moveCursorTo(row, column);
else
editor.selection.moveTo(row, column);
function getType(x) {
if (!x)
return "-";
if (/\s/.test(x))
return "s";
if (x == "_")
return "_";
if (x.toUpperCase() == x && x.toLowerCase() != x)
return "W";
if (x.toUpperCase() != x && x.toLowerCase() == x)
return "w";
return "o";
}
}
exports.handler = new HashHandler();
exports.handler.addCommands([{
name: "find_all_under",
exec: function (editor) {
if (editor.selection.isEmpty())
editor.selection.selectWord();
editor.findAll();
},
readOnly: true
}, {
name: "find_under",
exec: function (editor) {
if (editor.selection.isEmpty())
editor.selection.selectWord();
editor.findNext();
},
readOnly: true
}, {
name: "find_under_prev",
exec: function (editor) {
if (editor.selection.isEmpty())
editor.selection.selectWord();
editor.findPrevious();
},
readOnly: true
}, {
name: "find_under_expand",
exec: function (editor) {
editor.selectMore(1, false, true);
},
scrollIntoView: "animate",
readOnly: true
}, {
name: "find_under_expand_skip",
exec: function (editor) {
editor.selectMore(1, true, true);
},
scrollIntoView: "animate",
readOnly: true
}, {
name: "delete_to_hard_bol",
exec: function (editor) {
var pos = editor.selection.getCursor();
editor.session.remove({
start: { row: pos.row, column: 0 },
end: pos
});
},
multiSelectAction: "forEach",
scrollIntoView: "cursor"
}, {
name: "delete_to_hard_eol",
exec: function (editor) {
var pos = editor.selection.getCursor();
editor.session.remove({
start: pos,
end: { row: pos.row, column: Infinity }
});
},
multiSelectAction: "forEach",
scrollIntoView: "cursor"
}, {
name: "moveToWordStartLeft",
exec: function (editor) {
editor.selection.moveCursorLongWordLeft();
editor.clearSelection();
},
multiSelectAction: "forEach",
scrollIntoView: "cursor"
}, {
name: "moveToWordEndRight",
exec: function (editor) {
editor.selection.moveCursorLongWordRight();
editor.clearSelection();
},
multiSelectAction: "forEach",
scrollIntoView: "cursor"
}, {
name: "selectToWordStartLeft",
exec: function (editor) {
var sel = editor.selection;
sel.$moveSelection(sel.moveCursorLongWordLeft);
},
multiSelectAction: "forEach",
scrollIntoView: "cursor"
}, {
name: "selectToWordEndRight",
exec: function (editor) {
var sel = editor.selection;
sel.$moveSelection(sel.moveCursorLongWordRight);
},
multiSelectAction: "forEach",
scrollIntoView: "cursor"
}, {
name: "selectSubWordRight",
exec: function (editor) {
moveBySubWords(editor, 1, true);
},
multiSelectAction: "forEach",
scrollIntoView: "cursor",
readOnly: true
}, {
name: "selectSubWordLeft",
exec: function (editor) {
moveBySubWords(editor, -1, true);
},
multiSelectAction: "forEach",
scrollIntoView: "cursor",
readOnly: true
}, {
name: "moveSubWordRight",
exec: function (editor) {
moveBySubWords(editor, 1);
},
multiSelectAction: "forEach",
scrollIntoView: "cursor",
readOnly: true
}, {
name: "moveSubWordLeft",
exec: function (editor) {
moveBySubWords(editor, -1);
},
multiSelectAction: "forEach",
scrollIntoView: "cursor",
readOnly: true
}]);
[{
bindKey: { mac: "cmd-k cmd-backspace|cmd-backspace", win: "ctrl-shift-backspace|ctrl-k ctrl-backspace" },
name: "removetolinestarthard"
}, {
bindKey: { mac: "cmd-k cmd-k|cmd-delete|ctrl-k", win: "ctrl-shift-delete|ctrl-k ctrl-k" },
name: "removetolineendhard"
}, {
bindKey: { mac: "cmd-shift-d", win: "ctrl-shift-d" },
name: "duplicateSelection"
}, {
bindKey: { mac: "cmd-l", win: "ctrl-l" },
name: "expandtoline"
},
{
bindKey: { mac: "cmd-shift-a", win: "ctrl-shift-a" },
name: "expandSelection",
args: { to: "tag" }
}, {
bindKey: { mac: "cmd-shift-j", win: "ctrl-shift-j" },
name: "expandSelection",
args: { to: "indentation" }
}, {
bindKey: { mac: "ctrl-shift-m", win: "ctrl-shift-m" },
name: "expandSelection",
args: { to: "brackets" }
}, {
bindKey: { mac: "cmd-shift-space", win: "ctrl-shift-space" },
name: "expandSelection",
args: { to: "scope" }
},
{
bindKey: { mac: "ctrl-cmd-g", win: "alt-f3" },
name: "find_all_under"
}, {
bindKey: { mac: "alt-cmd-g", win: "ctrl-f3" },
name: "find_under"
}, {
bindKey: { mac: "shift-alt-cmd-g", win: "ctrl-shift-f3" },
name: "find_under_prev"
}, {
bindKey: { mac: "cmd-g", win: "f3" },
name: "findnext"
}, {
bindKey: { mac: "shift-cmd-g", win: "shift-f3" },
name: "findprevious"
}, {
bindKey: { mac: "cmd-d", win: "ctrl-d" },
name: "find_under_expand"
}, {
bindKey: { mac: "cmd-k cmd-d", win: "ctrl-k ctrl-d" },
name: "find_under_expand_skip"
},
{
bindKey: { mac: "cmd-alt-[", win: "ctrl-shift-[" },
name: "toggleFoldWidget"
}, {
bindKey: { mac: "cmd-alt-]", win: "ctrl-shift-]" },
name: "unfold"
}, {
bindKey: { mac: "cmd-k cmd-0|cmd-k cmd-j", win: "ctrl-k ctrl-0|ctrl-k ctrl-j" },
name: "unfoldall"
}, {
bindKey: { mac: "cmd-k cmd-1", win: "ctrl-k ctrl-1" },
name: "foldOther",
args: { level: 1 }
},
{
bindKey: { win: "ctrl-left", mac: "alt-left" },
name: "moveToWordStartLeft"
}, {
bindKey: { win: "ctrl-right", mac: "alt-right" },
name: "moveToWordEndRight"
}, {
bindKey: { win: "ctrl-shift-left", mac: "alt-shift-left" },
name: "selectToWordStartLeft"
}, {
bindKey: { win: "ctrl-shift-right", mac: "alt-shift-right" },
name: "selectToWordEndRight"
},
{
bindKey: { mac: "ctrl-alt-shift-right|ctrl-shift-right", win: "alt-shift-right" },
name: "selectSubWordRight"
}, {
bindKey: { mac: "ctrl-alt-shift-left|ctrl-shift-left", win: "alt-shift-left" },
name: "selectSubWordLeft"
}, {
bindKey: { mac: "ctrl-alt-right|ctrl-right", win: "alt-right" },
name: "moveSubWordRight"
}, {
bindKey: { mac: "ctrl-alt-left|ctrl-left", win: "alt-left" },
name: "moveSubWordLeft"
},
{
bindKey: { mac: "ctrl-m", win: "ctrl-m" },
name: "jumptomatching",
args: { to: "brackets" }
},
{
bindKey: { mac: "ctrl-f6", win: "ctrl-f6" },
name: "goToNextError"
}, {
bindKey: { mac: "ctrl-shift-f6", win: "ctrl-shift-f6" },
name: "goToPreviousError"
},
{
bindKey: { mac: "ctrl-o" },
name: "splitline"
},
{
bindKey: { mac: "ctrl-shift-w", win: "alt-shift-w" },
name: "surrowndWithTag"
}, {
bindKey: { mac: "cmd-alt-.", win: "alt-." },
name: "close_tag"
},
{
bindKey: { mac: "cmd-j", win: "ctrl-j" },
name: "joinlines"
},
{
bindKey: { mac: "ctrl--", win: "alt--" },
name: "jumpBack"
}, {
bindKey: { mac: "ctrl-shift--", win: "alt-shift--" },
name: "jumpForward"
},
{
bindKey: { mac: "cmd-k cmd-l", win: "ctrl-k ctrl-l" },
name: "tolowercase"
}, {
bindKey: { mac: "cmd-k cmd-u", win: "ctrl-k ctrl-u" },
name: "touppercase"
},
{
bindKey: { mac: "cmd-shift-v", win: "ctrl-shift-v" },
name: "paste_and_indent"
}, {
bindKey: { mac: "cmd-k cmd-v|cmd-alt-v", win: "ctrl-k ctrl-v" },
name: "paste_from_history"
},
{
bindKey: { mac: "cmd-shift-enter", win: "ctrl-shift-enter" },
name: "addLineBefore"
}, {
bindKey: { mac: "cmd-enter", win: "ctrl-enter" },
name: "addLineAfter"
}, {
bindKey: { mac: "ctrl-shift-k", win: "ctrl-shift-k" },
name: "removeline"
}, {
bindKey: { mac: "ctrl-alt-up", win: "ctrl-up" },
name: "scrollup"
}, {
bindKey: { mac: "ctrl-alt-down", win: "ctrl-down" },
name: "scrolldown"
}, {
bindKey: { mac: "cmd-a", win: "ctrl-a" },
name: "selectall"
}, {
bindKey: { linux: "alt-shift-down", mac: "ctrl-shift-down", win: "ctrl-alt-down" },
name: "addCursorBelow"
}, {
bindKey: { linux: "alt-shift-up", mac: "ctrl-shift-up", win: "ctrl-alt-up" },
name: "addCursorAbove"
},
{
bindKey: { mac: "cmd-k cmd-c|ctrl-l", win: "ctrl-k ctrl-c" },
name: "centerselection"
},
{
bindKey: { mac: "f5", win: "f9" },
name: "sortlines"
},
{
bindKey: { mac: "ctrl-f5", win: "ctrl-f9" },
name: "sortlines",
args: { caseSensitive: true }
},
{
bindKey: { mac: "cmd-shift-l", win: "ctrl-shift-l" },
name: "splitSelectionIntoLines"
}, {
bindKey: { mac: "ctrl-cmd-down", win: "ctrl-shift-down" },
name: "movelinesdown"
}, {
bindKey: { mac: "ctrl-cmd-up", win: "ctrl-shift-up" },
name: "movelinesup"
}, {
bindKey: { mac: "alt-down", win: "alt-down" },
name: "modifyNumberDown"
}, {
bindKey: { mac: "alt-up", win: "alt-up" },
name: "modifyNumberUp"
}, {
bindKey: { mac: "cmd-/", win: "ctrl-/" },
name: "togglecomment"
}, {
bindKey: { mac: "cmd-alt-/", win: "ctrl-shift-/" },
name: "toggleBlockComment"
},
{
bindKey: { linux: "ctrl-alt-q", mac: "ctrl-q", win: "ctrl-q" },
name: "togglerecording"
}, {
bindKey: { linux: "ctrl-alt-shift-q", mac: "ctrl-shift-q", win: "ctrl-shift-q" },
name: "replaymacro"
},
{
bindKey: { mac: "ctrl-t", win: "ctrl-t" },
name: "transpose"
}
].forEach(function (binding) {
var command = exports.handler.commands[binding.name];
if (command)
command.bindKey = binding.bindKey;
exports.handler.bindKey(binding.bindKey, command || binding.name);
});
}); (function() {
ace.require(["ace/keyboard/sublime"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,255 @@
ace.define("ace/keyboard/vscode",["require","exports","module","ace/keyboard/hash_handler","ace/config"], function(require, exports, module){"use strict";
var HashHandler = require("../keyboard/hash_handler").HashHandler;
var config = require("../config");
exports.handler = new HashHandler();
exports.handler.$id = "ace/keyboard/vscode";
exports.handler.addCommands([{
name: "toggleWordWrap",
exec: function (editor) {
var wrapUsed = editor.session.getUseWrapMode();
editor.session.setUseWrapMode(!wrapUsed);
},
readOnly: true
}, {
name: "navigateToLastEditLocation",
exec: function (editor) {
var lastDelta = editor.session.getUndoManager().$lastDelta;
var range = (lastDelta.action == "remove") ? lastDelta.start : lastDelta.end;
editor.moveCursorTo(range.row, range.column);
editor.clearSelection();
}
}, {
name: "replaceAll",
exec: function (editor) {
if (!editor.searchBox) {
config.loadModule("ace/ext/searchbox", function (e) {
e.Search(editor, true);
});
}
else {
if (editor.searchBox.active === true && editor.searchBox.replaceOption.checked === true) {
editor.searchBox.replaceAll();
}
}
}
}, {
name: "replaceOne",
exec: function (editor) {
if (!editor.searchBox) {
config.loadModule("ace/ext/searchbox", function (e) {
e.Search(editor, true);
});
}
else {
if (editor.searchBox.active === true && editor.searchBox.replaceOption.checked === true) {
editor.searchBox.replace();
}
}
}
}, {
name: "selectAllMatches",
exec: function (editor) {
if (!editor.searchBox) {
config.loadModule("ace/ext/searchbox", function (e) {
e.Search(editor, false);
});
}
else {
if (editor.searchBox.active === true) {
editor.searchBox.findAll();
}
}
}
}, {
name: "toggleFindCaseSensitive",
exec: function (editor) {
config.loadModule("ace/ext/searchbox", function (e) {
e.Search(editor, false);
var sb = editor.searchBox;
sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked;
sb.$syncOptions();
});
}
}, {
name: "toggleFindInSelection",
exec: function (editor) {
config.loadModule("ace/ext/searchbox", function (e) {
e.Search(editor, false);
var sb = editor.searchBox;
sb.searchOption.checked = !sb.searchRange;
sb.setSearchRange(sb.searchOption.checked && sb.editor.getSelectionRange());
sb.$syncOptions();
});
}
}, {
name: "toggleFindRegex",
exec: function (editor) {
config.loadModule("ace/ext/searchbox", function (e) {
e.Search(editor, false);
var sb = editor.searchBox;
sb.regExpOption.checked = !sb.regExpOption.checked;
sb.$syncOptions();
});
}
}, {
name: "toggleFindWholeWord",
exec: function (editor) {
config.loadModule("ace/ext/searchbox", function (e) {
e.Search(editor, false);
var sb = editor.searchBox;
sb.wholeWordOption.checked = !sb.wholeWordOption.checked;
sb.$syncOptions();
});
}
}, {
name: "removeSecondaryCursors",
exec: function (editor) {
var ranges = editor.selection.ranges;
if (ranges && ranges.length > 1)
editor.selection.toSingleRange(ranges[ranges.length - 1]);
else
editor.selection.clearSelection();
}
}]);
[{
bindKey: { mac: "Ctrl-G", win: "Ctrl-G" },
name: "gotoline"
}, {
bindKey: { mac: "Command-Shift-L|Command-F2", win: "Ctrl-Shift-L|Ctrl-F2" },
name: "findAll"
}, {
bindKey: { mac: "Shift-F8|Shift-Option-F8", win: "Shift-F8|Shift-Alt-F8" },
name: "goToPreviousError"
}, {
bindKey: { mac: "F8|Option-F8", win: "F8|Alt-F8" },
name: "goToNextError"
}, {
bindKey: { mac: "Command-Shift-P|F1", win: "Ctrl-Shift-P|F1" },
name: "openCommandPalette"
}, {
bindKey: { mac: "Shift-Option-Up", win: "Alt-Shift-Up" },
name: "copylinesup"
}, {
bindKey: { mac: "Shift-Option-Down", win: "Alt-Shift-Down" },
name: "copylinesdown"
}, {
bindKey: { mac: "Command-Shift-K", win: "Ctrl-Shift-K" },
name: "removeline"
}, {
bindKey: { mac: "Command-Enter", win: "Ctrl-Enter" },
name: "addLineAfter"
}, {
bindKey: { mac: "Command-Shift-Enter", win: "Ctrl-Shift-Enter" },
name: "addLineBefore"
}, {
bindKey: { mac: "Command-Shift-\\", win: "Ctrl-Shift-\\" },
name: "jumptomatching"
}, {
bindKey: { mac: "Command-]", win: "Ctrl-]" },
name: "blockindent"
}, {
bindKey: { mac: "Command-[", win: "Ctrl-[" },
name: "blockoutdent"
}, {
bindKey: { mac: "Ctrl-PageDown", win: "Alt-PageDown" },
name: "pagedown"
}, {
bindKey: { mac: "Ctrl-PageUp", win: "Alt-PageUp" },
name: "pageup"
}, {
bindKey: { mac: "Shift-Option-A", win: "Shift-Alt-A" },
name: "toggleBlockComment"
}, {
bindKey: { mac: "Option-Z", win: "Alt-Z" },
name: "toggleWordWrap"
}, {
bindKey: { mac: "Command-G", win: "F3|Ctrl-K Ctrl-D" },
name: "findnext"
}, {
bindKey: { mac: "Command-Shift-G", win: "Shift-F3" },
name: "findprevious"
}, {
bindKey: { mac: "Option-Enter", win: "Alt-Enter" },
name: "selectAllMatches"
}, {
bindKey: { mac: "Command-D", win: "Ctrl-D" },
name: "selectMoreAfter"
}, {
bindKey: { mac: "Command-K Command-D", win: "Ctrl-K Ctrl-D" },
name: "selectOrFindNext"
}, {
bindKey: { mac: "Shift-Option-I", win: "Shift-Alt-I" },
name: "splitSelectionIntoLines"
}, {
bindKey: { mac: "Command-K M", win: "Ctrl-K M" },
name: "modeSelect"
}, {
bindKey: { mac: "Command-Option-[", win: "Ctrl-Shift-[" },
name: "toggleFoldWidget"
}, {
bindKey: { mac: "Command-Option-]", win: "Ctrl-Shift-]" },
name: "toggleFoldWidget"
}, {
bindKey: { mac: "Command-K Command-0", win: "Ctrl-K Ctrl-0" },
name: "foldall"
}, {
bindKey: { mac: "Command-K Command-J", win: "Ctrl-K Ctrl-J" },
name: "unfoldall"
}, {
bindKey: { mac: "Command-K Command-1", win: "Ctrl-K Ctrl-1" },
name: "foldOther"
}, {
bindKey: { mac: "Command-K Command-Q", win: "Ctrl-K Ctrl-Q" },
name: "navigateToLastEditLocation"
}, {
bindKey: { mac: "Command-K Command-R|Command-K Command-S", win: "Ctrl-K Ctrl-R|Ctrl-K Ctrl-S" },
name: "showKeyboardShortcuts"
}, {
bindKey: { mac: "Command-K Command-X", win: "Ctrl-K Ctrl-X" },
name: "trimTrailingSpace"
}, {
bindKey: { mac: "Shift-Down|Command-Shift-Down", win: "Shift-Down|Ctrl-Shift-Down" },
name: "selectdown"
}, {
bindKey: { mac: "Shift-Up|Command-Shift-Up", win: "Shift-Up|Ctrl-Shift-Up" },
name: "selectup"
}, {
bindKey: { mac: "Command-Alt-Enter", win: "Ctrl-Alt-Enter" },
name: "replaceAll"
}, {
bindKey: { mac: "Command-Shift-1", win: "Ctrl-Shift-1" },
name: "replaceOne"
}, {
bindKey: { mac: "Option-C", win: "Alt-C" },
name: "toggleFindCaseSensitive"
}, {
bindKey: { mac: "Option-L", win: "Alt-L" },
name: "toggleFindInSelection"
}, {
bindKey: { mac: "Option-R", win: "Alt-R" },
name: "toggleFindRegex"
}, {
bindKey: { mac: "Option-W", win: "Alt-W" },
name: "toggleFindWholeWord"
}, {
bindKey: { mac: "Command-L", win: "Ctrl-L" },
name: "expandtoline"
}, {
bindKey: { mac: "Shift-Esc", win: "Shift-Esc" },
name: "removeSecondaryCursors"
}
].forEach(function (binding) {
var command = exports.handler.commands[binding.name];
if (command)
command.bindKey = binding.bindKey;
exports.handler.bindKey(binding.bindKey, command || binding.name);
});
}); (function() {
ace.require(["ace/keyboard/vscode"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,200 @@
ace.define("ace/mode/abap_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/*
* based on
* " Vim ABAP syntax file
* " Language: SAP - ABAP/R4
* " Revision: 2.1
* " Maintainer: Marius Piedallu van Wyk <lailoken@gmail.com>
* " Last Change: 2012 Oct 23
*/
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var AbapHighlightRules = function () {
var keywordMapper = this.createKeywordMapper({
"variable.language": "this",
"keyword": "ADD ALIAS ALIASES ASCENDING ASSERT ASSIGN ASSIGNING AT BACK" +
" CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY" +
" DATA DEFINE DEFINITION DEFERRED DELETE DESCENDING DESCRIBE DETAIL DIVIDE DO" +
" ELSE ELSEIF ENDAT ENDCASE ENDCLASS ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDTRY ENDWHILE EVENT EVENTS EXEC EXIT EXPORT EXPORTING EXTRACT" +
" FETCH FIELDS FORM FORMAT FREE FROM FUNCTION" +
" GENERATE GET" +
" HIDE" +
" IF IMPORT IMPORTING INDEX INFOTYPES INITIALIZATION INTERFACE INTERFACES INPUT INSERT IMPLEMENTATION" +
" LEAVE LIKE LINE LOAD LOCAL LOOP" +
" MESSAGE METHOD METHODS MODIFY MODULE MOVE MULTIPLY" +
" ON OVERLAY OPTIONAL OTHERS" +
" PACK PARAMETERS PERFORM POSITION PROGRAM PROVIDE PUT" +
" RAISE RANGES READ RECEIVE RECEIVING REDEFINITION REFERENCE REFRESH REJECT REPLACE REPORT RESERVE RESTORE RETURN RETURNING ROLLBACK" +
" SCAN SCROLL SEARCH SELECT SET SHIFT SKIP SORT SORTED SPLIT STANDARD STATICS STEP STOP SUBMIT SUBTRACT SUM SUMMARY SUPPRESS" +
" TABLES TIMES TRANSFER TRANSLATE TRY TYPE TYPES" +
" UNASSIGN ULINE UNPACK UPDATE" +
" WHEN WHILE WINDOW WRITE" +
" OCCURS STRUCTURE OBJECT PROPERTY" +
" CASTING APPEND RAISING VALUE COLOR" +
" CHANGING EXCEPTION EXCEPTIONS DEFAULT CHECKBOX COMMENT" +
" ID NUMBER FOR TITLE OUTPUT" +
" WITH EXIT USING" +
" INTO WHERE GROUP BY HAVING ORDER BY SINGLE" +
" APPENDING CORRESPONDING FIELDS OF TABLE" +
" LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER UP TO ROWS CONNECTING" +
" EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN",
"constant.language": "TRUE FALSE NULL SPACE",
"support.type": "c n i p f d t x string xstring decfloat16 decfloat34",
"keyword.operator": "abs sign ceil floor trunc frac acos asin atan cos sin tan" +
" abapOperator cosh sinh tanh exp log log10 sqrt" +
" strlen xstrlen charlen numofchar dbmaxlen lines"
}, "text", true, " ");
var compoundKeywords = "WITH\\W+(?:HEADER\\W+LINE|FRAME|KEY)|NO\\W+STANDARD\\W+PAGE\\W+HEADING|" +
"EXIT\\W+FROM\\W+STEP\\W+LOOP|BEGIN\\W+OF\\W+(?:BLOCK|LINE)|BEGIN\\W+OF|" +
"END\\W+OF\\W+(?:BLOCK|LINE)|END\\W+OF|NO\\W+INTERVALS|" +
"RESPECTING\\W+BLANKS|SEPARATED\\W+BY|USING\\W+(?:EDIT\\W+MASK)|" +
"WHERE\\W+(?:LINE)|RADIOBUTTON\\W+GROUP|REF\\W+TO|" +
"(?:PUBLIC|PRIVATE|PROTECTED)(?:\\W+SECTION)?|DELETING\\W+(?:TRAILING|LEADING)" +
"(?:ALL\\W+OCCURRENCES)|(?:FIRST|LAST)\\W+OCCURRENCE|INHERITING\\W+FROM|" +
"LINE-COUNT|ADD-CORRESPONDING|AUTHORITY-CHECK|BREAK-POINT|CLASS-DATA|CLASS-METHODS|" +
"CLASS-METHOD|DIVIDE-CORRESPONDING|EDITOR-CALL|END-OF-DEFINITION|END-OF-PAGE|END-OF-SELECTION|" +
"FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|NEW-LINE|" +
"NEW-PAGE|NEW-SECTION|PRINT-CONTROL|RP-PROVIDE-FROM-LAST|SELECT-OPTIONS|SELECTION-SCREEN|" +
"START-OF-SELECTION|SUBTRACT-CORRESPONDING|SYNTAX-CHECK|SYNTAX-TRACE|TOP-OF-PAGE|TYPE-POOL|" +
"TYPE-POOLS|LINE-SIZE|LINE-COUNT|MESSAGE-ID|DISPLAY-MODE|READ(?:-ONLY)?|" +
"IS\\W+(?:NOT\\W+)?(?:ASSIGNED|BOUND|INITIAL|SUPPLIED)";
this.$rules = {
"start": [
{ token: "string", regex: "`", next: "string" },
{ token: "string", regex: "'", next: "qstring" },
{ token: "doc.comment", regex: /^\*.+/ },
{ token: "comment", regex: /".+$/ },
{ token: "invalid", regex: "\\.{2,}" },
{ token: "keyword.operator", regex: /\W[\-+%=<>*]\W|\*\*|[~:,\.&$]|->*?|=>/ },
{ token: "paren.lparen", regex: "[\\[({]" },
{ token: "paren.rparen", regex: "[\\])}]" },
{ token: "constant.numeric", regex: "[+-]?\\d+\\b" },
{ token: "variable.parameter", regex: /sy|pa?\d\d\d\d\|t\d\d\d\.|innnn/ },
{ token: "keyword", regex: compoundKeywords },
{ token: "variable.parameter", regex: /\w+-\w[\-\w]*/ },
{ token: keywordMapper, regex: "\\b\\w+\\b" },
{ caseInsensitive: true }
],
"qstring": [
{ token: "constant.language.escape", regex: "''" },
{ token: "string", regex: "'", next: "start" },
{ defaultToken: "string" }
],
"string": [
{ token: "constant.language.escape", regex: "``" },
{ token: "string", regex: "`", next: "start" },
{ defaultToken: "string" }
]
};
};
oop.inherits(AbapHighlightRules, TextHighlightRules);
exports.AbapHighlightRules = AbapHighlightRules;
});
ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function () { };
oop.inherits(FoldMode, BaseFoldMode);
(function () {
this.commentBlock = function (session, row) {
var re = /\S/;
var line = session.getLine(row);
var startLevel = line.search(re);
if (startLevel == -1 || line[startLevel] != "#")
return;
var startColumn = line.length;
var maxRow = session.getLength();
var startRow = row;
var endRow = row;
while (++row < maxRow) {
line = session.getLine(row);
var level = line.search(re);
if (level == -1)
continue;
if (line[level] != "#")
break;
endRow = row;
}
if (endRow > startRow) {
var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn);
}
};
this.getFoldWidgetRange = function (session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
range = this.commentBlock(session, row);
if (range)
return range;
};
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row);
var indent = line.search(/\S/);
var next = session.getLine(row + 1);
var prev = session.getLine(row - 1);
var prevIndent = prev.search(/\S/);
var nextIndent = next.search(/\S/);
if (indent == -1) {
session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
return "";
}
if (prevIndent == -1) {
if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
session.foldWidgets[row - 1] = "";
session.foldWidgets[row + 1] = "";
return "start";
}
}
else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
if (session.getLine(row - 2).search(/\S/) == -1) {
session.foldWidgets[row - 1] = "start";
session.foldWidgets[row + 1] = "";
return "";
}
}
if (prevIndent != -1 && prevIndent < indent)
session.foldWidgets[row - 1] = "start";
else
session.foldWidgets[row - 1] = "";
if (indent < nextIndent)
return "start";
else
return "";
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/abap",["require","exports","module","ace/mode/abap_highlight_rules","ace/mode/folding/coffee","ace/range","ace/mode/text","ace/lib/oop"], function(require, exports, module){"use strict";
var Rules = require("./abap_highlight_rules").AbapHighlightRules;
var FoldMode = require("./folding/coffee").FoldMode;
var Range = require("../range").Range;
var TextMode = require("./text").Mode;
var oop = require("../lib/oop");
function Mode() {
this.HighlightRules = Rules;
this.foldingRules = new FoldMode();
}
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = '"';
this.getNextLineIndent = function (state, line, tab) {
var indent = this.$getIndent(line);
return indent;
};
this.$id = "ace/mode/abap";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/abap"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,243 @@
ace.define("ace/mode/abc_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was partially autogenerated from https://github.com/jimhawkridge/SublimeABC
Modifications
- more classes to express the abc semantic
- added syntax highlighting for Zupfnoter conventions (https://github.com/bwl21/zupfnoter)
- separate note pitch and note duration - even if it looks the same
***********************************************************************************************/
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var ABCHighlightRules = 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();
};
ABCHighlightRules.metaData = {
fileTypes: ['abc'],
name: 'ABC',
scopeName: 'text.abcnotation'
};
oop.inherits(ABCHighlightRules, TextHighlightRules);
exports.ABCHighlightRules = ABCHighlightRules;
});
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(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 (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.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(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var ABCHighlightRules = require("./abc_highlight_rules").ABCHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
this.HighlightRules = ABCHighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "%";
this.$id = "ace/mode/abc";
this.snippetFileId = "ace/snippets/abc";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/abc"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
File diff suppressed because one or more lines are too long
@@ -0,0 +1,108 @@
ace.define("ace/mode/ada_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var AdaHighlightRules = function () {
var keywords = "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";
var builtinConstants = ("true|false|null");
var builtinFunctions = ("count|min|max|avg|sum|rank|now|coalesce|main");
var keywordMapper = this.createKeywordMapper({
"support.function": builtinFunctions,
"keyword": keywords,
"constant.language": builtinConstants
}, "identifier", true);
this.$rules = {
"start": [{
token: "comment",
regex: "--.*$"
}, {
token: "string",
regex: '".*?"'
}, {
token: "string",
regex: "'.'"
}, {
token: "constant.numeric",
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, {
token: keywordMapper,
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+"
}]
};
};
oop.inherits(AdaHighlightRules, TextHighlightRules);
exports.AdaHighlightRules = AdaHighlightRules;
});
ace.define("ace/mode/ada",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ada_highlight_rules","ace/range"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var AdaHighlightRules = require("./ada_highlight_rules").AdaHighlightRules;
var Range = require("../range").Range;
var Mode = function () {
this.HighlightRules = AdaHighlightRules;
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "--";
this.getNextLineIndent = function (state, line, tab) {
var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens;
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
return indent;
}
if (state == "start") {
var match = line.match(/^.*(begin|loop|then|is|do)\s*$/);
if (match) {
indent += tab;
}
}
return indent;
};
this.checkOutdent = function (state, line, input) {
var complete_line = line + input;
if (complete_line.match(/^\s*(begin|end)$/)) {
return true;
}
return false;
};
this.autoOutdent = function (state, session, row) {
var line = session.getLine(row);
var prevLine = session.getLine(row - 1);
var prevIndent = this.$getIndent(prevLine).length;
var indent = this.$getIndent(line).length;
if (indent <= prevIndent) {
return;
}
session.outdentRows(new Range(row, 0, row + 2, 0));
};
this.$id = "ace/mode/ada";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/ada"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,279 @@
ace.define("ace/mode/alda_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from ../../src/alda.JSON-tmLanguage (uuid: ) */
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var AldaHighlightRules = function () {
this.$rules = {
pitch: [{
token: "variable.parameter.operator.pitch.alda",
regex: /(?:[+\-]+|\=)/
}, {
token: "",
regex: "",
next: "timing"
}],
timing: [{
token: "string.quoted.operator.timing.alda",
regex: /\d+(?:s|ms)?/
}, {
token: "",
regex: "",
next: "start"
}],
start: [{
token: [
"constant.language.instrument.alda",
"constant.language.instrument.alda",
"meta.part.call.alda",
"storage.type.nickname.alda",
"meta.part.call.alda"
],
regex: /^([a-zA-Z]{2}[\w\-+\'()]*)((?:\s*\/\s*[a-zA-Z]{2}[\w\-+\'()]*)*)(?:(\s*)(\"[a-zA-Z]{2}[\w\-+\'()]*\"))?(\s*:)/
}, {
token: [
"text",
"entity.other.inherited-class.voice.alda",
"text"
],
regex: /^(\s*)(V\d+)(:)/
}, {
token: "comment.line.number-sign.alda",
regex: /#.*$/
}, {
token: "entity.name.function.pipe.measure.alda",
regex: /\|/
}, {
token: "comment.block.inline.alda",
regex: /\(comment\b/,
push: [{
token: "comment.block.inline.alda",
regex: /\)/,
next: "pop"
}, {
defaultToken: "comment.block.inline.alda"
}]
}, {
token: "entity.name.function.marker.alda",
regex: /%[a-zA-Z]{2}[\w\-+\'()]*/
}, {
token: "entity.name.function.at-marker.alda",
regex: /@[a-zA-Z]{2}[\w\-+\'()]*/
}, {
token: "keyword.operator.octave-change.alda",
regex: /\bo\d+\b/
}, {
token: "keyword.operator.octave-shift.alda",
regex: /[><]/
}, {
token: "keyword.operator.repeat.alda",
regex: /\*\s*\d+/
}, {
token: "string.quoted.operator.timing.alda",
regex: /[.]|r\d*(?:s|ms)?/
}, {
token: "text",
regex: /([cdefgab])/,
next: "pitch"
}, {
token: "string.quoted.operator.timing.alda",
regex: /~/,
next: "timing"
}, {
token: "punctuation.section.embedded.cram.alda",
regex: /\}/,
next: "timing"
}, {
token: "constant.numeric.subchord.alda",
regex: /\//
}, {
todo: {
token: "punctuation.section.embedded.cram.alda",
regex: /\{/,
push: [{
token: "punctuation.section.embedded.cram.alda",
regex: /\}/,
next: "pop"
}, {
include: "$self"
}]
}
}, {
todo: {
token: "keyword.control.sequence.alda",
regex: /\[/,
push: [{
token: "keyword.control.sequence.alda",
regex: /\]/,
next: "pop"
}, {
include: "$self"
}]
}
}, {
token: "meta.inline.clojure.alda",
regex: /\(/,
push: [{
token: "meta.inline.clojure.alda",
regex: /\)/,
next: "pop"
}, {
include: "source.clojure"
}, {
defaultToken: "meta.inline.clojure.alda"
}]
}]
};
this.normalizeRules();
};
AldaHighlightRules.metaData = {
scopeName: "source.alda",
fileTypes: ["alda"],
name: "Alda"
};
oop.inherits(AldaHighlightRules, TextHighlightRules);
exports.AldaHighlightRules = AldaHighlightRules;
});
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(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 (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/alda",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/alda_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var AldaHighlightRules = require("./alda_highlight_rules").AldaHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
this.HighlightRules = AldaHighlightRules;
this.foldingRules = new FoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
this.$id = "ace/mode/alda";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/alda"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,318 @@
ace.define("ace/mode/apache_conf_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from https://raw.github.com/colinta/ApacheConf.tmLanguage/master/ApacheConf.tmLanguage (uuid: ) */
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var ApacheConfHighlightRules = function () {
this.$rules = { start: [{ token: ['punctuation.definition.comment.apacheconf',
'comment.line.hash.ini',
'comment.line.hash.ini'],
regex: '^((?:\\s)*)(#)(.*$)' },
{ token: ['punctuation.definition.tag.apacheconf',
'entity.tag.apacheconf',
'text',
'string.value.apacheconf',
'punctuation.definition.tag.apacheconf'],
regex: '(<)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost)(?:(\\s)(.+?))?(>)' },
{ token: ['punctuation.definition.tag.apacheconf',
'entity.tag.apacheconf',
'punctuation.definition.tag.apacheconf'],
regex: '(</)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost)(>)' },
{ token: ['keyword.alias.apacheconf', 'text',
'string.regexp.apacheconf', 'text',
'string.replacement.apacheconf', 'text'],
regex: '(Rewrite(?:Rule|Cond))(\\s+)(.+?)(\\s+)(.+?)($|\\s)' },
{ token: ['keyword.alias.apacheconf', 'text',
'entity.status.apacheconf', 'text',
'string.regexp.apacheconf', 'text',
'string.path.apacheconf', 'text'],
regex: '(RedirectMatch)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' },
{ token: ['keyword.alias.apacheconf', 'text',
'entity.status.apacheconf', 'text',
'string.path.apacheconf', 'text',
'string.path.apacheconf', 'text'],
regex: '(Redirect)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' },
{ token: ['keyword.alias.apacheconf', 'text',
'string.regexp.apacheconf', 'text',
'string.path.apacheconf', 'text'],
regex: '(ScriptAliasMatch|AliasMatch)(\\s+)(.+?)(\\s+)(?:(.+?)(\\s))?' },
{ token: ['keyword.alias.apacheconf', 'text',
'string.path.apacheconf', 'text',
'string.path.apacheconf', 'text'],
regex: '(RedirectPermanent|RedirectTemp|ScriptAlias|Alias)(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' },
{ token: 'keyword.core.apacheconf',
regex: '\\b(?:AcceptPathInfo|AccessFileName|AddDefaultCharset|AddOutputFilterByType|AllowEncodedSlashes|AllowOverride|AuthName|AuthType|CGIMapExtension|ContentDigest|DefaultType|DocumentRoot|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|FileETag|ForceType|HostnameLookups|IdentityCheck|Include|KeepAlive|KeepAliveTimeout|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|LogLevel|MaxKeepAliveRequests|NameVirtualHost|Options|Require|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScriptInterpreterSource|ServerAdmin|ServerAlias|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetHandler|SetInputFilter|SetOutputFilter|TimeOut|TraceEnable|UseCanonicalName)\\b' },
{ token: 'keyword.mpm.apacheconf',
regex: '\\b(?:AcceptMutex|AssignUserID|BS2000Account|ChildPerUserID|CoreDumpDirectory|EnableExceptionHook|Group|Listen|ListenBacklog|LockFile|MaxClients|MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MinSpareServers|MinSpareThreads|NumServers|PidFile|ReceiveBufferSize|ScoreBoardFile|SendBufferSize|ServerLimit|StartServers|StartThreads|ThreadLimit|ThreadsPerChild|ThreadStackSize|User|Win32DisableAcceptEx)\\b' },
{ token: 'keyword.access.apacheconf',
regex: '\\b(?:Allow|Deny|Order)\\b' },
{ token: 'keyword.actions.apacheconf',
regex: '\\b(?:Action|Script)\\b' },
{ token: 'keyword.alias.apacheconf',
regex: '\\b(?:Alias|AliasMatch|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ScriptAlias|ScriptAliasMatch)\\b' },
{ token: 'keyword.auth.apacheconf',
regex: '\\b(?:AuthAuthoritative|AuthGroupFile|AuthUserFile)\\b' },
{ token: 'keyword.auth_anon.apacheconf',
regex: '\\b(?:Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail)\\b' },
{ token: 'keyword.auth_dbm.apacheconf',
regex: '\\b(?:AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile)\\b' },
{ token: 'keyword.auth_digest.apacheconf',
regex: '\\b(?:AuthDigestAlgorithm|AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize)\\b' },
{ token: 'keyword.auth_ldap.apacheconf',
regex: '\\b(?:AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl)\\b' },
{ token: 'keyword.autoindex.apacheconf',
regex: '\\b(?:AddAlt|AddAltByEncoding|AddAltByType|AddDescription|AddIcon|AddIconByEncoding|AddIconByType|DefaultIcon|HeaderName|IndexIgnore|IndexOptions|IndexOrderDefault|ReadmeName)\\b' },
{ token: 'keyword.cache.apacheconf',
regex: '\\b(?:CacheDefaultExpire|CacheDisable|CacheEnable|CacheForceCompletion|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire)\\b' },
{ token: 'keyword.cern_meta.apacheconf',
regex: '\\b(?:MetaDir|MetaFiles|MetaSuffix)\\b' },
{ token: 'keyword.cgi.apacheconf',
regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength)\\b' },
{ token: 'keyword.cgid.apacheconf',
regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock)\\b' },
{ token: 'keyword.charset_lite.apacheconf',
regex: '\\b(?:CharsetDefault|CharsetOptions|CharsetSourceEnc)\\b' },
{ token: 'keyword.dav.apacheconf',
regex: '\\b(?:Dav|DavDepthInfinity|DavMinTimeout|DavLockDB)\\b' },
{ token: 'keyword.deflate.apacheconf',
regex: '\\b(?:DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize)\\b' },
{ token: 'keyword.dir.apacheconf',
regex: '\\b(?:DirectoryIndex|DirectorySlash)\\b' },
{ token: 'keyword.disk_cache.apacheconf',
regex: '\\b(?:CacheDirLength|CacheDirLevels|CacheExpiryCheck|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheMaxFileSize|CacheMinFileSize|CacheRoot|CacheSize|CacheTimeMargin)\\b' },
{ token: 'keyword.dumpio.apacheconf',
regex: '\\b(?:DumpIOInput|DumpIOOutput)\\b' },
{ token: 'keyword.env.apacheconf',
regex: '\\b(?:PassEnv|SetEnv|UnsetEnv)\\b' },
{ token: 'keyword.expires.apacheconf',
regex: '\\b(?:ExpiresActive|ExpiresByType|ExpiresDefault)\\b' },
{ token: 'keyword.ext_filter.apacheconf',
regex: '\\b(?:ExtFilterDefine|ExtFilterOptions)\\b' },
{ token: 'keyword.file_cache.apacheconf',
regex: '\\b(?:CacheFile|MMapFile)\\b' },
{ token: 'keyword.headers.apacheconf',
regex: '\\b(?:Header|RequestHeader)\\b' },
{ token: 'keyword.imap.apacheconf',
regex: '\\b(?:ImapBase|ImapDefault|ImapMenu)\\b' },
{ token: 'keyword.include.apacheconf',
regex: '\\b(?:SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|XBitHack)\\b' },
{ token: 'keyword.isapi.apacheconf',
regex: '\\b(?:ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer)\\b' },
{ token: 'keyword.ldap.apacheconf',
regex: '\\b(?:LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTrustedCA|LDAPTrustedCAType)\\b' },
{ token: 'keyword.log.apacheconf',
regex: '\\b(?:BufferedLogs|CookieLog|CustomLog|LogFormat|TransferLog|ForensicLog)\\b' },
{ token: 'keyword.mem_cache.apacheconf',
regex: '\\b(?:MCacheMaxObjectCount|MCacheMaxObjectSize|MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize)\\b' },
{ token: 'keyword.mime.apacheconf',
regex: '\\b(?:AddCharset|AddEncoding|AddHandler|AddInputFilter|AddLanguage|AddOutputFilter|AddType|DefaultLanguage|ModMimeUsePathInfo|MultiviewsMatch|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|TypesConfig)\\b' },
{ token: 'keyword.misc.apacheconf',
regex: '\\b(?:ProtocolEcho|Example|AddModuleInfo|MimeMagicFile|CheckSpelling|ExtendedStatus|SuexecUserGroup|UserDir)\\b' },
{ token: 'keyword.negotiation.apacheconf',
regex: '\\b(?:CacheNegotiatedDocs|ForceLanguagePriority|LanguagePriority)\\b' },
{ token: 'keyword.nw_ssl.apacheconf',
regex: '\\b(?:NWSSLTrustedCerts|NWSSLUpgradeable|SecureListen)\\b' },
{ token: 'keyword.proxy.apacheconf',
regex: '\\b(?:AllowCONNECT|NoProxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyFtpDirCharset|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassReverse|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia)\\b' },
{ token: 'keyword.rewrite.apacheconf',
regex: '\\b(?:RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule)\\b' },
{ token: 'keyword.setenvif.apacheconf',
regex: '\\b(?:BrowserMatch|BrowserMatchNoCase|SetEnvIf|SetEnvIfNoCase)\\b' },
{ token: 'keyword.so.apacheconf',
regex: '\\b(?:LoadFile|LoadModule)\\b' },
{ token: 'keyword.ssl.apacheconf',
regex: '\\b(?:SSLCACertificateFile|SSLCACertificatePath|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth)\\b' },
{ token: 'keyword.usertrack.apacheconf',
regex: '\\b(?:CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking)\\b' },
{ token: 'keyword.vhost_alias.apacheconf',
regex: '\\b(?:VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP)\\b' },
{ token: ['keyword.php.apacheconf',
'text',
'entity.property.apacheconf',
'text',
'string.value.apacheconf',
'text'],
regex: '\\b(php_value|php_flag)\\b(?:(\\s+)(.+?)(?:(\\s+)(.+?))?)?(\\s)' },
{ token: ['punctuation.variable.apacheconf',
'variable.env.apacheconf',
'variable.misc.apacheconf',
'punctuation.variable.apacheconf'],
regex: '(%\\{)(?:(HTTP_USER_AGENT|HTTP_REFERER|HTTP_COOKIE|HTTP_FORWARDED|HTTP_HOST|HTTP_PROXY_CONNECTION|HTTP_ACCEPT|REMOTE_ADDR|REMOTE_HOST|REMOTE_PORT|REMOTE_USER|REMOTE_IDENT|REQUEST_METHOD|SCRIPT_FILENAME|PATH_INFO|QUERY_STRING|AUTH_TYPE|DOCUMENT_ROOT|SERVER_ADMIN|SERVER_NAME|SERVER_ADDR|SERVER_PORT|SERVER_PROTOCOL|SERVER_SOFTWARE|TIME_YEAR|TIME_MON|TIME_DAY|TIME_HOUR|TIME_MIN|TIME_SEC|TIME_WDAY|TIME|API_VERSION|THE_REQUEST|REQUEST_URI|REQUEST_FILENAME|IS_SUBREQ|HTTPS)|(.*?))(\\})' },
{ token: ['entity.mime-type.apacheconf', 'text'],
regex: '\\b((?:text|image|application|video|audio)/.+?)(\\s)' },
{ token: 'entity.helper.apacheconf',
regex: '\\b(?:from|unset|set|on|off)\\b',
caseInsensitive: true },
{ token: 'constant.integer.apacheconf', regex: '\\b\\d+\\b' },
{ token: ['text',
'punctuation.definition.flag.apacheconf',
'string.flag.apacheconf',
'punctuation.definition.flag.apacheconf',
'text'],
regex: '(\\s)(\\[)(.*?)(\\])(\\s)' }] };
this.normalizeRules();
};
ApacheConfHighlightRules.metaData = { fileTypes: ['conf',
'CONF',
'htaccess',
'HTACCESS',
'htgroups',
'HTGROUPS',
'htpasswd',
'HTPASSWD',
'.htaccess',
'.HTACCESS',
'.htgroups',
'.HTGROUPS',
'.htpasswd',
'.HTPASSWD'],
name: 'Apache Conf',
scopeName: 'source.apacheconf' };
oop.inherits(ApacheConfHighlightRules, TextHighlightRules);
exports.ApacheConfHighlightRules = ApacheConfHighlightRules;
});
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(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 (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/apache_conf",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/apache_conf_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var ApacheConfHighlightRules = require("./apache_conf_highlight_rules").ApacheConfHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
this.HighlightRules = ApacheConfHighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "#";
this.$id = "ace/mode/apache_conf";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/apache_conf"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,402 @@
ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function () {
this.$rules = {
"start": [
{
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
defaultToken: "comment.doc",
caseInsensitive: true
}
]
};
};
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function (start) {
return {
token: "comment.doc.tag.storage.type",
regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
};
};
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc",
regex: "\\/\\*(?=\\*)",
next: start
};
};
DocCommentHighlightRules.getEndRule = function (start) {
return {
token: "comment.doc",
regex: "\\*\\/",
next: start
};
};
exports.DocCommentHighlightRules = DocCommentHighlightRules;
});
ace.define("ace/mode/apex_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/doc_comment_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("../mode/text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = require("../mode/doc_comment_highlight_rules").DocCommentHighlightRules;
var ApexHighlightRules = function () {
var mainKeywordMapper = this.createKeywordMapper({
"variable.language": "activate|any|autonomous|begin|bigdecimal|byte|cast|char|collect|const"
+ "|end|exit|export|float|goto|group|having|hint|import|inner|into|join|loop|number|object|of|outer"
+ "|parallel|pragma|retrieve|returning|search|short|stat|synchronized|then|this_month"
+ "|transaction|type|when",
"keyword": "private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final"
+ "|and|array|as|asc|break|bulk|by|catch|class|commit|continue|convertcurrency"
+ "|delete|desc|do|else|enum|extends|false|final|finally|for|from|future|global"
+ "|if|implements|in|insert|instanceof|interface|last_90_days|last_month"
+ "|last_n_days|last_week|like|limit|list|map|merge|new|next_90_days|next_month|next_n_days"
+ "|next_week|not|null|nulls|on|or|override|package|return"
+ "|rollback|savepoint|select|set|sort|super|testmethod|this|this_week|throw|today"
+ "|tolabel|tomorrow|trigger|true|try|undelete|update|upsert|using|virtual|webservice"
+ "|where|while|yesterday|switch|case|default",
"storage.type": "def|boolean|byte|char|short|int|float|pblob|date|datetime|decimal|double|id|integer|long|string|time|void|blob|Object",
"constant.language": "true|false|null|after|before|count|excludes|first|includes|last|order|sharing|with",
"support.function": "system|apex|label|apexpages|userinfo|schema"
}, "identifier", true);
function keywordMapper(value) {
if (value.slice(-3) == "__c")
return "support.function";
return mainKeywordMapper(value);
}
function string(start, options) {
return {
regex: start + (options.multiline ? "" : "(?=.)"),
token: "string.start",
next: [{
regex: options.escape,
token: "character.escape"
}, {
regex: options.error,
token: "error.invalid"
}, {
regex: start + (options.multiline ? "" : "|$"),
token: "string.end",
next: options.next || "start"
}, {
defaultToken: "string"
}]
};
}
function comments() {
return [{
token: "comment",
regex: "\\/\\/(?=.)",
next: [
DocCommentHighlightRules.getTagRule(),
{ token: "comment", regex: "$|^", next: "start" },
{ defaultToken: "comment", caseInsensitive: true }
]
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
token: "comment",
regex: /\/\*/,
next: [
DocCommentHighlightRules.getTagRule(),
{ token: "comment", regex: "\\*\\/", next: "start" },
{ defaultToken: "comment", caseInsensitive: true }
]
}
];
}
this.$rules = {
start: [
string("'", {
escape: /\\[nb'"\\]/,
error: /\\./,
multiline: false
}),
comments("c"),
{
type: "decoration",
token: [
"meta.package.apex",
"keyword.other.package.apex",
"meta.package.apex",
"storage.modifier.package.apex",
"meta.package.apex",
"punctuation.terminator.apex"
],
regex: /^(\s*)(package)\b(?:(\s*)([^ ;$]+)(\s*)((?:;)?))?/
}, {
regex: /@[a-zA-Z_$][a-zA-Z_$\d\u0080-\ufffe]*/,
token: "constant.language"
},
{
regex: /[a-zA-Z_$][a-zA-Z_$\d\u0080-\ufffe]*/,
token: keywordMapper
},
{
regex: "`#%",
token: "error.invalid"
}, {
token: "constant.numeric",
regex: /[+-]?\d+(?:(?:\.\d*)?(?:[LlDdEe][+-]?\d+)?)\b|\.\d+[LlDdEe]/
}, {
token: "keyword.operator",
regex: /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
next: "start"
}, {
token: "punctuation.operator",
regex: /[?:,;.]/,
next: "start"
}, {
token: "paren.lparen",
regex: /[\[]/,
next: "maybe_soql",
merge: false
}, {
token: "paren.lparen",
regex: /[\[({]/,
next: "start",
merge: false
}, {
token: "paren.rparen",
regex: /[\])}]/,
merge: false
}
],
maybe_soql: [{
regex: /\s+/,
token: "text"
}, {
regex: /(SELECT|FIND)\b/,
token: "keyword",
caseInsensitive: true,
next: "soql"
}, {
regex: "",
token: "none",
next: "start"
}],
soql: [{
regex: "(:?ASC|BY|CATEGORY|CUBE|DATA|DESC|END|FIND|FIRST|FOR|FROM|GROUP|HAVING|IN|LAST"
+ "|LIMIT|NETWORK|NULLS|OFFSET|ORDER|REFERENCE|RETURNING|ROLLUP|SCOPE|SELECT"
+ "|SNIPPET|TRACKING|TYPEOF|UPDATE|USING|VIEW|VIEWSTAT|WHERE|WITH|AND|OR)\\b",
token: "keyword",
caseInsensitive: true
}, {
regex: "(:?target_length|toLabel|convertCurrency|count|Contact|Account|User|FIELDS)\\b",
token: "support.function",
caseInsensitive: true
}, {
token: "paren.rparen",
regex: /[\]]/,
next: "start",
merge: false
},
string("'", {
escape: /\\[nb'"\\]/,
error: /\\./,
multiline: false,
next: "soql"
}),
string('"', {
escape: /\\[nb'"\\]/,
error: /\\./,
multiline: false,
next: "soql"
}),
{
regex: /\\./,
token: "character.escape"
},
{
regex: /[\?\&\|\!\{\}\[\]\(\)\^\~\*\:\"\'\+\-\,\.=\\\/]/,
token: "keyword.operator"
}],
"log-start": [{
token: "timestamp.invisible",
regex: /^[\d:.() ]+\|/,
next: "log-header"
}, {
token: "timestamp.invisible",
regex: /^ (Number of|Maximum)[^:]*:/,
next: "log-comment"
}, {
token: "invisible",
regex: /^Execute Anonymous:/,
next: "log-comment"
}, {
defaultToken: "text"
}],
"log-comment": [{
token: "log-comment",
regex: /.*$/,
next: "log-start"
}],
"log-header": [{
token: "timestamp.invisible",
regex: /((USER_DEBUG|\[\d+\]|DEBUG)\|)+/
},
{
token: "keyword",
regex: "(?:EXECUTION_FINISHED|EXECUTION_STARTED|CODE_UNIT_STARTED"
+ "|CUMULATIVE_LIMIT_USAGE|LIMIT_USAGE_FOR_NS"
+ "|CUMULATIVE_LIMIT_USAGE_END|CODE_UNIT_FINISHED)"
}, {
regex: "",
next: "log-start"
}]
};
this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
this.normalizeRules();
};
oop.inherits(ApexHighlightRules, TextHighlightRules);
exports.ApexHighlightRules = ApexHighlightRules;
});
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(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 (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/apex",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/apex_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/* caption: Apex; extensions: apex,cls,trigger,tgr */
"use strict";
var oop = require("../lib/oop");
var TextMode = require("../mode/text").Mode;
var ApexHighlightRules = require("./apex_highlight_rules").ApexHighlightRules;
var FoldMode = require("../mode/folding/cstyle").FoldMode;
function ApexMode() {
TextMode.call(this);
this.HighlightRules = ApexHighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
}
oop.inherits(ApexMode, TextMode);
ApexMode.prototype.lineCommentStart = "//";
ApexMode.prototype.blockComment = {
start: "/*",
end: "*/"
};
exports.Mode = ApexMode;
}); (function() {
ace.require(["ace/mode/apex"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,232 @@
ace.define("ace/mode/applescript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var AppleScriptHighlightRules = function () {
var keywords = ("about|above|after|against|and|around|as|at|back|before|beginning|" +
"behind|below|beneath|beside|between|but|by|considering|" +
"contain|contains|continue|copy|div|does|eighth|else|end|equal|" +
"equals|error|every|exit|fifth|first|for|fourth|from|front|" +
"get|given|global|if|ignoring|in|into|is|it|its|last|local|me|" +
"middle|mod|my|ninth|not|of|on|onto|or|over|prop|property|put|ref|" +
"reference|repeat|returning|script|second|set|seventh|since|" +
"sixth|some|tell|tenth|that|the|then|third|through|thru|" +
"timeout|times|to|transaction|try|until|where|while|whose|with|without");
var builtinConstants = ("AppleScript|false|linefeed|return|pi|quote|result|space|tab|true");
var builtinFunctions = ("activate|beep|count|delay|launch|log|offset|read|round|run|say|" +
"summarize|write");
var builtinTypes = ("alias|application|boolean|class|constant|date|file|integer|list|" +
"number|real|record|string|text|character|characters|contents|day|" +
"frontmost|id|item|length|month|name|paragraph|paragraphs|rest|" +
"reverse|running|time|version|weekday|word|words|year");
var keywordMapper = this.createKeywordMapper({
"support.function": builtinFunctions,
"constant.language": builtinConstants,
"support.type": builtinTypes,
"keyword": keywords
}, "identifier");
this.$rules = {
"start": [
{
token: "comment",
regex: "--.*$"
},
{
token: "comment",
regex: "\\(\\*",
next: "comment"
},
{
token: "string",
regex: '".*?"'
},
{
token: "support.type",
regex: '\\b(POSIX file|POSIX path|(date|time) string|quoted form)\\b'
},
{
token: "support.function",
regex: '\\b(clipboard info|the clipboard|info for|list (disks|folder)|' +
'mount volume|path to|(close|open for) access|(get|set) eof|' +
'current date|do shell script|get volume settings|random number|' +
'set volume|system attribute|system info|time to GMT|' +
'(load|run|store) script|scripting components|' +
'ASCII (character|number)|localized string|' +
'choose (application|color|file|file name|' +
'folder|from list|remote application|URL)|' +
'display (alert|dialog))\\b|^\\s*return\\b'
},
{
token: "constant.language",
regex: '\\b(text item delimiters|current application|missing value)\\b'
},
{
token: "keyword",
regex: '\\b(apart from|aside from|instead of|out of|greater than|' +
"isn't|(doesn't|does not) (equal|come before|come after|contain)|" +
'(greater|less) than( or equal)?|(starts?|ends|begins?) with|' +
'contained by|comes (before|after)|a (ref|reference))\\b'
},
{
token: keywordMapper,
regex: "[a-zA-Z][a-zA-Z0-9_]*\\b"
}
],
"comment": [
{
token: "comment",
regex: "\\*\\)",
next: "start"
}, {
defaultToken: "comment"
}
]
};
this.normalizeRules();
};
oop.inherits(AppleScriptHighlightRules, TextHighlightRules);
exports.AppleScriptHighlightRules = AppleScriptHighlightRules;
});
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(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 (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/applescript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/applescript_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var AppleScriptHighlightRules = require("./applescript_highlight_rules").AppleScriptHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
this.HighlightRules = AppleScriptHighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "--";
this.blockComment = { start: "(*", end: "*)" };
this.$id = "ace/mode/applescript";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/applescript"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,92 @@
ace.define("ace/mode/aql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var AqlHighlightRules = function () {
var keywords = ("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");
var builtinConstants = ("true|false");
var builtinFunctions = ("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");
var keywordMapper = this.createKeywordMapper({
"support.function": builtinFunctions,
"keyword": keywords,
"constant.language": builtinConstants
}, "identifier", true);
this.$rules = {
"start": [{
token: "comment",
regex: "//.*$"
}, {
token: "string",
regex: '".*?"'
}, {
token: "string",
regex: "'.*?'"
}, {
token: "constant.numeric",
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, {
token: keywordMapper,
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();
};
oop.inherits(AqlHighlightRules, TextHighlightRules);
exports.AqlHighlightRules = AqlHighlightRules;
});
ace.define("ace/mode/aql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/aql_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var AqlHighlightRules = require("./aql_highlight_rules").AqlHighlightRules;
var Mode = function () {
this.HighlightRules = AqlHighlightRules;
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "//";
this.$id = "ace/mode/aql";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/aql"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,311 @@
ace.define("ace/mode/asciidoc_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var AsciidocHighlightRules = function () {
var identifierRe = "[a-zA-Z\u00a1-\uffff]+\\b";
this.$rules = {
"start": [
{ token: "empty", regex: /$/ },
{ token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock" },
{ token: "literal", regex: /^-{4,}\s*$/, next: "literalBlock" },
{ token: "string", regex: /^\+{4,}\s*$/, next: "passthroughBlock" },
{ token: "keyword", regex: /^={4,}\s*$/ },
{ token: "text", regex: /^\s*$/ },
{ token: "empty", regex: "", next: "dissallowDelimitedBlock" }
],
"dissallowDelimitedBlock": [
{ include: "paragraphEnd" },
{ token: "comment", regex: '^//.+$' },
{ token: "keyword", regex: "^(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION):" },
{ include: "listStart" },
{ token: "literal", regex: /^\s+.+$/, next: "indentedBlock" },
{ token: "empty", regex: "", next: "text" }
],
"paragraphEnd": [
{ token: "doc.comment", regex: /^\/{4,}\s*$/, next: "commentBlock" },
{ token: "tableBlock", regex: /^\s*[|!]=+\s*$/, next: "tableBlock" },
{ token: "keyword", regex: /^(?:--|''')\s*$/, next: "start" },
{ token: "option", regex: /^\[.*\]\s*$/, next: "start" },
{ token: "pageBreak", regex: /^>{3,}$/, next: "start" },
{ token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock" },
{ token: "titleUnderline", regex: /^(?:={2,}|-{2,}|~{2,}|\^{2,}|\+{2,})\s*$/, next: "start" },
{ token: "singleLineTitle", regex: /^={1,5}\s+\S.*$/, next: "start" },
{ token: "otherBlock", regex: /^(?:\*{2,}|_{2,})\s*$/, next: "start" },
{ token: "optionalTitle", regex: /^\.[^.\s].+$/, next: "start" }
],
"listStart": [
{ token: "keyword", regex: /^\s*(?:\d+\.|[a-zA-Z]\.|[ixvmIXVM]+\)|\*{1,5}|-|\.{1,5})\s/, next: "listText" },
{ token: "meta.tag", regex: /^.+(?::{2,4}|;;)(?: |$)/, next: "listText" },
{ token: "support.function.list.callout", regex: /^(?:<\d+>|\d+>|>) /, next: "text" },
{ token: "keyword", regex: /^\+\s*$/, next: "start" }
],
"text": [
{ token: ["link", "variable.language"], regex: /((?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+)(\[.*?\])/ },
{ token: "link", regex: /(?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+/ },
{ token: "link", regex: /\b[\w\.\/\-]+@[\w\.\/\-]+\b/ },
{ include: "macros" },
{ include: "paragraphEnd" },
{ token: "literal", regex: /\+{3,}/, next: "smallPassthrough" },
{ token: "escape", regex: /\((?:C|TM|R)\)|\.{3}|->|<-|=>|<=|&#(?:\d+|x[a-fA-F\d]+);|(?: |^)--(?=\s+\S)/ },
{ token: "escape", regex: /\\[_*'`+#]|\\{2}[_*'`+#]{2}/ },
{ token: "keyword", regex: /\s\+$/ },
{ token: "text", regex: identifierRe },
{ token: ["keyword", "string", "keyword"],
regex: /(<<[\w\d\-$]+,)(.*?)(>>|$)/ },
{ token: "keyword", regex: /<<[\w\d\-$]+,?|>>/ },
{ token: "constant.character", regex: /\({2,3}.*?\){2,3}/ },
{ token: "keyword", regex: /\[\[.+?\]\]/ },
{ token: "support", regex: /^\[{3}[\w\d =\-]+\]{3}/ },
{ include: "quotes" },
{ token: "empty", regex: /^\s*$/, next: "start" }
],
"listText": [
{ include: "listStart" },
{ include: "text" }
],
"indentedBlock": [
{ token: "literal", regex: /^[\s\w].+$/, next: "indentedBlock" },
{ token: "literal", regex: "", next: "start" }
],
"listingBlock": [
{ token: "literal", regex: /^\.{4,}\s*$/, next: "dissallowDelimitedBlock" },
{ token: "constant.numeric", regex: '<\\d+>' },
{ token: "literal", regex: '[^<]+' },
{ token: "literal", regex: '<' }
],
"literalBlock": [
{ token: "literal", regex: /^-{4,}\s*$/, next: "dissallowDelimitedBlock" },
{ token: "constant.numeric", regex: '<\\d+>' },
{ token: "literal", regex: '[^<]+' },
{ token: "literal", regex: '<' }
],
"passthroughBlock": [
{ token: "literal", regex: /^\+{4,}\s*$/, next: "dissallowDelimitedBlock" },
{ token: "literal", regex: identifierRe + "|\\d+" },
{ include: "macros" },
{ token: "literal", regex: "." }
],
"smallPassthrough": [
{ token: "literal", regex: /[+]{3,}/, next: "dissallowDelimitedBlock" },
{ token: "literal", regex: /^\s*$/, next: "dissallowDelimitedBlock" },
{ token: "literal", regex: identifierRe + "|\\d+" },
{ include: "macros" }
],
"commentBlock": [
{ token: "doc.comment", regex: /^\/{4,}\s*$/, next: "dissallowDelimitedBlock" },
{ token: "doc.comment", regex: '^.*$' }
],
"tableBlock": [
{ token: "tableBlock", regex: /^\s*\|={3,}\s*$/, next: "dissallowDelimitedBlock" },
{ token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "innerTableBlock" },
{ token: "tableBlock", regex: /\|/ },
{ include: "text", noEscape: true }
],
"innerTableBlock": [
{ token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "tableBlock" },
{ token: "tableBlock", regex: /^\s*|={3,}\s*$/, next: "dissallowDelimitedBlock" },
{ token: "tableBlock", regex: /!/ }
],
"macros": [
{ token: "macro", regex: /{[\w\-$]+}/ },
{ token: ["text", "string", "text", "constant.character", "text"], regex: /({)([\w\-$]+)(:)?(.+)?(})/ },
{ token: ["text", "markup.list.macro", "keyword", "string"], regex: /(\w+)(footnote(?:ref)?::?)([^\s\[]+)?(\[.*?\])?/ },
{ token: ["markup.list.macro", "keyword", "string"], regex: /([a-zA-Z\-][\w\.\/\-]*::?)([^\s\[]+)(\[.*?\])?/ },
{ token: ["markup.list.macro", "keyword"], regex: /([a-zA-Z\-][\w\.\/\-]+::?)(\[.*?\])/ },
{ token: "keyword", regex: /^:.+?:(?= |$)/ }
],
"quotes": [
{ token: "string.italic", regex: /__[^_\s].*?__/ },
{ token: "string.italic", regex: quoteRule("_") },
{ token: "keyword.bold", regex: /\*\*[^*\s].*?\*\*/ },
{ token: "keyword.bold", regex: quoteRule("\\*") },
{ token: "literal", regex: quoteRule("\\+") },
{ token: "literal", regex: /\+\+[^+\s].*?\+\+/ },
{ token: "literal", regex: /\$\$.+?\$\$/ },
{ token: "literal", regex: quoteRule("`") },
{ token: "keyword", regex: quoteRule("^") },
{ token: "keyword", regex: quoteRule("~") },
{ token: "keyword", regex: /##?/ },
{ token: "keyword", regex: /(?:\B|^)``|\b''/ }
]
};
function quoteRule(ch) {
var prefix = /\w/.test(ch) ? "\\b" : "(?:\\B|^)";
return prefix + ch + "[^" + ch + "].*?" + ch + "(?![\\w*])";
}
var tokenMap = {
macro: "constant.character",
tableBlock: "doc.comment",
titleUnderline: "markup.heading",
singleLineTitle: "markup.heading",
pageBreak: "string",
option: "string.regexp",
otherBlock: "markup.list",
literal: "support.function",
optionalTitle: "constant.numeric",
escape: "constant.language.escape",
link: "markup.underline.list"
};
for (var state in this.$rules) {
var stateRules = this.$rules[state];
for (var i = stateRules.length; i--;) {
var rule = stateRules[i];
if (rule.include || typeof rule == "string") {
var args = [i, 1].concat(this.$rules[rule.include || rule]);
if (rule.noEscape) {
args = args.filter(function (x) {
return !x.next;
});
}
stateRules.splice.apply(stateRules, args);
}
else if (rule.token in tokenMap) {
rule.token = tokenMap[rule.token];
}
}
}
};
oop.inherits(AsciidocHighlightRules, TextHighlightRules);
exports.AsciidocHighlightRules = AsciidocHighlightRules;
});
ace.define("ace/mode/folding/asciidoc",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function () { };
oop.inherits(FoldMode, BaseFoldMode);
(function () {
this.foldingStartMarker = /^(?:\|={10,}|[\.\/=\-~^+]{4,}\s*$|={1,5} )/;
this.singleLineHeadingRe = /^={1,5}(?=\s+\S)/;
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row);
if (!this.foldingStartMarker.test(line))
return "";
if (line[0] == "=") {
if (this.singleLineHeadingRe.test(line))
return "start";
if (session.getLine(row - 1).length != session.getLine(row).length)
return "";
return "start";
}
if (session.bgTokenizer.getState(row) == "dissallowDelimitedBlock")
return "end";
return "start";
};
this.getFoldWidgetRange = function (session, foldStyle, row) {
var line = session.getLine(row);
var startColumn = line.length;
var maxRow = session.getLength();
var startRow = row;
var endRow = row;
if (!line.match(this.foldingStartMarker))
return;
var token;
function getTokenType(row) {
token = session.getTokens(row)[0];
return token && token.type;
}
var levels = ["=", "-", "~", "^", "+"];
var heading = "markup.heading";
var singleLineHeadingRe = this.singleLineHeadingRe;
function getLevel() {
var match = token.value.match(singleLineHeadingRe);
if (match)
return match[0].length;
var level = levels.indexOf(token.value[0]) + 1;
if (level == 1) {
if (session.getLine(row - 1).length != session.getLine(row).length)
return Infinity;
}
return level;
}
if (getTokenType(row) == heading) {
var startHeadingLevel = getLevel();
while (++row < maxRow) {
if (getTokenType(row) != heading)
continue;
var level = getLevel();
if (level <= startHeadingLevel)
break;
}
var isSingleLineHeading = token && token.value.match(this.singleLineHeadingRe);
endRow = isSingleLineHeading ? row - 1 : row - 2;
if (endRow > startRow) {
while (endRow > startRow && (!getTokenType(endRow) || token.value[0] == "["))
endRow--;
}
if (endRow > startRow) {
var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn);
}
}
else {
var state = session.bgTokenizer.getState(row);
if (state == "dissallowDelimitedBlock") {
while (row-- > 0) {
if (session.bgTokenizer.getState(row).lastIndexOf("Block") == -1)
break;
}
endRow = row + 1;
if (endRow < startRow) {
var endColumn = session.getLine(row).length;
return new Range(endRow, 5, startRow, startColumn - 5);
}
}
else {
while (++row < maxRow) {
if (session.bgTokenizer.getState(row) == "dissallowDelimitedBlock")
break;
}
endRow = row;
if (endRow > startRow) {
var endColumn = session.getLine(row).length;
return new Range(startRow, 5, endRow, endColumn - 5);
}
}
}
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/asciidoc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/asciidoc_highlight_rules","ace/mode/folding/asciidoc"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var AsciidocHighlightRules = require("./asciidoc_highlight_rules").AsciidocHighlightRules;
var AsciidocFoldMode = require("./folding/asciidoc").FoldMode;
var Mode = function () {
this.HighlightRules = AsciidocHighlightRules;
this.foldingRules = new AsciidocFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
this.type = "text";
this.getNextLineIndent = function (state, line, tab) {
if (state == "listblock") {
var match = /^((?:.+)?)([-+*][ ]+)/.exec(line);
if (match) {
return new Array(match[1].length + 1).join(" ") + match[2];
}
else {
return "";
}
}
else {
return this.$getIndent(line);
}
};
this.$id = "ace/mode/asciidoc";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/asciidoc"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,357 @@
ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function () {
this.$rules = {
"start": [
{
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
defaultToken: "comment.doc",
caseInsensitive: true
}
]
};
};
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function (start) {
return {
token: "comment.doc.tag.storage.type",
regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
};
};
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc",
regex: "\\/\\*(?=\\*)",
next: start
};
};
DocCommentHighlightRules.getEndRule = function (start) {
return {
token: "comment.doc",
regex: "\\*\\/",
next: start
};
};
exports.DocCommentHighlightRules = DocCommentHighlightRules;
});
ace.define("ace/mode/asl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var ASLHighlightRules = function () {
var keywords = ("Default|DefinitionBlock|Device|Method|Else|ElseIf|For|Function|If|Include|Method|Return|" +
"Scope|Switch|Case|While|Break|BreakPoint|Continue|NoOp|Wait|True|False|" +
"AccessAs|Acquire|Alias|BankField|Buffer|Concatenate|ConcatenateResTemplate|" +
"CondRefOf|Connection|CopyObject|CreateBitField|CreateByteField|CreateDWordField|" +
"CreateField|CreateQWordField|CreateWordField|DataTableRegion|Debug|" +
"DMA|DWordIO|DWordMemory|DWordSpace|EisaId|EISAID|EndDependentFn|Event|ExtendedIO|" +
"ExtendedMemory|ExtendedSpace|External|Fatal|Field|FindSetLeftBit|FindSetRightBit|" +
"FixedDMA|FixedIO|Fprintf|FromBCD|GpioInt|GpioIo|I2CSerialBusV2|IndexField|" +
"Interrupt|IO|IRQ|IRQNoFlags|Load|LoadTable|Match|Memory32|Memory32Fixed|" +
"Mid|Mutex|Name|Notify|Offset|ObjectType|OperationRegion|Package|PowerResource|Printf|" +
"QWordIO|QWordMemory|QWordSpace|RawDataBuffer|Register|Release|Reset|ResourceTemplate|" +
"Signal|SizeOf|Sleep|SPISerialBusV2|Stall|StartDependentFn|StartDependentFnNoPri|" +
"Store|ThermalZone|Timer|ToBCD|ToBuffer|ToDecimalString|ToInteger|ToPLD|ToString|" +
"ToUUID|UARTSerialBusV2|Unicode|Unload|VendorLong|VendorShort|WordBusNumber|WordIO|" +
"WordSpace");
var keywordOperators = ("Add|And|Decrement|Divide|Increment|Index|LAnd|LEqual|LGreater|LGreaterEqual|" +
"LLess|LLessEqual|LNot|LNotEqual|LOr|Mod|Multiply|NAnd|NOr|Not|Or|RefOf|Revision|" +
"ShiftLeft|ShiftRight|Subtract|XOr|DerefOf");
var flags = ("AttribQuick|AttribSendReceive|AttribByte|AttribBytes|AttribRawBytes|" +
"AttribRawProcessBytes|AttribWord|AttribBlock|AttribProcessCall|AttribBlockProcessCall|" +
"AnyAcc|ByteAcc|WordAcc|DWordAcc|QWordAcc|BufferAcc|" +
"AddressRangeMemory|AddressRangeReserved|AddressRangeNVS|AddressRangeACPI|" +
"RegionSpaceKeyword|FFixedHW|PCC|" +
"AddressingMode7Bit|AddressingMode10Bit|" +
"DataBitsFive|DataBitsSix|DataBitsSeven|DataBitsEight|DataBitsNine|" +
"BusMaster|NotBusMaster|" +
"ClockPhaseFirst|ClockPhaseSecond|ClockPolarityLow|ClockPolarityHigh|" +
"SubDecode|PosDecode|" +
"BigEndianing|LittleEndian|" +
"FlowControlNone|FlowControlXon|FlowControlHardware|" +
"Edge|Level|ActiveHigh|ActiveLow|ActiveBoth|Decode16|Decode10|" +
"IoRestrictionNone|IoRestrictionInputOnly|IoRestrictionOutputOnly|" +
"IoRestrictionNoneAndPreserve|Lock|NoLock|MTR|MEQ|MLE|MLT|MGE|MGT|" +
"MaxFixed|MaxNotFixed|Cacheable|WriteCombining|Prefetchable|NonCacheable|" +
"MinFixed|MinNotFixed|" +
"ParityTypeNone|ParityTypeSpace|ParityTypeMark|ParityTypeOdd|ParityTypeEven|" +
"PullDefault|PullUp|PullDown|PullNone|PolarityHigh|PolarityLow|" +
"ISAOnlyRanges|NonISAOnlyRanges|EntireRange|ReadWrite|ReadOnly|" +
"UserDefRegionSpace|SystemIO|SystemMemory|PCI_Config|EmbeddedControl|" +
"SMBus|SystemCMOS|PciBarTarget|IPMI|GeneralPurposeIO|GenericSerialBus|" +
"ResourceConsumer|ResourceProducer|Serialized|NotSerialized|" +
"Shared|Exclusive|SharedAndWake|ExclusiveAndWake|ControllerInitiated|DeviceInitiated|" +
"StopBitsZero|StopBitsOne|StopBitsOnePlusHalf|StopBitsTwo|" +
"Width8Bit|Width16Bit|Width32Bit|Width64Bit|Width128Bit|Width256Bit|" +
"SparseTranslation|DenseTranslation|TypeTranslation|TypeStatic|" +
"Preserve|WriteAsOnes|WriteAsZeros|Transfer8|Transfer16|Transfer8_16|" +
"ThreeWireMode|FourWireMode");
var storageTypes = ("UnknownObj|IntObj|StrObj|BuffObj|PkgObj|FieldUnitObj|DeviceObj|" +
"EventObj|MethodObj|MutexObj|OpRegionObj|PowerResObj|ProcessorObj|" +
"ThermalZoneObj|BuffFieldObj|DDBHandleObj");
var builtinConstants = ("__FILE__|__PATH__|__LINE__|__DATE__|__IASL__");
var strNumbers = ("One|Ones|Zero");
var deprecated = ("Memory24|Processor");
var keywordMapper = this.createKeywordMapper({
"keyword": keywords,
"constant.numeric": strNumbers,
"keyword.operator": keywordOperators,
"constant.language": builtinConstants,
"storage.type": storageTypes,
"constant.library": flags,
"invalid.deprecated": deprecated
}, "identifier");
this.$rules = {
"start": [
{
token: "comment",
regex: "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
token: "comment",
regex: "\\/\\*",
next: "comment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
token: "comment",
regex: "\\\[",
next: "ignoredfield"
}, {
token: "variable",
regex: "\\Local[0-7]|\\Arg[0-6]"
}, {
token: "keyword",
regex: "#\\s*(?:define|elif|else|endif|error|if|ifdef|ifndef|include|includebuffer|line|pragma|undef|warning)\\b",
next: "directive"
}, {
token: "string",
regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, {
token: "constant.character",
regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
token: "constant.numeric",
regex: /0[xX][0-9a-fA-F]+\b/
}, {
token: "constant.numeric",
regex: /[0-9]+\b/
}, {
token: keywordMapper,
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, {
token: "keyword.operator",
regex: /[!\~\*\/%+-<>\^|=&]/
}, {
token: "lparen",
regex: "[[({]"
}, {
token: "rparen",
regex: "[\\])}]"
}, {
token: "text",
regex: "\\s+"
}
],
"comment": [
{
token: "comment",
regex: "\\*\\/",
next: "start"
}, {
defaultToken: "comment"
}
],
"ignoredfield": [
{
token: "comment",
regex: "\\\]",
next: "start"
}, {
defaultToken: "comment"
}
],
"directive": [
{
token: "constant.other.multiline",
regex: /\\/
},
{
token: "constant.other.multiline",
regex: /.*\\/
},
{
token: "constant.other",
regex: "\\s*<.+?>*s",
next: "start"
},
{
token: "constant.other",
regex: '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]*s',
next: "start"
},
{
token: "constant.other",
regex: "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",
next: "start"
},
{
token: "constant.other",
regex: /[^\\\/]+/,
next: "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
};
oop.inherits(ASLHighlightRules, TextHighlightRules);
exports.ASLHighlightRules = ASLHighlightRules;
});
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(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 (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/asl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/asl_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var ASLHighlightRules = require("./asl_highlight_rules").ASLHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
this.HighlightRules = ASLHighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.$id = "ace/mode/asl";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/asl"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,170 @@
ace.define("ace/mode/assembly_x86_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from Assembly x86.tmLanguage (uuid: ) */
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var AssemblyX86HighlightRules = function () {
this.$rules = { start: [{ token: 'keyword.control.assembly',
regex: '\\b(?:aaa|aad|aam|aas|adc|add|addpd|addps|addsd|addss|addsubpd|addsubps|aesdec|aesdeclast|aesenc|aesenclast|aesimc|aeskeygenassist|and|andpd|andps|andnpd|andnps|arpl|blendpd|blendps|blendvpd|blendvps|bound|bsf|bsr|bswap|bt|btc|btr|bts|cbw|cwde|cdqe|clc|cld|cflush|clts|cmc|cmov(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|cmp|cmppd|cmpps|cmps|cnpsb|cmpsw|cmpsd|cmpsq|cmpss|cmpxchg|cmpxchg8b|cmpxchg16b|comisd|comiss|cpuid|crc32|cvtdq2pd|cvtdq2ps|cvtpd2dq|cvtpd2pi|cvtpd2ps|cvtpi2pd|cvtpi2ps|cvtps2dq|cvtps2pd|cvtps2pi|cvtsd2si|cvtsd2ss|cvts2sd|cvtsi2ss|cvtss2sd|cvtss2si|cvttpd2dq|cvtpd2pi|cvttps2dq|cvttps2pi|cvttps2dq|cvttps2pi|cvttsd2si|cvttss2si|cwd|cdq|cqo|daa|das|dec|div|divpd|divps|divsd|divss|dppd|dpps|emms|enter|extractps|f2xm1|fabs|fadd|faddp|fiadd|fbld|fbstp|fchs|fclex|fnclex|fcmov(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|fcom|fcmop|fcompp|fcomi|fcomip|fucomi|fucomip|fcos|fdecstp|fdiv|fdivp|fidiv|fdivr|fdivrp|fidivr|ffree|ficom|ficomp|fild|fincstp|finit|fnint|fist|fistp|fisttp|fld|fld1|fldl2t|fldl2e|fldpi|fldlg2|fldln2|fldz|fldcw|fldenv|fmul|fmulp|fimul|fnop|fpatan|fprem|fprem1|fptan|frndint|frstor|fsave|fnsave|fscale|fsin|fsincos|fsqrt|fst|fstp|fstcw|fnstcw|fstenv|fnstenv|fsts|fnstsw|fsub|fsubp|fisub|fsubr|fsubrp|fisubr|ftst|fucom|fucomp|fucompp|fxam|fxch|fxrstor|fxsave|fxtract|fyl2x|fyl2xp1|haddpd|haddps|husbpd|hsubps|idiv|imul|in|inc|ins|insb|insw|insd|insertps|int|into|invd|invplg|invpcid|iret|iretd|iretq|lahf|lar|lddqu|ldmxcsr|lds|les|lfs|lgs|lss|lea|leave|lfence|lgdt|lidt|llgdt|lmsw|lock|lods|lodsb|lodsw|lodsd|lodsq|lsl|ltr|maskmovdqu|maskmovq|maxpd|maxps|maxsd|maxss|mfence|minpd|minps|minsd|minss|monitor|mov|movapd|movaps|movbe|movd|movq|movddup|movdqa|movdqu|movq2q|movhlps|movhpd|movhps|movlhps|movlpd|movlps|movmskpd|movmskps|movntdqa|movntdq|movnti|movntpd|movntps|movntq|movq|movq2dq|movs|movsb|movsw|movsd|movsq|movsd|movshdup|movsldup|movss|movsx|movsxd|movupd|movups|movzx|mpsadbw|mul|mulpd|mulps|mulsd|mulss|mwait|neg|not|or|orpd|orps|out|outs|outsb|outsw|outsd|pabsb|pabsw|pabsd|packsswb|packssdw|packusdw|packuswbpaddb|paddw|paddd|paddq|paddsb|paddsw|paddusb|paddusw|palignr|pand|pandn|pause|pavgb|pavgw|pblendvb|pblendw|pclmulqdq|pcmpeqb|pcmpeqw|pcmpeqd|pcmpeqq|pcmpestri|pcmpestrm|pcmptb|pcmptgw|pcmpgtd|pcmpgtq|pcmpistri|pcmpisrm|pextrb|pextrd|pextrq|pextrw|phaddw|phaddd|phaddsw|phinposuw|phsubw|phsubd|phsubsw|pinsrb|pinsrd|pinsrq|pinsrw|pmaddubsw|pmadddwd|pmaxsb|pmaxsd|pmaxsw|pmaxsw|pmaxub|pmaxud|pmaxuw|pminsb|pminsd|pminsw|pminub|pminud|pminuw|pmovmskb|pmovsx|pmovzx|pmuldq|pmulhrsw|pmulhuw|pmulhw|pmulld|pmullw|pmuludw|pop|popa|popad|popcnt|popf|popfd|popfq|por|prefetch|psadbw|pshufb|pshufd|pshufhw|pshuflw|pshufw|psignb|psignw|psignd|pslldq|psllw|pslld|psllq|psraw|psrad|psrldq|psrlw|psrld|psrlq|psubb|psubw|psubd|psubq|psubsb|psubsw|psubusb|psubusw|test|ptest|punpckhbw|punpckhwd|punpckhdq|punpckhddq|punpcklbw|punpcklwd|punpckldq|punpckldqd|push|pusha|pushad|pushf|pushfd|pxor|prcl|rcr|rol|ror|rcpps|rcpss|rdfsbase|rdgsbase|rdmsr|rdpmc|rdrand|rdtsc|rdtscp|rep|repe|repz|repne|repnz|roundpd|roundps|roundsd|roundss|rsm|rsqrps|rsqrtss|sahf|sal|sar|shl|shr|sbb|scas|scasb|scasw|scasd|set(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|sfence|sgdt|shld|shrd|shufpd|shufps|sidt|sldt|smsw|sqrtpd|sqrtps|sqrtsd|sqrtss|stc|std|stmxcsr|stos|stosb|stosw|stosd|stosq|str|sub|subpd|subps|subsd|subss|swapgs|syscall|sysenter|sysexit|sysret|teset|ucomisd|ucomiss|ud2|unpckhpd|unpckhps|unpcklpd|unpcklps|vbroadcast|vcvtph2ps|vcvtp2sph|verr|verw|vextractf128|vinsertf128|vmaskmov|vpermilpd|vpermilps|vperm2f128|vtestpd|vtestps|vzeroall|vzeroupper|wait|fwait|wbinvd|wrfsbase|wrgsbase|wrmsr|xadd|xchg|xgetbv|xlat|xlatb|xor|xorpd|xorps|xrstor|xsave|xsaveopt|xsetbv|lzcnt|extrq|insertq|movntsd|movntss|vfmaddpd|vfmaddps|vfmaddsd|vfmaddss|vfmaddsubbpd|vfmaddsubps|vfmsubaddpd|vfmsubaddps|vfmsubpd|vfmsubps|vfmsubsd|vfnmaddpd|vfnmaddps|vfnmaddsd|vfnmaddss|vfnmsubpd|vfnmusbps|vfnmusbsd|vfnmusbss|cvt|xor|cli|sti|hlt|nop|lock|wait|enter|leave|ret|loop(?:n?e|n?z)?|call|j(?:mp|n?e|ge?|ae?|le?|be?|n?o|n?z))\\b',
caseInsensitive: true },
{ token: 'variable.parameter.register.assembly',
regex: '\\b(?:CS|DS|ES|FS|GS|SS|RAX|EAX|RBX|EBX|RCX|ECX|RDX|EDX|RCX|RIP|EIP|IP|RSP|ESP|SP|RSI|ESI|SI|RDI|EDI|DI|RFLAGS|EFLAGS|FLAGS|R8-15|(?:Y|X)MM(?:[0-9]|10|11|12|13|14|15)|(?:A|B|C|D)(?:X|H|L)|CR(?:[0-4]|DR(?:[0-7]|TR6|TR7|EFER)))\\b',
caseInsensitive: true },
{ token: 'constant.character.decimal.assembly',
regex: '\\b[0-9]+\\b' },
{ token: 'constant.character.hexadecimal.assembly',
regex: '\\b0x[A-F0-9]+\\b',
caseInsensitive: true },
{ token: 'constant.character.hexadecimal.assembly',
regex: '\\b[A-F0-9]+h\\b',
caseInsensitive: true },
{ token: 'string.assembly', regex: /'([^\\']|\\.)*'/ },
{ token: 'string.assembly', regex: /"([^\\"]|\\.)*"/ },
{ token: 'support.function.directive.assembly',
regex: '^\\[',
push: [{ token: 'support.function.directive.assembly',
regex: '\\]$',
next: 'pop' },
{ defaultToken: 'support.function.directive.assembly' }] },
{ token: ['support.function.directive.assembly',
'support.function.directive.assembly',
'entity.name.function.assembly'],
regex: '(^struc)( )([_a-zA-Z][_a-zA-Z0-9]*)' },
{ token: 'support.function.directive.assembly',
regex: '^endstruc\\b' },
{ token: ['support.function.directive.assembly',
'entity.name.function.assembly',
'support.function.directive.assembly',
'constant.character.assembly'],
regex: '^(%macro )([_a-zA-Z][_a-zA-Z0-9]*)( )([0-9]+)' },
{ token: 'support.function.directive.assembly',
regex: '^%endmacro' },
{ token: ['text',
'support.function.directive.assembly',
'text',
'entity.name.function.assembly'],
regex: '(\\s*)(%define|%xdefine|%idefine|%undef|%assign|%defstr|%strcat|%strlen|%substr|%00|%0|%rotate|%rep|%endrep|%include|\\$\\$|\\$|%unmacro|%if|%elif|%else|%endif|%(?:el)?ifdef|%(?:el)?ifmacro|%(?:el)?ifctx|%(?:el)?ifidn|%(?:el)?ifidni|%(?:el)?ifid|%(?:el)?ifnum|%(?:el)?ifstr|%(?:el)?iftoken|%(?:el)?ifempty|%(?:el)?ifenv|%pathsearch|%depend|%use|%push|%pop|%repl|%arg|%stacksize|%local|%error|%warning|%fatal|%line|%!|%comment|%endcomment|__NASM_VERSION_ID__|__NASM_VER__|__FILE__|__LINE__|__BITS__|__OUTPUT_FORMAT__|__DATE__|__TIME__|__DATE_NUM__|_TIME__NUM__|__UTC_DATE__|__UTC_TIME__|__UTC_DATE_NUM__|__UTC_TIME_NUM__|__POSIX_TIME__|__PASS__|ISTRUC|AT|IEND|BITS 16|BITS 32|BITS 64|USE16|USE32|__SECT__|ABSOLUTE|EXTERN|GLOBAL|COMMON|CPU|FLOAT)\\b( ?)((?:[_a-zA-Z][_a-zA-Z0-9]*)?)',
caseInsensitive: true },
{ token: 'support.function.directive.assembly',
regex: '\\b(?:d[bwdqtoy]|res[bwdqto]|equ|times|align|alignb|sectalign|section|ptr|byte|word|dword|qword|incbin)\\b',
caseInsensitive: true },
{ 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: ';.*$' }]
};
this.normalizeRules();
};
AssemblyX86HighlightRules.metaData = { fileTypes: ['asm'],
name: 'Assembly x86',
scopeName: 'source.assembly' };
oop.inherits(AssemblyX86HighlightRules, TextHighlightRules);
exports.AssemblyX86HighlightRules = AssemblyX86HighlightRules;
});
ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function () { };
oop.inherits(FoldMode, BaseFoldMode);
(function () {
this.commentBlock = function (session, row) {
var re = /\S/;
var line = session.getLine(row);
var startLevel = line.search(re);
if (startLevel == -1 || line[startLevel] != "#")
return;
var startColumn = line.length;
var maxRow = session.getLength();
var startRow = row;
var endRow = row;
while (++row < maxRow) {
line = session.getLine(row);
var level = line.search(re);
if (level == -1)
continue;
if (line[level] != "#")
break;
endRow = row;
}
if (endRow > startRow) {
var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn);
}
};
this.getFoldWidgetRange = function (session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
range = this.commentBlock(session, row);
if (range)
return range;
};
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row);
var indent = line.search(/\S/);
var next = session.getLine(row + 1);
var prev = session.getLine(row - 1);
var prevIndent = prev.search(/\S/);
var nextIndent = next.search(/\S/);
if (indent == -1) {
session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
return "";
}
if (prevIndent == -1) {
if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
session.foldWidgets[row - 1] = "";
session.foldWidgets[row + 1] = "";
return "start";
}
}
else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
if (session.getLine(row - 2).search(/\S/) == -1) {
session.foldWidgets[row - 1] = "start";
session.foldWidgets[row + 1] = "";
return "";
}
}
if (prevIndent != -1 && prevIndent < indent)
session.foldWidgets[row - 1] = "start";
else
session.foldWidgets[row - 1] = "";
if (indent < nextIndent)
return "start";
else
return "";
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/assembly_x86",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/assembly_x86_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var AssemblyX86HighlightRules = require("./assembly_x86_highlight_rules").AssemblyX86HighlightRules;
var FoldMode = require("./folding/coffee").FoldMode;
var Mode = function () {
this.HighlightRules = AssemblyX86HighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = [";"];
this.$id = "ace/mode/assembly_x86";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/assembly_x86"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,199 @@
ace.define("ace/mode/batchfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from C:\Users\LED\AppData\Roaming\Sublime Text 2\Packages\Batch File\Batch File.tmLanguage (uuid: ) */
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var BatchFileHighlightRules = 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: true },
{ token: 'keyword.control.statement.dosbatch',
regex: '\\b(?:goto|call|exit)\\b',
caseInsensitive: true },
{ token: 'keyword.control.conditional.if.dosbatch',
regex: '\\bif\\s+not\\s+(?:exist|defined|errorlevel|cmdextversion)\\b',
caseInsensitive: true },
{ token: 'keyword.control.conditional.dosbatch',
regex: '\\b(?:if|else)\\b',
caseInsensitive: true },
{ token: 'keyword.control.repeat.dosbatch',
regex: '\\bfor\\b',
caseInsensitive: true },
{ token: 'keyword.operator.dosbatch',
regex: '\\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b' },
{ token: ['doc.comment', 'comment'],
regex: '(?:^|\\b)(rem)($|\\s.*$)',
caseInsensitive: true },
{ 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();
};
BatchFileHighlightRules.metaData = { name: 'Batch File',
scopeName: 'source.dosbatch',
fileTypes: ['bat'] };
oop.inherits(BatchFileHighlightRules, TextHighlightRules);
exports.BatchFileHighlightRules = BatchFileHighlightRules;
});
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(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 (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.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(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var BatchFileHighlightRules = require("./batchfile_highlight_rules").BatchFileHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
this.HighlightRules = BatchFileHighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "::";
this.blockComment = "";
this.$id = "ace/mode/batchfile";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/batchfile"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,318 @@
ace.define("ace/mode/bibtex_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var BibTeXHighlightRules = function () {
this.$rules = {
start: [
{
token: "comment",
regex: /@Comment\{/,
stateName: "bibtexComment",
push: [
{
token: "comment",
regex: /}/,
next: "pop"
}, {
token: "comment",
regex: /\{/,
push: "bibtexComment"
}, {
defaultToken: "comment"
}
]
}, {
token: [
"keyword", "text", "paren.lparen", "text", "variable", "text", "keyword.operator"
],
regex: /(@String)(\s*)(\{)(\s*)([a-zA-Z]*)(\s*)(=)/,
push: [
{
token: "paren.rparen",
regex: /\}/,
next: "pop"
}, {
include: "#misc"
}, {
defaultToken: "text"
}
]
}, {
token: [
"keyword", "text", "paren.lparen", "text", "variable", "text", "keyword.operator"
],
regex: /(@String)(\s*)(\()(\s*)([a-zA-Z]*)(\s*)(=)/,
push: [
{
token: "paren.rparen",
regex: /\)/,
next: "pop"
}, {
include: "#misc"
}, {
defaultToken: "text"
}
]
}, {
token: [
"keyword", "text", "paren.lparen"
],
regex: /(@preamble)(\s*)(\()/,
push: [
{
token: "paren.rparen",
regex: /\)/,
next: "pop"
}, {
include: "#misc"
}, {
defaultToken: "text"
}
]
}, {
token: [
"keyword", "text", "paren.lparen"
],
regex: /(@preamble)(\s*)(\{)/,
push: [
{
token: "paren.rparen",
regex: /\}/,
next: "pop"
}, {
include: "#misc"
}, {
defaultToken: "text"
}
]
}, {
token: [
"keyword", "text", "paren.lparen", "text", "support.class"
],
regex: /(@[a-zA-Z]+)(\s*)(\{)(\s*)([\w-]+)/,
push: [
{
token: "paren.rparen",
regex: /\}/,
next: "pop"
}, {
token: [
"variable", "text", "keyword.operator"
],
regex: /([a-zA-Z0-9\!\$\&\*\+\-\.\/\:\;\<\>\?\[\]\^\_\`\|]+)(\s*)(=)/,
push: [
{
token: "text",
regex: /(?=[,}])/,
next: "pop"
}, {
include: "#misc"
}, {
include: "#integer"
}, {
defaultToken: "text"
}
]
}, {
token: "punctuation",
regex: /,/
}, {
defaultToken: "text"
}
]
}, {
defaultToken: "comment"
}
],
"#integer": [
{
token: "constant.numeric.bibtex",
regex: /\d+/
}
],
"#misc": [
{
token: "string",
regex: /"/,
push: "#string_quotes"
}, {
token: "paren.lparen",
regex: /\{/,
push: "#string_braces"
}, {
token: "keyword.operator",
regex: /#/
}
],
"#string_braces": [
{
token: "paren.rparen",
regex: /\}/,
next: "pop"
}, {
token: "invalid.illegal",
regex: /@/
}, {
include: "#misc"
}, {
defaultToken: "string"
}
],
"#string_quotes": [
{
token: "string",
regex: /"/,
next: "pop"
}, {
include: "#misc"
}, {
defaultToken: "string"
}
]
};
this.normalizeRules();
};
oop.inherits(BibTeXHighlightRules, TextHighlightRules);
exports.BibTeXHighlightRules = BibTeXHighlightRules;
});
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(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 (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/bibtex",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/bibtex_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var BibTeXHighlightRules = require("./bibtex_highlight_rules").BibTeXHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
this.HighlightRules = BibTeXHighlightRules;
this.foldingRules = new FoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
this.$id = "ace/mode/bibtex";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/bibtex"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,250 @@
ace.define("ace/mode/c9search_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var lang = require("../lib/lang");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
function safeCreateRegexp(source, flag) {
try {
return new RegExp(source, flag);
}
catch (e) { }
}
var C9SearchHighlightRules = function () {
this.$rules = {
"start": [
{
tokenNames: ["c9searchresults.constant.numeric", "c9searchresults.text", "c9searchresults.text", "c9searchresults.keyword"],
regex: /(^\s+[0-9]+)(:)(\d*\s?)([^\r\n]+)/,
onMatch: function (val, state, stack) {
var values = this.splitRegex.exec(val);
var types = this.tokenNames;
var tokens = [{
type: types[0],
value: values[1]
}, {
type: types[1],
value: values[2]
}];
if (values[3]) {
if (values[3] == " ")
tokens[1] = { type: types[1], value: values[2] + " " };
else
tokens.push({ type: types[1], value: values[3] });
}
var regex = stack[1];
var str = values[4];
var m;
var last = 0;
if (regex && regex.exec) {
regex.lastIndex = 0;
while (m = regex.exec(str)) {
var skipped = str.substring(last, m.index);
last = regex.lastIndex;
if (skipped)
tokens.push({ type: types[2], value: skipped });
if (m[0])
tokens.push({ type: types[3], value: m[0] });
else if (!skipped)
break;
}
}
if (last < str.length)
tokens.push({ type: types[2], value: str.substr(last) });
return tokens;
}
},
{
regex: "^Searching for [^\\r\\n]*$",
onMatch: function (val, state, stack) {
var parts = val.split("\x01");
if (parts.length < 3)
return "text";
var options, search;
var i = 0;
var tokens = [{
value: parts[i++] + "'",
type: "text"
}, {
value: search = parts[i++],
type: "text" // "c9searchresults.keyword"
}, {
value: "'" + parts[i++],
type: "text"
}];
if (parts[2] !== " in") {
tokens.push({
value: "'" + parts[i++] + "'",
type: "text"
}, {
value: parts[i++],
type: "text"
});
}
tokens.push({
value: " " + parts[i++] + " ",
type: "text"
});
if (parts[i + 1]) {
options = parts[i + 1];
tokens.push({
value: "(" + parts[i + 1] + ")",
type: "text"
});
i += 1;
}
else {
i -= 1;
}
while (i++ < parts.length) {
parts[i] && tokens.push({
value: parts[i],
type: "text"
});
}
if (search) {
if (!/regex/.test(options))
search = lang.escapeRegExp(search);
if (/whole/.test(options))
search = "\\b" + search + "\\b";
}
var regex = search && safeCreateRegexp("(" + search + ")", / sensitive/.test(options) ? "g" : "ig");
if (regex) {
stack[0] = state;
stack[1] = regex;
}
return tokens;
}
},
{
regex: "^(?=Found \\d+ matches)",
token: "text",
next: "numbers"
},
{
token: "string",
regex: "^\\S:?[^:]+",
next: "numbers"
}
],
numbers: [{
regex: "\\d+",
token: "constant.numeric"
}, {
regex: "$",
token: "text",
next: "start"
}]
};
this.normalizeRules();
};
oop.inherits(C9SearchHighlightRules, TextHighlightRules);
exports.C9SearchHighlightRules = C9SearchHighlightRules;
});
ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
var Range = require("../range").Range;
var MatchingBraceOutdent = function () { };
(function () {
this.checkOutdent = function (line, input) {
if (!/^\s+$/.test(line))
return false;
return /^\s*\}/.test(input);
};
this.autoOutdent = function (doc, row) {
var line = doc.getLine(row);
var match = line.match(/^(\s*\})/);
if (!match)
return 0;
var column = match[1].length;
var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column - 1), indent);
};
this.$getIndent = function (line) {
return line.match(/^\s*/)[0];
};
}).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
ace.define("ace/mode/folding/c9search",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function () { };
oop.inherits(FoldMode, BaseFoldMode);
(function () {
this.foldingStartMarker = /^(\S.*:|Searching for.*)$/;
this.foldingStopMarker = /^(\s+|Found.*)$/;
this.getFoldWidgetRange = function (session, foldStyle, row) {
var lines = session.doc.getAllLines(row);
var line = lines[row];
var level1 = /^(Found.*|Searching for.*)$/;
var level2 = /^(\S.*:|\s*)$/;
var re = level1.test(line) ? level1 : level2;
var startRow = row;
var endRow = row;
if (this.foldingStartMarker.test(line)) {
for (var i = row + 1, l = session.getLength(); i < l; i++) {
if (re.test(lines[i]))
break;
}
endRow = i;
}
else if (this.foldingStopMarker.test(line)) {
for (var i = row - 1; i >= 0; i--) {
line = lines[i];
if (re.test(line))
break;
}
startRow = i;
}
if (startRow != endRow) {
var col = line.length;
if (re === level1)
col = line.search(/\(Found[^)]+\)$|$/);
return new Range(startRow, col, endRow, 0);
}
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/c9search",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c9search_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/c9search"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var C9SearchHighlightRules = require("./c9search_highlight_rules").C9SearchHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var C9StyleFoldMode = require("./folding/c9search").FoldMode;
var Mode = function () {
this.HighlightRules = C9SearchHighlightRules;
this.$outdent = new MatchingBraceOutdent();
this.foldingRules = new C9StyleFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
this.getNextLineIndent = function (state, line, tab) {
var indent = this.$getIndent(line);
return indent;
};
this.checkOutdent = function (state, line, input) {
return this.$outdent.checkOutdent(line, input);
};
this.autoOutdent = function (state, doc, row) {
this.$outdent.autoOutdent(doc, row);
};
this.$id = "ace/mode/c9search";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/c9search"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,417 @@
ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function () {
this.$rules = {
"start": [
{
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
defaultToken: "comment.doc",
caseInsensitive: true
}
]
};
};
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function (start) {
return {
token: "comment.doc.tag.storage.type",
regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
};
};
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc",
regex: "\\/\\*(?=\\*)",
next: start
};
};
DocCommentHighlightRules.getEndRule = function (start) {
return {
token: "comment.doc",
regex: "\\*\\/",
next: start
};
};
exports.DocCommentHighlightRules = DocCommentHighlightRules;
});
ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var cFunctions = exports.cFunctions = "hypot|hypotf|hypotl|sscanf|system|snprintf|scanf|scalbn|scalbnf|scalbnl|scalbln|scalblnf|scalblnl|sin|sinh|sinhf|sinhl|sinf|sinl|signal|signbit|strstr|strspn|strncpy|strncat|strncmp|strcspn|strchr|strcoll|strcpy|strcat|strcmp|strtoimax|strtod|strtoul|strtoull|strtoumax|strtok|strtof|strtol|strtold|strtoll|strerror|strpbrk|strftime|strlen|strrchr|strxfrm|sprintf|setjmp|setvbuf|setlocale|setbuf|sqrt|sqrtf|sqrtl|swscanf|swprintf|srand|nearbyint|nearbyintf|nearbyintl|nexttoward|nexttowardf|nexttowardl|nextafter|nextafterf|nextafterl|nan|nanf|nanl|csin|csinh|csinhf|csinhl|csinf|csinl|csqrt|csqrtf|csqrtl|ccos|ccosh|ccoshf|ccosf|ccosl|cimag|cimagf|cimagl|ctime|ctan|ctanh|ctanhf|ctanhl|ctanf|ctanl|cos|cosh|coshf|coshl|cosf|cosl|conj|conjf|conjl|copysign|copysignf|copysignl|cpow|cpowf|cpowl|cproj|cprojf|cprojl|ceil|ceilf|ceill|cexp|cexpf|cexpl|clock|clog|clogf|clogl|clearerr|casin|casinh|casinhf|casinhl|casinf|casinl|cacos|cacosh|cacoshf|cacoshl|cacosf|cacosl|catan|catanh|catanhf|catanhl|catanf|catanl|calloc|carg|cargf|cargl|cabs|cabsf|cabsl|creal|crealf|creall|cbrt|cbrtf|cbrtl|time|toupper|tolower|tan|tanh|tanhf|tanhl|tanf|tanl|trunc|truncf|truncl|tgamma|tgammaf|tgammal|tmpnam|tmpfile|isspace|isnormal|isnan|iscntrl|isinf|isdigit|isunordered|isupper|ispunct|isprint|isfinite|iswspace|iswcntrl|iswctype|iswdigit|iswupper|iswpunct|iswprint|iswlower|iswalnum|iswalpha|iswgraph|iswxdigit|iswblank|islower|isless|islessequal|islessgreater|isalnum|isalpha|isgreater|isgreaterequal|isgraph|isxdigit|isblank|ilogb|ilogbf|ilogbl|imaxdiv|imaxabs|div|difftime|_Exit|ungetc|ungetwc|pow|powf|powl|puts|putc|putchar|putwc|putwchar|perror|printf|erf|erfc|erfcf|erfcl|erff|erfl|exit|exp|exp2|exp2f|exp2l|expf|expl|expm1|expm1f|expm1l|vsscanf|vsnprintf|vscanf|vsprintf|vswscanf|vswprintf|vprintf|vfscanf|vfprintf|vfwscanf|vfwprintf|vwscanf|vwprintf|va_start|va_copy|va_end|va_arg|qsort|fscanf|fsetpos|fseek|fclose|ftell|fopen|fdim|fdimf|fdiml|fpclassify|fputs|fputc|fputws|fputwc|fprintf|feholdexcept|fesetenv|fesetexceptflag|fesetround|feclearexcept|fetestexcept|feof|feupdateenv|feraiseexcept|ferror|fegetenv|fegetexceptflag|fegetround|fflush|fwscanf|fwide|fwprintf|fwrite|floor|floorf|floorl|fabs|fabsf|fabsl|fgets|fgetc|fgetpos|fgetws|fgetwc|freopen|free|fread|frexp|frexpf|frexpl|fmin|fminf|fminl|fmod|fmodf|fmodl|fma|fmaf|fmal|fmax|fmaxf|fmaxl|ldiv|ldexp|ldexpf|ldexpl|longjmp|localtime|localeconv|log|log1p|log1pf|log1pl|log10|log10f|log10l|log2|log2f|log2l|logf|logl|logb|logbf|logbl|labs|lldiv|llabs|llrint|llrintf|llrintl|llround|llroundf|llroundl|lrint|lrintf|lrintl|lround|lroundf|lroundl|lgamma|lgammaf|lgammal|wscanf|wcsstr|wcsspn|wcsncpy|wcsncat|wcsncmp|wcscspn|wcschr|wcscoll|wcscpy|wcscat|wcscmp|wcstoimax|wcstod|wcstoul|wcstoull|wcstoumax|wcstok|wcstof|wcstol|wcstold|wcstoll|wcstombs|wcspbrk|wcsftime|wcslen|wcsrchr|wcsrtombs|wcsxfrm|wctob|wctomb|wcrtomb|wprintf|wmemset|wmemchr|wmemcpy|wmemcmp|wmemmove|assert|asctime|asin|asinh|asinhf|asinhl|asinf|asinl|acos|acosh|acoshf|acoshl|acosf|acosl|atoi|atof|atol|atoll|atexit|atan|atanh|atanhf|atanhl|atan2|atan2f|atan2l|atanf|atanl|abs|abort|gets|getc|getchar|getenv|getwc|getwchar|gmtime|rint|rintf|rintl|round|roundf|roundl|rename|realloc|rewind|remove|remquo|remquof|remquol|remainder|remainderf|remainderl|rand|raise|bsearch|btowc|modf|modff|modfl|memset|memchr|memcpy|memcmp|memmove|mktime|malloc|mbsinit|mbstowcs|mbsrtowcs|mbtowc|mblen|mbrtowc|mbrlen";
var c_cppHighlightRules = function (extraKeywords) {
var keywordControls = ("break|case|continue|default|do|else|for|goto|if|_Pragma|" +
"return|switch|while|catch|operator|try|throw|using");
var storageType = ("asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" +
"_Imaginary|int|int8_t|int16_t|int32_t|int64_t|long|short|signed|size_t|struct|typedef|uint8_t|uint16_t|uint32_t|uint64_t|union|unsigned|void|" +
"class|wchar_t|template|char16_t|char32_t");
var storageModifiers = ("const|extern|register|restrict|static|volatile|inline|private|" +
"protected|public|friend|explicit|virtual|export|mutable|typename|" +
"constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local");
var keywordOperators = ("and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|" +
"const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace");
var builtinConstants = ("NULL|true|false|TRUE|FALSE|nullptr");
var keywordMapper = this.$keywords = this.createKeywordMapper(Object.assign({
"keyword.control": keywordControls,
"storage.type": storageType,
"storage.modifier": storageModifiers,
"keyword.operator": keywordOperators,
"variable.language": "this",
"constant.language": builtinConstants,
"support.function.C99.c": cFunctions
}, extraKeywords), "identifier");
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
var escapeRe = /\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source;
var formatRe = "%"
+ /(\d+\$)?/.source // field (argument #)
+ /[#0\- +']*/.source // flags
+ /[,;:_]?/.source // separator character (AltiVec)
+ /((-?\d+)|\*(-?\d+\$)?)?/.source // minimum field width
+ /(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source // precision
+ /(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source // length modifier
+ /(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source; // conversion type
this.$rules = {
"start": [
{
token: "comment",
regex: "//$",
next: "start"
}, {
token: "comment",
regex: "//",
next: "singleLineComment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
token: "comment",
regex: "\\/\\*",
next: "comment"
}, {
token: "string",
regex: "'(?:" + escapeRe + "|.)?'"
}, {
token: "string.start",
regex: '"',
stateName: "qqstring",
next: [
{ token: "string", regex: /\\\s*$/, next: "qqstring" },
{ token: "constant.language.escape", regex: escapeRe },
{ token: "constant.language.escape", regex: formatRe },
{ token: "string.end", regex: '"|$', next: "start" },
{ defaultToken: "string" }
]
}, {
token: "string.start",
regex: 'R"\\(',
stateName: "rawString",
next: [
{ token: "string.end", regex: '\\)"', next: "start" },
{ defaultToken: "string" }
]
}, {
token: "constant.numeric",
regex: "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
}, {
token: "constant.numeric",
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
}, {
token: "keyword",
regex: "#\\s*(?:include|import|pragma|line|define|undef)\\b",
next: "directive"
}, {
token: "keyword",
regex: "#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"
}, {
token: keywordMapper,
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*"
}, {
token: "keyword.operator",
regex: /--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/
}, {
token: "punctuation.operator",
regex: "\\?|\\:|\\,|\\;|\\."
}, {
token: "paren.lparen",
regex: "[[({]"
}, {
token: "paren.rparen",
regex: "[\\])}]"
}, {
token: "text",
regex: "\\s+"
}
],
"comment": [
{
token: "comment",
regex: "\\*\\/",
next: "start"
}, {
defaultToken: "comment"
}
],
"singleLineComment": [
{
token: "comment",
regex: /\\$/,
next: "singleLineComment"
}, {
token: "comment",
regex: /$/,
next: "start"
}, {
defaultToken: "comment"
}
],
"directive": [
{
token: "constant.other.multiline",
regex: /\\/
},
{
token: "constant.other.multiline",
regex: /.*\\/
},
{
token: "constant.other",
regex: "\\s*<.+?>",
next: "start"
},
{
token: "constant.other",
regex: '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',
next: "start"
},
{
token: "constant.other",
regex: "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",
next: "start"
},
{
token: "constant.other",
regex: /[^\\\/]+/,
next: "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
this.normalizeRules();
};
oop.inherits(c_cppHighlightRules, TextHighlightRules);
exports.c_cppHighlightRules = c_cppHighlightRules;
});
ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
var Range = require("../range").Range;
var MatchingBraceOutdent = function () { };
(function () {
this.checkOutdent = function (line, input) {
if (!/^\s+$/.test(line))
return false;
return /^\s*\}/.test(input);
};
this.autoOutdent = function (doc, row) {
var line = doc.getLine(row);
var match = line.match(/^(\s*\})/);
if (!match)
return 0;
var column = match[1].length;
var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column - 1), indent);
};
this.$getIndent = function (line) {
return line.match(/^\s*/)[0];
};
}).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(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 (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
this.HighlightRules = c_cppHighlightRules;
this.$outdent = new MatchingBraceOutdent();
this.$behaviour = this.$defaultBehaviour;
this.foldingRules = new CStyleFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "//";
this.blockComment = { start: "/*", end: "*/" };
this.getNextLineIndent = function (state, line, tab) {
var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens;
var endState = tokenizedLine.state;
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
return indent;
}
if (state == "start") {
var match = line.match(/^.*[\{\(\[]\s*$/);
if (match) {
indent += tab;
}
}
else if (state == "doc-start") {
if (endState == "start") {
return "";
}
var match = line.match(/^\s*(\/?)\*/);
if (match) {
if (match[1]) {
indent += " ";
}
indent += "* ";
}
}
return indent;
};
this.checkOutdent = function (state, line, input) {
return this.$outdent.checkOutdent(line, input);
};
this.autoOutdent = function (state, doc, row) {
this.$outdent.autoOutdent(doc, row);
};
this.$id = "ace/mode/c_cpp";
this.snippetFileId = "ace/snippets/c_cpp";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/c_cpp"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,192 @@
ace.define("ace/mode/cirru_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CirruHighlightRules = function () {
this.$rules = {
start: [{
token: 'constant.numeric',
regex: /[\d\.]+/
}, {
token: 'comment.line.double-dash',
regex: /--/,
next: 'comment'
}, {
token: 'storage.modifier',
regex: /\(/
}, {
token: 'storage.modifier',
regex: /,/,
next: 'line'
}, {
token: 'support.function',
regex: /[^\(\)"\s{}\[\]]+/,
next: 'line'
}, {
token: 'string.quoted.double',
regex: /"/,
next: 'string'
}, {
token: 'storage.modifier',
regex: /\)/
}],
comment: [{
token: 'comment.line.double-dash',
regex: / +[^\n]+/,
next: 'start'
}],
string: [{
token: 'string.quoted.double',
regex: /"/,
next: 'line'
}, {
token: 'constant.character.escape',
regex: /\\/,
next: 'escape'
}, {
token: 'string.quoted.double',
regex: /[^\\"]+/
}],
escape: [{
token: 'constant.character.escape',
regex: /./,
next: 'string'
}],
line: [{
token: 'constant.numeric',
regex: /[\d\.]+/
}, {
token: 'markup.raw',
regex: /^\s*/,
next: 'start'
}, {
token: 'storage.modifier',
regex: /\$/,
next: 'start'
}, {
token: 'variable.parameter',
regex: /[^\(\)"\s{}\[\]]+/
}, {
token: 'storage.modifier',
regex: /\(/,
next: 'start'
}, {
token: 'storage.modifier',
regex: /\)/
}, {
token: 'markup.raw',
regex: /^ */,
next: 'start'
}, {
token: 'string.quoted.double',
regex: /"/,
next: 'string'
}]
};
};
oop.inherits(CirruHighlightRules, TextHighlightRules);
exports.CirruHighlightRules = CirruHighlightRules;
});
ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function () { };
oop.inherits(FoldMode, BaseFoldMode);
(function () {
this.commentBlock = function (session, row) {
var re = /\S/;
var line = session.getLine(row);
var startLevel = line.search(re);
if (startLevel == -1 || line[startLevel] != "#")
return;
var startColumn = line.length;
var maxRow = session.getLength();
var startRow = row;
var endRow = row;
while (++row < maxRow) {
line = session.getLine(row);
var level = line.search(re);
if (level == -1)
continue;
if (line[level] != "#")
break;
endRow = row;
}
if (endRow > startRow) {
var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn);
}
};
this.getFoldWidgetRange = function (session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
range = this.commentBlock(session, row);
if (range)
return range;
};
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row);
var indent = line.search(/\S/);
var next = session.getLine(row + 1);
var prev = session.getLine(row - 1);
var prevIndent = prev.search(/\S/);
var nextIndent = next.search(/\S/);
if (indent == -1) {
session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
return "";
}
if (prevIndent == -1) {
if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
session.foldWidgets[row - 1] = "";
session.foldWidgets[row + 1] = "";
return "start";
}
}
else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
if (session.getLine(row - 2).search(/\S/) == -1) {
session.foldWidgets[row - 1] = "start";
session.foldWidgets[row + 1] = "";
return "";
}
}
if (prevIndent != -1 && prevIndent < indent)
session.foldWidgets[row - 1] = "start";
else
session.foldWidgets[row - 1] = "";
if (indent < nextIndent)
return "start";
else
return "";
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/cirru",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/cirru_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var CirruHighlightRules = require("./cirru_highlight_rules").CirruHighlightRules;
var CoffeeFoldMode = require("./folding/coffee").FoldMode;
var Mode = function () {
this.HighlightRules = CirruHighlightRules;
this.foldingRules = new CoffeeFoldMode();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "--";
this.$id = "ace/mode/cirru";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/cirru"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,322 @@
ace.define("ace/mode/clojure_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var ClojureHighlightRules = function () {
var builtinFunctions = ('* *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* ' +
'*command-line-args* *compile-files* *compile-path* *e *err* *file* ' +
'*flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* ' +
'*print-dup* *print-length* *print-level* *print-meta* *print-readably* ' +
'*read-eval* *source-path* *use-context-classloader* ' +
'*warn-on-reflection* + - -> ->> .. / < <= = ' +
'== > &gt; >= &gt;= accessor aclone ' +
'add-classpath add-watch agent agent-errors aget alength alias all-ns ' +
'alter alter-meta! alter-var-root amap ancestors and apply areduce ' +
'array-map aset aset-boolean aset-byte aset-char aset-double aset-float ' +
'aset-int aset-long aset-short assert assoc assoc! assoc-in associative? ' +
'atom await await-for await1 bases bean bigdec bigint binding bit-and ' +
'bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left ' +
'bit-shift-right bit-test bit-xor boolean boolean-array booleans ' +
'bound-fn bound-fn* butlast byte byte-array bytes cast char char-array ' +
'char-escape-string char-name-string char? chars chunk chunk-append ' +
'chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? ' +
'class class? clear-agent-errors clojure-version coll? comment commute ' +
'comp comparator compare compare-and-set! compile complement concat cond ' +
'condp conj conj! cons constantly construct-proxy contains? count ' +
'counted? create-ns create-struct cycle dec decimal? declare definline ' +
'defmacro defmethod defmulti defn defn- defonce defstruct delay delay? ' +
'deliver deref derive descendants destructure disj disj! dissoc dissoc! ' +
'distinct distinct? doall doc dorun doseq dosync dotimes doto double ' +
'double-array doubles drop drop-last drop-while empty empty? ensure ' +
'enumeration-seq eval even? every? false? ffirst file-seq filter find ' +
'find-doc find-ns find-var first float float-array float? floats flush ' +
'fn fn? fnext for force format future future-call future-cancel ' +
'future-cancelled? future-done? future? gen-class gen-interface gensym ' +
'get get-in get-method get-proxy-class get-thread-bindings get-validator ' +
'hash hash-map hash-set identical? identity if-let if-not ifn? import ' +
'in-ns inc init-proxy instance? int int-array integer? interleave intern ' +
'interpose into into-array ints io! isa? iterate iterator-seq juxt key ' +
'keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list ' +
'list* list? load load-file load-reader load-string loaded-libs locking ' +
'long long-array longs loop macroexpand macroexpand-1 make-array ' +
'make-hierarchy map map? mapcat max max-key memfn memoize merge ' +
'merge-with meta method-sig methods min min-key mod name namespace neg? ' +
'newline next nfirst nil? nnext not not-any? not-empty not-every? not= ' +
'ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ' +
'ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? ' +
'or parents partial partition pcalls peek persistent! pmap pop pop! ' +
'pop-thread-bindings pos? pr pr-str prefer-method prefers ' +
'primitives-classnames print print-ctor print-doc print-dup print-method ' +
'print-namespace-doc print-simple print-special-doc print-str printf ' +
'println println-str prn prn-str promise proxy proxy-call-with-super ' +
'proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot ' +
'rand rand-int range ratio? rational? rationalize re-find re-groups ' +
're-matcher re-matches re-pattern re-seq read read-line read-string ' +
'reduce ref ref-history-count ref-max-history ref-min-history ref-set ' +
'refer refer-clojure release-pending-sends rem remove remove-method ' +
'remove-ns remove-watch repeat repeatedly replace replicate require ' +
'reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq ' +
'rsubseq second select-keys send send-off seq seq? seque sequence ' +
'sequential? set set-validator! set? short short-array shorts ' +
'shutdown-agents slurp some sort sort-by sorted-map sorted-map-by ' +
'sorted-set sorted-set-by sorted? special-form-anchor special-symbol? ' +
'split-at split-with str stream? string? struct struct-map subs subseq ' +
'subvec supers swap! symbol symbol? sync syntax-symbol-anchor take ' +
'take-last take-nth take-while test the-ns time to-array to-array-2d ' +
'trampoline transient tree-seq true? type unchecked-add unchecked-dec ' +
'unchecked-divide unchecked-inc unchecked-multiply unchecked-negate ' +
'unchecked-remainder unchecked-subtract underive unquote ' +
'unquote-splicing update-in update-proxy use val vals var-get var-set ' +
'var? vary-meta vec vector vector? when when-first when-let when-not ' +
'while with-bindings with-bindings* with-in-str with-loading-context ' +
'with-local-vars with-meta with-open with-out-str with-precision xml-seq ' +
'zero? zipmap');
var keywords = ('throw try var ' +
'def do fn if let loop monitor-enter monitor-exit new quote recur set!');
var buildinConstants = ("true false nil");
var keywordMapper = this.createKeywordMapper({
"keyword": keywords,
"constant.language": buildinConstants,
"support.function": builtinFunctions
}, "identifier", false, " ");
this.$rules = {
"start": [
{
token: "comment",
regex: ";.*$"
}, {
token: "keyword",
regex: "[\\(|\\)]"
}, {
token: "keyword",
regex: "[\\'\\(]"
}, {
token: "keyword",
regex: "[\\[|\\]]"
}, {
token: "string.regexp",
regex: '#"',
next: "regex"
}, {
token: "keyword",
regex: "[\\{|\\}|\\#\\{|\\#\\}]"
}, {
token: "keyword",
regex: '[\\&]'
}, {
token: "keyword",
regex: '[\\#\\^\\{]'
}, {
token: "keyword",
regex: '[\\%]'
}, {
token: "keyword",
regex: '[@]'
}, {
token: "constant.numeric",
regex: "0[xX][0-9a-fA-F]+\\b"
}, {
token: "constant.numeric",
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, {
token: "constant.language",
regex: '[!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+||=|!=|<=|>=|<>|<|>|!|&&]'
}, {
token: keywordMapper,
regex: "[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b"
}, {
token: "string",
regex: '"',
next: "string"
}, {
token: "constant",
regex: /:[^()\[\]{}'"\^%`,;\s]+/
}
],
"string": [
{
token: "constant.language.escape",
regex: "\\\\.|\\\\$"
}, {
token: "string",
regex: '"',
next: "start"
}, {
defaultToken: "string"
}
],
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
token: "string.regexp",
regex: '"',
next: "start"
}, {
token: "constant.language.escape",
regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
}, {
token: "constant.language.delimiter",
regex: /\|/
}, {
token: "constant.language.escape",
regex: /\[\^?/,
next: "regex_character_class"
}, {
defaultToken: "string.regexp"
}
],
"regex_character_class": [
{
token: "regexp.charclass.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
token: "constant.language.escape",
regex: "]",
next: "regex"
}, {
token: "constant.language.escape",
regex: "-"
}, {
defaultToken: "string.regexp.charachterclass"
}
]
};
};
oop.inherits(ClojureHighlightRules, TextHighlightRules);
exports.ClojureHighlightRules = ClojureHighlightRules;
});
ace.define("ace/mode/matching_parens_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
var Range = require("../range").Range;
var MatchingParensOutdent = function () { };
(function () {
this.checkOutdent = function (line, input) {
if (!/^\s+$/.test(line))
return false;
return /^\s*\)/.test(input);
};
this.autoOutdent = function (doc, row) {
var line = doc.getLine(row);
var match = line.match(/^(\s*\))/);
if (!match)
return 0;
var column = match[1].length;
var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column - 1), indent);
};
this.$getIndent = function (line) {
var match = line.match(/^(\s+)/);
if (match) {
return match[1];
}
return "";
};
}).call(MatchingParensOutdent.prototype);
exports.MatchingParensOutdent = MatchingParensOutdent;
});
ace.define("ace/mode/clojure",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/clojure_highlight_rules","ace/mode/matching_parens_outdent"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var ClojureHighlightRules = require("./clojure_highlight_rules").ClojureHighlightRules;
var MatchingParensOutdent = require("./matching_parens_outdent").MatchingParensOutdent;
var Mode = function () {
this.HighlightRules = ClojureHighlightRules;
this.$outdent = new MatchingParensOutdent();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = ";";
this.minorIndentFunctions = ["defn", "defn-", "defmacro", "def", "deftest", "testing"];
this.$toIndent = function (str) {
return str.split('').map(function (ch) {
if (/\s/.exec(ch)) {
return ch;
}
else {
return ' ';
}
}).join('');
};
this.$calculateIndent = function (line, tab) {
var baseIndent = this.$getIndent(line);
var delta = 0;
var isParen, ch;
for (var i = line.length - 1; i >= 0; i--) {
ch = line[i];
if (ch === '(') {
delta--;
isParen = true;
}
else if (ch === '(' || ch === '[' || ch === '{') {
delta--;
isParen = false;
}
else if (ch === ')' || ch === ']' || ch === '}') {
delta++;
}
if (delta < 0) {
break;
}
}
if (delta < 0 && isParen) {
i += 1;
var iBefore = i;
var fn = '';
while (true) {
ch = line[i];
if (ch === ' ' || ch === '\t') {
if (this.minorIndentFunctions.indexOf(fn) !== -1) {
return this.$toIndent(line.substring(0, iBefore - 1) + tab);
}
else {
return this.$toIndent(line.substring(0, i + 1));
}
}
else if (ch === undefined) {
return this.$toIndent(line.substring(0, iBefore - 1) + tab);
}
fn += line[i];
i++;
}
}
else if (delta < 0 && !isParen) {
return this.$toIndent(line.substring(0, i + 1));
}
else if (delta > 0) {
baseIndent = baseIndent.substring(0, baseIndent.length - tab.length);
return baseIndent;
}
else {
return baseIndent;
}
};
this.getNextLineIndent = function (state, line, tab) {
return this.$calculateIndent(line, tab);
};
this.checkOutdent = function (state, line, input) {
return this.$outdent.checkOutdent(line, input);
};
this.autoOutdent = function (state, doc, row) {
this.$outdent.autoOutdent(doc, row);
};
this.$id = "ace/mode/clojure";
this.snippetFileId = "ace/snippets/clojure";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/clojure"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,82 @@
ace.define("ace/mode/cobol_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CobolHighlightRules = function () {
var keywords = "ACCEPT|MERGE|SUM|ADD||MESSAGE|TABLE|ADVANCING|MODE|TAPE|" +
"AFTER|MULTIPLY|TEST|ALL|NEGATIVE|TEXT|ALPHABET|NEXT|THAN|" +
"ALSO|NO|THEN|ALTERNATE|NOT|THROUGH|AND|NUMBER|THRU|ANY|OCCURS|" +
"TIME|ARE|OF|TO|AREA|OFF|TOP||ASCENDING|OMITTED|TRUE|ASSIGN|ON|TYPE|AT|OPEN|" +
"UNIT|AUTHOR|OR|UNTIL|BEFORE|OTHER|UP|BLANK|OUTPUT|USE|BLOCK|PAGE|USING|BOTTOM|" +
"PERFORM|VALUE|BY|PIC|VALUES|CALL|PICTURE|WHEN|CANCEL|PLUS|WITH|CD|POINTER|WRITE|" +
"CHARACTER|POSITION||ZERO|CLOSE|POSITIVE|ZEROS|COLUMN|PROCEDURE|ZEROES|COMMA|PROGRAM|" +
"COMMON|PROGRAM-ID|COMMUNICATION|QUOTE|COMP|RANDOM|COMPUTE|READ|CONTAINS|RECEIVE|CONFIGURATION|" +
"RECORD|CONTINUE|REDEFINES|CONTROL|REFERENCE|COPY|REMAINDER|COUNT|REPLACE|DATA|REPORT|DATE|RESERVE|" +
"DAY|RESET|DELETE|RETURN|DESTINATION|REWIND|DISABLE|REWRITE|DISPLAY|RIGHT|DIVIDE|RUN|DOWN|SAME|" +
"ELSE|SEARCH|ENABLE|SECTION|END|SELECT|ENVIRONMENT|SENTENCE|EQUAL|SET|ERROR|SIGN|EXIT|SEQUENTIAL|" +
"EXTERNAL|SIZE|FLASE|SORT|FILE|SOURCE|LENGTH|SPACE|LESS|STANDARD|LIMIT|START|LINE|STOP|LOCK|STRING|LOW-VALUE|SUBTRACT";
var builtinConstants = ("true|false|null");
var builtinFunctions = ("count|min|max|avg|sum|rank|now|coalesce|main");
var keywordMapper = this.createKeywordMapper({
"support.function": builtinFunctions,
"keyword": keywords,
"constant.language": builtinConstants
}, "identifier", true);
this.$rules = {
"start": [{
token: "comment",
regex: "\\*.*$"
}, {
token: "string",
regex: '".*?"'
}, {
token: "string",
regex: "'.*?'"
}, {
token: "constant.numeric",
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, {
token: keywordMapper,
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+"
}]
};
};
oop.inherits(CobolHighlightRules, TextHighlightRules);
exports.CobolHighlightRules = CobolHighlightRules;
});
ace.define("ace/mode/cobol",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/cobol_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var CobolHighlightRules = require("./cobol_highlight_rules").CobolHighlightRules;
var Mode = function () {
this.HighlightRules = CobolHighlightRules;
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "*";
this.$id = "ace/mode/cobol";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/cobol"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,335 @@
ace.define("ace/mode/coffee_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
oop.inherits(CoffeeHighlightRules, TextHighlightRules);
function CoffeeHighlightRules() {
var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*";
var keywords = ("this|throw|then|try|typeof|super|switch|return|break|by|continue|" +
"catch|class|in|instanceof|is|isnt|if|else|extends|for|own|" +
"finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" +
"or|on|unless|until|and|yes|yield|export|import|default");
var langConstant = ("true|false|null|undefined|NaN|Infinity");
var illegal = ("case|const|function|var|void|with|enum|implements|" +
"interface|let|package|private|protected|public|static");
var supportClass = ("Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|" +
"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
"SyntaxError|TypeError|URIError|" +
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray");
var supportFunction = ("Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" +
"encodeURIComponent|decodeURI|decodeURIComponent|String|");
var variableLanguage = ("window|arguments|prototype|document");
var keywordMapper = this.createKeywordMapper({
"keyword": keywords,
"constant.language": langConstant,
"invalid.illegal": illegal,
"language.support.class": supportClass,
"language.support.function": supportFunction,
"variable.language": variableLanguage
}, "identifier");
var functionRule = {
token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"],
regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()"'\/])*?)(\))(\s*))?([\-=]>)/.source
};
var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/;
this.$rules = {
start: [
{
token: "constant.numeric",
regex: "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"
}, {
stateName: "qdoc",
token: "string", regex: "'''", next: [
{ token: "string", regex: "'''", next: "start" },
{ token: "constant.language.escape", regex: stringEscape },
{ defaultToken: "string" }
]
}, {
stateName: "qqdoc",
token: "string",
regex: '"""',
next: [
{ token: "string", regex: '"""', next: "start" },
{ token: "paren.string", regex: '#{', push: "start" },
{ token: "constant.language.escape", regex: stringEscape },
{ defaultToken: "string" }
]
}, {
stateName: "qstring",
token: "string", regex: "'", next: [
{ token: "string", regex: "'", next: "start" },
{ token: "constant.language.escape", regex: stringEscape },
{ defaultToken: "string" }
]
}, {
stateName: "qqstring",
token: "string.start", regex: '"', next: [
{ token: "string.end", regex: '"', next: "start" },
{ token: "paren.string", regex: '#{', push: "start" },
{ token: "constant.language.escape", regex: stringEscape },
{ defaultToken: "string" }
]
}, {
stateName: "js",
token: "string", regex: "`", next: [
{ token: "string", regex: "`", next: "start" },
{ token: "constant.language.escape", regex: stringEscape },
{ defaultToken: "string" }
]
}, {
regex: "[{}]", onMatch: function (val, state, stack) {
this.next = "";
if (val == "{" && stack.length) {
stack.unshift("start", state);
return "paren";
}
if (val == "}" && stack.length) {
stack.shift();
this.next = stack.shift() || "";
if (this.next.indexOf("string") != -1)
return "paren.string";
}
return "paren";
}
}, {
token: "string.regex",
regex: "///",
next: "heregex"
}, {
token: "string.regex",
regex: /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/
}, {
token: "comment",
regex: "###(?!#)",
next: "comment"
}, {
token: "comment",
regex: "#.*"
}, {
token: ["punctuation.operator", "text", "identifier"],
regex: "(\\.)(\\s*)(" + illegal + ")"
}, {
token: "punctuation.operator",
regex: "\\.{1,3}"
}, {
token: ["keyword", "text", "language.support.class",
"text", "keyword", "text", "language.support.class"],
regex: "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?"
}, {
token: ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token),
regex: "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex
},
functionRule,
{
token: "variable",
regex: "@(?:" + identifier + ")?"
}, {
token: keywordMapper,
regex: identifier
}, {
token: "punctuation.operator",
regex: "\\,|\\."
}, {
token: "storage.type",
regex: "[\\-=]>"
}, {
token: "keyword.operator",
regex: "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])"
}, {
token: "paren.lparen",
regex: "[({[]"
}, {
token: "paren.rparen",
regex: "[\\]})]"
}, {
token: "text",
regex: "\\s+"
}
],
heregex: [{
token: "string.regex",
regex: '.*?///[imgy]{0,4}',
next: "start"
}, {
token: "comment.regex",
regex: "\\s+(?:#.*)?"
}, {
token: "string.regex",
regex: "\\S+"
}],
comment: [{
token: "comment",
regex: '###',
next: "start"
}, {
defaultToken: "comment"
}]
};
this.normalizeRules();
}
exports.CoffeeHighlightRules = CoffeeHighlightRules;
});
ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
var Range = require("../range").Range;
var MatchingBraceOutdent = function () { };
(function () {
this.checkOutdent = function (line, input) {
if (!/^\s+$/.test(line))
return false;
return /^\s*\}/.test(input);
};
this.autoOutdent = function (doc, row) {
var line = doc.getLine(row);
var match = line.match(/^(\s*\})/);
if (!match)
return 0;
var column = match[1].length;
var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column - 1), indent);
};
this.$getIndent = function (line) {
return line.match(/^\s*/)[0];
};
}).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function () { };
oop.inherits(FoldMode, BaseFoldMode);
(function () {
this.commentBlock = function (session, row) {
var re = /\S/;
var line = session.getLine(row);
var startLevel = line.search(re);
if (startLevel == -1 || line[startLevel] != "#")
return;
var startColumn = line.length;
var maxRow = session.getLength();
var startRow = row;
var endRow = row;
while (++row < maxRow) {
line = session.getLine(row);
var level = line.search(re);
if (level == -1)
continue;
if (line[level] != "#")
break;
endRow = row;
}
if (endRow > startRow) {
var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn);
}
};
this.getFoldWidgetRange = function (session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
range = this.commentBlock(session, row);
if (range)
return range;
};
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row);
var indent = line.search(/\S/);
var next = session.getLine(row + 1);
var prev = session.getLine(row - 1);
var prevIndent = prev.search(/\S/);
var nextIndent = next.search(/\S/);
if (indent == -1) {
session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
return "";
}
if (prevIndent == -1) {
if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
session.foldWidgets[row - 1] = "";
session.foldWidgets[row + 1] = "";
return "start";
}
}
else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
if (session.getLine(row - 2).search(/\S/) == -1) {
session.foldWidgets[row - 1] = "start";
session.foldWidgets[row + 1] = "";
return "";
}
}
if (prevIndent != -1 && prevIndent < indent)
session.foldWidgets[row - 1] = "start";
else
session.foldWidgets[row - 1] = "";
if (indent < nextIndent)
return "start";
else
return "";
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/coffee",["require","exports","module","ace/mode/coffee_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/coffee","ace/range","ace/mode/text","ace/worker/worker_client","ace/lib/oop"], function(require, exports, module){"use strict";
var Rules = require("./coffee_highlight_rules").CoffeeHighlightRules;
var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var FoldMode = require("./folding/coffee").FoldMode;
var Range = require("../range").Range;
var TextMode = require("./text").Mode;
var WorkerClient = require("../worker/worker_client").WorkerClient;
var oop = require("../lib/oop");
function Mode() {
this.HighlightRules = Rules;
this.$outdent = new Outdent();
this.foldingRules = new FoldMode();
}
oop.inherits(Mode, TextMode);
(function () {
var indenter = /(?:[({[=:]|[-=]>|\b(?:else|try|(?:swi|ca)tch(?:\s+[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$|^\s*(else\b\s*)?(?:if|for|while|loop)\b(?!.*\bthen\b)/;
this.lineCommentStart = "#";
this.blockComment = { start: "###", end: "###" };
this.getNextLineIndent = function (state, line, tab) {
var indent = this.$getIndent(line);
var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
if (!(tokens.length && tokens[tokens.length - 1].type === 'comment') &&
state === 'start' && indenter.test(line))
indent += tab;
return indent;
};
this.checkOutdent = function (state, line, input) {
return this.$outdent.checkOutdent(line, input);
};
this.autoOutdent = function (state, doc, row) {
this.$outdent.autoOutdent(doc, row);
};
this.createWorker = function (session) {
var worker = new WorkerClient(["ace"], "ace/mode/coffee_worker", "Worker");
worker.attachToDocument(session.getDocument());
worker.on("annotate", function (e) {
session.setAnnotations(e.data);
});
worker.on("terminate", function () {
session.clearAnnotations();
});
return worker;
};
this.$id = "ace/mode/coffee";
this.snippetFileId = "ace/snippets/coffee";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/coffee"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,586 @@
ace.define("ace/mode/crystal_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CrystalHighlightRules = function () {
var builtinFunctions = ("puts|initialize|previous_def|typeof|as|pointerof|sizeof|instance_sizeof");
var keywords = ("if|end|else|elsif|unless|case|when|break|while|next|until|def|return|class|new|getter|setter|property|lib"
+ "|fun|do|struct|private|protected|public|module|super|abstract|include|extend|begin|enum|raise|yield|with"
+ "|alias|rescue|ensure|macro|uninitialized|union|type|require");
var buildinConstants = ("true|TRUE|false|FALSE|nil|NIL|__LINE__|__END_LINE__|__FILE__|__DIR__");
var builtinVariables = ("$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|" +
"root_url|flash|session|cookies|params|request|response|logger|self");
var keywordMapper = this.$keywords = this.createKeywordMapper({
"keyword": keywords,
"constant.language": buildinConstants,
"variable.language": builtinVariables,
"support.function": builtinFunctions
}, "identifier");
var hexNumber = "(?:0[xX][\\dA-Fa-f]+)";
var decNumber = "(?:[0-9][\\d_]*)";
var octNumber = "(?:0o[0-7][0-7]*)";
var binNumber = "(?:0[bB][01]+)";
var intNumber = "(?:[+-]?)(?:" + hexNumber + "|" + decNumber + "|" + octNumber + "|" + binNumber + ")(?:_?[iIuU](?:8|16|32|64))?\\b";
var escapeExpression = /\\(?:[nsrtvfbae'"\\]|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u{[\da-fA-F]{1,6}})/;
var extEscapeExspresssion = /\\(?:[nsrtvfbae'"\\]|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u{[\da-fA-F]{1,6}}|u{(:?[\da-fA-F]{2}\s)*[\da-fA-F]{2}})/;
this.$rules = {
"start": [
{
token: "comment",
regex: "#.*$"
}, {
token: "string.regexp",
regex: "[/]",
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string.regexp",
regex: "[/][imx]*(?=[).,;\\s]|$)",
next: "pop"
}, {
defaultToken: "string.regexp"
}]
},
[{
regex: "[{}]", onMatch: function (val, state, stack) {
this.next = val == "{" ? this.nextState : "";
if (val == "{" && stack.length) {
stack.unshift("start", state);
return "paren.lparen";
}
if (val == "}" && stack.length) {
stack.shift();
this.next = stack.shift();
if (this.next.indexOf("string") != -1)
return "paren.end";
}
return val == "{" ? "paren.lparen" : "paren.rparen";
},
nextState: "start"
}, {
token: "string.start",
regex: /"/,
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string",
regex: /\\#{/
}, {
token: "paren.start",
regex: /#{/,
push: "start"
}, {
token: "string.end",
regex: /"/,
next: "pop"
}, {
defaultToken: "string"
}]
}, {
token: "string.start",
regex: /`/,
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string",
regex: /\\#{/
}, {
token: "paren.start",
regex: /#{/,
push: "start"
}, {
token: "string.end",
regex: /`/,
next: "pop"
}, {
defaultToken: "string"
}]
}, {
stateName: "rpstring",
token: "string.start",
regex: /%[Qx]?\(/,
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string.start",
regex: /\(/,
push: "rpstring"
}, {
token: "string.end",
regex: /\)/,
next: "pop"
}, {
token: "paren.start",
regex: /#{/,
push: "start"
}, {
defaultToken: "string"
}]
}, {
stateName: "spstring",
token: "string.start",
regex: /%[Qx]?\[/,
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string.start",
regex: /\[/,
push: "spstring"
}, {
token: "string.end",
regex: /]/,
next: "pop"
}, {
token: "paren.start",
regex: /#{/,
push: "start"
}, {
defaultToken: "string"
}]
}, {
stateName: "fpstring",
token: "string.start",
regex: /%[Qx]?{/,
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string.start",
regex: /{/,
push: "fpstring"
}, {
token: "string.end",
regex: /}/,
next: "pop"
}, {
token: "paren.start",
regex: /#{/,
push: "start"
}, {
defaultToken: "string"
}]
}, {
stateName: "tpstring",
token: "string.start",
regex: /%[Qx]?</,
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string.start",
regex: /</,
push: "tpstring"
}, {
token: "string.end",
regex: />/,
next: "pop"
}, {
token: "paren.start",
regex: /#{/,
push: "start"
}, {
defaultToken: "string"
}]
}, {
stateName: "ppstring",
token: "string.start",
regex: /%[Qx]?\|/,
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string.end",
regex: /\|/,
next: "pop"
}, {
token: "paren.start",
regex: /#{/,
push: "start"
}, {
defaultToken: "string"
}]
}, {
stateName: "rpqstring",
token: "string.start",
regex: /%[qwir]\(/,
push: [{
token: "string.start",
regex: /\(/,
push: "rpqstring"
}, {
token: "string.end",
regex: /\)/,
next: "pop"
}, {
defaultToken: "string"
}]
}, {
stateName: "spqstring",
token: "string.start",
regex: /%[qwir]\[/,
push: [{
token: "string.start",
regex: /\[/,
push: "spqstring"
}, {
token: "string.end",
regex: /]/,
next: "pop"
}, {
defaultToken: "string"
}]
}, {
stateName: "fpqstring",
token: "string.start",
regex: /%[qwir]{/,
push: [{
token: "string.start",
regex: /{/,
push: "fpqstring"
}, {
token: "string.end",
regex: /}/,
next: "pop"
}, {
defaultToken: "string"
}]
}, {
stateName: "tpqstring",
token: "string.start",
regex: /%[qwir]</,
push: [{
token: "string.start",
regex: /</,
push: "tpqstring"
}, {
token: "string.end",
regex: />/,
next: "pop"
}, {
defaultToken: "string"
}]
}, {
stateName: "ppqstring",
token: "string.start",
regex: /%[qwir]\|/,
push: [{
token: "string.end",
regex: /\|/,
next: "pop"
}, {
defaultToken: "string"
}]
}, {
token: "string.start",
regex: /'/,
push: [{
token: "constant.language.escape",
regex: escapeExpression
}, {
token: "string.end",
regex: /'|$/,
next: "pop"
}, {
defaultToken: "string"
}]
}], {
token: "text",
regex: "::"
}, {
token: "variable.instance",
regex: "@{1,2}[a-zA-Z_\\d]+"
}, {
token: "variable.fresh",
regex: "%[a-zA-Z_\\d]+"
}, {
token: "support.class",
regex: "[A-Z][a-zA-Z_\\d]+"
}, {
token: "constant.other.symbol",
regex: "[:](?:(?:===|<=>|\\[]\\?|\\[]=|\\[]|>>|\\*\\*|<<|==|!=|>=|<=|!~|=~|<|\\+|-|\\*|\\/|%|&|\\||\\^|>|!|~)|(?:(?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?))"
}, {
token: "constant.numeric",
regex: "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?(?:_?[fF](?:32|64))?\\b"
}, {
token: "constant.numeric",
regex: intNumber
}, {
token: "constant.other.symbol",
regex: ':"',
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "constant.other.symbol",
regex: '"',
next: "pop"
}, {
defaultToken: "constant.other.symbol"
}]
}, {
token: "constant.language.boolean",
regex: "(?:true|false)\\b"
}, {
token: "support.function",
regex: "(?:is_a\\?|nil\\?|responds_to\\?|as\\?)"
}, {
token: keywordMapper,
regex: "[a-zA-Z_$][a-zA-Z0-9_$!?]*\\b"
}, {
token: "variable.system",
regex: "\\$\\!|\\$\\?"
}, {
token: "punctuation.separator.key-value",
regex: "=>"
}, {
stateName: "heredoc",
onMatch: function (value, currentState, stack) {
var next = "heredoc";
var tokens = value.split(this.splitRegex);
stack.push(next, tokens[3]);
return [
{ type: "constant", value: tokens[1] },
{ type: "string", value: tokens[2] },
{ type: "support.class", value: tokens[3] },
{ type: "string", value: tokens[4] }
];
},
regex: "(<<-)([']?)([\\w]+)([']?)",
rules: {
heredoc: [{
token: "string",
regex: "^ +"
}, {
onMatch: function (value, currentState, stack) {
if (value === stack[1]) {
stack.shift();
stack.shift();
this.next = stack[0] || "start";
return "support.class";
}
this.next = "";
return "string";
},
regex: ".*$",
next: "start"
}]
}
}, {
regex: "$",
token: "empty",
next: function (currentState, stack) {
if (stack[0] === "heredoc")
return stack[0];
return currentState;
}
}, {
token: "punctuation.operator",
regex: /[.]\s*(?![.])/,
push: [{
token: "punctuation.operator",
regex: /[.]\s*(?![.])/
}, {
token: "support.function",
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, {
regex: "",
token: "empty",
next: "pop"
}]
}, {
token: "keyword.operator",
regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|\\?|\\:|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\^|\\|"
}, {
token: "punctuation.operator",
regex: /[?:,;.]/
}, {
token: "paren.lparen",
regex: "[[({]"
}, {
token: "paren.rparen",
regex: "[\\])}]"
}, {
token: "text",
regex: "\\s+"
}
]
};
this.normalizeRules();
};
oop.inherits(CrystalHighlightRules, TextHighlightRules);
exports.CrystalHighlightRules = CrystalHighlightRules;
});
ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
var Range = require("../range").Range;
var MatchingBraceOutdent = function () { };
(function () {
this.checkOutdent = function (line, input) {
if (!/^\s+$/.test(line))
return false;
return /^\s*\}/.test(input);
};
this.autoOutdent = function (doc, row) {
var line = doc.getLine(row);
var match = line.match(/^(\s*\})/);
if (!match)
return 0;
var column = match[1].length;
var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column - 1), indent);
};
this.$getIndent = function (line) {
return line.match(/^\s*/)[0];
};
}).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function () { };
oop.inherits(FoldMode, BaseFoldMode);
(function () {
this.commentBlock = function (session, row) {
var re = /\S/;
var line = session.getLine(row);
var startLevel = line.search(re);
if (startLevel == -1 || line[startLevel] != "#")
return;
var startColumn = line.length;
var maxRow = session.getLength();
var startRow = row;
var endRow = row;
while (++row < maxRow) {
line = session.getLine(row);
var level = line.search(re);
if (level == -1)
continue;
if (line[level] != "#")
break;
endRow = row;
}
if (endRow > startRow) {
var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn);
}
};
this.getFoldWidgetRange = function (session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
range = this.commentBlock(session, row);
if (range)
return range;
};
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row);
var indent = line.search(/\S/);
var next = session.getLine(row + 1);
var prev = session.getLine(row - 1);
var prevIndent = prev.search(/\S/);
var nextIndent = next.search(/\S/);
if (indent == -1) {
session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
return "";
}
if (prevIndent == -1) {
if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
session.foldWidgets[row - 1] = "";
session.foldWidgets[row + 1] = "";
return "start";
}
}
else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
if (session.getLine(row - 2).search(/\S/) == -1) {
session.foldWidgets[row - 1] = "start";
session.foldWidgets[row + 1] = "";
return "";
}
}
if (prevIndent != -1 && prevIndent < indent)
session.foldWidgets[row - 1] = "start";
else
session.foldWidgets[row - 1] = "";
if (indent < nextIndent)
return "start";
else
return "";
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/crystal",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/crystal_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/folding/coffee"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var CrystalHighlightRules = require("./crystal_highlight_rules").CrystalHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var Range = require("../range").Range;
var FoldMode = require("./folding/coffee").FoldMode;
var Mode = function () {
this.HighlightRules = CrystalHighlightRules;
this.$outdent = new MatchingBraceOutdent();
this.$behaviour = this.$defaultBehaviour;
this.foldingRules = new FoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "#";
this.getNextLineIndent = function (state, line, tab) {
var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens;
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
return indent;
}
if (state == "start") {
var match = line.match(/^.*[\{\(\[]\s*$/);
var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/);
var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/);
var startingConditional = line.match(/^\s*(if|else|when)\s*/);
if (match || startingClassOrMethod || startingDoBlock || startingConditional) {
indent += tab;
}
}
return indent;
};
this.checkOutdent = function (state, line, input) {
return /^\s+(end|else)$/.test(line + input) || this.$outdent.checkOutdent(line, input);
};
this.autoOutdent = function (state, session, row) {
var line = session.getLine(row);
if (/}/.test(line))
return this.$outdent.autoOutdent(session, row);
var indent = this.$getIndent(line);
var prevLine = session.getLine(row - 1);
var prevIndent = this.$getIndent(prevLine);
var tab = session.getTabString();
if (prevIndent.length <= indent.length) {
if (indent.slice(-tab.length) == tab)
session.remove(new Range(row, indent.length - tab.length, row, indent.length));
}
};
this.$id = "ace/mode/crystal";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/crystal"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
@@ -0,0 +1,413 @@
ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function () {
this.$rules = {
"start": [
{
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
defaultToken: "comment.doc",
caseInsensitive: true
}
]
};
};
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function (start) {
return {
token: "comment.doc.tag.storage.type",
regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
};
};
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc",
regex: "\\/\\*(?=\\*)",
next: start
};
};
DocCommentHighlightRules.getEndRule = function (start) {
return {
token: "comment.doc",
regex: "\\*\\/",
next: start
};
};
exports.DocCommentHighlightRules = DocCommentHighlightRules;
});
ace.define("ace/mode/csharp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CSharpHighlightRules = function () {
var keywordMapper = this.createKeywordMapper({
"variable.language": "this",
"keyword": "abstract|async|await|event|new|struct|as|explicit|null|switch|base|extern|object|this|bool|false|operator|throw|break|finally|out|true|byte|fixed|override|try|case|float|params|typeof|catch|for|private|uint|char|foreach|protected|ulong|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|ushort|continue|in|return|using|decimal|int|sbyte|virtual|default|interface|sealed|volatile|delegate|internal|partial|short|void|do|is|sizeof|while|double|lock|stackalloc|else|long|static|enum|namespace|string|var|dynamic",
"constant.language": "null|true|false"
}, "identifier");
this.$rules = {
"start": [
{
token: "comment",
regex: "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
token: "comment",
regex: "\\/\\*",
next: "comment"
}, {
token: "string",
regex: /'(?:.|\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n]))?'/
}, {
token: "string", start: '"', end: '"|$', next: [
{ token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/ },
{ token: "invalid", regex: /\\./ }
]
}, {
token: "string", start: '@"', end: '"', next: [
{ token: "constant.language.escape", regex: '""' }
]
}, {
token: "string", start: /\$"/, end: '"|$', next: [
{ token: "constant.language.escape", regex: /\\(:?$)|{{/ },
{ token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/ },
{ token: "invalid", regex: /\\./ }
]
}, {
token: "constant.numeric",
regex: "0[xX][0-9a-fA-F]+\\b"
}, {
token: "constant.numeric",
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, {
token: "constant.language.boolean",
regex: "(?:true|false)\\b"
}, {
token: keywordMapper,
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, {
token: "keyword.operator",
regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
}, {
token: "keyword",
regex: "^\\s*#(if|else|elif|endif|define|undef|warning|error|line|region|endregion|pragma)"
}, {
token: "punctuation.operator",
regex: "\\?|\\:|\\,|\\;|\\."
}, {
token: "paren.lparen",
regex: "[[({]"
}, {
token: "paren.rparen",
regex: "[\\])}]"
}, {
token: "text",
regex: "\\s+"
}
],
"comment": [
{
token: "comment",
regex: "\\*\\/",
next: "start"
}, {
defaultToken: "comment"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
this.normalizeRules();
};
oop.inherits(CSharpHighlightRules, TextHighlightRules);
exports.CSharpHighlightRules = CSharpHighlightRules;
});
ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
var Range = require("../range").Range;
var MatchingBraceOutdent = function () { };
(function () {
this.checkOutdent = function (line, input) {
if (!/^\s+$/.test(line))
return false;
return /^\s*\}/.test(input);
};
this.autoOutdent = function (doc, row) {
var line = doc.getLine(row);
var match = line.match(/^(\s*\})/);
if (!match)
return 0;
var column = match[1].length;
var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column - 1), indent);
};
this.$getIndent = function (line) {
return line.match(/^\s*/)[0];
};
}).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(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 (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/folding/csharp",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var CFoldMode = require("./cstyle").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, CFoldMode);
(function () {
this.usingRe = /^\s*using \S/;
this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
this.getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function (session, foldStyle, row) {
var fw = this.getFoldWidgetBase(session, foldStyle, row);
if (!fw) {
var line = session.getLine(row);
if (/^\s*#region\b/.test(line))
return "start";
var usingRe = this.usingRe;
if (usingRe.test(line)) {
var prev = session.getLine(row - 1);
var next = session.getLine(row + 1);
if (!usingRe.test(prev) && usingRe.test(next))
return "start";
}
}
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row) {
var range = this.getFoldWidgetRangeBase(session, foldStyle, row);
if (range)
return range;
var line = session.getLine(row);
if (this.usingRe.test(line))
return this.getUsingStatementBlock(session, line, row);
if (/^\s*#region\b/.test(line))
return this.getRegionBlock(session, line, row);
};
this.getUsingStatementBlock = function (session, line, row) {
var startColumn = line.match(this.usingRe)[0].length - 1;
var maxRow = session.getLength();
var startRow = row;
var endRow = row;
while (++row < maxRow) {
line = session.getLine(row);
if (/^\s*$/.test(line))
continue;
if (!this.usingRe.test(line))
break;
endRow = row;
}
if (endRow > startRow) {
var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn);
}
};
this.getRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*#(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/csharp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/csharp_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/csharp"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var CSharpHighlightRules = require("./csharp_highlight_rules").CSharpHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var CStyleFoldMode = require("./folding/csharp").FoldMode;
var Mode = function () {
this.HighlightRules = CSharpHighlightRules;
this.$outdent = new MatchingBraceOutdent();
this.$behaviour = this.$defaultBehaviour;
this.foldingRules = new CStyleFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "//";
this.blockComment = { start: "/*", end: "*/" };
this.getNextLineIndent = function (state, line, tab) {
var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens;
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
return indent;
}
if (state == "start") {
var match = line.match(/^.*[\{\(\[]\s*$/);
if (match) {
indent += tab;
}
}
return indent;
};
this.checkOutdent = function (state, line, input) {
return this.$outdent.checkOutdent(line, input);
};
this.autoOutdent = function (state, doc, row) {
this.$outdent.autoOutdent(doc, row);
};
this.createWorker = function (session) {
return null;
};
this.$id = "ace/mode/csharp";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
ace.require(["ace/mode/csharp"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

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