update codeeditor with new features (#1863)

update ace v1.2.0 to v1.2.3
add codecompletion and live codecompletion(with documentation inline)
add snippets to lenguajes(php,javascript,html,css)
add translation to spanish
add search and replace buttons
This commit is contained in:
Lucas Martín 2016-04-19 08:36:45 +02:00 committed by Samuel Georges
parent be7b3b3009
commit e2566c36a0
43 changed files with 21387 additions and 3487 deletions

View File

@ -31,6 +31,26 @@ $(document).ready(function(){
editor.setShowInvisibles($(this).is(':checked'))
})
$('#Form-field-EditorPreferences-enable_basic_autocompletion').on('change', function(){
editor.setOption('enableBasicAutocompletion', $(this).is(':checked'))
})
$('#Form-field-EditorPreferences-enable_snippets').on('change', function(){
editor.setOption('enableSnippets', $(this).is(':checked'))
})
$('#Form-field-EditorPreferences-enable_live_autocompletion').on('change', function(){
editor.setOption('enableLiveAutocompletion', $(this).is(':checked'))
})
$('#Form-field-EditorPreferences-display_indent_guides').on('change', function(){
editor.setDisplayIndentGuides($(this).is(':checked'))
})
$('#Form-field-EditorPreferences-show_print_margin').on('change', function(){
editor.setShowPrintMargin($(this).is(':checked'))
})
$('#Form-field-EditorPreferences-highlight_active_line').on('change', function(){
editor.setHighlightActiveLine($(this).is(':checked'))
})

View File

@ -53,7 +53,11 @@ class EditorPreferences extends Controller
$this->vars['showGutter'] = true;
$this->vars['language'] = 'css';
$this->vars['margin'] = 0;
$this->vars['enableBasicAutocompletion'] = $editorSettings->enable_basic_autocompletion;
$this->vars['enableSnippets'] = $editorSettings->enable_snippets;
$this->vars['enableLiveAutocompletion'] = $editorSettings->enable_live_autocompletion;
$this->vars['displayIndentGuides'] = $editorSettings->display_indent_guides;
$this->vars['showPrintMargin'] = $editorSettings->show_print_margin;
$this->asExtension('FormController')->update();
$this->pageTitle = 'backend::lang.editor.menu_label';
}

View File

@ -21,6 +21,11 @@
data-tab-size="<?= $tabSize ?>"
data-theme="<?= $theme ?>"
data-show-invisibles="<?= $showInvisibles ?>"
data-enable-basic-autocompletion="<?= $enableBasicAutocompletion ?>"
data-enable-snippets="<?= $enableSnippets ?>"
data-enable-live-autocompletion="<?= $enableLiveAutocompletion ?>"
data-display-indent-guides="<?= $displayIndentGuides ?>"
data-show-print-margin="<?= $showPrintMargin ?>"
data-highlight-active-line="<?= $highlightActiveLine ?>"
data-use-soft-tabs="<?= $useSoftTabs ?>"
data-show-gutter="<?= $showGutter ? 'true' : 'false' ?>"

View File

@ -72,6 +72,31 @@ class CodeEditor extends FormWidgetBase
*/
public $readOnly = false;
/**
* @var boolean If true, the editor activate Basic Autocompletion if press Ctrl+Space
*/
public $enableBasicAutocompletion = true;
/**
* @var boolean If true, the editor activate use Snippets
*/
public $enableSnippets = true;
/**
* @var boolean If true, the editor activate Live Autocompletion mode
*/
public $enableLiveAutocompletion = true;
/**
* @var boolean If true, the editor show Indent Guides
*/
public $displayIndentGuides = true;
/**
* @var boolean If true, the editor show Print Margin
*/
public $showPrintMargin = false;
//
// Object properties
//
@ -99,7 +124,12 @@ class CodeEditor extends FormWidgetBase
'fontSize',
'margin',
'theme',
'readOnly'
'readOnly',
'enableBasicAutocompletion',
'enableSnippets',
'enableLiveAutocompletion',
'displayIndentGuides',
'showPrintMargin'
]);
}
@ -133,6 +163,11 @@ class CodeEditor extends FormWidgetBase
$this->vars['size'] = $this->formField->size;
$this->vars['name'] = $this->formField->getName();
$this->vars['readOnly'] = $this->readOnly;
$this->vars['enableBasicAutocompletion'] = $this->enableBasicAutocompletion;
$this->vars['enableSnippets'] = $this->enableSnippets;
$this->vars['enableLiveAutocompletion'] = $this->enableLiveAutocompletion;
$this->vars['displayIndentGuides'] = $this->displayIndentGuides;
$this->vars['showPrintMargin'] = $this->showPrintMargin;
// Double encode when escaping
$this->vars['value'] = htmlentities($this->getLoadValue(), ENT_QUOTES, 'UTF-8', true);
@ -166,6 +201,11 @@ class CodeEditor extends FormWidgetBase
$this->highlightActiveLine = $editorSettings->highlight_active_line;
$this->useSoftTabs = !$editorSettings->use_hard_tabs;
$this->showGutter = $editorSettings->show_gutter;
$this->enableBasicAutocompletion = $editorSettings->enable_basic_autocompletion;
$this->enableSnippets = $editorSettings->enable_snippets;
$this->enableLiveAutocompletion = $editorSettings->enable_live_autocompletion;
$this->displayIndentGuides = $editorSettings->display_indent_guides;
$this->showPrintMargin = $editorSettings->show_print_margin;
}
}

File diff suppressed because one or more lines are too long

View File

@ -6,13 +6,14 @@
*
* @see build-min.js
*
* Current Ace build v1.2.0 using "src-noconflict"
* Current Ace build v1.2.3 using "src-noconflict"
* https://github.com/ajaxorg/ace-builds/
*
=require ../vendor/emmet/emmet.js
=require ../vendor/ace/ace.js
=require ../vendor/ace/ext-emmet.js
=require ../vendor/ace/ext-language_tools.js
=require ../vendor/ace/mode-php.js
=require ../vendor/ace/mode-twig.js
=require ../vendor/ace/mode-markdown.js

View File

@ -37,6 +37,12 @@
this.isFullscreen = false
this.$fullscreenEnable = this.$toolbar.find('li.fullscreen-enable')
this.$fullscreenDisable = this.$toolbar.find('li.fullscreen-disable')
this.isSearchbox = false
this.$searchboxEnable = this.$toolbar.find('li.searchbox-enable')
this.$searchboxDisable = this.$toolbar.find('li.searchbox-disable')
this.isReplacebox = false
this.$replaceboxEnable = this.$toolbar.find('li.replacebox-enable')
this.$replaceboxDisable = this.$toolbar.find('li.replacebox-disable')
$.oc.foundation.controlUtils.markDisposable(element)
@ -63,7 +69,7 @@
language: 'php',
margin: 0,
vendorPath: '/',
showPrintMargin: true,
showPrintMargin: false,
highlightSelectedWord: false,
hScrollBarAlwaysVisible: false,
readOnly: false
@ -128,6 +134,7 @@
editor.setTheme('ace/theme/' + options.theme)
var inline = options.language === 'php'
editor.getSession().setMode({ path: 'ace/mode/'+options.language, inline: inline })
//editor.getSession().setMode({ path: 'ace/mode/'+options.language })
})
/*
@ -142,6 +149,13 @@
editor.setHighlightSelectedWord(options.highlightSelectedWord)
editor.renderer.setHScrollBarAlwaysVisible(options.hScrollBarAlwaysVisible)
editor.setOption('enableEmmet', options.enableEmmet)
// enable autocompletion and snippets
editor.setOptions({
enableBasicAutocompletion: options.enableBasicAutocompletion,
enableSnippets: options.enableSnippets,
enableLiveAutocompletion: options.enableLiveAutocompletion
})
editor.setDisplayIndentGuides(options.displayIndentGuides)
editor.getSession().setUseSoftTabs(options.useSoftTabs)
editor.getSession().setTabSize(options.tabSize)
editor.setReadOnly(options.readOnly)
@ -172,7 +186,7 @@
})
.tooltip({
delay: 500,
placement: 'left',
placement: 'bottom',
html: true
})
;
@ -181,6 +195,14 @@
this.$fullscreenEnable.on('click.codeeditor', '>a', $.proxy(this.toggleFullscreen, this))
this.$fullscreenDisable.on('click.codeeditor', '>a', $.proxy(this.toggleFullscreen, this))
this.$searchboxDisable.hide()
this.$searchboxEnable.on('click.codeeditor', '>a', $.proxy(this.toggleSearchbox, this))
this.$searchboxDisable.on('click.codeeditor', '>a', $.proxy(this.toggleSearchbox, this))
this.$replaceboxDisable.hide()
this.$replaceboxEnable.on('click.codeeditor', '>a', $.proxy(this.toggleReplacebox, this))
this.$replaceboxDisable.on('click.codeeditor', '>a', $.proxy(this.toggleReplacebox, this))
/*
* Hotkeys
*/
@ -211,6 +233,10 @@
this.$code = null
this.$fullscreenEnable = null
this.$fullscreenDisable = null
this.$searchboxEnable = null
this.$searchboxDisable = null
this.$replaceboxEnable = null
this.$replaceboxDisable = null
this.$form = null
this.options = null
@ -340,6 +366,26 @@
this.editor.focus()
}
CodeEditor.prototype.toggleSearchbox = function() {
this.$searchboxEnable.toggle()
this.$searchboxDisable.toggle()
this.editor.execCommand("find")
this.editor.resize()
this.editor.focus()
}
CodeEditor.prototype.toggleReplacebox = function() {
this.$replaceboxEnable.toggle()
this.$replaceboxDisable.toggle()
this.editor.execCommand("replace")
this.editor.resize()
this.editor.focus()
}
// CODEEDITOR PLUGIN DEFINITION
// ============================

File diff suppressed because it is too large Load Diff

View File

@ -503,6 +503,9 @@ var SnippetManager = function() {
s.trigger = lang.escapeRegExp(s.tabTrigger);
}
if (!s.trigger && !s.guard && !s.endTrigger && !s.endGuard)
return;
s.startRe = guardedRegexp(s.trigger, s.guard, true);
s.triggerRe = new RegExp(s.trigger, "", true);
@ -1006,8 +1009,10 @@ AceEmmetEditor.prototype = {
if (!profile)
profile = this.ace.session.getLines(0,2).join("").search(/<!DOCTYPE[^>]+XHTML/i) != -1 ? "xhtml": "html";
return profile;
default:
var mode = this.ace.session.$mode;
return mode.emmetConfig && mode.emmetConfig.profile || "xhtml";
}
return "xhtml";
},
prompt: function(title) {
return prompt(title);
@ -1095,16 +1100,18 @@ var keymap = {
var editorProxy = new AceEmmetEditor();
exports.commands = new HashHandler();
exports.runEmmetCommand = function(editor) {
exports.runEmmetCommand = function runEmmetCommand(editor) {
try {
editorProxy.setupContext(editor);
if (editorProxy.getSyntax() == "php")
return false;
var actions = emmet.require("actions");
if (this.action == "expand_abbreviation_with_tab") {
if (!editor.selection.isEmpty())
return false;
var pos = editor.selection.lead;
var token = editor.session.getTokenAt(pos.row, pos.column);
if (token && /\btag\b/.test(token.type))
return false;
}
if (this.action == "wrap_with_abbreviation") {
@ -1113,13 +1120,12 @@ exports.runEmmetCommand = function(editor) {
}, 0);
}
var pos = editor.selection.lead;
var token = editor.session.getTokenAt(pos.row, pos.column);
if (token && /\btag\b/.test(token.type))
return false;
var result = actions.run(this.action, editorProxy);
} catch(e) {
if (!emmet) {
load(runEmmetCommand.bind(this, editor));
return true;
}
editor._signal("changeStatus", typeof e == "string" ? e : e.message);
console.log(e);
result = false;
@ -1145,25 +1151,47 @@ exports.updateCommands = function(editor, enabled) {
}
};
exports.isSupportedMode = function(modeId) {
return modeId && /css|less|scss|sass|stylus|html|php|twig|ejs|handlebars/.test(modeId);
exports.isSupportedMode = function(mode) {
if (!mode) return false;
if (mode.emmetConfig) return true;
var id = mode.$id || mode;
return /css|less|scss|sass|stylus|html|php|twig|ejs|handlebars/.test(id);
};
exports.isAvailable = function(editor, command) {
if (/(evaluate_math_expression|expand_abbreviation)$/.test(command))
return true;
var mode = editor.session.$mode;
var isSupported = exports.isSupportedMode(mode);
if (isSupported && mode.$modes) {
try {
editorProxy.setupContext(editor);
if (/js|php/.test(editorProxy.getSyntax()))
isSupported = false;
} catch(e) {}
}
return isSupported;
}
var onChangeMode = function(e, target) {
var editor = target;
if (!editor)
return;
var enabled = exports.isSupportedMode(editor.session.$modeId);
var enabled = exports.isSupportedMode(editor.session.$mode);
if (e.enableEmmet === false)
enabled = false;
if (enabled) {
if (enabled)
load();
exports.updateCommands(editor, enabled);
};
var load = function(cb) {
if (typeof emmetPath == "string") {
require("ace/config").loadModule(emmetPath, function() {
emmetPath = null;
cb && cb();
});
}
}
exports.updateCommands(editor, enabled);
};
exports.AceEmmetEditor = AceEmmetEditor;
@ -1187,3 +1215,4 @@ exports.setCore = function(e) {
(function() {
ace.require(["ace/ext/emmet"], function() {});
})();

File diff suppressed because it is too large Load Diff

View File

@ -63,7 +63,6 @@ cursor: pointer;\
float: left;\
height: 22px;\
margin: 0;\
padding: 0;\
position: relative;\
}\
.ace_searchbtn:last-child,\
@ -255,10 +254,14 @@ var SearchBox = function(editor, range, showReplaceForm) {
}]);
this.$searchBarKb = new HashHandler();
this.$searchBarKb.bindKeys({
"Ctrl-f|Command-f|Ctrl-H|Command-Option-F": function(sb) {
"Ctrl-f|Command-f": function(sb) {
var isReplace = sb.isReplace = !sb.isReplace;
sb.replaceBox.style.display = isReplace ? "" : "none";
sb[isReplace ? "replaceInput" : "searchInput"].focus();
sb.searchInput.focus();
},
"Ctrl-H|Command-Option-F": function(sb) {
sb.replaceBox.style.display = "";
sb.replaceInput.focus();
},
"Ctrl-G|Command-G": function(sb) {
sb.findNext();
@ -323,14 +326,15 @@ var SearchBox = function(editor, range, showReplaceForm) {
this.editor.session.highlight(re || this.editor.$search.$options.re);
this.editor.renderer.updateBackMarkers()
};
this.find = function(skipCurrent, backwards) {
this.find = function(skipCurrent, backwards, preventScroll) {
var range = this.editor.find(this.searchInput.value, {
skipCurrent: skipCurrent,
backwards: backwards,
wrap: true,
regExp: this.regExpOption.checked,
caseSensitive: this.caseSensitiveOption.checked,
wholeWord: this.wholeWordOption.checked
wholeWord: this.wholeWordOption.checked,
preventScroll: preventScroll
});
var noMatch = !range && this.searchInput.value;
dom.setCssClass(this.searchBox, "ace_nomatch", noMatch);
@ -383,6 +387,9 @@ var SearchBox = function(editor, range, showReplaceForm) {
if (value)
this.searchInput.value = value;
this.find(false, false, true);
this.searchInput.focus();
this.searchInput.select();

View File

@ -4,7 +4,7 @@ ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib
var oop = require("../lib/oop");
var lang = require("../lib/lang");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index";
var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero";
var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
@ -182,6 +182,180 @@ var MatchingBraceOutdent = function() {};
exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) {
"use strict";
var propertyMap = {
"background": {"#$0": 1},
"background-color": {"#$0": 1, "transparent": 1, "fixed": 1},
"background-image": {"url('/$0')": 1},
"background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1},
"background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2},
"background-attachment": {"scroll": 1, "fixed": 1},
"background-size": {"cover": 1, "contain": 1},
"background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1},
"background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1},
"border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1},
"border-color": {"#$0": 1},
"border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2},
"border-collapse": {"collapse": 1, "separate": 1},
"bottom": {"px": 1, "em": 1, "%": 1},
"clear": {"left": 1, "right": 1, "both": 1, "none": 1},
"color": {"#$0": 1, "rgb(#$00,0,0)": 1},
"cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1},
"display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1},
"empty-cells": {"show": 1, "hide": 1},
"float": {"left": 1, "right": 1, "none": 1},
"font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1},
"font-size": {"px": 1, "em": 1, "%": 1},
"font-weight": {"bold": 1, "normal": 1},
"font-style": {"italic": 1, "normal": 1},
"font-variant": {"normal": 1, "small-caps": 1},
"height": {"px": 1, "em": 1, "%": 1},
"left": {"px": 1, "em": 1, "%": 1},
"letter-spacing": {"normal": 1},
"line-height": {"normal": 1},
"list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1},
"margin": {"px": 1, "em": 1, "%": 1},
"margin-right": {"px": 1, "em": 1, "%": 1},
"margin-left": {"px": 1, "em": 1, "%": 1},
"margin-top": {"px": 1, "em": 1, "%": 1},
"margin-bottom": {"px": 1, "em": 1, "%": 1},
"max-height": {"px": 1, "em": 1, "%": 1},
"max-width": {"px": 1, "em": 1, "%": 1},
"min-height": {"px": 1, "em": 1, "%": 1},
"min-width": {"px": 1, "em": 1, "%": 1},
"overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
"overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
"overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
"padding": {"px": 1, "em": 1, "%": 1},
"padding-top": {"px": 1, "em": 1, "%": 1},
"padding-right": {"px": 1, "em": 1, "%": 1},
"padding-bottom": {"px": 1, "em": 1, "%": 1},
"padding-left": {"px": 1, "em": 1, "%": 1},
"page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
"page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
"position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1},
"right": {"px": 1, "em": 1, "%": 1},
"table-layout": {"fixed": 1, "auto": 1},
"text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1},
"text-align": {"left": 1, "right": 1, "center": 1, "justify": 1},
"text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1},
"top": {"px": 1, "em": 1, "%": 1},
"vertical-align": {"top": 1, "bottom": 1},
"visibility": {"hidden": 1, "visible": 1},
"white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1},
"width": {"px": 1, "em": 1, "%": 1},
"word-spacing": {"normal": 1},
"filter": {"alpha(opacity=$0100)": 1},
"text-shadow": {"$02px 2px 2px #777": 1},
"text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},
"-moz-border-radius": 1,
"-moz-border-radius-topright": 1,
"-moz-border-radius-bottomright": 1,
"-moz-border-radius-topleft": 1,
"-moz-border-radius-bottomleft": 1,
"-webkit-border-radius": 1,
"-webkit-border-top-right-radius": 1,
"-webkit-border-top-left-radius": 1,
"-webkit-border-bottom-right-radius": 1,
"-webkit-border-bottom-left-radius": 1,
"-moz-box-shadow": 1,
"-webkit-box-shadow": 1,
"transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
"-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
"-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 }
};
var CssCompletions = function() {
};
(function() {
this.completionsDefined = false;
this.defineCompletions = function() {
if (document) {
var style = document.createElement('c').style;
for (var i in style) {
if (typeof style[i] !== 'string')
continue;
var name = i.replace(/[A-Z]/g, function(x) {
return '-' + x.toLowerCase();
});
if (!propertyMap.hasOwnProperty(name))
propertyMap[name] = 1;
}
}
this.completionsDefined = true;
}
this.getCompletions = function(state, session, pos, prefix) {
if (!this.completionsDefined) {
this.defineCompletions();
}
var token = session.getTokenAt(pos.row, pos.column);
if (!token)
return [];
if (state==='ruleset'){
var line = session.getLine(pos.row).substr(0, pos.column);
if (/:[^;]+$/.test(line)) {
/([\w\-]+):[^:]*$/.test(line);
return this.getPropertyValueCompletions(state, session, pos, prefix);
} else {
return this.getPropertyCompletions(state, session, pos, prefix);
}
}
return [];
};
this.getPropertyCompletions = function(state, session, pos, prefix) {
var properties = Object.keys(propertyMap);
return properties.map(function(property){
return {
caption: property,
snippet: property + ': $0',
meta: "property",
score: Number.MAX_VALUE
};
});
};
this.getPropertyValueCompletions = function(state, session, pos, prefix) {
var line = session.getLine(pos.row).substr(0, pos.column);
var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
if (!property)
return [];
var values = [];
if (property in propertyMap && typeof propertyMap[property] === "object") {
values = Object.keys(propertyMap[property]);
}
return values.map(function(value){
return {
caption: value,
snippet: value,
meta: "property value",
score: Number.MAX_VALUE
};
});
};
}).call(CssCompletions.prototype);
exports.CssCompletions = CssCompletions;
});
ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
"use strict";
@ -758,7 +932,7 @@ oop.inherits(FoldMode, BaseFoldMode);
});
ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
@ -766,6 +940,7 @@ var TextMode = require("./text").Mode;
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
var CssCompletions = require("./css_completions").CssCompletions;
var CssBehaviour = require("./behaviour/css").CssBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
@ -773,6 +948,7 @@ var Mode = function() {
this.HighlightRules = CssHighlightRules;
this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new CssBehaviour();
this.$completer = new CssCompletions();
this.foldingRules = new CStyleFoldMode();
};
oop.inherits(Mode, TextMode);
@ -805,6 +981,10 @@ oop.inherits(Mode, TextMode);
this.$outdent.autoOutdent(doc, row);
};
this.getCompletions = function(state, session, pos, prefix) {
return this.$completer.getCompletions(state, session, pos, prefix);
};
this.createWorker = function(session) {
var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
worker.attachToDocument(session.getDocument());

View File

@ -54,6 +54,7 @@ ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","
var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function(options) {
var keywordMapper = this.createKeywordMapper({
@ -69,7 +70,7 @@ var JavaScriptHighlightRules = function(options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document" , // Pseudo
"keyword":
"const|yield|import|get|set|" +
"const|yield|import|get|set|async|await|" +
"break|case|catch|continue|default|delete|do|else|finally|for|function|" +
"if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
@ -83,29 +84,20 @@ var JavaScriptHighlightRules = function(options) {
"constant.language.boolean": "true|false"
}, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
"u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
"[0-2][0-7]{0,2}|" + // oct
"3[0-6][0-7]?|" + // oct
"37[0-7]?|" + // oct
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
this.$rules = {
"no_regex" : [
{
token : "comment",
regex : "\\/\\/",
next : "line_comment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
{
token : "comment", // multi line comment
regex : /\/\*/,
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
next : "qstring"
@ -115,10 +107,10 @@ var JavaScriptHighlightRules = function(options) {
next : "qqstring"
}, {
token : "constant.numeric", // hex
regex : /0[xX][0-9a-fA-F]+\b/
regex : /0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/
}, {
token : "constant.numeric", // float
regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
regex : /[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
}, {
token : [
"storage.type", "punctuation.operator", "support.function",
@ -171,15 +163,6 @@ var JavaScriptHighlightRules = function(options) {
token : "keyword",
regex : "(?:" + kwBeforeRe + ")\\b",
next : "start"
}, {
token : ["punctuation.operator", "support.function"],
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, {
token : ["punctuation.operator", "support.function.dom"],
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, {
token : ["punctuation.operator", "support.constant"],
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, {
token : ["support.constant"],
regex : /that\b/
@ -189,9 +172,13 @@ var JavaScriptHighlightRules = function(options) {
}, {
token : keywordMapper,
regex : identifierRe
}, {
token : "punctuation.operator",
regex : /[.](?![.])/,
next : "property"
}, {
token : "keyword.operator",
regex : /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
next : "start"
}, {
token : "punctuation.operator",
@ -209,17 +196,42 @@ var JavaScriptHighlightRules = function(options) {
regex: /^#!.*$/
}
],
property: [{
token : "text",
regex : "\\s+"
}, {
token : [
"storage.type", "punctuation.operator", "entity.name.function", "text",
"keyword.operator", "text",
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
next: "function_arguments"
}, {
token : "punctuation.operator",
regex : /[.](?![.])/
}, {
token : "support.function",
regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, {
token : "support.function.dom",
regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, {
token : "support.constant",
regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, {
token : "identifier",
regex : identifierRe
}, {
regex: "",
token: "empty",
next: "no_regex"
}
],
"start": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("start"),
{
token : "comment", // multi line comment
regex : "\\/\\*",
next : "comment_regex_allowed"
}, {
token : "comment",
regex : "\\/\\/",
next : "line_comment_regex_allowed"
}, {
token: "string.regexp",
regex: "\\/",
next: "regex"
@ -297,26 +309,6 @@ var JavaScriptHighlightRules = function(options) {
next: "no_regex"
}
],
"comment_regex_allowed" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "\\*\\/", next : "start"},
{defaultToken : "comment", caseInsensitive: true}
],
"comment" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "\\*\\/", next : "no_regex"},
{defaultToken : "comment", caseInsensitive: true}
],
"line_comment_regex_allowed" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "$|^", next : "start"},
{defaultToken : "comment", caseInsensitive: true}
],
"line_comment" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "$|^", next : "no_regex"},
{defaultToken : "comment", caseInsensitive: true}
],
"qqstring" : [
{
token : "constant.language.escape",
@ -358,12 +350,11 @@ var JavaScriptHighlightRules = function(options) {
this.next = val == "{" ? this.nextState : "";
if (val == "{" && stack.length) {
stack.unshift("start", state);
return "paren";
}
if (val == "}" && stack.length) {
else if (val == "}" && stack.length) {
stack.shift();
this.next = stack.shift();
if (this.next.indexOf("string") != -1)
if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
return "paren.quasi.end";
}
return val == "{" ? "paren.lparen" : "paren.rparen";
@ -387,6 +378,9 @@ var JavaScriptHighlightRules = function(options) {
defaultToken: "string.quasi"
}]
});
if (!options || !options.noJSX)
JSX.call(this);
}
this.embedRules(DocCommentHighlightRules, "doc-",
@ -397,6 +391,127 @@ var JavaScriptHighlightRules = function(options) {
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
function JSX() {
var tagRegex = identifierRe.replace("\\d", "\\d\\-");
var jsxTag = {
onMatch : function(val, state, stack) {
var offset = val.charAt(1) == "/" ? 2 : 1;
if (offset == 1) {
if (state != this.nextState)
stack.unshift(this.next, this.nextState, 0);
else
stack.unshift(this.next);
stack[2]++;
} else if (offset == 2) {
if (state == this.nextState) {
stack[1]--;
if (!stack[1] || stack[1] < 0) {
stack.shift();
stack.shift();
}
}
}
return [{
type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
value: val.slice(0, offset)
}, {
type: "meta.tag.tag-name.xml",
value: val.substr(offset)
}];
},
regex : "</?" + tagRegex + "",
next: "jsxAttributes",
nextState: "jsx"
};
this.$rules.start.unshift(jsxTag);
var jsxJsRule = {
regex: "{",
token: "paren.quasi.start",
push: "start"
};
this.$rules.jsx = [
jsxJsRule,
jsxTag,
{include : "reference"},
{defaultToken: "string"}
];
this.$rules.jsxAttributes = [{
token : "meta.tag.punctuation.tag-close.xml",
regex : "/?>",
onMatch : function(value, currentState, stack) {
if (currentState == stack[0])
stack.shift();
if (value.length == 2) {
if (stack[0] == this.nextState)
stack[1]--;
if (!stack[1] || stack[1] < 0) {
stack.splice(0, 2);
}
}
this.next = stack[0] || "start";
return [{type: this.token, value: value}];
},
nextState: "jsx"
},
jsxJsRule,
comments("jsxAttributes"),
{
token : "entity.other.attribute-name.xml",
regex : tagRegex
}, {
token : "keyword.operator.attribute-equals.xml",
regex : "="
}, {
token : "text.tag-whitespace.xml",
regex : "\\s+"
}, {
token : "string.attribute-value.xml",
regex : "'",
stateName : "jsx_attr_q",
push : [
{token : "string.attribute-value.xml", regex: "'", next: "pop"},
{include : "reference"},
{defaultToken : "string.attribute-value.xml"}
]
}, {
token : "string.attribute-value.xml",
regex : '"',
stateName : "jsx_attr_qq",
push : [
{token : "string.attribute-value.xml", regex: '"', next: "pop"},
{include : "reference"},
{defaultToken : "string.attribute-value.xml"}
]
},
jsxTag
];
this.$rules.reference = [{
token : "constant.language.escape.reference.xml",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}];
}
function comments(next) {
return [
{
token : "comment", // multi line comment
regex : /\/\*/,
next: [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "\\*\\/", next : next || "pop"},
{defaultToken : "comment", caseInsensitive: true}
]
}, {
token : "comment",
regex : "\\/\\/",
next: [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "$|^", next : next || "pop"},
{defaultToken : "comment", caseInsensitive: true}
]
}
];
}
exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
});
@ -1030,7 +1145,7 @@ ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib
var oop = require("../lib/oop");
var lang = require("../lib/lang");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index";
var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero";
var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
@ -1168,6 +1283,180 @@ exports.CssHighlightRules = CssHighlightRules;
});
ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) {
"use strict";
var propertyMap = {
"background": {"#$0": 1},
"background-color": {"#$0": 1, "transparent": 1, "fixed": 1},
"background-image": {"url('/$0')": 1},
"background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1},
"background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2},
"background-attachment": {"scroll": 1, "fixed": 1},
"background-size": {"cover": 1, "contain": 1},
"background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1},
"background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1},
"border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1},
"border-color": {"#$0": 1},
"border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2},
"border-collapse": {"collapse": 1, "separate": 1},
"bottom": {"px": 1, "em": 1, "%": 1},
"clear": {"left": 1, "right": 1, "both": 1, "none": 1},
"color": {"#$0": 1, "rgb(#$00,0,0)": 1},
"cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1},
"display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1},
"empty-cells": {"show": 1, "hide": 1},
"float": {"left": 1, "right": 1, "none": 1},
"font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1},
"font-size": {"px": 1, "em": 1, "%": 1},
"font-weight": {"bold": 1, "normal": 1},
"font-style": {"italic": 1, "normal": 1},
"font-variant": {"normal": 1, "small-caps": 1},
"height": {"px": 1, "em": 1, "%": 1},
"left": {"px": 1, "em": 1, "%": 1},
"letter-spacing": {"normal": 1},
"line-height": {"normal": 1},
"list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1},
"margin": {"px": 1, "em": 1, "%": 1},
"margin-right": {"px": 1, "em": 1, "%": 1},
"margin-left": {"px": 1, "em": 1, "%": 1},
"margin-top": {"px": 1, "em": 1, "%": 1},
"margin-bottom": {"px": 1, "em": 1, "%": 1},
"max-height": {"px": 1, "em": 1, "%": 1},
"max-width": {"px": 1, "em": 1, "%": 1},
"min-height": {"px": 1, "em": 1, "%": 1},
"min-width": {"px": 1, "em": 1, "%": 1},
"overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
"overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
"overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
"padding": {"px": 1, "em": 1, "%": 1},
"padding-top": {"px": 1, "em": 1, "%": 1},
"padding-right": {"px": 1, "em": 1, "%": 1},
"padding-bottom": {"px": 1, "em": 1, "%": 1},
"padding-left": {"px": 1, "em": 1, "%": 1},
"page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
"page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
"position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1},
"right": {"px": 1, "em": 1, "%": 1},
"table-layout": {"fixed": 1, "auto": 1},
"text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1},
"text-align": {"left": 1, "right": 1, "center": 1, "justify": 1},
"text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1},
"top": {"px": 1, "em": 1, "%": 1},
"vertical-align": {"top": 1, "bottom": 1},
"visibility": {"hidden": 1, "visible": 1},
"white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1},
"width": {"px": 1, "em": 1, "%": 1},
"word-spacing": {"normal": 1},
"filter": {"alpha(opacity=$0100)": 1},
"text-shadow": {"$02px 2px 2px #777": 1},
"text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},
"-moz-border-radius": 1,
"-moz-border-radius-topright": 1,
"-moz-border-radius-bottomright": 1,
"-moz-border-radius-topleft": 1,
"-moz-border-radius-bottomleft": 1,
"-webkit-border-radius": 1,
"-webkit-border-top-right-radius": 1,
"-webkit-border-top-left-radius": 1,
"-webkit-border-bottom-right-radius": 1,
"-webkit-border-bottom-left-radius": 1,
"-moz-box-shadow": 1,
"-webkit-box-shadow": 1,
"transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
"-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
"-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 }
};
var CssCompletions = function() {
};
(function() {
this.completionsDefined = false;
this.defineCompletions = function() {
if (document) {
var style = document.createElement('c').style;
for (var i in style) {
if (typeof style[i] !== 'string')
continue;
var name = i.replace(/[A-Z]/g, function(x) {
return '-' + x.toLowerCase();
});
if (!propertyMap.hasOwnProperty(name))
propertyMap[name] = 1;
}
}
this.completionsDefined = true;
}
this.getCompletions = function(state, session, pos, prefix) {
if (!this.completionsDefined) {
this.defineCompletions();
}
var token = session.getTokenAt(pos.row, pos.column);
if (!token)
return [];
if (state==='ruleset'){
var line = session.getLine(pos.row).substr(0, pos.column);
if (/:[^;]+$/.test(line)) {
/([\w\-]+):[^:]*$/.test(line);
return this.getPropertyValueCompletions(state, session, pos, prefix);
} else {
return this.getPropertyCompletions(state, session, pos, prefix);
}
}
return [];
};
this.getPropertyCompletions = function(state, session, pos, prefix) {
var properties = Object.keys(propertyMap);
return properties.map(function(property){
return {
caption: property,
snippet: property + ': $0',
meta: "property",
score: Number.MAX_VALUE
};
});
};
this.getPropertyValueCompletions = function(state, session, pos, prefix) {
var line = session.getLine(pos.row).substr(0, pos.column);
var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
if (!property)
return [];
var values = [];
if (property in propertyMap && typeof propertyMap[property] === "object") {
values = Object.keys(propertyMap[property]);
}
return values.map(function(value){
return {
caption: value,
snippet: value,
meta: "property value",
score: Number.MAX_VALUE
};
});
};
}).call(CssCompletions.prototype);
exports.CssCompletions = CssCompletions;
});
ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) {
"use strict";
@ -1247,7 +1536,7 @@ oop.inherits(CssBehaviour, CstyleBehaviour);
exports.CssBehaviour = CssBehaviour;
});
ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
@ -1255,6 +1544,7 @@ var TextMode = require("./text").Mode;
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
var CssCompletions = require("./css_completions").CssCompletions;
var CssBehaviour = require("./behaviour/css").CssBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
@ -1262,6 +1552,7 @@ var Mode = function() {
this.HighlightRules = CssHighlightRules;
this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new CssBehaviour();
this.$completer = new CssCompletions();
this.foldingRules = new CStyleFoldMode();
};
oop.inherits(Mode, TextMode);
@ -1294,6 +1585,10 @@ oop.inherits(Mode, TextMode);
this.$outdent.autoOutdent(doc, row);
};
this.getCompletions = function(state, session, pos, prefix) {
return this.$completer.getCompletions(state, session, pos, prefix);
};
this.createWorker = function(session) {
var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
worker.attachToDocument(session.getDocument());
@ -1334,7 +1629,7 @@ var XmlHighlightRules = function(normalize) {
},
{
token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction",
regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction"
},
{token : "comment.xml", regex : "<\\!--", next : "comment"},
{
@ -1595,11 +1890,11 @@ var HtmlHighlightRules = function() {
tag_stuff: [
{include : "attributes"},
{token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
],
]
});
this.embedTagRules(CssHighlightRules, "css-", "style");
this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
this.embedTagRules(new JavaScriptHighlightRules({noJSX: true}).getRules(), "js-", "script");
if (this.constructor === HtmlHighlightRules)
this.normalizeRules();
@ -2177,118 +2472,120 @@ var eventAttributes = [
var globalAttributes = commonAttributes.concat(eventAttributes);
var attributeMap = {
"html": ["manifest"],
"head": [],
"title": [],
"base": ["href", "target"],
"link": ["href", "hreflang", "rel", "media", "type", "sizes"],
"meta": ["http-equiv", "name", "content", "charset"],
"style": ["type", "media", "scoped"],
"script": ["charset", "type", "src", "defer", "async"],
"noscript": ["href"],
"body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"],
"section": [],
"nav": [],
"article": ["pubdate"],
"aside": [],
"h1": [],
"h2": [],
"h3": [],
"h4": [],
"h5": [],
"h6": [],
"header": [],
"footer": [],
"address": [],
"main": [],
"p": [],
"hr": [],
"pre": [],
"blockquote": ["cite"],
"ol": ["start", "reversed"],
"ul": [],
"li": ["value"],
"dl": [],
"dt": [],
"dd": [],
"figure": [],
"figcaption": [],
"div": [],
"a": ["href", "target", "ping", "rel", "media", "hreflang", "type"],
"em": [],
"strong": [],
"small": [],
"s": [],
"cite": [],
"q": ["cite"],
"dfn": [],
"abbr": [],
"data": [],
"time": ["datetime"],
"code": [],
"var": [],
"samp": [],
"kbd": [],
"sub": [],
"sup": [],
"i": [],
"b": [],
"u": [],
"mark": [],
"ruby": [],
"rt": [],
"rp": [],
"bdi": [],
"bdo": [],
"span": [],
"br": [],
"wbr": [],
"ins": ["cite", "datetime"],
"del": ["cite", "datetime"],
"img": ["alt", "src", "height", "width", "usemap", "ismap"],
"iframe": ["name", "src", "height", "width", "sandbox", "seamless"],
"embed": ["src", "height", "width", "type"],
"object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"],
"param": ["name", "value"],
"video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"],
"audio": ["src", "autobuffer", "autoplay", "loop", "controls"],
"source": ["src", "type", "media"],
"track": ["kind", "src", "srclang", "label", "default"],
"canvas": ["width", "height"],
"map": ["name"],
"area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"],
"svg": [],
"math": [],
"table": ["summary"],
"caption": [],
"colgroup": ["span"],
"col": ["span"],
"tbody": [],
"thead": [],
"tfoot": [],
"tr": [],
"td": ["headers", "rowspan", "colspan"],
"th": ["headers", "rowspan", "colspan", "scope"],
"form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"],
"fieldset": ["disabled", "form", "name"],
"legend": [],
"label": ["form", "for"],
"input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"],
"button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"],
"select": ["autofocus", "disabled", "form", "multiple", "name", "size"],
"datalist": [],
"optgroup": ["disabled", "label"],
"option": ["disabled", "selected", "label", "value"],
"textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"],
"keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"],
"output": ["for", "form", "name"],
"progress": ["value", "max"],
"meter": ["value", "min", "max", "low", "high", "optimum"],
"details": ["open"],
"summary": [],
"command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"],
"menu": ["type", "label"],
"dialog": ["open"]
"html": {"manifest": 1},
"head": {},
"title": {},
"base": {"href": 1, "target": 1},
"link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1},
"meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1},
"style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1},
"script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1},
"noscript": {"href": 1},
"body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1},
"section": {},
"nav": {},
"article": {"pubdate": 1},
"aside": {},
"h1": {},
"h2": {},
"h3": {},
"h4": {},
"h5": {},
"h6": {},
"header": {},
"footer": {},
"address": {},
"main": {},
"p": {},
"hr": {},
"pre": {},
"blockquote": {"cite": 1},
"ol": {"start": 1, "reversed": 1},
"ul": {},
"li": {"value": 1},
"dl": {},
"dt": {},
"dd": {},
"figure": {},
"figcaption": {},
"div": {},
"a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1},
"em": {},
"strong": {},
"small": {},
"s": {},
"cite": {},
"q": {"cite": 1},
"dfn": {},
"abbr": {},
"data": {},
"time": {"datetime": 1},
"code": {},
"var": {},
"samp": {},
"kbd": {},
"sub": {},
"sup": {},
"i": {},
"b": {},
"u": {},
"mark": {},
"ruby": {},
"rt": {},
"rp": {},
"bdi": {},
"bdo": {},
"span": {},
"br": {},
"wbr": {},
"ins": {"cite": 1, "datetime": 1},
"del": {"cite": 1, "datetime": 1},
"img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1},
"iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}},
"embed": {"src": 1, "height": 1, "width": 1, "type": 1},
"object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1},
"param": {"name": 1, "value": 1},
"video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}},
"audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }},
"source": {"src": 1, "type": 1, "media": 1},
"track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1},
"canvas": {"width": 1, "height": 1},
"map": {"name": 1},
"area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1},
"svg": {},
"math": {},
"table": {"summary": 1},
"caption": {},
"colgroup": {"span": 1},
"col": {"span": 1},
"tbody": {},
"thead": {},
"tfoot": {},
"tr": {},
"td": {"headers": 1, "rowspan": 1, "colspan": 1},
"th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1},
"form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}},
"fieldset": {"disabled": 1, "form": 1, "name": 1},
"legend": {},
"label": {"form": 1, "for": 1},
"input": {
"type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1},
"accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1},
"button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}},
"select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}},
"datalist": {},
"optgroup": {"disabled": 1, "label": 1},
"option": {"disabled": 1, "selected": 1, "label": 1, "value": 1},
"textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}},
"keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1},
"output": {"for": 1, "form": 1, "name": 1},
"progress": {"value": 1, "max": 1},
"meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1},
"details": {"open": 1},
"summary": {},
"command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1},
"menu": {"type": 1, "label": 1},
"dialog": {"open": 1}
};
var elements = Object.keys(attributeMap);
@ -2307,6 +2604,16 @@ function findTagName(session, pos) {
return token.value;
}
function findAttributeName(session, pos) {
var iterator = new TokenIterator(session, pos.row, pos.column);
var token = iterator.getCurrentToken();
while (token && !is(token, "attribute-name")){
token = iterator.stepBackward();
}
if (token)
return token.value;
}
var HtmlCompletions = function() {
};
@ -2321,7 +2628,12 @@ var HtmlCompletions = function() {
if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
return this.getTagCompletions(state, session, pos, prefix);
if (is(token, "tag-whitespace") || is(token, "attribute-name"))
return this.getAttributeCompetions(state, session, pos, prefix);
return this.getAttributeCompletions(state, session, pos, prefix);
if (is(token, "attribute-value"))
return this.getAttributeValueCompletions(state, session, pos, prefix);
var line = session.getLine(pos.row).substr(0, pos.column);
if (/&[A-z]*$/i.test(line))
return this.getHTMLEntityCompletions(state, session, pos, prefix);
return [];
};
@ -2336,13 +2648,13 @@ var HtmlCompletions = function() {
});
};
this.getAttributeCompetions = function(state, session, pos, prefix) {
this.getAttributeCompletions = function(state, session, pos, prefix) {
var tagName = findTagName(session, pos);
if (!tagName)
return [];
var attributes = globalAttributes;
if (tagName in attributeMap) {
attributes = attributes.concat(attributeMap[tagName]);
attributes = attributes.concat(Object.keys(attributeMap[tagName]));
}
return attributes.map(function(attribute){
return {
@ -2354,6 +2666,39 @@ var HtmlCompletions = function() {
});
};
this.getAttributeValueCompletions = function(state, session, pos, prefix) {
var tagName = findTagName(session, pos);
var attributeName = findAttributeName(session, pos);
if (!tagName)
return [];
var values = [];
if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
values = Object.keys(attributeMap[tagName][attributeName]);
}
return values.map(function(value){
return {
caption: value,
snippet: value,
meta: "attribute value",
score: Number.MAX_VALUE
};
});
};
this.getHTMLEntityCompletions = function(state, session, pos, prefix) {
var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;'];
return values.map(function(value){
return {
caption: value,
snippet: value,
meta: "html entity",
score: Number.MAX_VALUE
};
});
};
}).call(HtmlCompletions.prototype);
exports.HtmlCompletions = HtmlCompletions;

View File

@ -54,6 +54,7 @@ ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","
var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function(options) {
var keywordMapper = this.createKeywordMapper({
@ -69,7 +70,7 @@ var JavaScriptHighlightRules = function(options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document" , // Pseudo
"keyword":
"const|yield|import|get|set|" +
"const|yield|import|get|set|async|await|" +
"break|case|catch|continue|default|delete|do|else|finally|for|function|" +
"if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
@ -83,29 +84,20 @@ var JavaScriptHighlightRules = function(options) {
"constant.language.boolean": "true|false"
}, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
"u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
"[0-2][0-7]{0,2}|" + // oct
"3[0-6][0-7]?|" + // oct
"37[0-7]?|" + // oct
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
this.$rules = {
"no_regex" : [
{
token : "comment",
regex : "\\/\\/",
next : "line_comment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
{
token : "comment", // multi line comment
regex : /\/\*/,
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
next : "qstring"
@ -115,10 +107,10 @@ var JavaScriptHighlightRules = function(options) {
next : "qqstring"
}, {
token : "constant.numeric", // hex
regex : /0[xX][0-9a-fA-F]+\b/
regex : /0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/
}, {
token : "constant.numeric", // float
regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
regex : /[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
}, {
token : [
"storage.type", "punctuation.operator", "support.function",
@ -171,15 +163,6 @@ var JavaScriptHighlightRules = function(options) {
token : "keyword",
regex : "(?:" + kwBeforeRe + ")\\b",
next : "start"
}, {
token : ["punctuation.operator", "support.function"],
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, {
token : ["punctuation.operator", "support.function.dom"],
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, {
token : ["punctuation.operator", "support.constant"],
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, {
token : ["support.constant"],
regex : /that\b/
@ -189,9 +172,13 @@ var JavaScriptHighlightRules = function(options) {
}, {
token : keywordMapper,
regex : identifierRe
}, {
token : "punctuation.operator",
regex : /[.](?![.])/,
next : "property"
}, {
token : "keyword.operator",
regex : /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
next : "start"
}, {
token : "punctuation.operator",
@ -209,17 +196,42 @@ var JavaScriptHighlightRules = function(options) {
regex: /^#!.*$/
}
],
property: [{
token : "text",
regex : "\\s+"
}, {
token : [
"storage.type", "punctuation.operator", "entity.name.function", "text",
"keyword.operator", "text",
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
next: "function_arguments"
}, {
token : "punctuation.operator",
regex : /[.](?![.])/
}, {
token : "support.function",
regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, {
token : "support.function.dom",
regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, {
token : "support.constant",
regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, {
token : "identifier",
regex : identifierRe
}, {
regex: "",
token: "empty",
next: "no_regex"
}
],
"start": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("start"),
{
token : "comment", // multi line comment
regex : "\\/\\*",
next : "comment_regex_allowed"
}, {
token : "comment",
regex : "\\/\\/",
next : "line_comment_regex_allowed"
}, {
token: "string.regexp",
regex: "\\/",
next: "regex"
@ -297,26 +309,6 @@ var JavaScriptHighlightRules = function(options) {
next: "no_regex"
}
],
"comment_regex_allowed" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "\\*\\/", next : "start"},
{defaultToken : "comment", caseInsensitive: true}
],
"comment" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "\\*\\/", next : "no_regex"},
{defaultToken : "comment", caseInsensitive: true}
],
"line_comment_regex_allowed" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "$|^", next : "start"},
{defaultToken : "comment", caseInsensitive: true}
],
"line_comment" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "$|^", next : "no_regex"},
{defaultToken : "comment", caseInsensitive: true}
],
"qqstring" : [
{
token : "constant.language.escape",
@ -358,12 +350,11 @@ var JavaScriptHighlightRules = function(options) {
this.next = val == "{" ? this.nextState : "";
if (val == "{" && stack.length) {
stack.unshift("start", state);
return "paren";
}
if (val == "}" && stack.length) {
else if (val == "}" && stack.length) {
stack.shift();
this.next = stack.shift();
if (this.next.indexOf("string") != -1)
if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
return "paren.quasi.end";
}
return val == "{" ? "paren.lparen" : "paren.rparen";
@ -387,6 +378,9 @@ var JavaScriptHighlightRules = function(options) {
defaultToken: "string.quasi"
}]
});
if (!options || !options.noJSX)
JSX.call(this);
}
this.embedRules(DocCommentHighlightRules, "doc-",
@ -397,6 +391,127 @@ var JavaScriptHighlightRules = function(options) {
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
function JSX() {
var tagRegex = identifierRe.replace("\\d", "\\d\\-");
var jsxTag = {
onMatch : function(val, state, stack) {
var offset = val.charAt(1) == "/" ? 2 : 1;
if (offset == 1) {
if (state != this.nextState)
stack.unshift(this.next, this.nextState, 0);
else
stack.unshift(this.next);
stack[2]++;
} else if (offset == 2) {
if (state == this.nextState) {
stack[1]--;
if (!stack[1] || stack[1] < 0) {
stack.shift();
stack.shift();
}
}
}
return [{
type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
value: val.slice(0, offset)
}, {
type: "meta.tag.tag-name.xml",
value: val.substr(offset)
}];
},
regex : "</?" + tagRegex + "",
next: "jsxAttributes",
nextState: "jsx"
};
this.$rules.start.unshift(jsxTag);
var jsxJsRule = {
regex: "{",
token: "paren.quasi.start",
push: "start"
};
this.$rules.jsx = [
jsxJsRule,
jsxTag,
{include : "reference"},
{defaultToken: "string"}
];
this.$rules.jsxAttributes = [{
token : "meta.tag.punctuation.tag-close.xml",
regex : "/?>",
onMatch : function(value, currentState, stack) {
if (currentState == stack[0])
stack.shift();
if (value.length == 2) {
if (stack[0] == this.nextState)
stack[1]--;
if (!stack[1] || stack[1] < 0) {
stack.splice(0, 2);
}
}
this.next = stack[0] || "start";
return [{type: this.token, value: value}];
},
nextState: "jsx"
},
jsxJsRule,
comments("jsxAttributes"),
{
token : "entity.other.attribute-name.xml",
regex : tagRegex
}, {
token : "keyword.operator.attribute-equals.xml",
regex : "="
}, {
token : "text.tag-whitespace.xml",
regex : "\\s+"
}, {
token : "string.attribute-value.xml",
regex : "'",
stateName : "jsx_attr_q",
push : [
{token : "string.attribute-value.xml", regex: "'", next: "pop"},
{include : "reference"},
{defaultToken : "string.attribute-value.xml"}
]
}, {
token : "string.attribute-value.xml",
regex : '"',
stateName : "jsx_attr_qq",
push : [
{token : "string.attribute-value.xml", regex: '"', next: "pop"},
{include : "reference"},
{defaultToken : "string.attribute-value.xml"}
]
},
jsxTag
];
this.$rules.reference = [{
token : "constant.language.escape.reference.xml",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}];
}
function comments(next) {
return [
{
token : "comment", // multi line comment
regex : /\/\*/,
next: [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "\\*\\/", next : next || "pop"},
{defaultToken : "comment", caseInsensitive: true}
]
}, {
token : "comment",
regex : "\\/\\/",
next: [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "$|^", next : next || "pop"},
{defaultToken : "comment", caseInsensitive: true}
]
}
];
}
exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
});

View File

@ -1,128 +1,171 @@
ace.define("ace/mode/less_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
ace.define("ace/mode/css_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;
var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero";
var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var CssHighlightRules = function() {
var keywordMapper = this.createKeywordMapper({
"support.function": supportFunction,
"support.constant": supportConstant,
"support.type": supportType,
"support.constant.color": supportConstantColor,
"support.constant.fonts": supportConstantFonts
}, "text", true);
this.$rules = {
"start" : [{
token : "comment", // multi line comment
regex : "\\/\\*",
push : "comment"
}, {
token: "paren.lparen",
regex: "\\{",
push: "ruleset"
}, {
token: "string",
regex: "@.*?{",
push: "media"
}, {
token: "keyword",
regex: "#[a-z0-9-_]+"
}, {
token: "variable",
regex: "\\.[a-z0-9-_]+"
}, {
token: "string",
regex: ":[a-z0-9-_]+"
}, {
token: "constant",
regex: "[a-z0-9-_]+"
}, {
caseInsensitive: true
}],
"media" : [{
token : "comment", // multi line comment
regex : "\\/\\*",
push : "comment"
}, {
token: "paren.lparen",
regex: "\\{",
push: "ruleset"
}, {
token: "string",
regex: "\\}",
next: "pop"
}, {
token: "keyword",
regex: "#[a-z0-9-_]+"
}, {
token: "variable",
regex: "\\.[a-z0-9-_]+"
}, {
token: "string",
regex: ":[a-z0-9-_]+"
}, {
token: "constant",
regex: "[a-z0-9-_]+"
}, {
caseInsensitive: true
}],
"comment" : [{
token : "comment",
regex : "\\*\\/",
next : "pop"
}, {
defaultToken : "comment"
}],
"ruleset" : [
{
token : "paren.rparen",
regex : "\\}",
next: "pop"
}, {
token : "comment", // multi line comment
regex : "\\/\\*",
push : "comment"
}, {
token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, {
token : "string", // single line
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
}, {
token : "constant.numeric",
regex : numRe
}, {
token : "constant.numeric", // hex6 color
regex : "#[a-f0-9]{6}"
}, {
token : "constant.numeric", // hex3 color
regex : "#[a-f0-9]{3}"
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex : pseudoElements
}, {
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex : pseudoClasses
}, {
token : ["support.function", "string", "support.function"],
regex : "(url\\()(.*)(\\))"
}, {
token : keywordMapper,
regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
}, {
caseInsensitive: true
}]
};
this.normalizeRules();
};
oop.inherits(CssHighlightRules, TextHighlightRules);
exports.CssHighlightRules = CssHighlightRules;
});
ace.define("ace/mode/less_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CssHighlightRules = require('./css_highlight_rules');
var LessHighlightRules = function() {
var properties = lang.arrayToMap( (function () {
var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|");
var keywordList = "@import|@media|@font-face|@keyframes|@-webkit-keyframes|@supports|" +
"@charset|@plugin|@namespace|@document|@page|@viewport|@-ms-viewport|" +
"or|and|when|not";
var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" +
"background-size|binding|border-bottom-colors|border-left-colors|" +
"border-right-colors|border-top-colors|border-end|border-end-color|" +
"border-end-style|border-end-width|border-image|border-start|" +
"border-start-color|border-start-style|border-start-width|box-align|" +
"box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" +
"box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" +
"column-rule-width|column-rule-style|column-rule-color|float-edge|" +
"font-feature-settings|font-language-override|force-broken-image-icon|" +
"image-region|margin-end|margin-start|opacity|outline|outline-color|" +
"outline-offset|outline-radius|outline-radius-bottomleft|" +
"outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" +
"outline-style|outline-width|padding-end|padding-start|stack-sizing|" +
"tab-size|text-blink|text-decoration-color|text-decoration-line|" +
"text-decoration-style|transform|transform-origin|transition|" +
"transition-delay|transition-duration|transition-property|" +
"transition-timing-function|user-focus|user-input|user-modify|user-select|" +
"window-shadow|border-radius").split("|");
var keywords = keywordList.split('|');
var properties = ("azimuth|background-attachment|background-color|background-image|" +
"background-position|background-repeat|background|border-bottom-color|" +
"border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
"border-color|border-left-color|border-left-style|border-left-width|" +
"border-left|border-right-color|border-right-style|border-right-width|" +
"border-right|border-spacing|border-style|border-top-color|" +
"border-top-style|border-top-width|border-top|border-width|border|" +
"bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
"counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
"elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
"font-stretch|font-style|font-variant|font-weight|font|height|left|" +
"letter-spacing|line-height|list-style-image|list-style-position|" +
"list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
"margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
"min-width|opacity|orphans|outline-color|" +
"outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
"padding-left|padding-right|padding-top|padding|page-break-after|" +
"page-break-before|page-break-inside|page|pause-after|pause-before|" +
"pause|pitch-range|pitch|play-during|position|quotes|richness|right|" +
"size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
"stress|table-layout|text-align|text-decoration|text-indent|" +
"text-shadow|text-transform|top|unicode-bidi|vertical-align|" +
"visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
"z-index").split("|");
var ret = [];
for (var i=0, ln=browserPrefix.length; i<ln; i++) {
Array.prototype.push.apply(
ret,
(( browserPrefix[i] + prefixProperties.join("|" + browserPrefix[i]) ).split("|"))
);
}
Array.prototype.push.apply(ret, prefixProperties);
Array.prototype.push.apply(ret, properties);
var properties = CssHighlightRules.supportType.split('|');
return ret;
})() );
var functions = lang.arrayToMap(
("hsl|hsla|rgb|rgba|url|attr|counter|counters|lighten|darken|saturate|" +
"desaturate|fadein|fadeout|fade|spin|mix|hue|saturation|lightness|" +
"alpha|round|ceil|floor|percentage|color|iscolor|isnumber|isstring|" +
"iskeyword|isurl|ispixel|ispercentage|isem").split("|")
);
var constants = lang.arrayToMap(
("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
"block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
"char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
"decimal-leading-zero|decimal|default|disabled|disc|" +
"distribute-all-lines|distribute-letter|distribute-space|" +
"distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
"hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
"ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
"ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
"inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
"keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
"lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
"medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
"nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
"overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
"ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
"solid|square|static|strict|super|sw-resize|table-footer-group|" +
"table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
"transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
"vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
"zero").split("|")
);
var colors = lang.arrayToMap(
("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
"purple|red|silver|teal|white|yellow").split("|")
);
var keywords = lang.arrayToMap(
("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|" +
"@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|" +
"def|end|declare|when|not|and").split("|")
);
var tags = lang.arrayToMap(
("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" +
"big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" +
"command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" +
"figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" +
"header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" +
"link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" +
"option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" +
"small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" +
"textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|")
);
var keywordMapper = this.createKeywordMapper({
"support.constant": CssHighlightRules.supportConstant,
"keyword": keywordList,
"support.constant.color": CssHighlightRules.supportConstantColor,
"support.constant.fonts": CssHighlightRules.supportConstantFonts
}, "identifier", true);
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
@ -143,8 +186,8 @@ var LessHighlightRules = function() {
token : "string", // single line
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
token : "constant.numeric",
regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"
token : ["constant.numeric", "keyword"],
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
}, {
token : "constant.numeric", // hex6 color
regex : "#[a-f0-9]{6}"
@ -154,31 +197,38 @@ var LessHighlightRules = function() {
}, {
token : "constant.numeric",
regex : numRe
}, {
token : ["support.function", "paren.lparen", "string", "paren.rparen"],
regex : "(url)(\\()(.*)(\\))"
}, {
token : ["support.function", "paren.lparen"],
regex : "(:extend|[a-z0-9_\\-]+)(\\()"
}, {
token : function(value) {
if (keywords.hasOwnProperty(value))
if (keywords.indexOf(value.toLowerCase()) > -1)
return "keyword";
else
return "variable";
},
regex : "@[a-z0-9_\\-@]*\\b"
regex : "[@\\$][a-z0-9_\\-@\\$]*\\b"
}, {
token : function(value) {
if (properties.hasOwnProperty(value.toLowerCase()))
return "support.type";
else if (keywords.hasOwnProperty(value))
return "keyword";
else if (constants.hasOwnProperty(value))
return "constant.language";
else if (functions.hasOwnProperty(value))
return "support.function";
else if (colors.hasOwnProperty(value.toLowerCase()))
return "support.constant.color";
else if (tags.hasOwnProperty(value.toLowerCase()))
return "variable.language";
else
return "text";
token : "variable",
regex : "[@\\$]\\{[a-z0-9_\\-@\\$]*\\}"
}, {
token : function(first, second) {
if(properties.indexOf(first.toLowerCase()) > -1) {
return ["support.type.property", "text"];
}
else {
return ["support.type.unknownProperty", "text"];
}
},
regex : "([a-z0-9-_]+)(\\s*:)"
}, {
token : "keyword",
regex : "&" // special case - always treat as keyword
}, {
token : keywordMapper,
regex : "\\-?[@a-z_][@a-z0-9_\\-]*"
}, {
token: "variable.language",
@ -194,7 +244,7 @@ var LessHighlightRules = function() {
regex: "[a-z0-9-_]+"
}, {
token : "keyword.operator",
regex : "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"
regex : "<|>|<=|>=|=|!=|-|%|\\+|\\*"
}, {
token : "paren.lparen",
regex : "[[({]"
@ -219,6 +269,7 @@ var LessHighlightRules = function() {
}
]
};
this.normalizeRules();
};
oop.inherits(LessHighlightRules, TextHighlightRules);
@ -703,6 +754,180 @@ oop.inherits(CssBehaviour, CstyleBehaviour);
exports.CssBehaviour = CssBehaviour;
});
ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) {
"use strict";
var propertyMap = {
"background": {"#$0": 1},
"background-color": {"#$0": 1, "transparent": 1, "fixed": 1},
"background-image": {"url('/$0')": 1},
"background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1},
"background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2},
"background-attachment": {"scroll": 1, "fixed": 1},
"background-size": {"cover": 1, "contain": 1},
"background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1},
"background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1},
"border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1},
"border-color": {"#$0": 1},
"border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2},
"border-collapse": {"collapse": 1, "separate": 1},
"bottom": {"px": 1, "em": 1, "%": 1},
"clear": {"left": 1, "right": 1, "both": 1, "none": 1},
"color": {"#$0": 1, "rgb(#$00,0,0)": 1},
"cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1},
"display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1},
"empty-cells": {"show": 1, "hide": 1},
"float": {"left": 1, "right": 1, "none": 1},
"font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1},
"font-size": {"px": 1, "em": 1, "%": 1},
"font-weight": {"bold": 1, "normal": 1},
"font-style": {"italic": 1, "normal": 1},
"font-variant": {"normal": 1, "small-caps": 1},
"height": {"px": 1, "em": 1, "%": 1},
"left": {"px": 1, "em": 1, "%": 1},
"letter-spacing": {"normal": 1},
"line-height": {"normal": 1},
"list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1},
"margin": {"px": 1, "em": 1, "%": 1},
"margin-right": {"px": 1, "em": 1, "%": 1},
"margin-left": {"px": 1, "em": 1, "%": 1},
"margin-top": {"px": 1, "em": 1, "%": 1},
"margin-bottom": {"px": 1, "em": 1, "%": 1},
"max-height": {"px": 1, "em": 1, "%": 1},
"max-width": {"px": 1, "em": 1, "%": 1},
"min-height": {"px": 1, "em": 1, "%": 1},
"min-width": {"px": 1, "em": 1, "%": 1},
"overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
"overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
"overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
"padding": {"px": 1, "em": 1, "%": 1},
"padding-top": {"px": 1, "em": 1, "%": 1},
"padding-right": {"px": 1, "em": 1, "%": 1},
"padding-bottom": {"px": 1, "em": 1, "%": 1},
"padding-left": {"px": 1, "em": 1, "%": 1},
"page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
"page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
"position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1},
"right": {"px": 1, "em": 1, "%": 1},
"table-layout": {"fixed": 1, "auto": 1},
"text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1},
"text-align": {"left": 1, "right": 1, "center": 1, "justify": 1},
"text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1},
"top": {"px": 1, "em": 1, "%": 1},
"vertical-align": {"top": 1, "bottom": 1},
"visibility": {"hidden": 1, "visible": 1},
"white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1},
"width": {"px": 1, "em": 1, "%": 1},
"word-spacing": {"normal": 1},
"filter": {"alpha(opacity=$0100)": 1},
"text-shadow": {"$02px 2px 2px #777": 1},
"text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},
"-moz-border-radius": 1,
"-moz-border-radius-topright": 1,
"-moz-border-radius-bottomright": 1,
"-moz-border-radius-topleft": 1,
"-moz-border-radius-bottomleft": 1,
"-webkit-border-radius": 1,
"-webkit-border-top-right-radius": 1,
"-webkit-border-top-left-radius": 1,
"-webkit-border-bottom-right-radius": 1,
"-webkit-border-bottom-left-radius": 1,
"-moz-box-shadow": 1,
"-webkit-box-shadow": 1,
"transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
"-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
"-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 }
};
var CssCompletions = function() {
};
(function() {
this.completionsDefined = false;
this.defineCompletions = function() {
if (document) {
var style = document.createElement('c').style;
for (var i in style) {
if (typeof style[i] !== 'string')
continue;
var name = i.replace(/[A-Z]/g, function(x) {
return '-' + x.toLowerCase();
});
if (!propertyMap.hasOwnProperty(name))
propertyMap[name] = 1;
}
}
this.completionsDefined = true;
}
this.getCompletions = function(state, session, pos, prefix) {
if (!this.completionsDefined) {
this.defineCompletions();
}
var token = session.getTokenAt(pos.row, pos.column);
if (!token)
return [];
if (state==='ruleset'){
var line = session.getLine(pos.row).substr(0, pos.column);
if (/:[^;]+$/.test(line)) {
/([\w\-]+):[^:]*$/.test(line);
return this.getPropertyValueCompletions(state, session, pos, prefix);
} else {
return this.getPropertyCompletions(state, session, pos, prefix);
}
}
return [];
};
this.getPropertyCompletions = function(state, session, pos, prefix) {
var properties = Object.keys(propertyMap);
return properties.map(function(property){
return {
caption: property,
snippet: property + ': $0',
meta: "property",
score: Number.MAX_VALUE
};
});
};
this.getPropertyValueCompletions = function(state, session, pos, prefix) {
var line = session.getLine(pos.row).substr(0, pos.column);
var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
if (!property)
return [];
var values = [];
if (property in propertyMap && typeof propertyMap[property] === "object") {
values = Object.keys(propertyMap[property]);
}
return values.map(function(value){
return {
caption: value,
snippet: value,
meta: "property value",
score: Number.MAX_VALUE
};
});
};
}).call(CssCompletions.prototype);
exports.CssCompletions = CssCompletions;
});
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";
@ -843,7 +1068,7 @@ oop.inherits(FoldMode, BaseFoldMode);
});
ace.define("ace/mode/less",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/less_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
ace.define("ace/mode/less",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/less_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/css","ace/mode/css_completions","ace/mode/folding/cstyle"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
@ -851,12 +1076,15 @@ var TextMode = require("./text").Mode;
var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var CssBehaviour = require("./behaviour/css").CssBehaviour;
var CssCompletions = require("./css_completions").CssCompletions;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function() {
this.HighlightRules = LessHighlightRules;
this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new CssBehaviour();
this.$completer = new CssCompletions();
this.foldingRules = new CStyleFoldMode();
};
oop.inherits(Mode, TextMode);
@ -889,6 +1117,10 @@ oop.inherits(Mode, TextMode);
this.$outdent.autoOutdent(doc, row);
};
this.getCompletions = function(state, session, pos, prefix) {
return this.$completer.getCompletions("ruleset", session, pos, prefix);
};
this.$id = "ace/mode/less";
}).call(Mode.prototype);

View File

@ -54,6 +54,7 @@ ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","
var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function(options) {
var keywordMapper = this.createKeywordMapper({
@ -69,7 +70,7 @@ var JavaScriptHighlightRules = function(options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document" , // Pseudo
"keyword":
"const|yield|import|get|set|" +
"const|yield|import|get|set|async|await|" +
"break|case|catch|continue|default|delete|do|else|finally|for|function|" +
"if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
@ -83,29 +84,20 @@ var JavaScriptHighlightRules = function(options) {
"constant.language.boolean": "true|false"
}, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
"u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
"[0-2][0-7]{0,2}|" + // oct
"3[0-6][0-7]?|" + // oct
"37[0-7]?|" + // oct
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
this.$rules = {
"no_regex" : [
{
token : "comment",
regex : "\\/\\/",
next : "line_comment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
{
token : "comment", // multi line comment
regex : /\/\*/,
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
next : "qstring"
@ -115,10 +107,10 @@ var JavaScriptHighlightRules = function(options) {
next : "qqstring"
}, {
token : "constant.numeric", // hex
regex : /0[xX][0-9a-fA-F]+\b/
regex : /0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/
}, {
token : "constant.numeric", // float
regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
regex : /[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
}, {
token : [
"storage.type", "punctuation.operator", "support.function",
@ -171,15 +163,6 @@ var JavaScriptHighlightRules = function(options) {
token : "keyword",
regex : "(?:" + kwBeforeRe + ")\\b",
next : "start"
}, {
token : ["punctuation.operator", "support.function"],
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, {
token : ["punctuation.operator", "support.function.dom"],
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, {
token : ["punctuation.operator", "support.constant"],
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, {
token : ["support.constant"],
regex : /that\b/
@ -189,9 +172,13 @@ var JavaScriptHighlightRules = function(options) {
}, {
token : keywordMapper,
regex : identifierRe
}, {
token : "punctuation.operator",
regex : /[.](?![.])/,
next : "property"
}, {
token : "keyword.operator",
regex : /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
next : "start"
}, {
token : "punctuation.operator",
@ -209,17 +196,42 @@ var JavaScriptHighlightRules = function(options) {
regex: /^#!.*$/
}
],
property: [{
token : "text",
regex : "\\s+"
}, {
token : [
"storage.type", "punctuation.operator", "entity.name.function", "text",
"keyword.operator", "text",
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
next: "function_arguments"
}, {
token : "punctuation.operator",
regex : /[.](?![.])/
}, {
token : "support.function",
regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, {
token : "support.function.dom",
regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, {
token : "support.constant",
regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, {
token : "identifier",
regex : identifierRe
}, {
regex: "",
token: "empty",
next: "no_regex"
}
],
"start": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("start"),
{
token : "comment", // multi line comment
regex : "\\/\\*",
next : "comment_regex_allowed"
}, {
token : "comment",
regex : "\\/\\/",
next : "line_comment_regex_allowed"
}, {
token: "string.regexp",
regex: "\\/",
next: "regex"
@ -297,26 +309,6 @@ var JavaScriptHighlightRules = function(options) {
next: "no_regex"
}
],
"comment_regex_allowed" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "\\*\\/", next : "start"},
{defaultToken : "comment", caseInsensitive: true}
],
"comment" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "\\*\\/", next : "no_regex"},
{defaultToken : "comment", caseInsensitive: true}
],
"line_comment_regex_allowed" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "$|^", next : "start"},
{defaultToken : "comment", caseInsensitive: true}
],
"line_comment" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "$|^", next : "no_regex"},
{defaultToken : "comment", caseInsensitive: true}
],
"qqstring" : [
{
token : "constant.language.escape",
@ -358,12 +350,11 @@ var JavaScriptHighlightRules = function(options) {
this.next = val == "{" ? this.nextState : "";
if (val == "{" && stack.length) {
stack.unshift("start", state);
return "paren";
}
if (val == "}" && stack.length) {
else if (val == "}" && stack.length) {
stack.shift();
this.next = stack.shift();
if (this.next.indexOf("string") != -1)
if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
return "paren.quasi.end";
}
return val == "{" ? "paren.lparen" : "paren.rparen";
@ -387,6 +378,9 @@ var JavaScriptHighlightRules = function(options) {
defaultToken: "string.quasi"
}]
});
if (!options || !options.noJSX)
JSX.call(this);
}
this.embedRules(DocCommentHighlightRules, "doc-",
@ -397,6 +391,127 @@ var JavaScriptHighlightRules = function(options) {
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
function JSX() {
var tagRegex = identifierRe.replace("\\d", "\\d\\-");
var jsxTag = {
onMatch : function(val, state, stack) {
var offset = val.charAt(1) == "/" ? 2 : 1;
if (offset == 1) {
if (state != this.nextState)
stack.unshift(this.next, this.nextState, 0);
else
stack.unshift(this.next);
stack[2]++;
} else if (offset == 2) {
if (state == this.nextState) {
stack[1]--;
if (!stack[1] || stack[1] < 0) {
stack.shift();
stack.shift();
}
}
}
return [{
type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
value: val.slice(0, offset)
}, {
type: "meta.tag.tag-name.xml",
value: val.substr(offset)
}];
},
regex : "</?" + tagRegex + "",
next: "jsxAttributes",
nextState: "jsx"
};
this.$rules.start.unshift(jsxTag);
var jsxJsRule = {
regex: "{",
token: "paren.quasi.start",
push: "start"
};
this.$rules.jsx = [
jsxJsRule,
jsxTag,
{include : "reference"},
{defaultToken: "string"}
];
this.$rules.jsxAttributes = [{
token : "meta.tag.punctuation.tag-close.xml",
regex : "/?>",
onMatch : function(value, currentState, stack) {
if (currentState == stack[0])
stack.shift();
if (value.length == 2) {
if (stack[0] == this.nextState)
stack[1]--;
if (!stack[1] || stack[1] < 0) {
stack.splice(0, 2);
}
}
this.next = stack[0] || "start";
return [{type: this.token, value: value}];
},
nextState: "jsx"
},
jsxJsRule,
comments("jsxAttributes"),
{
token : "entity.other.attribute-name.xml",
regex : tagRegex
}, {
token : "keyword.operator.attribute-equals.xml",
regex : "="
}, {
token : "text.tag-whitespace.xml",
regex : "\\s+"
}, {
token : "string.attribute-value.xml",
regex : "'",
stateName : "jsx_attr_q",
push : [
{token : "string.attribute-value.xml", regex: "'", next: "pop"},
{include : "reference"},
{defaultToken : "string.attribute-value.xml"}
]
}, {
token : "string.attribute-value.xml",
regex : '"',
stateName : "jsx_attr_qq",
push : [
{token : "string.attribute-value.xml", regex: '"', next: "pop"},
{include : "reference"},
{defaultToken : "string.attribute-value.xml"}
]
},
jsxTag
];
this.$rules.reference = [{
token : "constant.language.escape.reference.xml",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}];
}
function comments(next) {
return [
{
token : "comment", // multi line comment
regex : /\/\*/,
next: [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "\\*\\/", next : next || "pop"},
{defaultToken : "comment", caseInsensitive: true}
]
}, {
token : "comment",
regex : "\\/\\/",
next: [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "$|^", next : next || "pop"},
{defaultToken : "comment", caseInsensitive: true}
]
}
];
}
exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
});
@ -1042,7 +1157,7 @@ var XmlHighlightRules = function(normalize) {
},
{
token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction",
regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction"
},
{token : "comment.xml", regex : "<\\!--", next : "comment"},
{
@ -1692,7 +1807,7 @@ ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib
var oop = require("../lib/oop");
var lang = require("../lib/lang");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index";
var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero";
var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
@ -1830,6 +1945,180 @@ exports.CssHighlightRules = CssHighlightRules;
});
ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) {
"use strict";
var propertyMap = {
"background": {"#$0": 1},
"background-color": {"#$0": 1, "transparent": 1, "fixed": 1},
"background-image": {"url('/$0')": 1},
"background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1},
"background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2},
"background-attachment": {"scroll": 1, "fixed": 1},
"background-size": {"cover": 1, "contain": 1},
"background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1},
"background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1},
"border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1},
"border-color": {"#$0": 1},
"border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2},
"border-collapse": {"collapse": 1, "separate": 1},
"bottom": {"px": 1, "em": 1, "%": 1},
"clear": {"left": 1, "right": 1, "both": 1, "none": 1},
"color": {"#$0": 1, "rgb(#$00,0,0)": 1},
"cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1},
"display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1},
"empty-cells": {"show": 1, "hide": 1},
"float": {"left": 1, "right": 1, "none": 1},
"font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1},
"font-size": {"px": 1, "em": 1, "%": 1},
"font-weight": {"bold": 1, "normal": 1},
"font-style": {"italic": 1, "normal": 1},
"font-variant": {"normal": 1, "small-caps": 1},
"height": {"px": 1, "em": 1, "%": 1},
"left": {"px": 1, "em": 1, "%": 1},
"letter-spacing": {"normal": 1},
"line-height": {"normal": 1},
"list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1},
"margin": {"px": 1, "em": 1, "%": 1},
"margin-right": {"px": 1, "em": 1, "%": 1},
"margin-left": {"px": 1, "em": 1, "%": 1},
"margin-top": {"px": 1, "em": 1, "%": 1},
"margin-bottom": {"px": 1, "em": 1, "%": 1},
"max-height": {"px": 1, "em": 1, "%": 1},
"max-width": {"px": 1, "em": 1, "%": 1},
"min-height": {"px": 1, "em": 1, "%": 1},
"min-width": {"px": 1, "em": 1, "%": 1},
"overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
"overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
"overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
"padding": {"px": 1, "em": 1, "%": 1},
"padding-top": {"px": 1, "em": 1, "%": 1},
"padding-right": {"px": 1, "em": 1, "%": 1},
"padding-bottom": {"px": 1, "em": 1, "%": 1},
"padding-left": {"px": 1, "em": 1, "%": 1},
"page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
"page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
"position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1},
"right": {"px": 1, "em": 1, "%": 1},
"table-layout": {"fixed": 1, "auto": 1},
"text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1},
"text-align": {"left": 1, "right": 1, "center": 1, "justify": 1},
"text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1},
"top": {"px": 1, "em": 1, "%": 1},
"vertical-align": {"top": 1, "bottom": 1},
"visibility": {"hidden": 1, "visible": 1},
"white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1},
"width": {"px": 1, "em": 1, "%": 1},
"word-spacing": {"normal": 1},
"filter": {"alpha(opacity=$0100)": 1},
"text-shadow": {"$02px 2px 2px #777": 1},
"text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},
"-moz-border-radius": 1,
"-moz-border-radius-topright": 1,
"-moz-border-radius-bottomright": 1,
"-moz-border-radius-topleft": 1,
"-moz-border-radius-bottomleft": 1,
"-webkit-border-radius": 1,
"-webkit-border-top-right-radius": 1,
"-webkit-border-top-left-radius": 1,
"-webkit-border-bottom-right-radius": 1,
"-webkit-border-bottom-left-radius": 1,
"-moz-box-shadow": 1,
"-webkit-box-shadow": 1,
"transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
"-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
"-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 }
};
var CssCompletions = function() {
};
(function() {
this.completionsDefined = false;
this.defineCompletions = function() {
if (document) {
var style = document.createElement('c').style;
for (var i in style) {
if (typeof style[i] !== 'string')
continue;
var name = i.replace(/[A-Z]/g, function(x) {
return '-' + x.toLowerCase();
});
if (!propertyMap.hasOwnProperty(name))
propertyMap[name] = 1;
}
}
this.completionsDefined = true;
}
this.getCompletions = function(state, session, pos, prefix) {
if (!this.completionsDefined) {
this.defineCompletions();
}
var token = session.getTokenAt(pos.row, pos.column);
if (!token)
return [];
if (state==='ruleset'){
var line = session.getLine(pos.row).substr(0, pos.column);
if (/:[^;]+$/.test(line)) {
/([\w\-]+):[^:]*$/.test(line);
return this.getPropertyValueCompletions(state, session, pos, prefix);
} else {
return this.getPropertyCompletions(state, session, pos, prefix);
}
}
return [];
};
this.getPropertyCompletions = function(state, session, pos, prefix) {
var properties = Object.keys(propertyMap);
return properties.map(function(property){
return {
caption: property,
snippet: property + ': $0',
meta: "property",
score: Number.MAX_VALUE
};
});
};
this.getPropertyValueCompletions = function(state, session, pos, prefix) {
var line = session.getLine(pos.row).substr(0, pos.column);
var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
if (!property)
return [];
var values = [];
if (property in propertyMap && typeof propertyMap[property] === "object") {
values = Object.keys(propertyMap[property]);
}
return values.map(function(value){
return {
caption: value,
snippet: value,
meta: "property value",
score: Number.MAX_VALUE
};
});
};
}).call(CssCompletions.prototype);
exports.CssCompletions = CssCompletions;
});
ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) {
"use strict";
@ -1909,7 +2198,7 @@ oop.inherits(CssBehaviour, CstyleBehaviour);
exports.CssBehaviour = CssBehaviour;
});
ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
@ -1917,6 +2206,7 @@ var TextMode = require("./text").Mode;
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
var CssCompletions = require("./css_completions").CssCompletions;
var CssBehaviour = require("./behaviour/css").CssBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
@ -1924,6 +2214,7 @@ var Mode = function() {
this.HighlightRules = CssHighlightRules;
this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new CssBehaviour();
this.$completer = new CssCompletions();
this.foldingRules = new CStyleFoldMode();
};
oop.inherits(Mode, TextMode);
@ -1956,6 +2247,10 @@ oop.inherits(Mode, TextMode);
this.$outdent.autoOutdent(doc, row);
};
this.getCompletions = function(state, session, pos, prefix) {
return this.$completer.getCompletions(state, session, pos, prefix);
};
this.createWorker = function(session) {
var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
worker.attachToDocument(session.getDocument());
@ -2045,11 +2340,11 @@ var HtmlHighlightRules = function() {
tag_stuff: [
{include : "attributes"},
{token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
],
]
});
this.embedTagRules(CssHighlightRules, "css-", "style");
this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
this.embedTagRules(new JavaScriptHighlightRules({noJSX: true}).getRules(), "js-", "script");
if (this.constructor === HtmlHighlightRules)
this.normalizeRules();
@ -2223,118 +2518,120 @@ var eventAttributes = [
var globalAttributes = commonAttributes.concat(eventAttributes);
var attributeMap = {
"html": ["manifest"],
"head": [],
"title": [],
"base": ["href", "target"],
"link": ["href", "hreflang", "rel", "media", "type", "sizes"],
"meta": ["http-equiv", "name", "content", "charset"],
"style": ["type", "media", "scoped"],
"script": ["charset", "type", "src", "defer", "async"],
"noscript": ["href"],
"body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"],
"section": [],
"nav": [],
"article": ["pubdate"],
"aside": [],
"h1": [],
"h2": [],
"h3": [],
"h4": [],
"h5": [],
"h6": [],
"header": [],
"footer": [],
"address": [],
"main": [],
"p": [],
"hr": [],
"pre": [],
"blockquote": ["cite"],
"ol": ["start", "reversed"],
"ul": [],
"li": ["value"],
"dl": [],
"dt": [],
"dd": [],
"figure": [],
"figcaption": [],
"div": [],
"a": ["href", "target", "ping", "rel", "media", "hreflang", "type"],
"em": [],
"strong": [],
"small": [],
"s": [],
"cite": [],
"q": ["cite"],
"dfn": [],
"abbr": [],
"data": [],
"time": ["datetime"],
"code": [],
"var": [],
"samp": [],
"kbd": [],
"sub": [],
"sup": [],
"i": [],
"b": [],
"u": [],
"mark": [],
"ruby": [],
"rt": [],
"rp": [],
"bdi": [],
"bdo": [],
"span": [],
"br": [],
"wbr": [],
"ins": ["cite", "datetime"],
"del": ["cite", "datetime"],
"img": ["alt", "src", "height", "width", "usemap", "ismap"],
"iframe": ["name", "src", "height", "width", "sandbox", "seamless"],
"embed": ["src", "height", "width", "type"],
"object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"],
"param": ["name", "value"],
"video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"],
"audio": ["src", "autobuffer", "autoplay", "loop", "controls"],
"source": ["src", "type", "media"],
"track": ["kind", "src", "srclang", "label", "default"],
"canvas": ["width", "height"],
"map": ["name"],
"area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"],
"svg": [],
"math": [],
"table": ["summary"],
"caption": [],
"colgroup": ["span"],
"col": ["span"],
"tbody": [],
"thead": [],
"tfoot": [],
"tr": [],
"td": ["headers", "rowspan", "colspan"],
"th": ["headers", "rowspan", "colspan", "scope"],
"form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"],
"fieldset": ["disabled", "form", "name"],
"legend": [],
"label": ["form", "for"],
"input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"],
"button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"],
"select": ["autofocus", "disabled", "form", "multiple", "name", "size"],
"datalist": [],
"optgroup": ["disabled", "label"],
"option": ["disabled", "selected", "label", "value"],
"textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"],
"keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"],
"output": ["for", "form", "name"],
"progress": ["value", "max"],
"meter": ["value", "min", "max", "low", "high", "optimum"],
"details": ["open"],
"summary": [],
"command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"],
"menu": ["type", "label"],
"dialog": ["open"]
"html": {"manifest": 1},
"head": {},
"title": {},
"base": {"href": 1, "target": 1},
"link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1},
"meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1},
"style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1},
"script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1},
"noscript": {"href": 1},
"body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1},
"section": {},
"nav": {},
"article": {"pubdate": 1},
"aside": {},
"h1": {},
"h2": {},
"h3": {},
"h4": {},
"h5": {},
"h6": {},
"header": {},
"footer": {},
"address": {},
"main": {},
"p": {},
"hr": {},
"pre": {},
"blockquote": {"cite": 1},
"ol": {"start": 1, "reversed": 1},
"ul": {},
"li": {"value": 1},
"dl": {},
"dt": {},
"dd": {},
"figure": {},
"figcaption": {},
"div": {},
"a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1},
"em": {},
"strong": {},
"small": {},
"s": {},
"cite": {},
"q": {"cite": 1},
"dfn": {},
"abbr": {},
"data": {},
"time": {"datetime": 1},
"code": {},
"var": {},
"samp": {},
"kbd": {},
"sub": {},
"sup": {},
"i": {},
"b": {},
"u": {},
"mark": {},
"ruby": {},
"rt": {},
"rp": {},
"bdi": {},
"bdo": {},
"span": {},
"br": {},
"wbr": {},
"ins": {"cite": 1, "datetime": 1},
"del": {"cite": 1, "datetime": 1},
"img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1},
"iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}},
"embed": {"src": 1, "height": 1, "width": 1, "type": 1},
"object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1},
"param": {"name": 1, "value": 1},
"video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}},
"audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }},
"source": {"src": 1, "type": 1, "media": 1},
"track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1},
"canvas": {"width": 1, "height": 1},
"map": {"name": 1},
"area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1},
"svg": {},
"math": {},
"table": {"summary": 1},
"caption": {},
"colgroup": {"span": 1},
"col": {"span": 1},
"tbody": {},
"thead": {},
"tfoot": {},
"tr": {},
"td": {"headers": 1, "rowspan": 1, "colspan": 1},
"th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1},
"form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}},
"fieldset": {"disabled": 1, "form": 1, "name": 1},
"legend": {},
"label": {"form": 1, "for": 1},
"input": {
"type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1},
"accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1},
"button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}},
"select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}},
"datalist": {},
"optgroup": {"disabled": 1, "label": 1},
"option": {"disabled": 1, "selected": 1, "label": 1, "value": 1},
"textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}},
"keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1},
"output": {"for": 1, "form": 1, "name": 1},
"progress": {"value": 1, "max": 1},
"meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1},
"details": {"open": 1},
"summary": {},
"command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1},
"menu": {"type": 1, "label": 1},
"dialog": {"open": 1}
};
var elements = Object.keys(attributeMap);
@ -2353,6 +2650,16 @@ function findTagName(session, pos) {
return token.value;
}
function findAttributeName(session, pos) {
var iterator = new TokenIterator(session, pos.row, pos.column);
var token = iterator.getCurrentToken();
while (token && !is(token, "attribute-name")){
token = iterator.stepBackward();
}
if (token)
return token.value;
}
var HtmlCompletions = function() {
};
@ -2367,7 +2674,12 @@ var HtmlCompletions = function() {
if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
return this.getTagCompletions(state, session, pos, prefix);
if (is(token, "tag-whitespace") || is(token, "attribute-name"))
return this.getAttributeCompetions(state, session, pos, prefix);
return this.getAttributeCompletions(state, session, pos, prefix);
if (is(token, "attribute-value"))
return this.getAttributeValueCompletions(state, session, pos, prefix);
var line = session.getLine(pos.row).substr(0, pos.column);
if (/&[A-z]*$/i.test(line))
return this.getHTMLEntityCompletions(state, session, pos, prefix);
return [];
};
@ -2382,13 +2694,13 @@ var HtmlCompletions = function() {
});
};
this.getAttributeCompetions = function(state, session, pos, prefix) {
this.getAttributeCompletions = function(state, session, pos, prefix) {
var tagName = findTagName(session, pos);
if (!tagName)
return [];
var attributes = globalAttributes;
if (tagName in attributeMap) {
attributes = attributes.concat(attributeMap[tagName]);
attributes = attributes.concat(Object.keys(attributeMap[tagName]));
}
return attributes.map(function(attribute){
return {
@ -2400,6 +2712,39 @@ var HtmlCompletions = function() {
});
};
this.getAttributeValueCompletions = function(state, session, pos, prefix) {
var tagName = findTagName(session, pos);
var attributeName = findAttributeName(session, pos);
if (!tagName)
return [];
var values = [];
if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
values = Object.keys(attributeMap[tagName][attributeName]);
}
return values.map(function(value){
return {
caption: value,
snippet: value,
meta: "attribute value",
score: Number.MAX_VALUE
};
});
};
this.getHTMLEntityCompletions = function(state, session, pos, prefix) {
var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;'];
return values.map(function(value){
return {
caption: value,
snippet: value,
meta: "html entity",
score: Number.MAX_VALUE
};
});
};
}).call(HtmlCompletions.prototype);
exports.HtmlCompletions = HtmlCompletions;
@ -2584,6 +2929,7 @@ var MarkdownHighlightRules = function() {
}],
"allowBlock": [
{token : "support.function", regex : "^ {4}.+", next : "allowBlock"},
{token : "empty_line", regex : '^$', next: "allowBlock"},
{token : "empty", regex : "", next : "start"}
],

File diff suppressed because it is too large Load Diff

View File

@ -54,6 +54,7 @@ ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","
var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function(options) {
var keywordMapper = this.createKeywordMapper({
@ -69,7 +70,7 @@ var JavaScriptHighlightRules = function(options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document" , // Pseudo
"keyword":
"const|yield|import|get|set|" +
"const|yield|import|get|set|async|await|" +
"break|case|catch|continue|default|delete|do|else|finally|for|function|" +
"if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
@ -83,29 +84,20 @@ var JavaScriptHighlightRules = function(options) {
"constant.language.boolean": "true|false"
}, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
"u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
"[0-2][0-7]{0,2}|" + // oct
"3[0-6][0-7]?|" + // oct
"37[0-7]?|" + // oct
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
this.$rules = {
"no_regex" : [
{
token : "comment",
regex : "\\/\\/",
next : "line_comment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
{
token : "comment", // multi line comment
regex : /\/\*/,
next : "comment"
}, {
token : "string",
regex : "'(?=.)",
next : "qstring"
@ -115,10 +107,10 @@ var JavaScriptHighlightRules = function(options) {
next : "qqstring"
}, {
token : "constant.numeric", // hex
regex : /0[xX][0-9a-fA-F]+\b/
regex : /0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/
}, {
token : "constant.numeric", // float
regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
regex : /[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
}, {
token : [
"storage.type", "punctuation.operator", "support.function",
@ -171,15 +163,6 @@ var JavaScriptHighlightRules = function(options) {
token : "keyword",
regex : "(?:" + kwBeforeRe + ")\\b",
next : "start"
}, {
token : ["punctuation.operator", "support.function"],
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, {
token : ["punctuation.operator", "support.function.dom"],
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, {
token : ["punctuation.operator", "support.constant"],
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, {
token : ["support.constant"],
regex : /that\b/
@ -189,9 +172,13 @@ var JavaScriptHighlightRules = function(options) {
}, {
token : keywordMapper,
regex : identifierRe
}, {
token : "punctuation.operator",
regex : /[.](?![.])/,
next : "property"
}, {
token : "keyword.operator",
regex : /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
next : "start"
}, {
token : "punctuation.operator",
@ -209,17 +196,42 @@ var JavaScriptHighlightRules = function(options) {
regex: /^#!.*$/
}
],
property: [{
token : "text",
regex : "\\s+"
}, {
token : [
"storage.type", "punctuation.operator", "entity.name.function", "text",
"keyword.operator", "text",
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
],
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
next: "function_arguments"
}, {
token : "punctuation.operator",
regex : /[.](?![.])/
}, {
token : "support.function",
regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
}, {
token : "support.function.dom",
regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
}, {
token : "support.constant",
regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
}, {
token : "identifier",
regex : identifierRe
}, {
regex: "",
token: "empty",
next: "no_regex"
}
],
"start": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("start"),
{
token : "comment", // multi line comment
regex : "\\/\\*",
next : "comment_regex_allowed"
}, {
token : "comment",
regex : "\\/\\/",
next : "line_comment_regex_allowed"
}, {
token: "string.regexp",
regex: "\\/",
next: "regex"
@ -297,26 +309,6 @@ var JavaScriptHighlightRules = function(options) {
next: "no_regex"
}
],
"comment_regex_allowed" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "\\*\\/", next : "start"},
{defaultToken : "comment", caseInsensitive: true}
],
"comment" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "\\*\\/", next : "no_regex"},
{defaultToken : "comment", caseInsensitive: true}
],
"line_comment_regex_allowed" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "$|^", next : "start"},
{defaultToken : "comment", caseInsensitive: true}
],
"line_comment" : [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "$|^", next : "no_regex"},
{defaultToken : "comment", caseInsensitive: true}
],
"qqstring" : [
{
token : "constant.language.escape",
@ -358,12 +350,11 @@ var JavaScriptHighlightRules = function(options) {
this.next = val == "{" ? this.nextState : "";
if (val == "{" && stack.length) {
stack.unshift("start", state);
return "paren";
}
if (val == "}" && stack.length) {
else if (val == "}" && stack.length) {
stack.shift();
this.next = stack.shift();
if (this.next.indexOf("string") != -1)
if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
return "paren.quasi.end";
}
return val == "{" ? "paren.lparen" : "paren.rparen";
@ -387,6 +378,9 @@ var JavaScriptHighlightRules = function(options) {
defaultToken: "string.quasi"
}]
});
if (!options || !options.noJSX)
JSX.call(this);
}
this.embedRules(DocCommentHighlightRules, "doc-",
@ -397,6 +391,127 @@ var JavaScriptHighlightRules = function(options) {
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
function JSX() {
var tagRegex = identifierRe.replace("\\d", "\\d\\-");
var jsxTag = {
onMatch : function(val, state, stack) {
var offset = val.charAt(1) == "/" ? 2 : 1;
if (offset == 1) {
if (state != this.nextState)
stack.unshift(this.next, this.nextState, 0);
else
stack.unshift(this.next);
stack[2]++;
} else if (offset == 2) {
if (state == this.nextState) {
stack[1]--;
if (!stack[1] || stack[1] < 0) {
stack.shift();
stack.shift();
}
}
}
return [{
type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
value: val.slice(0, offset)
}, {
type: "meta.tag.tag-name.xml",
value: val.substr(offset)
}];
},
regex : "</?" + tagRegex + "",
next: "jsxAttributes",
nextState: "jsx"
};
this.$rules.start.unshift(jsxTag);
var jsxJsRule = {
regex: "{",
token: "paren.quasi.start",
push: "start"
};
this.$rules.jsx = [
jsxJsRule,
jsxTag,
{include : "reference"},
{defaultToken: "string"}
];
this.$rules.jsxAttributes = [{
token : "meta.tag.punctuation.tag-close.xml",
regex : "/?>",
onMatch : function(value, currentState, stack) {
if (currentState == stack[0])
stack.shift();
if (value.length == 2) {
if (stack[0] == this.nextState)
stack[1]--;
if (!stack[1] || stack[1] < 0) {
stack.splice(0, 2);
}
}
this.next = stack[0] || "start";
return [{type: this.token, value: value}];
},
nextState: "jsx"
},
jsxJsRule,
comments("jsxAttributes"),
{
token : "entity.other.attribute-name.xml",
regex : tagRegex
}, {
token : "keyword.operator.attribute-equals.xml",
regex : "="
}, {
token : "text.tag-whitespace.xml",
regex : "\\s+"
}, {
token : "string.attribute-value.xml",
regex : "'",
stateName : "jsx_attr_q",
push : [
{token : "string.attribute-value.xml", regex: "'", next: "pop"},
{include : "reference"},
{defaultToken : "string.attribute-value.xml"}
]
}, {
token : "string.attribute-value.xml",
regex : '"',
stateName : "jsx_attr_qq",
push : [
{token : "string.attribute-value.xml", regex: '"', next: "pop"},
{include : "reference"},
{defaultToken : "string.attribute-value.xml"}
]
},
jsxTag
];
this.$rules.reference = [{
token : "constant.language.escape.reference.xml",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}];
}
function comments(next) {
return [
{
token : "comment", // multi line comment
regex : /\/\*/,
next: [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "\\*\\/", next : next || "pop"},
{defaultToken : "comment", caseInsensitive: true}
]
}, {
token : "comment",
regex : "\\/\\/",
next: [
DocCommentHighlightRules.getTagRule(),
{token : "comment", regex : "$|^", next : next || "pop"},
{defaultToken : "comment", caseInsensitive: true}
]
}
];
}
exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
});
@ -1030,7 +1145,7 @@ ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib
var oop = require("../lib/oop");
var lang = require("../lib/lang");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index";
var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero";
var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
@ -1168,6 +1283,180 @@ exports.CssHighlightRules = CssHighlightRules;
});
ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) {
"use strict";
var propertyMap = {
"background": {"#$0": 1},
"background-color": {"#$0": 1, "transparent": 1, "fixed": 1},
"background-image": {"url('/$0')": 1},
"background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1},
"background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2},
"background-attachment": {"scroll": 1, "fixed": 1},
"background-size": {"cover": 1, "contain": 1},
"background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1},
"background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1},
"border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1},
"border-color": {"#$0": 1},
"border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2},
"border-collapse": {"collapse": 1, "separate": 1},
"bottom": {"px": 1, "em": 1, "%": 1},
"clear": {"left": 1, "right": 1, "both": 1, "none": 1},
"color": {"#$0": 1, "rgb(#$00,0,0)": 1},
"cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1},
"display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1},
"empty-cells": {"show": 1, "hide": 1},
"float": {"left": 1, "right": 1, "none": 1},
"font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1},
"font-size": {"px": 1, "em": 1, "%": 1},
"font-weight": {"bold": 1, "normal": 1},
"font-style": {"italic": 1, "normal": 1},
"font-variant": {"normal": 1, "small-caps": 1},
"height": {"px": 1, "em": 1, "%": 1},
"left": {"px": 1, "em": 1, "%": 1},
"letter-spacing": {"normal": 1},
"line-height": {"normal": 1},
"list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1},
"margin": {"px": 1, "em": 1, "%": 1},
"margin-right": {"px": 1, "em": 1, "%": 1},
"margin-left": {"px": 1, "em": 1, "%": 1},
"margin-top": {"px": 1, "em": 1, "%": 1},
"margin-bottom": {"px": 1, "em": 1, "%": 1},
"max-height": {"px": 1, "em": 1, "%": 1},
"max-width": {"px": 1, "em": 1, "%": 1},
"min-height": {"px": 1, "em": 1, "%": 1},
"min-width": {"px": 1, "em": 1, "%": 1},
"overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
"overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
"overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
"padding": {"px": 1, "em": 1, "%": 1},
"padding-top": {"px": 1, "em": 1, "%": 1},
"padding-right": {"px": 1, "em": 1, "%": 1},
"padding-bottom": {"px": 1, "em": 1, "%": 1},
"padding-left": {"px": 1, "em": 1, "%": 1},
"page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
"page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
"position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1},
"right": {"px": 1, "em": 1, "%": 1},
"table-layout": {"fixed": 1, "auto": 1},
"text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1},
"text-align": {"left": 1, "right": 1, "center": 1, "justify": 1},
"text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1},
"top": {"px": 1, "em": 1, "%": 1},
"vertical-align": {"top": 1, "bottom": 1},
"visibility": {"hidden": 1, "visible": 1},
"white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1},
"width": {"px": 1, "em": 1, "%": 1},
"word-spacing": {"normal": 1},
"filter": {"alpha(opacity=$0100)": 1},
"text-shadow": {"$02px 2px 2px #777": 1},
"text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},
"-moz-border-radius": 1,
"-moz-border-radius-topright": 1,
"-moz-border-radius-bottomright": 1,
"-moz-border-radius-topleft": 1,
"-moz-border-radius-bottomleft": 1,
"-webkit-border-radius": 1,
"-webkit-border-top-right-radius": 1,
"-webkit-border-top-left-radius": 1,
"-webkit-border-bottom-right-radius": 1,
"-webkit-border-bottom-left-radius": 1,
"-moz-box-shadow": 1,
"-webkit-box-shadow": 1,
"transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
"-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
"-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 }
};
var CssCompletions = function() {
};
(function() {
this.completionsDefined = false;
this.defineCompletions = function() {
if (document) {
var style = document.createElement('c').style;
for (var i in style) {
if (typeof style[i] !== 'string')
continue;
var name = i.replace(/[A-Z]/g, function(x) {
return '-' + x.toLowerCase();
});
if (!propertyMap.hasOwnProperty(name))
propertyMap[name] = 1;
}
}
this.completionsDefined = true;
}
this.getCompletions = function(state, session, pos, prefix) {
if (!this.completionsDefined) {
this.defineCompletions();
}
var token = session.getTokenAt(pos.row, pos.column);
if (!token)
return [];
if (state==='ruleset'){
var line = session.getLine(pos.row).substr(0, pos.column);
if (/:[^;]+$/.test(line)) {
/([\w\-]+):[^:]*$/.test(line);
return this.getPropertyValueCompletions(state, session, pos, prefix);
} else {
return this.getPropertyCompletions(state, session, pos, prefix);
}
}
return [];
};
this.getPropertyCompletions = function(state, session, pos, prefix) {
var properties = Object.keys(propertyMap);
return properties.map(function(property){
return {
caption: property,
snippet: property + ': $0',
meta: "property",
score: Number.MAX_VALUE
};
});
};
this.getPropertyValueCompletions = function(state, session, pos, prefix) {
var line = session.getLine(pos.row).substr(0, pos.column);
var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
if (!property)
return [];
var values = [];
if (property in propertyMap && typeof propertyMap[property] === "object") {
values = Object.keys(propertyMap[property]);
}
return values.map(function(value){
return {
caption: value,
snippet: value,
meta: "property value",
score: Number.MAX_VALUE
};
});
};
}).call(CssCompletions.prototype);
exports.CssCompletions = CssCompletions;
});
ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) {
"use strict";
@ -1247,7 +1536,7 @@ oop.inherits(CssBehaviour, CstyleBehaviour);
exports.CssBehaviour = CssBehaviour;
});
ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
@ -1255,6 +1544,7 @@ var TextMode = require("./text").Mode;
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
var CssCompletions = require("./css_completions").CssCompletions;
var CssBehaviour = require("./behaviour/css").CssBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
@ -1262,6 +1552,7 @@ var Mode = function() {
this.HighlightRules = CssHighlightRules;
this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new CssBehaviour();
this.$completer = new CssCompletions();
this.foldingRules = new CStyleFoldMode();
};
oop.inherits(Mode, TextMode);
@ -1294,6 +1585,10 @@ oop.inherits(Mode, TextMode);
this.$outdent.autoOutdent(doc, row);
};
this.getCompletions = function(state, session, pos, prefix) {
return this.$completer.getCompletions(state, session, pos, prefix);
};
this.createWorker = function(session) {
var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
worker.attachToDocument(session.getDocument());
@ -1334,7 +1629,7 @@ var XmlHighlightRules = function(normalize) {
},
{
token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction",
regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction"
},
{token : "comment.xml", regex : "<\\!--", next : "comment"},
{
@ -1595,11 +1890,11 @@ var HtmlHighlightRules = function() {
tag_stuff: [
{include : "attributes"},
{token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
],
]
});
this.embedTagRules(CssHighlightRules, "css-", "style");
this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
this.embedTagRules(new JavaScriptHighlightRules({noJSX: true}).getRules(), "js-", "script");
if (this.constructor === HtmlHighlightRules)
this.normalizeRules();
@ -2177,118 +2472,120 @@ var eventAttributes = [
var globalAttributes = commonAttributes.concat(eventAttributes);
var attributeMap = {
"html": ["manifest"],
"head": [],
"title": [],
"base": ["href", "target"],
"link": ["href", "hreflang", "rel", "media", "type", "sizes"],
"meta": ["http-equiv", "name", "content", "charset"],
"style": ["type", "media", "scoped"],
"script": ["charset", "type", "src", "defer", "async"],
"noscript": ["href"],
"body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"],
"section": [],
"nav": [],
"article": ["pubdate"],
"aside": [],
"h1": [],
"h2": [],
"h3": [],
"h4": [],
"h5": [],
"h6": [],
"header": [],
"footer": [],
"address": [],
"main": [],
"p": [],
"hr": [],
"pre": [],
"blockquote": ["cite"],
"ol": ["start", "reversed"],
"ul": [],
"li": ["value"],
"dl": [],
"dt": [],
"dd": [],
"figure": [],
"figcaption": [],
"div": [],
"a": ["href", "target", "ping", "rel", "media", "hreflang", "type"],
"em": [],
"strong": [],
"small": [],
"s": [],
"cite": [],
"q": ["cite"],
"dfn": [],
"abbr": [],
"data": [],
"time": ["datetime"],
"code": [],
"var": [],
"samp": [],
"kbd": [],
"sub": [],
"sup": [],
"i": [],
"b": [],
"u": [],
"mark": [],
"ruby": [],
"rt": [],
"rp": [],
"bdi": [],
"bdo": [],
"span": [],
"br": [],
"wbr": [],
"ins": ["cite", "datetime"],
"del": ["cite", "datetime"],
"img": ["alt", "src", "height", "width", "usemap", "ismap"],
"iframe": ["name", "src", "height", "width", "sandbox", "seamless"],
"embed": ["src", "height", "width", "type"],
"object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"],
"param": ["name", "value"],
"video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"],
"audio": ["src", "autobuffer", "autoplay", "loop", "controls"],
"source": ["src", "type", "media"],
"track": ["kind", "src", "srclang", "label", "default"],
"canvas": ["width", "height"],
"map": ["name"],
"area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"],
"svg": [],
"math": [],
"table": ["summary"],
"caption": [],
"colgroup": ["span"],
"col": ["span"],
"tbody": [],
"thead": [],
"tfoot": [],
"tr": [],
"td": ["headers", "rowspan", "colspan"],
"th": ["headers", "rowspan", "colspan", "scope"],
"form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"],
"fieldset": ["disabled", "form", "name"],
"legend": [],
"label": ["form", "for"],
"input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"],
"button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"],
"select": ["autofocus", "disabled", "form", "multiple", "name", "size"],
"datalist": [],
"optgroup": ["disabled", "label"],
"option": ["disabled", "selected", "label", "value"],
"textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"],
"keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"],
"output": ["for", "form", "name"],
"progress": ["value", "max"],
"meter": ["value", "min", "max", "low", "high", "optimum"],
"details": ["open"],
"summary": [],
"command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"],
"menu": ["type", "label"],
"dialog": ["open"]
"html": {"manifest": 1},
"head": {},
"title": {},
"base": {"href": 1, "target": 1},
"link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1},
"meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1},
"style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1},
"script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1},
"noscript": {"href": 1},
"body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1},
"section": {},
"nav": {},
"article": {"pubdate": 1},
"aside": {},
"h1": {},
"h2": {},
"h3": {},
"h4": {},
"h5": {},
"h6": {},
"header": {},
"footer": {},
"address": {},
"main": {},
"p": {},
"hr": {},
"pre": {},
"blockquote": {"cite": 1},
"ol": {"start": 1, "reversed": 1},
"ul": {},
"li": {"value": 1},
"dl": {},
"dt": {},
"dd": {},
"figure": {},
"figcaption": {},
"div": {},
"a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1},
"em": {},
"strong": {},
"small": {},
"s": {},
"cite": {},
"q": {"cite": 1},
"dfn": {},
"abbr": {},
"data": {},
"time": {"datetime": 1},
"code": {},
"var": {},
"samp": {},
"kbd": {},
"sub": {},
"sup": {},
"i": {},
"b": {},
"u": {},
"mark": {},
"ruby": {},
"rt": {},
"rp": {},
"bdi": {},
"bdo": {},
"span": {},
"br": {},
"wbr": {},
"ins": {"cite": 1, "datetime": 1},
"del": {"cite": 1, "datetime": 1},
"img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1},
"iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}},
"embed": {"src": 1, "height": 1, "width": 1, "type": 1},
"object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1},
"param": {"name": 1, "value": 1},
"video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}},
"audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }},
"source": {"src": 1, "type": 1, "media": 1},
"track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1},
"canvas": {"width": 1, "height": 1},
"map": {"name": 1},
"area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1},
"svg": {},
"math": {},
"table": {"summary": 1},
"caption": {},
"colgroup": {"span": 1},
"col": {"span": 1},
"tbody": {},
"thead": {},
"tfoot": {},
"tr": {},
"td": {"headers": 1, "rowspan": 1, "colspan": 1},
"th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1},
"form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}},
"fieldset": {"disabled": 1, "form": 1, "name": 1},
"legend": {},
"label": {"form": 1, "for": 1},
"input": {
"type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1},
"accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1},
"button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}},
"select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}},
"datalist": {},
"optgroup": {"disabled": 1, "label": 1},
"option": {"disabled": 1, "selected": 1, "label": 1, "value": 1},
"textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}},
"keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1},
"output": {"for": 1, "form": 1, "name": 1},
"progress": {"value": 1, "max": 1},
"meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1},
"details": {"open": 1},
"summary": {},
"command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1},
"menu": {"type": 1, "label": 1},
"dialog": {"open": 1}
};
var elements = Object.keys(attributeMap);
@ -2307,6 +2604,16 @@ function findTagName(session, pos) {
return token.value;
}
function findAttributeName(session, pos) {
var iterator = new TokenIterator(session, pos.row, pos.column);
var token = iterator.getCurrentToken();
while (token && !is(token, "attribute-name")){
token = iterator.stepBackward();
}
if (token)
return token.value;
}
var HtmlCompletions = function() {
};
@ -2321,7 +2628,12 @@ var HtmlCompletions = function() {
if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
return this.getTagCompletions(state, session, pos, prefix);
if (is(token, "tag-whitespace") || is(token, "attribute-name"))
return this.getAttributeCompetions(state, session, pos, prefix);
return this.getAttributeCompletions(state, session, pos, prefix);
if (is(token, "attribute-value"))
return this.getAttributeValueCompletions(state, session, pos, prefix);
var line = session.getLine(pos.row).substr(0, pos.column);
if (/&[A-z]*$/i.test(line))
return this.getHTMLEntityCompletions(state, session, pos, prefix);
return [];
};
@ -2336,13 +2648,13 @@ var HtmlCompletions = function() {
});
};
this.getAttributeCompetions = function(state, session, pos, prefix) {
this.getAttributeCompletions = function(state, session, pos, prefix) {
var tagName = findTagName(session, pos);
if (!tagName)
return [];
var attributes = globalAttributes;
if (tagName in attributeMap) {
attributes = attributes.concat(attributeMap[tagName]);
attributes = attributes.concat(Object.keys(attributeMap[tagName]));
}
return attributes.map(function(attribute){
return {
@ -2354,6 +2666,39 @@ var HtmlCompletions = function() {
});
};
this.getAttributeValueCompletions = function(state, session, pos, prefix) {
var tagName = findTagName(session, pos);
var attributeName = findAttributeName(session, pos);
if (!tagName)
return [];
var values = [];
if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
values = Object.keys(attributeMap[tagName][attributeName]);
}
return values.map(function(value){
return {
caption: value,
snippet: value,
meta: "attribute value",
score: Number.MAX_VALUE
};
});
};
this.getHTMLEntityCompletions = function(state, session, pos, prefix) {
var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;'];
return values.map(function(value){
return {
caption: value,
snippet: value,
meta: "html entity",
score: Number.MAX_VALUE
};
});
};
}).call(HtmlCompletions.prototype);
exports.HtmlCompletions = HtmlCompletions;

View File

@ -0,0 +1,974 @@
ace.define("ace/snippets/css",["require","exports","module"], function(require, exports, module) {
"use strict";
exports.snippetText = "snippet .\n\
${1} {\n\
${2}\n\
}\n\
snippet !\n\
!important\n\
snippet bdi:m+\n\
-moz-border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${7:stretch};\n\
snippet bdi:m\n\
-moz-border-image: ${1};\n\
snippet bdrz:m\n\
-moz-border-radius: ${1};\n\
snippet bxsh:m+\n\
-moz-box-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\n\
snippet bxsh:m\n\
-moz-box-shadow: ${1};\n\
snippet bdi:w+\n\
-webkit-border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${7:stretch};\n\
snippet bdi:w\n\
-webkit-border-image: ${1};\n\
snippet bdrz:w\n\
-webkit-border-radius: ${1};\n\
snippet bxsh:w+\n\
-webkit-box-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\n\
snippet bxsh:w\n\
-webkit-box-shadow: ${1};\n\
snippet @f\n\
@font-face {\n\
font-family: ${1};\n\
src: url(${2});\n\
}\n\
snippet @i\n\
@import url(${1});\n\
snippet @m\n\
@media ${1:print} {\n\
${2}\n\
}\n\
snippet bg+\n\
background: #${1:FFF} url(${2}) ${3:0} ${4:0} ${5:no-repeat};\n\
snippet bga\n\
background-attachment: ${1};\n\
snippet bga:f\n\
background-attachment: fixed;\n\
snippet bga:s\n\
background-attachment: scroll;\n\
snippet bgbk\n\
background-break: ${1};\n\
snippet bgbk:bb\n\
background-break: bounding-box;\n\
snippet bgbk:c\n\
background-break: continuous;\n\
snippet bgbk:eb\n\
background-break: each-box;\n\
snippet bgcp\n\
background-clip: ${1};\n\
snippet bgcp:bb\n\
background-clip: border-box;\n\
snippet bgcp:cb\n\
background-clip: content-box;\n\
snippet bgcp:nc\n\
background-clip: no-clip;\n\
snippet bgcp:pb\n\
background-clip: padding-box;\n\
snippet bgc\n\
background-color: #${1:FFF};\n\
snippet bgc:t\n\
background-color: transparent;\n\
snippet bgi\n\
background-image: url(${1});\n\
snippet bgi:n\n\
background-image: none;\n\
snippet bgo\n\
background-origin: ${1};\n\
snippet bgo:bb\n\
background-origin: border-box;\n\
snippet bgo:cb\n\
background-origin: content-box;\n\
snippet bgo:pb\n\
background-origin: padding-box;\n\
snippet bgpx\n\
background-position-x: ${1};\n\
snippet bgpy\n\
background-position-y: ${1};\n\
snippet bgp\n\
background-position: ${1:0} ${2:0};\n\
snippet bgr\n\
background-repeat: ${1};\n\
snippet bgr:n\n\
background-repeat: no-repeat;\n\
snippet bgr:x\n\
background-repeat: repeat-x;\n\
snippet bgr:y\n\
background-repeat: repeat-y;\n\
snippet bgr:r\n\
background-repeat: repeat;\n\
snippet bgz\n\
background-size: ${1};\n\
snippet bgz:a\n\
background-size: auto;\n\
snippet bgz:ct\n\
background-size: contain;\n\
snippet bgz:cv\n\
background-size: cover;\n\
snippet bg\n\
background: ${1};\n\
snippet bg:ie\n\
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1}',sizingMethod='${2:crop}');\n\
snippet bg:n\n\
background: none;\n\
snippet bd+\n\
border: ${1:1px} ${2:solid} #${3:000};\n\
snippet bdb+\n\
border-bottom: ${1:1px} ${2:solid} #${3:000};\n\
snippet bdbc\n\
border-bottom-color: #${1:000};\n\
snippet bdbi\n\
border-bottom-image: url(${1});\n\
snippet bdbi:n\n\
border-bottom-image: none;\n\
snippet bdbli\n\
border-bottom-left-image: url(${1});\n\
snippet bdbli:c\n\
border-bottom-left-image: continue;\n\
snippet bdbli:n\n\
border-bottom-left-image: none;\n\
snippet bdblrz\n\
border-bottom-left-radius: ${1};\n\
snippet bdbri\n\
border-bottom-right-image: url(${1});\n\
snippet bdbri:c\n\
border-bottom-right-image: continue;\n\
snippet bdbri:n\n\
border-bottom-right-image: none;\n\
snippet bdbrrz\n\
border-bottom-right-radius: ${1};\n\
snippet bdbs\n\
border-bottom-style: ${1};\n\
snippet bdbs:n\n\
border-bottom-style: none;\n\
snippet bdbw\n\
border-bottom-width: ${1};\n\
snippet bdb\n\
border-bottom: ${1};\n\
snippet bdb:n\n\
border-bottom: none;\n\
snippet bdbk\n\
border-break: ${1};\n\
snippet bdbk:c\n\
border-break: close;\n\
snippet bdcl\n\
border-collapse: ${1};\n\
snippet bdcl:c\n\
border-collapse: collapse;\n\
snippet bdcl:s\n\
border-collapse: separate;\n\
snippet bdc\n\
border-color: #${1:000};\n\
snippet bdci\n\
border-corner-image: url(${1});\n\
snippet bdci:c\n\
border-corner-image: continue;\n\
snippet bdci:n\n\
border-corner-image: none;\n\
snippet bdf\n\
border-fit: ${1};\n\
snippet bdf:c\n\
border-fit: clip;\n\
snippet bdf:of\n\
border-fit: overwrite;\n\
snippet bdf:ow\n\
border-fit: overwrite;\n\
snippet bdf:r\n\
border-fit: repeat;\n\
snippet bdf:sc\n\
border-fit: scale;\n\
snippet bdf:sp\n\
border-fit: space;\n\
snippet bdf:st\n\
border-fit: stretch;\n\
snippet bdi\n\
border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${7:stretch};\n\
snippet bdi:n\n\
border-image: none;\n\
snippet bdl+\n\
border-left: ${1:1px} ${2:solid} #${3:000};\n\
snippet bdlc\n\
border-left-color: #${1:000};\n\
snippet bdli\n\
border-left-image: url(${1});\n\
snippet bdli:n\n\
border-left-image: none;\n\
snippet bdls\n\
border-left-style: ${1};\n\
snippet bdls:n\n\
border-left-style: none;\n\
snippet bdlw\n\
border-left-width: ${1};\n\
snippet bdl\n\
border-left: ${1};\n\
snippet bdl:n\n\
border-left: none;\n\
snippet bdlt\n\
border-length: ${1};\n\
snippet bdlt:a\n\
border-length: auto;\n\
snippet bdrz\n\
border-radius: ${1};\n\
snippet bdr+\n\
border-right: ${1:1px} ${2:solid} #${3:000};\n\
snippet bdrc\n\
border-right-color: #${1:000};\n\
snippet bdri\n\
border-right-image: url(${1});\n\
snippet bdri:n\n\
border-right-image: none;\n\
snippet bdrs\n\
border-right-style: ${1};\n\
snippet bdrs:n\n\
border-right-style: none;\n\
snippet bdrw\n\
border-right-width: ${1};\n\
snippet bdr\n\
border-right: ${1};\n\
snippet bdr:n\n\
border-right: none;\n\
snippet bdsp\n\
border-spacing: ${1};\n\
snippet bds\n\
border-style: ${1};\n\
snippet bds:ds\n\
border-style: dashed;\n\
snippet bds:dtds\n\
border-style: dot-dash;\n\
snippet bds:dtdtds\n\
border-style: dot-dot-dash;\n\
snippet bds:dt\n\
border-style: dotted;\n\
snippet bds:db\n\
border-style: double;\n\
snippet bds:g\n\
border-style: groove;\n\
snippet bds:h\n\
border-style: hidden;\n\
snippet bds:i\n\
border-style: inset;\n\
snippet bds:n\n\
border-style: none;\n\
snippet bds:o\n\
border-style: outset;\n\
snippet bds:r\n\
border-style: ridge;\n\
snippet bds:s\n\
border-style: solid;\n\
snippet bds:w\n\
border-style: wave;\n\
snippet bdt+\n\
border-top: ${1:1px} ${2:solid} #${3:000};\n\
snippet bdtc\n\
border-top-color: #${1:000};\n\
snippet bdti\n\
border-top-image: url(${1});\n\
snippet bdti:n\n\
border-top-image: none;\n\
snippet bdtli\n\
border-top-left-image: url(${1});\n\
snippet bdtli:c\n\
border-corner-image: continue;\n\
snippet bdtli:n\n\
border-corner-image: none;\n\
snippet bdtlrz\n\
border-top-left-radius: ${1};\n\
snippet bdtri\n\
border-top-right-image: url(${1});\n\
snippet bdtri:c\n\
border-top-right-image: continue;\n\
snippet bdtri:n\n\
border-top-right-image: none;\n\
snippet bdtrrz\n\
border-top-right-radius: ${1};\n\
snippet bdts\n\
border-top-style: ${1};\n\
snippet bdts:n\n\
border-top-style: none;\n\
snippet bdtw\n\
border-top-width: ${1};\n\
snippet bdt\n\
border-top: ${1};\n\
snippet bdt:n\n\
border-top: none;\n\
snippet bdw\n\
border-width: ${1};\n\
snippet bd\n\
border: ${1};\n\
snippet bd:n\n\
border: none;\n\
snippet b\n\
bottom: ${1};\n\
snippet b:a\n\
bottom: auto;\n\
snippet bxsh+\n\
box-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\n\
snippet bxsh\n\
box-shadow: ${1};\n\
snippet bxsh:n\n\
box-shadow: none;\n\
snippet bxz\n\
box-sizing: ${1};\n\
snippet bxz:bb\n\
box-sizing: border-box;\n\
snippet bxz:cb\n\
box-sizing: content-box;\n\
snippet cps\n\
caption-side: ${1};\n\
snippet cps:b\n\
caption-side: bottom;\n\
snippet cps:t\n\
caption-side: top;\n\
snippet cl\n\
clear: ${1};\n\
snippet cl:b\n\
clear: both;\n\
snippet cl:l\n\
clear: left;\n\
snippet cl:n\n\
clear: none;\n\
snippet cl:r\n\
clear: right;\n\
snippet cp\n\
clip: ${1};\n\
snippet cp:a\n\
clip: auto;\n\
snippet cp:r\n\
clip: rect(${1:0} ${2:0} ${3:0} ${4:0});\n\
snippet c\n\
color: #${1:000};\n\
snippet ct\n\
content: ${1};\n\
snippet ct:a\n\
content: attr(${1});\n\
snippet ct:cq\n\
content: close-quote;\n\
snippet ct:c\n\
content: counter(${1});\n\
snippet ct:cs\n\
content: counters(${1});\n\
snippet ct:ncq\n\
content: no-close-quote;\n\
snippet ct:noq\n\
content: no-open-quote;\n\
snippet ct:n\n\
content: normal;\n\
snippet ct:oq\n\
content: open-quote;\n\
snippet coi\n\
counter-increment: ${1};\n\
snippet cor\n\
counter-reset: ${1};\n\
snippet cur\n\
cursor: ${1};\n\
snippet cur:a\n\
cursor: auto;\n\
snippet cur:c\n\
cursor: crosshair;\n\
snippet cur:d\n\
cursor: default;\n\
snippet cur:ha\n\
cursor: hand;\n\
snippet cur:he\n\
cursor: help;\n\
snippet cur:m\n\
cursor: move;\n\
snippet cur:p\n\
cursor: pointer;\n\
snippet cur:t\n\
cursor: text;\n\
snippet d\n\
display: ${1};\n\
snippet d:mib\n\
display: -moz-inline-box;\n\
snippet d:mis\n\
display: -moz-inline-stack;\n\
snippet d:b\n\
display: block;\n\
snippet d:cp\n\
display: compact;\n\
snippet d:ib\n\
display: inline-block;\n\
snippet d:itb\n\
display: inline-table;\n\
snippet d:i\n\
display: inline;\n\
snippet d:li\n\
display: list-item;\n\
snippet d:n\n\
display: none;\n\
snippet d:ri\n\
display: run-in;\n\
snippet d:tbcp\n\
display: table-caption;\n\
snippet d:tbc\n\
display: table-cell;\n\
snippet d:tbclg\n\
display: table-column-group;\n\
snippet d:tbcl\n\
display: table-column;\n\
snippet d:tbfg\n\
display: table-footer-group;\n\
snippet d:tbhg\n\
display: table-header-group;\n\
snippet d:tbrg\n\
display: table-row-group;\n\
snippet d:tbr\n\
display: table-row;\n\
snippet d:tb\n\
display: table;\n\
snippet ec\n\
empty-cells: ${1};\n\
snippet ec:h\n\
empty-cells: hide;\n\
snippet ec:s\n\
empty-cells: show;\n\
snippet exp\n\
expression()\n\
snippet fl\n\
float: ${1};\n\
snippet fl:l\n\
float: left;\n\
snippet fl:n\n\
float: none;\n\
snippet fl:r\n\
float: right;\n\
snippet f+\n\
font: ${1:1em} ${2:Arial},${3:sans-serif};\n\
snippet fef\n\
font-effect: ${1};\n\
snippet fef:eb\n\
font-effect: emboss;\n\
snippet fef:eg\n\
font-effect: engrave;\n\
snippet fef:n\n\
font-effect: none;\n\
snippet fef:o\n\
font-effect: outline;\n\
snippet femp\n\
font-emphasize-position: ${1};\n\
snippet femp:a\n\
font-emphasize-position: after;\n\
snippet femp:b\n\
font-emphasize-position: before;\n\
snippet fems\n\
font-emphasize-style: ${1};\n\
snippet fems:ac\n\
font-emphasize-style: accent;\n\
snippet fems:c\n\
font-emphasize-style: circle;\n\
snippet fems:ds\n\
font-emphasize-style: disc;\n\
snippet fems:dt\n\
font-emphasize-style: dot;\n\
snippet fems:n\n\
font-emphasize-style: none;\n\
snippet fem\n\
font-emphasize: ${1};\n\
snippet ff\n\
font-family: ${1};\n\
snippet ff:c\n\
font-family: ${1:'Monotype Corsiva','Comic Sans MS'},cursive;\n\
snippet ff:f\n\
font-family: ${1:Capitals,Impact},fantasy;\n\
snippet ff:m\n\
font-family: ${1:Monaco,'Courier New'},monospace;\n\
snippet ff:ss\n\
font-family: ${1:Helvetica,Arial},sans-serif;\n\
snippet ff:s\n\
font-family: ${1:Georgia,'Times New Roman'},serif;\n\
snippet fza\n\
font-size-adjust: ${1};\n\
snippet fza:n\n\
font-size-adjust: none;\n\
snippet fz\n\
font-size: ${1};\n\
snippet fsm\n\
font-smooth: ${1};\n\
snippet fsm:aw\n\
font-smooth: always;\n\
snippet fsm:a\n\
font-smooth: auto;\n\
snippet fsm:n\n\
font-smooth: never;\n\
snippet fst\n\
font-stretch: ${1};\n\
snippet fst:c\n\
font-stretch: condensed;\n\
snippet fst:e\n\
font-stretch: expanded;\n\
snippet fst:ec\n\
font-stretch: extra-condensed;\n\
snippet fst:ee\n\
font-stretch: extra-expanded;\n\
snippet fst:n\n\
font-stretch: normal;\n\
snippet fst:sc\n\
font-stretch: semi-condensed;\n\
snippet fst:se\n\
font-stretch: semi-expanded;\n\
snippet fst:uc\n\
font-stretch: ultra-condensed;\n\
snippet fst:ue\n\
font-stretch: ultra-expanded;\n\
snippet fs\n\
font-style: ${1};\n\
snippet fs:i\n\
font-style: italic;\n\
snippet fs:n\n\
font-style: normal;\n\
snippet fs:o\n\
font-style: oblique;\n\
snippet fv\n\
font-variant: ${1};\n\
snippet fv:n\n\
font-variant: normal;\n\
snippet fv:sc\n\
font-variant: small-caps;\n\
snippet fw\n\
font-weight: ${1};\n\
snippet fw:b\n\
font-weight: bold;\n\
snippet fw:br\n\
font-weight: bolder;\n\
snippet fw:lr\n\
font-weight: lighter;\n\
snippet fw:n\n\
font-weight: normal;\n\
snippet f\n\
font: ${1};\n\
snippet h\n\
height: ${1};\n\
snippet h:a\n\
height: auto;\n\
snippet l\n\
left: ${1};\n\
snippet l:a\n\
left: auto;\n\
snippet lts\n\
letter-spacing: ${1};\n\
snippet lh\n\
line-height: ${1};\n\
snippet lisi\n\
list-style-image: url(${1});\n\
snippet lisi:n\n\
list-style-image: none;\n\
snippet lisp\n\
list-style-position: ${1};\n\
snippet lisp:i\n\
list-style-position: inside;\n\
snippet lisp:o\n\
list-style-position: outside;\n\
snippet list\n\
list-style-type: ${1};\n\
snippet list:c\n\
list-style-type: circle;\n\
snippet list:dclz\n\
list-style-type: decimal-leading-zero;\n\
snippet list:dc\n\
list-style-type: decimal;\n\
snippet list:d\n\
list-style-type: disc;\n\
snippet list:lr\n\
list-style-type: lower-roman;\n\
snippet list:n\n\
list-style-type: none;\n\
snippet list:s\n\
list-style-type: square;\n\
snippet list:ur\n\
list-style-type: upper-roman;\n\
snippet lis\n\
list-style: ${1};\n\
snippet lis:n\n\
list-style: none;\n\
snippet mb\n\
margin-bottom: ${1};\n\
snippet mb:a\n\
margin-bottom: auto;\n\
snippet ml\n\
margin-left: ${1};\n\
snippet ml:a\n\
margin-left: auto;\n\
snippet mr\n\
margin-right: ${1};\n\
snippet mr:a\n\
margin-right: auto;\n\
snippet mt\n\
margin-top: ${1};\n\
snippet mt:a\n\
margin-top: auto;\n\
snippet m\n\
margin: ${1};\n\
snippet m:4\n\
margin: ${1:0} ${2:0} ${3:0} ${4:0};\n\
snippet m:3\n\
margin: ${1:0} ${2:0} ${3:0};\n\
snippet m:2\n\
margin: ${1:0} ${2:0};\n\
snippet m:0\n\
margin: 0;\n\
snippet m:a\n\
margin: auto;\n\
snippet mah\n\
max-height: ${1};\n\
snippet mah:n\n\
max-height: none;\n\
snippet maw\n\
max-width: ${1};\n\
snippet maw:n\n\
max-width: none;\n\
snippet mih\n\
min-height: ${1};\n\
snippet miw\n\
min-width: ${1};\n\
snippet op\n\
opacity: ${1};\n\
snippet op:ie\n\
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=${1:100});\n\
snippet op:ms\n\
-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=${1:100})';\n\
snippet orp\n\
orphans: ${1};\n\
snippet o+\n\
outline: ${1:1px} ${2:solid} #${3:000};\n\
snippet oc\n\
outline-color: ${1:#000};\n\
snippet oc:i\n\
outline-color: invert;\n\
snippet oo\n\
outline-offset: ${1};\n\
snippet os\n\
outline-style: ${1};\n\
snippet ow\n\
outline-width: ${1};\n\
snippet o\n\
outline: ${1};\n\
snippet o:n\n\
outline: none;\n\
snippet ovs\n\
overflow-style: ${1};\n\
snippet ovs:a\n\
overflow-style: auto;\n\
snippet ovs:mq\n\
overflow-style: marquee;\n\
snippet ovs:mv\n\
overflow-style: move;\n\
snippet ovs:p\n\
overflow-style: panner;\n\
snippet ovs:s\n\
overflow-style: scrollbar;\n\
snippet ovx\n\
overflow-x: ${1};\n\
snippet ovx:a\n\
overflow-x: auto;\n\
snippet ovx:h\n\
overflow-x: hidden;\n\
snippet ovx:s\n\
overflow-x: scroll;\n\
snippet ovx:v\n\
overflow-x: visible;\n\
snippet ovy\n\
overflow-y: ${1};\n\
snippet ovy:a\n\
overflow-y: auto;\n\
snippet ovy:h\n\
overflow-y: hidden;\n\
snippet ovy:s\n\
overflow-y: scroll;\n\
snippet ovy:v\n\
overflow-y: visible;\n\
snippet ov\n\
overflow: ${1};\n\
snippet ov:a\n\
overflow: auto;\n\
snippet ov:h\n\
overflow: hidden;\n\
snippet ov:s\n\
overflow: scroll;\n\
snippet ov:v\n\
overflow: visible;\n\
snippet pb\n\
padding-bottom: ${1};\n\
snippet pl\n\
padding-left: ${1};\n\
snippet pr\n\
padding-right: ${1};\n\
snippet pt\n\
padding-top: ${1};\n\
snippet p\n\
padding: ${1};\n\
snippet p:4\n\
padding: ${1:0} ${2:0} ${3:0} ${4:0};\n\
snippet p:3\n\
padding: ${1:0} ${2:0} ${3:0};\n\
snippet p:2\n\
padding: ${1:0} ${2:0};\n\
snippet p:0\n\
padding: 0;\n\
snippet pgba\n\
page-break-after: ${1};\n\
snippet pgba:aw\n\
page-break-after: always;\n\
snippet pgba:a\n\
page-break-after: auto;\n\
snippet pgba:l\n\
page-break-after: left;\n\
snippet pgba:r\n\
page-break-after: right;\n\
snippet pgbb\n\
page-break-before: ${1};\n\
snippet pgbb:aw\n\
page-break-before: always;\n\
snippet pgbb:a\n\
page-break-before: auto;\n\
snippet pgbb:l\n\
page-break-before: left;\n\
snippet pgbb:r\n\
page-break-before: right;\n\
snippet pgbi\n\
page-break-inside: ${1};\n\
snippet pgbi:a\n\
page-break-inside: auto;\n\
snippet pgbi:av\n\
page-break-inside: avoid;\n\
snippet pos\n\
position: ${1};\n\
snippet pos:a\n\
position: absolute;\n\
snippet pos:f\n\
position: fixed;\n\
snippet pos:r\n\
position: relative;\n\
snippet pos:s\n\
position: static;\n\
snippet q\n\
quotes: ${1};\n\
snippet q:en\n\
quotes: '\\201C' '\\201D' '\\2018' '\\2019';\n\
snippet q:n\n\
quotes: none;\n\
snippet q:ru\n\
quotes: '\\00AB' '\\00BB' '\\201E' '\\201C';\n\
snippet rz\n\
resize: ${1};\n\
snippet rz:b\n\
resize: both;\n\
snippet rz:h\n\
resize: horizontal;\n\
snippet rz:n\n\
resize: none;\n\
snippet rz:v\n\
resize: vertical;\n\
snippet r\n\
right: ${1};\n\
snippet r:a\n\
right: auto;\n\
snippet tbl\n\
table-layout: ${1};\n\
snippet tbl:a\n\
table-layout: auto;\n\
snippet tbl:f\n\
table-layout: fixed;\n\
snippet tal\n\
text-align-last: ${1};\n\
snippet tal:a\n\
text-align-last: auto;\n\
snippet tal:c\n\
text-align-last: center;\n\
snippet tal:l\n\
text-align-last: left;\n\
snippet tal:r\n\
text-align-last: right;\n\
snippet ta\n\
text-align: ${1};\n\
snippet ta:c\n\
text-align: center;\n\
snippet ta:l\n\
text-align: left;\n\
snippet ta:r\n\
text-align: right;\n\
snippet td\n\
text-decoration: ${1};\n\
snippet td:l\n\
text-decoration: line-through;\n\
snippet td:n\n\
text-decoration: none;\n\
snippet td:o\n\
text-decoration: overline;\n\
snippet td:u\n\
text-decoration: underline;\n\
snippet te\n\
text-emphasis: ${1};\n\
snippet te:ac\n\
text-emphasis: accent;\n\
snippet te:a\n\
text-emphasis: after;\n\
snippet te:b\n\
text-emphasis: before;\n\
snippet te:c\n\
text-emphasis: circle;\n\
snippet te:ds\n\
text-emphasis: disc;\n\
snippet te:dt\n\
text-emphasis: dot;\n\
snippet te:n\n\
text-emphasis: none;\n\
snippet th\n\
text-height: ${1};\n\
snippet th:a\n\
text-height: auto;\n\
snippet th:f\n\
text-height: font-size;\n\
snippet th:m\n\
text-height: max-size;\n\
snippet th:t\n\
text-height: text-size;\n\
snippet ti\n\
text-indent: ${1};\n\
snippet ti:-\n\
text-indent: -9999px;\n\
snippet tj\n\
text-justify: ${1};\n\
snippet tj:a\n\
text-justify: auto;\n\
snippet tj:d\n\
text-justify: distribute;\n\
snippet tj:ic\n\
text-justify: inter-cluster;\n\
snippet tj:ii\n\
text-justify: inter-ideograph;\n\
snippet tj:iw\n\
text-justify: inter-word;\n\
snippet tj:k\n\
text-justify: kashida;\n\
snippet tj:t\n\
text-justify: tibetan;\n\
snippet to+\n\
text-outline: ${1:0} ${2:0} #${3:000};\n\
snippet to\n\
text-outline: ${1};\n\
snippet to:n\n\
text-outline: none;\n\
snippet tr\n\
text-replace: ${1};\n\
snippet tr:n\n\
text-replace: none;\n\
snippet tsh+\n\
text-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\n\
snippet tsh\n\
text-shadow: ${1};\n\
snippet tsh:n\n\
text-shadow: none;\n\
snippet tt\n\
text-transform: ${1};\n\
snippet tt:c\n\
text-transform: capitalize;\n\
snippet tt:l\n\
text-transform: lowercase;\n\
snippet tt:n\n\
text-transform: none;\n\
snippet tt:u\n\
text-transform: uppercase;\n\
snippet tw\n\
text-wrap: ${1};\n\
snippet tw:no\n\
text-wrap: none;\n\
snippet tw:n\n\
text-wrap: normal;\n\
snippet tw:s\n\
text-wrap: suppress;\n\
snippet tw:u\n\
text-wrap: unrestricted;\n\
snippet t\n\
top: ${1};\n\
snippet t:a\n\
top: auto;\n\
snippet va\n\
vertical-align: ${1};\n\
snippet va:bl\n\
vertical-align: baseline;\n\
snippet va:b\n\
vertical-align: bottom;\n\
snippet va:m\n\
vertical-align: middle;\n\
snippet va:sub\n\
vertical-align: sub;\n\
snippet va:sup\n\
vertical-align: super;\n\
snippet va:tb\n\
vertical-align: text-bottom;\n\
snippet va:tt\n\
vertical-align: text-top;\n\
snippet va:t\n\
vertical-align: top;\n\
snippet v\n\
visibility: ${1};\n\
snippet v:c\n\
visibility: collapse;\n\
snippet v:h\n\
visibility: hidden;\n\
snippet v:v\n\
visibility: visible;\n\
snippet whsc\n\
white-space-collapse: ${1};\n\
snippet whsc:ba\n\
white-space-collapse: break-all;\n\
snippet whsc:bs\n\
white-space-collapse: break-strict;\n\
snippet whsc:k\n\
white-space-collapse: keep-all;\n\
snippet whsc:l\n\
white-space-collapse: loose;\n\
snippet whsc:n\n\
white-space-collapse: normal;\n\
snippet whs\n\
white-space: ${1};\n\
snippet whs:n\n\
white-space: normal;\n\
snippet whs:nw\n\
white-space: nowrap;\n\
snippet whs:pl\n\
white-space: pre-line;\n\
snippet whs:pw\n\
white-space: pre-wrap;\n\
snippet whs:p\n\
white-space: pre;\n\
snippet wid\n\
widows: ${1};\n\
snippet w\n\
width: ${1};\n\
snippet w:a\n\
width: auto;\n\
snippet wob\n\
word-break: ${1};\n\
snippet wob:ba\n\
word-break: break-all;\n\
snippet wob:bs\n\
word-break: break-strict;\n\
snippet wob:k\n\
word-break: keep-all;\n\
snippet wob:l\n\
word-break: loose;\n\
snippet wob:n\n\
word-break: normal;\n\
snippet wos\n\
word-spacing: ${1};\n\
snippet wow\n\
word-wrap: ${1};\n\
snippet wow:no\n\
word-wrap: none;\n\
snippet wow:n\n\
word-wrap: normal;\n\
snippet wow:s\n\
word-wrap: suppress;\n\
snippet wow:u\n\
word-wrap: unrestricted;\n\
snippet z\n\
z-index: ${1};\n\
snippet z:a\n\
z-index: auto;\n\
snippet zoo\n\
zoom: 1;\n\
";
exports.scope = "css";
});

View File

@ -0,0 +1,835 @@
ace.define("ace/snippets/html",["require","exports","module"], function(require, exports, module) {
"use strict";
exports.snippetText = "# Some useful Unicode entities\n\
# Non-Breaking Space\n\
snippet nbs\n\
&nbsp;\n\
# \n\
snippet left\n\
&#x2190;\n\
# \n\
snippet right\n\
&#x2192;\n\
# \n\
snippet up\n\
&#x2191;\n\
# \n\
snippet down\n\
&#x2193;\n\
# \n\
snippet return\n\
&#x21A9;\n\
# \n\
snippet backtab\n\
&#x21E4;\n\
# \n\
snippet tab\n\
&#x21E5;\n\
# \n\
snippet shift\n\
&#x21E7;\n\
# \n\
snippet ctrl\n\
&#x2303;\n\
# \n\
snippet enter\n\
&#x2305;\n\
# \n\
snippet cmd\n\
&#x2318;\n\
# \n\
snippet option\n\
&#x2325;\n\
# \n\
snippet delete\n\
&#x2326;\n\
# \n\
snippet backspace\n\
&#x232B;\n\
# \n\
snippet esc\n\
&#x238B;\n\
# Generic Doctype\n\
snippet doctype HTML 4.01 Strict\n\
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n\
\"http://www.w3.org/TR/html4/strict.dtd\">\n\
snippet doctype HTML 4.01 Transitional\n\
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n\
\"http://www.w3.org/TR/html4/loose.dtd\">\n\
snippet doctype HTML 5\n\
<!DOCTYPE HTML>\n\
snippet doctype XHTML 1.0 Frameset\n\
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\
snippet doctype XHTML 1.0 Strict\n\
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\
snippet doctype XHTML 1.0 Transitional\n\
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\
snippet doctype XHTML 1.1\n\
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n\
\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n\
# HTML Doctype 4.01 Strict\n\
snippet docts\n\
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n\
\"http://www.w3.org/TR/html4/strict.dtd\">\n\
# HTML Doctype 4.01 Transitional\n\
snippet doct\n\
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n\
\"http://www.w3.org/TR/html4/loose.dtd\">\n\
# HTML Doctype 5\n\
snippet doct5\n\
<!DOCTYPE HTML>\n\
# XHTML Doctype 1.0 Frameset\n\
snippet docxf\n\
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\"\n\
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n\
# XHTML Doctype 1.0 Strict\n\
snippet docxs\n\
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\
# XHTML Doctype 1.0 Transitional\n\
snippet docxt\n\
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\
# XHTML Doctype 1.1\n\
snippet docx\n\
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n\
\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n\
# Attributes\n\
snippet attr\n\
${1:attribute}=\"${2:property}\"\n\
snippet attr+\n\
${1:attribute}=\"${2:property}\" attr+${3}\n\
snippet .\n\
class=\"${1}\"${2}\n\
snippet #\n\
id=\"${1}\"${2}\n\
snippet alt\n\
alt=\"${1}\"${2}\n\
snippet charset\n\
charset=\"${1:utf-8}\"${2}\n\
snippet data\n\
data-${1}=\"${2:$1}\"${3}\n\
snippet for\n\
for=\"${1}\"${2}\n\
snippet height\n\
height=\"${1}\"${2}\n\
snippet href\n\
href=\"${1:#}\"${2}\n\
snippet lang\n\
lang=\"${1:en}\"${2}\n\
snippet media\n\
media=\"${1}\"${2}\n\
snippet name\n\
name=\"${1}\"${2}\n\
snippet rel\n\
rel=\"${1}\"${2}\n\
snippet scope\n\
scope=\"${1:row}\"${2}\n\
snippet src\n\
src=\"${1}\"${2}\n\
snippet title=\n\
title=\"${1}\"${2}\n\
snippet type\n\
type=\"${1}\"${2}\n\
snippet value\n\
value=\"${1}\"${2}\n\
snippet width\n\
width=\"${1}\"${2}\n\
# Elements\n\
snippet a\n\
<a href=\"${1:#}\">${2:$1}</a>\n\
snippet a.\n\
<a class=\"${1}\" href=\"${2:#}\">${3:$1}</a>\n\
snippet a#\n\
<a id=\"${1}\" href=\"${2:#}\">${3:$1}</a>\n\
snippet a:ext\n\
<a href=\"http://${1:example.com}\">${2:$1}</a>\n\
snippet a:mail\n\
<a href=\"mailto:${1:joe@example.com}?subject=${2:feedback}\">${3:email me}</a>\n\
snippet abbr\n\
<abbr title=\"${1}\">${2}</abbr>\n\
snippet address\n\
<address>\n\
${1}\n\
</address>\n\
snippet area\n\
<area shape=\"${1:rect}\" coords=\"${2}\" href=\"${3}\" alt=\"${4}\" />\n\
snippet area+\n\
<area shape=\"${1:rect}\" coords=\"${2}\" href=\"${3}\" alt=\"${4}\" />\n\
area+${5}\n\
snippet area:c\n\
<area shape=\"circle\" coords=\"${1}\" href=\"${2}\" alt=\"${3}\" />\n\
snippet area:d\n\
<area shape=\"default\" coords=\"${1}\" href=\"${2}\" alt=\"${3}\" />\n\
snippet area:p\n\
<area shape=\"poly\" coords=\"${1}\" href=\"${2}\" alt=\"${3}\" />\n\
snippet area:r\n\
<area shape=\"rect\" coords=\"${1}\" href=\"${2}\" alt=\"${3}\" />\n\
snippet article\n\
<article>\n\
${1}\n\
</article>\n\
snippet article.\n\
<article class=\"${1}\">\n\
${2}\n\
</article>\n\
snippet article#\n\
<article id=\"${1}\">\n\
${2}\n\
</article>\n\
snippet aside\n\
<aside>\n\
${1}\n\
</aside>\n\
snippet aside.\n\
<aside class=\"${1}\">\n\
${2}\n\
</aside>\n\
snippet aside#\n\
<aside id=\"${1}\">\n\
${2}\n\
</aside>\n\
snippet audio\n\
<audio src=\"${1}>${2}</audio>\n\
snippet b\n\
<b>${1}</b>\n\
snippet base\n\
<base href=\"${1}\" target=\"${2}\" />\n\
snippet bdi\n\
<bdi>${1}</bdo>\n\
snippet bdo\n\
<bdo dir=\"${1}\">${2}</bdo>\n\
snippet bdo:l\n\
<bdo dir=\"ltr\">${1}</bdo>\n\
snippet bdo:r\n\
<bdo dir=\"rtl\">${1}</bdo>\n\
snippet blockquote\n\
<blockquote>\n\
${1}\n\
</blockquote>\n\
snippet body\n\
<body>\n\
${1}\n\
</body>\n\
snippet br\n\
<br />${1}\n\
snippet button\n\
<button type=\"${1:submit}\">${2}</button>\n\
snippet button.\n\
<button class=\"${1:button}\" type=\"${2:submit}\">${3}</button>\n\
snippet button#\n\
<button id=\"${1}\" type=\"${2:submit}\">${3}</button>\n\
snippet button:s\n\
<button type=\"submit\">${1}</button>\n\
snippet button:r\n\
<button type=\"reset\">${1}</button>\n\
snippet canvas\n\
<canvas>\n\
${1}\n\
</canvas>\n\
snippet caption\n\
<caption>${1}</caption>\n\
snippet cite\n\
<cite>${1}</cite>\n\
snippet code\n\
<code>${1}</code>\n\
snippet col\n\
<col />${1}\n\
snippet col+\n\
<col />\n\
col+${1}\n\
snippet colgroup\n\
<colgroup>\n\
${1}\n\
</colgroup>\n\
snippet colgroup+\n\
<colgroup>\n\
<col />\n\
col+${1}\n\
</colgroup>\n\
snippet command\n\
<command type=\"command\" label=\"${1}\" icon=\"${2}\" />\n\
snippet command:c\n\
<command type=\"checkbox\" label=\"${1}\" icon=\"${2}\" />\n\
snippet command:r\n\
<command type=\"radio\" radiogroup=\"${1}\" label=\"${2}\" icon=\"${3}\" />\n\
snippet datagrid\n\
<datagrid>\n\
${1}\n\
</datagrid>\n\
snippet datalist\n\
<datalist>\n\
${1}\n\
</datalist>\n\
snippet datatemplate\n\
<datatemplate>\n\
${1}\n\
</datatemplate>\n\
snippet dd\n\
<dd>${1}</dd>\n\
snippet dd.\n\
<dd class=\"${1}\">${2}</dd>\n\
snippet dd#\n\
<dd id=\"${1}\">${2}</dd>\n\
snippet del\n\
<del>${1}</del>\n\
snippet details\n\
<details>${1}</details>\n\
snippet dfn\n\
<dfn>${1}</dfn>\n\
snippet dialog\n\
<dialog>\n\
${1}\n\
</dialog>\n\
snippet div\n\
<div>\n\
${1}\n\
</div>\n\
snippet div.\n\
<div class=\"${1}\">\n\
${2}\n\
</div>\n\
snippet div#\n\
<div id=\"${1}\">\n\
${2}\n\
</div>\n\
snippet dl\n\
<dl>\n\
${1}\n\
</dl>\n\
snippet dl.\n\
<dl class=\"${1}\">\n\
${2}\n\
</dl>\n\
snippet dl#\n\
<dl id=\"${1}\">\n\
${2}\n\
</dl>\n\
snippet dl+\n\
<dl>\n\
<dt>${1}</dt>\n\
<dd>${2}</dd>\n\
dt+${3}\n\
</dl>\n\
snippet dt\n\
<dt>${1}</dt>\n\
snippet dt.\n\
<dt class=\"${1}\">${2}</dt>\n\
snippet dt#\n\
<dt id=\"${1}\">${2}</dt>\n\
snippet dt+\n\
<dt>${1}</dt>\n\
<dd>${2}</dd>\n\
dt+${3}\n\
snippet em\n\
<em>${1}</em>\n\
snippet embed\n\
<embed src=${1} type=\"${2} />\n\
snippet fieldset\n\
<fieldset>\n\
${1}\n\
</fieldset>\n\
snippet fieldset.\n\
<fieldset class=\"${1}\">\n\
${2}\n\
</fieldset>\n\
snippet fieldset#\n\
<fieldset id=\"${1}\">\n\
${2}\n\
</fieldset>\n\
snippet fieldset+\n\
<fieldset>\n\
<legend><span>${1}</span></legend>\n\
${2}\n\
</fieldset>\n\
fieldset+${3}\n\
snippet figcaption\n\
<figcaption>${1}</figcaption>\n\
snippet figure\n\
<figure>${1}</figure>\n\
snippet footer\n\
<footer>\n\
${1}\n\
</footer>\n\
snippet footer.\n\
<footer class=\"${1}\">\n\
${2}\n\
</footer>\n\
snippet footer#\n\
<footer id=\"${1}\">\n\
${2}\n\
</footer>\n\
snippet form\n\
<form action=\"${1}\" method=\"${2:get}\" accept-charset=\"utf-8\">\n\
${3}\n\
</form>\n\
snippet form.\n\
<form class=\"${1}\" action=\"${2}\" method=\"${3:get}\" accept-charset=\"utf-8\">\n\
${4}\n\
</form>\n\
snippet form#\n\
<form id=\"${1}\" action=\"${2}\" method=\"${3:get}\" accept-charset=\"utf-8\">\n\
${4}\n\
</form>\n\
snippet h1\n\
<h1>${1}</h1>\n\
snippet h1.\n\
<h1 class=\"${1}\">${2}</h1>\n\
snippet h1#\n\
<h1 id=\"${1}\">${2}</h1>\n\
snippet h2\n\
<h2>${1}</h2>\n\
snippet h2.\n\
<h2 class=\"${1}\">${2}</h2>\n\
snippet h2#\n\
<h2 id=\"${1}\">${2}</h2>\n\
snippet h3\n\
<h3>${1}</h3>\n\
snippet h3.\n\
<h3 class=\"${1}\">${2}</h3>\n\
snippet h3#\n\
<h3 id=\"${1}\">${2}</h3>\n\
snippet h4\n\
<h4>${1}</h4>\n\
snippet h4.\n\
<h4 class=\"${1}\">${2}</h4>\n\
snippet h4#\n\
<h4 id=\"${1}\">${2}</h4>\n\
snippet h5\n\
<h5>${1}</h5>\n\
snippet h5.\n\
<h5 class=\"${1}\">${2}</h5>\n\
snippet h5#\n\
<h5 id=\"${1}\">${2}</h5>\n\
snippet h6\n\
<h6>${1}</h6>\n\
snippet h6.\n\
<h6 class=\"${1}\">${2}</h6>\n\
snippet h6#\n\
<h6 id=\"${1}\">${2}</h6>\n\
snippet head\n\
<head>\n\
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n\
\n\
<title>${1:`substitute(Filename('', 'Page Title'), '^.', '\\u&', '')`}</title>\n\
${2}\n\
</head>\n\
snippet header\n\
<header>\n\
${1}\n\
</header>\n\
snippet header.\n\
<header class=\"${1}\">\n\
${2}\n\
</header>\n\
snippet header#\n\
<header id=\"${1}\">\n\
${2}\n\
</header>\n\
snippet hgroup\n\
<hgroup>\n\
${1}\n\
</hgroup>\n\
snippet hgroup.\n\
<hgroup class=\"${1}>\n\
${2}\n\
</hgroup>\n\
snippet hr\n\
<hr />${1}\n\
snippet html\n\
<html>\n\
${1}\n\
</html>\n\
snippet xhtml\n\
<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\
${1}\n\
</html>\n\
snippet html5\n\
<!DOCTYPE html>\n\
<html>\n\
<head>\n\
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n\
<title>${1:`substitute(Filename('', 'Page Title'), '^.', '\\u&', '')`}</title>\n\
${2:meta}\n\
</head>\n\
<body>\n\
${3:body}\n\
</body>\n\
</html>\n\
snippet i\n\
<i>${1}</i>\n\
snippet iframe\n\
<iframe src=\"${1}\" frameborder=\"0\"></iframe>${2}\n\
snippet iframe.\n\
<iframe class=\"${1}\" src=\"${2}\" frameborder=\"0\"></iframe>${3}\n\
snippet iframe#\n\
<iframe id=\"${1}\" src=\"${2}\" frameborder=\"0\"></iframe>${3}\n\
snippet img\n\
<img src=\"${1}\" alt=\"${2}\" />${3}\n\
snippet img.\n\
<img class=\"${1}\" src=\"${2}\" alt=\"${3}\" />${4}\n\
snippet img#\n\
<img id=\"${1}\" src=\"${2}\" alt=\"${3}\" />${4}\n\
snippet input\n\
<input type=\"${1:text/submit/hidden/button/image}\" name=\"${2}\" id=\"${3:$2}\" value=\"${4}\" />${5}\n\
snippet input.\n\
<input class=\"${1}\" type=\"${2:text/submit/hidden/button/image}\" name=\"${3}\" id=\"${4:$3}\" value=\"${5}\" />${6}\n\
snippet input:text\n\
<input type=\"text\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:submit\n\
<input type=\"submit\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:hidden\n\
<input type=\"hidden\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:button\n\
<input type=\"button\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:image\n\
<input type=\"image\" name=\"${1}\" id=\"${2:$1}\" src=\"${3}\" alt=\"${4}\" />${5}\n\
snippet input:checkbox\n\
<input type=\"checkbox\" name=\"${1}\" id=\"${2:$1}\" />${3}\n\
snippet input:radio\n\
<input type=\"radio\" name=\"${1}\" id=\"${2:$1}\" />${3}\n\
snippet input:color\n\
<input type=\"color\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:date\n\
<input type=\"date\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:datetime\n\
<input type=\"datetime\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:datetime-local\n\
<input type=\"datetime-local\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:email\n\
<input type=\"email\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:file\n\
<input type=\"file\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:month\n\
<input type=\"month\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:number\n\
<input type=\"number\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:password\n\
<input type=\"password\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:range\n\
<input type=\"range\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:reset\n\
<input type=\"reset\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:search\n\
<input type=\"search\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:time\n\
<input type=\"time\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:url\n\
<input type=\"url\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet input:week\n\
<input type=\"week\" name=\"${1}\" id=\"${2:$1}\" value=\"${3}\" />${4}\n\
snippet ins\n\
<ins>${1}</ins>\n\
snippet kbd\n\
<kbd>${1}</kbd>\n\
snippet keygen\n\
<keygen>${1}</keygen>\n\
snippet label\n\
<label for=\"${2:$1}\">${1}</label>\n\
snippet label:i\n\
<label for=\"${2:$1}\">${1}</label>\n\
<input type=\"${3:text/submit/hidden/button}\" name=\"${4:$2}\" id=\"${5:$2}\" value=\"${6}\" />${7}\n\
snippet label:s\n\
<label for=\"${2:$1}\">${1}</label>\n\
<select name=\"${3:$2}\" id=\"${4:$2}\">\n\
<option value=\"${5}\">${6:$5}</option>\n\
</select>\n\
snippet legend\n\
<legend>${1}</legend>\n\
snippet legend+\n\
<legend><span>${1}</span></legend>\n\
snippet li\n\
<li>${1}</li>\n\
snippet li.\n\
<li class=\"${1}\">${2}</li>\n\
snippet li+\n\
<li>${1}</li>\n\
li+${2}\n\
snippet lia\n\
<li><a href=\"${2:#}\">${1}</a></li>\n\
snippet lia+\n\
<li><a href=\"${2:#}\">${1}</a></li>\n\
lia+${3}\n\
snippet link\n\
<link rel=\"${1}\" href=\"${2}\" title=\"${3}\" type=\"${4}\" />${5}\n\
snippet link:atom\n\
<link rel=\"alternate\" href=\"${1:atom.xml}\" title=\"Atom\" type=\"application/atom+xml\" />${2}\n\
snippet link:css\n\
<link rel=\"stylesheet\" href=\"${2:style.css}\" type=\"text/css\" media=\"${3:all}\" />${4}\n\
snippet link:favicon\n\
<link rel=\"shortcut icon\" href=\"${1:favicon.ico}\" type=\"image/x-icon\" />${2}\n\
snippet link:rss\n\
<link rel=\"alternate\" href=\"${1:rss.xml}\" title=\"RSS\" type=\"application/atom+xml\" />${2}\n\
snippet link:touch\n\
<link rel=\"apple-touch-icon\" href=\"${1:favicon.png}\" />${2}\n\
snippet map\n\
<map name=\"${1}\">\n\
${2}\n\
</map>\n\
snippet map.\n\
<map class=\"${1}\" name=\"${2}\">\n\
${3}\n\
</map>\n\
snippet map#\n\
<map name=\"${1}\" id=\"${2:$1}>\n\
${3}\n\
</map>\n\
snippet map+\n\
<map name=\"${1}\">\n\
<area shape=\"${2}\" coords=\"${3}\" href=\"${4}\" alt=\"${5}\" />${6}\n\
</map>${7}\n\
snippet mark\n\
<mark>${1}</mark>\n\
snippet menu\n\
<menu>\n\
${1}\n\
</menu>\n\
snippet menu:c\n\
<menu type=\"context\">\n\
${1}\n\
</menu>\n\
snippet menu:t\n\
<menu type=\"toolbar\">\n\
${1}\n\
</menu>\n\
snippet meta\n\
<meta http-equiv=\"${1}\" content=\"${2}\" />${3}\n\
snippet meta:compat\n\
<meta http-equiv=\"X-UA-Compatible\" content=\"IE=${1:7,8,edge}\" />${3}\n\
snippet meta:refresh\n\
<meta http-equiv=\"refresh\" content=\"text/html;charset=UTF-8\" />${3}\n\
snippet meta:utf\n\
<meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />${3}\n\
snippet meter\n\
<meter>${1}</meter>\n\
snippet nav\n\
<nav>\n\
${1}\n\
</nav>\n\
snippet nav.\n\
<nav class=\"${1}\">\n\
${2}\n\
</nav>\n\
snippet nav#\n\
<nav id=\"${1}\">\n\
${2}\n\
</nav>\n\
snippet noscript\n\
<noscript>\n\
${1}\n\
</noscript>\n\
snippet object\n\
<object data=\"${1}\" type=\"${2}\">\n\
${3}\n\
</object>${4}\n\
# Embed QT Movie\n\
snippet movie\n\
<object width=\"$2\" height=\"$3\" classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\"\n\
codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\">\n\
<param name=\"src\" value=\"$1\" />\n\
<param name=\"controller\" value=\"$4\" />\n\
<param name=\"autoplay\" value=\"$5\" />\n\
<embed src=\"${1:movie.mov}\"\n\
width=\"${2:320}\" height=\"${3:240}\"\n\
controller=\"${4:true}\" autoplay=\"${5:true}\"\n\
scale=\"tofit\" cache=\"true\"\n\
pluginspage=\"http://www.apple.com/quicktime/download/\" />\n\
</object>${6}\n\
snippet ol\n\
<ol>\n\
${1}\n\
</ol>\n\
snippet ol.\n\
<ol class=\"${1}>\n\
${2}\n\
</ol>\n\
snippet ol#\n\
<ol id=\"${1}>\n\
${2}\n\
</ol>\n\
snippet ol+\n\
<ol>\n\
<li>${1}</li>\n\
li+${2}\n\
</ol>\n\
snippet opt\n\
<option value=\"${1}\">${2:$1}</option>\n\
snippet opt+\n\
<option value=\"${1}\">${2:$1}</option>\n\
opt+${3}\n\
snippet optt\n\
<option>${1}</option>\n\
snippet optgroup\n\
<optgroup>\n\
<option value=\"${1}\">${2:$1}</option>\n\
opt+${3}\n\
</optgroup>\n\
snippet output\n\
<output>${1}</output>\n\
snippet p\n\
<p>${1}</p>\n\
snippet param\n\
<param name=\"${1}\" value=\"${2}\" />${3}\n\
snippet pre\n\
<pre>\n\
${1}\n\
</pre>\n\
snippet progress\n\
<progress>${1}</progress>\n\
snippet q\n\
<q>${1}</q>\n\
snippet rp\n\
<rp>${1}</rp>\n\
snippet rt\n\
<rt>${1}</rt>\n\
snippet ruby\n\
<ruby>\n\
<rp><rt>${1}</rt></rp>\n\
</ruby>\n\
snippet s\n\
<s>${1}</s>\n\
snippet samp\n\
<samp>\n\
${1}\n\
</samp>\n\
snippet script\n\
<script type=\"text/javascript\" charset=\"utf-8\">\n\
${1}\n\
</script>\n\
snippet scriptsrc\n\
<script src=\"${1}.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n\
snippet section\n\
<section>\n\
${1}\n\
</section>\n\
snippet section.\n\
<section class=\"${1}\">\n\
${2}\n\
</section>\n\
snippet section#\n\
<section id=\"${1}\">\n\
${2}\n\
</section>\n\
snippet select\n\
<select name=\"${1}\" id=\"${2:$1}\">\n\
${3}\n\
</select>\n\
snippet select.\n\
<select name=\"${1}\" id=\"${2:$1}\" class=\"${3}>\n\
${4}\n\
</select>\n\
snippet select+\n\
<select name=\"${1}\" id=\"${2:$1}\">\n\
<option value=\"${3}\">${4:$3}</option>\n\
opt+${5}\n\
</select>\n\
snippet small\n\
<small>${1}</small>\n\
snippet source\n\
<source src=\"${1}\" type=\"${2}\" media=\"${3}\" />\n\
snippet span\n\
<span>${1}</span>\n\
snippet strong\n\
<strong>${1}</strong>\n\
snippet style\n\
<style type=\"text/css\" media=\"${1:all}\">\n\
${2}\n\
</style>\n\
snippet sub\n\
<sub>${1}</sub>\n\
snippet summary\n\
<summary>\n\
${1}\n\
</summary>\n\
snippet sup\n\
<sup>${1}</sup>\n\
snippet table\n\
<table border=\"${1:0}\">\n\
${2}\n\
</table>\n\
snippet table.\n\
<table class=\"${1}\" border=\"${2:0}\">\n\
${3}\n\
</table>\n\
snippet table#\n\
<table id=\"${1}\" border=\"${2:0}\">\n\
${3}\n\
</table>\n\
snippet tbody\n\
<tbody>\n\
${1}\n\
</tbody>\n\
snippet td\n\
<td>${1}</td>\n\
snippet td.\n\
<td class=\"${1}\">${2}</td>\n\
snippet td#\n\
<td id=\"${1}\">${2}</td>\n\
snippet td+\n\
<td>${1}</td>\n\
td+${2}\n\
snippet textarea\n\
<textarea name=\"${1}\" id=${2:$1} rows=\"${3:8}\" cols=\"${4:40}\">${5}</textarea>${6}\n\
snippet tfoot\n\
<tfoot>\n\
${1}\n\
</tfoot>\n\
snippet th\n\
<th>${1}</th>\n\
snippet th.\n\
<th class=\"${1}\">${2}</th>\n\
snippet th#\n\
<th id=\"${1}\">${2}</th>\n\
snippet th+\n\
<th>${1}</th>\n\
th+${2}\n\
snippet thead\n\
<thead>\n\
${1}\n\
</thead>\n\
snippet time\n\
<time datetime=\"${1}\" pubdate=\"${2:$1}>${3:$1}</time>\n\
snippet title\n\
<title>${1:`substitute(Filename('', 'Page Title'), '^.', '\\u&', '')`}</title>\n\
snippet tr\n\
<tr>\n\
${1}\n\
</tr>\n\
snippet tr+\n\
<tr>\n\
<td>${1}</td>\n\
td+${2}\n\
</tr>\n\
snippet track\n\
<track src=\"${1}\" srclang=\"${2}\" label=\"${3}\" default=\"${4:default}>${5}</track>${6}\n\
snippet ul\n\
<ul>\n\
${1}\n\
</ul>\n\
snippet ul.\n\
<ul class=\"${1}\">\n\
${2}\n\
</ul>\n\
snippet ul#\n\
<ul id=\"${1}\">\n\
${2}\n\
</ul>\n\
snippet ul+\n\
<ul>\n\
<li>${1}</li>\n\
li+${2}\n\
</ul>\n\
snippet var\n\
<var>${1}</var>\n\
snippet video\n\
<video src=\"${1} height=\"${2}\" width=\"${3}\" preload=\"${5:none}\" autoplay=\"${6:autoplay}>${7}</video>${8}\n\
snippet wbr\n\
<wbr />${1}\n\
";
exports.scope = "html";
});

View File

@ -0,0 +1,202 @@
ace.define("ace/snippets/javascript",["require","exports","module"], function(require, exports, module) {
"use strict";
exports.snippetText = "# Prototype\n\
snippet proto\n\
${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {\n\
${4:// body...}\n\
};\n\
# Function\n\
snippet fun\n\
function ${1?:function_name}(${2:argument}) {\n\
${3:// body...}\n\
}\n\
# Anonymous Function\n\
regex /((=)\\s*|(:)\\s*|(\\()|\\b)/f/(\\))?/\n\
snippet f\n\
function${M1?: ${1:functionName}}($2) {\n\
${0:$TM_SELECTED_TEXT}\n\
}${M2?;}${M3?,}${M4?)}\n\
# Immediate function\n\
trigger \\(?f\\(\n\
endTrigger \\)?\n\
snippet f(\n\
(function(${1}) {\n\
${0:${TM_SELECTED_TEXT:/* code */}}\n\
}(${1}));\n\
# if\n\
snippet if\n\
if (${1:true}) {\n\
${0}\n\
}\n\
# if ... else\n\
snippet ife\n\
if (${1:true}) {\n\
${2}\n\
} else {\n\
${0}\n\
}\n\
# tertiary conditional\n\
snippet ter\n\
${1:/* condition */} ? ${2:a} : ${3:b}\n\
# switch\n\
snippet switch\n\
switch (${1:expression}) {\n\
case '${3:case}':\n\
${4:// code}\n\
break;\n\
${5}\n\
default:\n\
${2:// code}\n\
}\n\
# case\n\
snippet case\n\
case '${1:case}':\n\
${2:// code}\n\
break;\n\
${3}\n\
\n\
# while (...) {...}\n\
snippet wh\n\
while (${1:/* condition */}) {\n\
${0:/* code */}\n\
}\n\
# try\n\
snippet try\n\
try {\n\
${0:/* code */}\n\
} catch (e) {}\n\
# do...while\n\
snippet do\n\
do {\n\
${2:/* code */}\n\
} while (${1:/* condition */});\n\
# Object Method\n\
snippet :f\n\
regex /([,{[])|^\\s*/:f/\n\
${1:method_name}: function(${2:attribute}) {\n\
${0}\n\
}${3:,}\n\
# setTimeout function\n\
snippet setTimeout\n\
regex /\\b/st|timeout|setTimeo?u?t?/\n\
setTimeout(function() {${3:$TM_SELECTED_TEXT}}, ${1:10});\n\
# Get Elements\n\
snippet gett\n\
getElementsBy${1:TagName}('${2}')${3}\n\
# Get Element\n\
snippet get\n\
getElementBy${1:Id}('${2}')${3}\n\
# console.log (Firebug)\n\
snippet cl\n\
console.log(${1});\n\
# return\n\
snippet ret\n\
return ${1:result}\n\
# for (property in object ) { ... }\n\
snippet fori\n\
for (var ${1:prop} in ${2:Things}) {\n\
${0:$2[$1]}\n\
}\n\
# hasOwnProperty\n\
snippet has\n\
hasOwnProperty(${1})\n\
# docstring\n\
snippet /**\n\
/**\n\
* ${1:description}\n\
*\n\
*/\n\
snippet @par\n\
regex /^\\s*\\*\\s*/@(para?m?)?/\n\
@param {${1:type}} ${2:name} ${3:description}\n\
snippet @ret\n\
@return {${1:type}} ${2:description}\n\
# JSON.parse\n\
snippet jsonp\n\
JSON.parse(${1:jstr});\n\
# JSON.stringify\n\
snippet jsons\n\
JSON.stringify(${1:object});\n\
# self-defining function\n\
snippet sdf\n\
var ${1:function_name} = function(${2:argument}) {\n\
${3:// initial code ...}\n\
\n\
$1 = function($2) {\n\
${4:// main code}\n\
};\n\
}\n\
# singleton\n\
snippet sing\n\
function ${1:Singleton} (${2:argument}) {\n\
// the cached instance\n\
var instance;\n\
\n\
// rewrite the constructor\n\
$1 = function $1($2) {\n\
return instance;\n\
};\n\
\n\
// carry over the prototype properties\n\
$1.prototype = this;\n\
\n\
// the instance\n\
instance = new $1();\n\
\n\
// reset the constructor pointer\n\
instance.constructor = $1;\n\
\n\
${3:// code ...}\n\
\n\
return instance;\n\
}\n\
# class\n\
snippet class\n\
regex /^\\s*/clas{0,2}/\n\
var ${1:class} = function(${20}) {\n\
$40$0\n\
};\n\
\n\
(function() {\n\
${60:this.prop = \"\"}\n\
}).call(${1:class}.prototype);\n\
\n\
exports.${1:class} = ${1:class};\n\
# \n\
snippet for-\n\
for (var ${1:i} = ${2:Things}.length; ${1:i}--; ) {\n\
${0:${2:Things}[${1:i}];}\n\
}\n\
# for (...) {...}\n\
snippet for\n\
for (var ${1:i} = 0; $1 < ${2:Things}.length; $1++) {\n\
${3:$2[$1]}$0\n\
}\n\
# for (...) {...} (Improved Native For-Loop)\n\
snippet forr\n\
for (var ${1:i} = ${2:Things}.length - 1; $1 >= 0; $1--) {\n\
${3:$2[$1]}$0\n\
}\n\
\n\
\n\
#modules\n\
snippet def\n\
define(function(require, exports, module) {\n\
\"use strict\";\n\
var ${1/.*\\///} = require(\"${1}\");\n\
\n\
$TM_SELECTED_TEXT\n\
});\n\
snippet req\n\
guard ^\\s*\n\
var ${1/.*\\///} = require(\"${1}\");\n\
$0\n\
snippet requ\n\
guard ^\\s*\n\
var ${1/.*\\/(.)/\\u$1/} = require(\"${1}\").${1/.*\\/(.)/\\u$1/};\n\
$0\n\
";
exports.scope = "javascript";
});

View File

@ -0,0 +1,95 @@
ace.define("ace/snippets/markdown",["require","exports","module"], function(require, exports, module) {
"use strict";
exports.snippetText = "# Markdown\n\
\n\
# Includes octopress (http://octopress.org/) snippets\n\
\n\
snippet [\n\
[${1:text}](http://${2:address} \"${3:title}\")\n\
snippet [*\n\
[${1:link}](${2:`@*`} \"${3:title}\")${4}\n\
\n\
snippet [:\n\
[${1:id}]: http://${2:url} \"${3:title}\"\n\
snippet [:*\n\
[${1:id}]: ${2:`@*`} \"${3:title}\"\n\
\n\
snippet ![\n\
![${1:alttext}](${2:/images/image.jpg} \"${3:title}\")\n\
snippet ![*\n\
![${1:alt}](${2:`@*`} \"${3:title}\")${4}\n\
\n\
snippet ![:\n\
![${1:id}]: ${2:url} \"${3:title}\"\n\
snippet ![:*\n\
![${1:id}]: ${2:`@*`} \"${3:title}\"\n\
\n\
snippet ===\n\
regex /^/=+/=*//\n\
${PREV_LINE/./=/g}\n\
\n\
${0}\n\
snippet ---\n\
regex /^/-+/-*//\n\
${PREV_LINE/./-/g}\n\
\n\
${0}\n\
snippet blockquote\n\
{% blockquote %}\n\
${1:quote}\n\
{% endblockquote %}\n\
\n\
snippet blockquote-author\n\
{% blockquote ${1:author}, ${2:title} %}\n\
${3:quote}\n\
{% endblockquote %}\n\
\n\
snippet blockquote-link\n\
{% blockquote ${1:author} ${2:URL} ${3:link_text} %}\n\
${4:quote}\n\
{% endblockquote %}\n\
\n\
snippet bt-codeblock-short\n\
```\n\
${1:code_snippet}\n\
```\n\
\n\
snippet bt-codeblock-full\n\
``` ${1:language} ${2:title} ${3:URL} ${4:link_text}\n\
${5:code_snippet}\n\
```\n\
\n\
snippet codeblock-short\n\
{% codeblock %}\n\
${1:code_snippet}\n\
{% endcodeblock %}\n\
\n\
snippet codeblock-full\n\
{% codeblock ${1:title} lang:${2:language} ${3:URL} ${4:link_text} %}\n\
${5:code_snippet}\n\
{% endcodeblock %}\n\
\n\
snippet gist-full\n\
{% gist ${1:gist_id} ${2:filename} %}\n\
\n\
snippet gist-short\n\
{% gist ${1:gist_id} %}\n\
\n\
snippet img\n\
{% img ${1:class} ${2:URL} ${3:width} ${4:height} ${5:title_text} ${6:alt_text} %}\n\
\n\
snippet youtube\n\
{% youtube ${1:video_id} %}\n\
\n\
# The quote should appear only once in the text. It is inherently part of it.\n\
# See http://octopress.org/docs/plugins/pullquote/ for more info.\n\
\n\
snippet pullquote\n\
{% pullquote %}\n\
${1:text} {\" ${2:quote} \"} ${3:text}\n\
{% endpullquote %}\n\
";
exports.scope = "markdown";
});

View File

@ -0,0 +1,384 @@
ace.define("ace/snippets/php",["require","exports","module"], function(require, exports, module) {
"use strict";
exports.snippetText = "snippet <?\n\
<?php\n\
\n\
${1}\n\
snippet ec\n\
echo ${1};\n\
snippet <?e\n\
<?php echo ${1} ?>\n\
# this one is for php5.4\n\
snippet <?=\n\
<?=${1}?>\n\
snippet ns\n\
namespace ${1:Foo\\Bar\\Baz};\n\
${2}\n\
snippet use\n\
use ${1:Foo\\Bar\\Baz};\n\
${2}\n\
snippet c\n\
${1:abstract }class ${2:$FILENAME}\n\
{\n\
${3}\n\
}\n\
snippet i\n\
interface ${1:$FILENAME}\n\
{\n\
${2}\n\
}\n\
snippet t.\n\
$this->${1}\n\
snippet f\n\
function ${1:foo}(${2:array }${3:$bar})\n\
{\n\
${4}\n\
}\n\
# method\n\
snippet m\n\
${1:abstract }${2:protected}${3: static} function ${4:foo}(${5:array }${6:$bar})\n\
{\n\
${7}\n\
}\n\
# setter method\n\
snippet sm \n\
/**\n\
* Sets the value of ${1:foo}\n\
*\n\
* @param ${2:$1} $$1 ${3:description}\n\
*\n\
* @return ${4:$FILENAME}\n\
*/\n\
${5:public} function set${6:$2}(${7:$2 }$$1)\n\
{\n\
$this->${8:$1} = $$1;\n\
return $this;\n\
}${9}\n\
# getter method\n\
snippet gm\n\
/**\n\
* Gets the value of ${1:foo}\n\
*\n\
* @return ${2:$1}\n\
*/\n\
${3:public} function get${4:$2}()\n\
{\n\
return $this->${5:$1};\n\
}${6}\n\
#setter\n\
snippet $s\n\
${1:$foo}->set${2:Bar}(${3});\n\
#getter\n\
snippet $g\n\
${1:$foo}->get${2:Bar}();\n\
\n\
# Tertiary conditional\n\
snippet =?:\n\
$${1:foo} = ${2:true} ? ${3:a} : ${4};\n\
snippet ?:\n\
${1:true} ? ${2:a} : ${3}\n\
\n\
snippet C\n\
$_COOKIE['${1:variable}']${2}\n\
snippet E\n\
$_ENV['${1:variable}']${2}\n\
snippet F\n\
$_FILES['${1:variable}']${2}\n\
snippet G\n\
$_GET['${1:variable}']${2}\n\
snippet P\n\
$_POST['${1:variable}']${2}\n\
snippet R\n\
$_REQUEST['${1:variable}']${2}\n\
snippet S\n\
$_SERVER['${1:variable}']${2}\n\
snippet SS\n\
$_SESSION['${1:variable}']${2}\n\
\n\
# the following are old ones\n\
snippet inc\n\
include '${1:file}';${2}\n\
snippet inc1\n\
include_once '${1:file}';${2}\n\
snippet req\n\
require '${1:file}';${2}\n\
snippet req1\n\
require_once '${1:file}';${2}\n\
# Start Docblock\n\
snippet /*\n\
/**\n\
* ${1}\n\
*/\n\
# Class - post doc\n\
snippet doc_cp\n\
/**\n\
* ${1:undocumented class}\n\
*\n\
* @package ${2:default}\n\
* @subpackage ${3:default}\n\
* @author ${4:`g:snips_author`}\n\
*/${5}\n\
# Class Variable - post doc\n\
snippet doc_vp\n\
/**\n\
* ${1:undocumented class variable}\n\
*\n\
* @var ${2:string}\n\
*/${3}\n\
# Class Variable\n\
snippet doc_v\n\
/**\n\
* ${3:undocumented class variable}\n\
*\n\
* @var ${4:string}\n\
*/\n\
${1:var} $${2};${5}\n\
# Class\n\
snippet doc_c\n\
/**\n\
* ${3:undocumented class}\n\
*\n\
* @package ${4:default}\n\
* @subpackage ${5:default}\n\
* @author ${6:`g:snips_author`}\n\
*/\n\
${1:}class ${2:}\n\
{\n\
${7}\n\
} // END $1class $2\n\
# Constant Definition - post doc\n\
snippet doc_dp\n\
/**\n\
* ${1:undocumented constant}\n\
*/${2}\n\
# Constant Definition\n\
snippet doc_d\n\
/**\n\
* ${3:undocumented constant}\n\
*/\n\
define(${1}, ${2});${4}\n\
# Function - post doc\n\
snippet doc_fp\n\
/**\n\
* ${1:undocumented function}\n\
*\n\
* @return ${2:void}\n\
* @author ${3:`g:snips_author`}\n\
*/${4}\n\
# Function signature\n\
snippet doc_s\n\
/**\n\
* ${4:undocumented function}\n\
*\n\
* @return ${5:void}\n\
* @author ${6:`g:snips_author`}\n\
*/\n\
${1}function ${2}(${3});${7}\n\
# Function\n\
snippet doc_f\n\
/**\n\
* ${4:undocumented function}\n\
*\n\
* @return ${5:void}\n\
* @author ${6:`g:snips_author`}\n\
*/\n\
${1}function ${2}(${3})\n\
{${7}\n\
}\n\
# Header\n\
snippet doc_h\n\
/**\n\
* ${1}\n\
*\n\
* @author ${2:`g:snips_author`}\n\
* @version ${3:$Id$}\n\
* @copyright ${4:$2}, `strftime('%d %B, %Y')`\n\
* @package ${5:default}\n\
*/\n\
\n\
# Interface\n\
snippet interface\n\
/**\n\
* ${2:undocumented class}\n\
*\n\
* @package ${3:default}\n\
* @author ${4:`g:snips_author`}\n\
*/\n\
interface ${1:$FILENAME}\n\
{\n\
${5}\n\
}\n\
# class ...\n\
snippet class\n\
/**\n\
* ${1}\n\
*/\n\
class ${2:$FILENAME}\n\
{\n\
${3}\n\
/**\n\
* ${4}\n\
*/\n\
${5:public} function ${6:__construct}(${7:argument})\n\
{\n\
${8:// code...}\n\
}\n\
}\n\
# define(...)\n\
snippet def\n\
define('${1}'${2});${3}\n\
# defined(...)\n\
snippet def?\n\
${1}defined('${2}')${3}\n\
snippet wh\n\
while (${1:/* condition */}) {\n\
${2:// code...}\n\
}\n\
# do ... while\n\
snippet do\n\
do {\n\
${2:// code... }\n\
} while (${1:/* condition */});\n\
snippet if\n\
if (${1:/* condition */}) {\n\
${2:// code...}\n\
}\n\
snippet ifil\n\
<?php if (${1:/* condition */}): ?>\n\
${2:<!-- code... -->}\n\
<?php endif; ?>\n\
snippet ife\n\
if (${1:/* condition */}) {\n\
${2:// code...}\n\
} else {\n\
${3:// code...}\n\
}\n\
${4}\n\
snippet ifeil\n\
<?php if (${1:/* condition */}): ?>\n\
${2:<!-- html... -->}\n\
<?php else: ?>\n\
${3:<!-- html... -->}\n\
<?php endif; ?>\n\
${4}\n\
snippet else\n\
else {\n\
${1:// code...}\n\
}\n\
snippet elseif\n\
elseif (${1:/* condition */}) {\n\
${2:// code...}\n\
}\n\
snippet switch\n\
switch ($${1:variable}) {\n\
case '${2:value}':\n\
${3:// code...}\n\
break;\n\
${5}\n\
default:\n\
${4:// code...}\n\
break;\n\
}\n\
snippet case\n\
case '${1:value}':\n\
${2:// code...}\n\
break;${3}\n\
snippet for\n\
for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) {\n\
${4: // code...}\n\
}\n\
snippet foreach\n\
foreach ($${1:variable} as $${2:value}) {\n\
${3:// code...}\n\
}\n\
snippet foreachil\n\
<?php foreach ($${1:variable} as $${2:value}): ?>\n\
${3:<!-- html... -->}\n\
<?php endforeach; ?>\n\
snippet foreachk\n\
foreach ($${1:variable} as $${2:key} => $${3:value}) {\n\
${4:// code...}\n\
}\n\
snippet foreachkil\n\
<?php foreach ($${1:variable} as $${2:key} => $${3:value}): ?>\n\
${4:<!-- html... -->}\n\
<?php endforeach; ?>\n\
# $... = array (...)\n\
snippet array\n\
$${1:arrayName} = array('${2}' => ${3});${4}\n\
snippet try\n\
try {\n\
${2}\n\
} catch (${1:Exception} $e) {\n\
}\n\
# lambda with closure\n\
snippet lambda\n\
${1:static }function (${2:args}) use (${3:&$x, $y /*put vars in scope (closure) */}) {\n\
${4}\n\
};\n\
# pre_dump();\n\
snippet pd\n\
echo '<pre>'; var_dump(${1}); echo '</pre>';\n\
# pre_dump(); die();\n\
snippet pdd\n\
echo '<pre>'; var_dump(${1}); echo '</pre>'; die(${2:});\n\
snippet vd\n\
var_dump(${1});\n\
snippet vdd\n\
var_dump(${1}); die(${2:});\n\
snippet http_redirect\n\
header (\"HTTP/1.1 301 Moved Permanently\"); \n\
header (\"Location: \".URL); \n\
exit();\n\
# Getters & Setters\n\
snippet gs\n\
/**\n\
* Gets the value of ${1:foo}\n\
*\n\
* @return ${2:$1}\n\
*/\n\
public function get${3:$2}()\n\
{\n\
return $this->${4:$1};\n\
}\n\
\n\
/**\n\
* Sets the value of $1\n\
*\n\
* @param $2 $$1 ${5:description}\n\
*\n\
* @return ${6:$FILENAME}\n\
*/\n\
public function set$3(${7:$2 }$$1)\n\
{\n\
$this->$4 = $$1;\n\
return $this;\n\
}${8}\n\
# anotation, get, and set, useful for doctrine\n\
snippet ags\n\
/**\n\
* ${1:description}\n\
* \n\
* @${7}\n\
*/\n\
${2:protected} $${3:foo};\n\
\n\
public function get${4:$3}()\n\
{\n\
return $this->$3;\n\
}\n\
\n\
public function set$4(${5:$4 }$${6:$3})\n\
{\n\
$this->$3 = $$6;\n\
return $this;\n\
}\n\
snippet rett\n\
return true;\n\
snippet retf\n\
return false;\n\
";
exports.scope = "php";
});

View File

@ -0,0 +1,384 @@
ace.define("ace/snippets/php",["require","exports","module"], function(require, exports, module) {
"use strict";
exports.snippetText = "snippet <?\n\
<?php\n\
\n\
${1}\n\
snippet ec\n\
echo ${1};\n\
snippet <?e\n\
<?php echo ${1} ?>\n\
# this one is for php5.4\n\
snippet <?=\n\
<?=${1}?>\n\
snippet ns\n\
namespace ${1:Foo\\Bar\\Baz};\n\
${2}\n\
snippet use\n\
use ${1:Foo\\Bar\\Baz};\n\
${2}\n\
snippet c\n\
${1:abstract }class ${2:$FILENAME}\n\
{\n\
${3}\n\
}\n\
snippet i\n\
interface ${1:$FILENAME}\n\
{\n\
${2}\n\
}\n\
snippet t.\n\
$this->${1}\n\
snippet f\n\
function ${1:foo}(${2:array }${3:$bar})\n\
{\n\
${4}\n\
}\n\
# method\n\
snippet m\n\
${1:abstract }${2:protected}${3: static} function ${4:foo}(${5:array }${6:$bar})\n\
{\n\
${7}\n\
}\n\
# setter method\n\
snippet sm \n\
/**\n\
* Sets the value of ${1:foo}\n\
*\n\
* @param ${2:$1} $$1 ${3:description}\n\
*\n\
* @return ${4:$FILENAME}\n\
*/\n\
${5:public} function set${6:$2}(${7:$2 }$$1)\n\
{\n\
$this->${8:$1} = $$1;\n\
return $this;\n\
}${9}\n\
# getter method\n\
snippet gm\n\
/**\n\
* Gets the value of ${1:foo}\n\
*\n\
* @return ${2:$1}\n\
*/\n\
${3:public} function get${4:$2}()\n\
{\n\
return $this->${5:$1};\n\
}${6}\n\
#setter\n\
snippet $s\n\
${1:$foo}->set${2:Bar}(${3});\n\
#getter\n\
snippet $g\n\
${1:$foo}->get${2:Bar}();\n\
\n\
# Tertiary conditional\n\
snippet =?:\n\
$${1:foo} = ${2:true} ? ${3:a} : ${4};\n\
snippet ?:\n\
${1:true} ? ${2:a} : ${3}\n\
\n\
snippet C\n\
$_COOKIE['${1:variable}']${2}\n\
snippet E\n\
$_ENV['${1:variable}']${2}\n\
snippet F\n\
$_FILES['${1:variable}']${2}\n\
snippet G\n\
$_GET['${1:variable}']${2}\n\
snippet P\n\
$_POST['${1:variable}']${2}\n\
snippet R\n\
$_REQUEST['${1:variable}']${2}\n\
snippet S\n\
$_SERVER['${1:variable}']${2}\n\
snippet SS\n\
$_SESSION['${1:variable}']${2}\n\
\n\
# the following are old ones\n\
snippet inc\n\
include '${1:file}';${2}\n\
snippet inc1\n\
include_once '${1:file}';${2}\n\
snippet req\n\
require '${1:file}';${2}\n\
snippet req1\n\
require_once '${1:file}';${2}\n\
# Start Docblock\n\
snippet /*\n\
/**\n\
* ${1}\n\
*/\n\
# Class - post doc\n\
snippet doc_cp\n\
/**\n\
* ${1:undocumented class}\n\
*\n\
* @package ${2:default}\n\
* @subpackage ${3:default}\n\
* @author ${4:`g:snips_author`}\n\
*/${5}\n\
# Class Variable - post doc\n\
snippet doc_vp\n\
/**\n\
* ${1:undocumented class variable}\n\
*\n\
* @var ${2:string}\n\
*/${3}\n\
# Class Variable\n\
snippet doc_v\n\
/**\n\
* ${3:undocumented class variable}\n\
*\n\
* @var ${4:string}\n\
*/\n\
${1:var} $${2};${5}\n\
# Class\n\
snippet doc_c\n\
/**\n\
* ${3:undocumented class}\n\
*\n\
* @package ${4:default}\n\
* @subpackage ${5:default}\n\
* @author ${6:`g:snips_author`}\n\
*/\n\
${1:}class ${2:}\n\
{\n\
${7}\n\
} // END $1class $2\n\
# Constant Definition - post doc\n\
snippet doc_dp\n\
/**\n\
* ${1:undocumented constant}\n\
*/${2}\n\
# Constant Definition\n\
snippet doc_d\n\
/**\n\
* ${3:undocumented constant}\n\
*/\n\
define(${1}, ${2});${4}\n\
# Function - post doc\n\
snippet doc_fp\n\
/**\n\
* ${1:undocumented function}\n\
*\n\
* @return ${2:void}\n\
* @author ${3:`g:snips_author`}\n\
*/${4}\n\
# Function signature\n\
snippet doc_s\n\
/**\n\
* ${4:undocumented function}\n\
*\n\
* @return ${5:void}\n\
* @author ${6:`g:snips_author`}\n\
*/\n\
${1}function ${2}(${3});${7}\n\
# Function\n\
snippet doc_f\n\
/**\n\
* ${4:undocumented function}\n\
*\n\
* @return ${5:void}\n\
* @author ${6:`g:snips_author`}\n\
*/\n\
${1}function ${2}(${3})\n\
{${7}\n\
}\n\
# Header\n\
snippet doc_h\n\
/**\n\
* ${1}\n\
*\n\
* @author ${2:`g:snips_author`}\n\
* @version ${3:$Id$}\n\
* @copyright ${4:$2}, `strftime('%d %B, %Y')`\n\
* @package ${5:default}\n\
*/\n\
\n\
# Interface\n\
snippet interface\n\
/**\n\
* ${2:undocumented class}\n\
*\n\
* @package ${3:default}\n\
* @author ${4:`g:snips_author`}\n\
*/\n\
interface ${1:$FILENAME}\n\
{\n\
${5}\n\
}\n\
# class ...\n\
snippet class\n\
/**\n\
* ${1}\n\
*/\n\
class ${2:$FILENAME}\n\
{\n\
${3}\n\
/**\n\
* ${4}\n\
*/\n\
${5:public} function ${6:__construct}(${7:argument})\n\
{\n\
${8:// code...}\n\
}\n\
}\n\
# define(...)\n\
snippet def\n\
define('${1}'${2});${3}\n\
# defined(...)\n\
snippet def?\n\
${1}defined('${2}')${3}\n\
snippet wh\n\
while (${1:/* condition */}) {\n\
${2:// code...}\n\
}\n\
# do ... while\n\
snippet do\n\
do {\n\
${2:// code... }\n\
} while (${1:/* condition */});\n\
snippet if\n\
if (${1:/* condition */}) {\n\
${2:// code...}\n\
}\n\
snippet ifil\n\
<?php if (${1:/* condition */}): ?>\n\
${2:<!-- code... -->}\n\
<?php endif; ?>\n\
snippet ife\n\
if (${1:/* condition */}) {\n\
${2:// code...}\n\
} else {\n\
${3:// code...}\n\
}\n\
${4}\n\
snippet ifeil\n\
<?php if (${1:/* condition */}): ?>\n\
${2:<!-- html... -->}\n\
<?php else: ?>\n\
${3:<!-- html... -->}\n\
<?php endif; ?>\n\
${4}\n\
snippet else\n\
else {\n\
${1:// code...}\n\
}\n\
snippet elseif\n\
elseif (${1:/* condition */}) {\n\
${2:// code...}\n\
}\n\
snippet switch\n\
switch ($${1:variable}) {\n\
case '${2:value}':\n\
${3:// code...}\n\
break;\n\
${5}\n\
default:\n\
${4:// code...}\n\
break;\n\
}\n\
snippet case\n\
case '${1:value}':\n\
${2:// code...}\n\
break;${3}\n\
snippet for\n\
for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) {\n\
${4: // code...}\n\
}\n\
snippet foreach\n\
foreach ($${1:variable} as $${2:value}) {\n\
${3:// code...}\n\
}\n\
snippet foreachil\n\
<?php foreach ($${1:variable} as $${2:value}): ?>\n\
${3:<!-- html... -->}\n\
<?php endforeach; ?>\n\
snippet foreachk\n\
foreach ($${1:variable} as $${2:key} => $${3:value}) {\n\
${4:// code...}\n\
}\n\
snippet foreachkil\n\
<?php foreach ($${1:variable} as $${2:key} => $${3:value}): ?>\n\
${4:<!-- html... -->}\n\
<?php endforeach; ?>\n\
# $... = array (...)\n\
snippet array\n\
$${1:arrayName} = array('${2}' => ${3});${4}\n\
snippet try\n\
try {\n\
${2}\n\
} catch (${1:Exception} $e) {\n\
}\n\
# lambda with closure\n\
snippet lambda\n\
${1:static }function (${2:args}) use (${3:&$x, $y /*put vars in scope (closure) */}) {\n\
${4}\n\
};\n\
# pre_dump();\n\
snippet pd\n\
echo '<pre>'; var_dump(${1}); echo '</pre>';\n\
# pre_dump(); die();\n\
snippet pdd\n\
echo '<pre>'; var_dump(${1}); echo '</pre>'; die(${2:});\n\
snippet vd\n\
var_dump(${1});\n\
snippet vdd\n\
var_dump(${1}); die(${2:});\n\
snippet http_redirect\n\
header (\"HTTP/1.1 301 Moved Permanently\"); \n\
header (\"Location: \".URL); \n\
exit();\n\
# Getters & Setters\n\
snippet gs\n\
/**\n\
* Gets the value of ${1:foo}\n\
*\n\
* @return ${2:$1}\n\
*/\n\
public function get${3:$2}()\n\
{\n\
return $this->${4:$1};\n\
}\n\
\n\
/**\n\
* Sets the value of $1\n\
*\n\
* @param $2 $$1 ${5:description}\n\
*\n\
* @return ${6:$FILENAME}\n\
*/\n\
public function set$3(${7:$2 }$$1)\n\
{\n\
$this->$4 = $$1;\n\
return $this;\n\
}${8}\n\
# anotation, get, and set, useful for doctrine\n\
snippet ags\n\
/**\n\
* ${1:description}\n\
* \n\
* @${7}\n\
*/\n\
${2:protected} $${3:foo};\n\
\n\
public function get${4:$3}()\n\
{\n\
return $this->$3;\n\
}\n\
\n\
public function set$4(${5:$4 }$${6:$3})\n\
{\n\
$this->$3 = $$6;\n\
return $this;\n\
}\n\
snippet rett\n\
return true;\n\
snippet retf\n\
return false;\n\
";
exports.scope = "php";
});

View File

@ -0,0 +1,7 @@
ace.define("ace/snippets/sass",["require","exports","module"], function(require, exports, module) {
"use strict";
exports.snippetText =undefined;
exports.scope = "sass";
});

View File

@ -0,0 +1,7 @@
ace.define("ace/snippets/scss",["require","exports","module"], function(require, exports, module) {
"use strict";
exports.snippetText =undefined;
exports.scope = "scss";
});

View File

@ -0,0 +1,7 @@
ace.define("ace/snippets/text",["require","exports","module"], function(require, exports, module) {
"use strict";
exports.snippetText =undefined;
exports.scope = "text";
});

View File

@ -0,0 +1,7 @@
ace.define("ace/snippets/twig",["require","exports","module"], function(require, exports, module) {
"use strict";
exports.snippetText =undefined;
exports.scope = "twig";
});

View File

@ -0,0 +1,7 @@
ace.define("ace/snippets/yaml",["require","exports","module"], function(require, exports, module) {
"use strict";
exports.snippetText =undefined;
exports.scope = "yaml";
});

View File

@ -66,7 +66,6 @@ background: rgb(181, 213, 255);\
}\
.ace-github.ace_multiselect .ace_selection.ace_start {\
box-shadow: 0 0 3px 0px white;\
border-radius: 2px;\
}\
.ace-github.ace_nobold .ace_line > span {\
font-weight: normal !important;\

View File

@ -23,7 +23,6 @@ background: rgba(245, 170, 0, 0.57);\
}\
.ace-kuroir.ace_multiselect .ace_selection.ace_start {\
box-shadow: 0 0 3px 0px #E8E9E8;\
border-radius: 2px;\
}\
.ace-kuroir .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\

View File

@ -5,6 +5,7 @@ if (typeof window.window != "undefined" && window.document)
if (window.require && window.define)
return;
if (!window.console) {
window.console = function() {
var msgs = Array.prototype.slice.call(arguments, 0);
postMessage({type: "log", data: msgs});
@ -13,7 +14,7 @@ window.console.error =
window.console.warn =
window.console.log =
window.console.trace = window.console;
}
window.window = window;
window.ace = window;
@ -562,7 +563,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
if (!this.isMultiLine()) {
if (row === this.start.row) {
return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0);
};
}
}
if (row < this.start.row)
@ -1245,7 +1246,7 @@ var Document = function(textOrLines) {
}
};
this.replace = function(range, text) {
if (!range instanceof Range)
if (!(range instanceof Range))
range = Range.fromPoints(range.start, range.end);
if (text.length === 0 && range.isEmpty())
return range.start;
@ -3614,7 +3615,7 @@ var Properties = {
"alignment-baseline" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",
"animation" : 1,
"animation-delay" : { multi: "<time>", comma: true },
"animation-direction" : { multi: "normal | alternate", comma: true },
"animation-direction" : { multi: "normal | reverse | alternate | alternate-reverse", comma: true },
"animation-duration" : { multi: "<time>", comma: true },
"animation-fill-mode" : { multi: "none | forwards | backwards | both", comma: true },
"animation-iteration-count" : { multi: "<number> | infinite", comma: true },
@ -3622,21 +3623,21 @@ var Properties = {
"animation-play-state" : { multi: "running | paused", comma: true },
"animation-timing-function" : 1,
"-moz-animation-delay" : { multi: "<time>", comma: true },
"-moz-animation-direction" : { multi: "normal | alternate", comma: true },
"-moz-animation-direction" : { multi: "normal | reverse | alternate | alternate-reverse", comma: true },
"-moz-animation-duration" : { multi: "<time>", comma: true },
"-moz-animation-iteration-count" : { multi: "<number> | infinite", comma: true },
"-moz-animation-name" : { multi: "none | <ident>", comma: true },
"-moz-animation-play-state" : { multi: "running | paused", comma: true },
"-ms-animation-delay" : { multi: "<time>", comma: true },
"-ms-animation-direction" : { multi: "normal | alternate", comma: true },
"-ms-animation-direction" : { multi: "normal | reverse | alternate | alternate-reverse", comma: true },
"-ms-animation-duration" : { multi: "<time>", comma: true },
"-ms-animation-iteration-count" : { multi: "<number> | infinite", comma: true },
"-ms-animation-name" : { multi: "none | <ident>", comma: true },
"-ms-animation-play-state" : { multi: "running | paused", comma: true },
"-webkit-animation-delay" : { multi: "<time>", comma: true },
"-webkit-animation-direction" : { multi: "normal | alternate", comma: true },
"-webkit-animation-direction" : { multi: "normal | reverse | alternate | alternate-reverse", comma: true },
"-webkit-animation-duration" : { multi: "<time>", comma: true },
"-webkit-animation-fill-mode" : { multi: "none | forwards | backwards | both", comma: true },
"-webkit-animation-iteration-count" : { multi: "<number> | infinite", comma: true },
@ -3644,7 +3645,7 @@ var Properties = {
"-webkit-animation-play-state" : { multi: "running | paused", comma: true },
"-o-animation-delay" : { multi: "<time>", comma: true },
"-o-animation-direction" : { multi: "normal | alternate", comma: true },
"-o-animation-direction" : { multi: "normal | reverse | alternate | alternate-reverse", comma: true },
"-o-animation-duration" : { multi: "<time>", comma: true },
"-o-animation-iteration-count" : { multi: "<number> | infinite", comma: true },
"-o-animation-name" : { multi: "none | <ident>", comma: true },

View File

@ -5,6 +5,7 @@ if (typeof window.window != "undefined" && window.document)
if (window.require && window.define)
return;
if (!window.console) {
window.console = function() {
var msgs = Array.prototype.slice.call(arguments, 0);
postMessage({type: "log", data: msgs});
@ -13,7 +14,7 @@ window.console.error =
window.console.warn =
window.console.log =
window.console.trace = window.console;
}
window.window = window;
window.ace = window;
@ -562,7 +563,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
if (!this.isMultiLine()) {
if (row === this.start.row) {
return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0);
};
}
}
if (row < this.start.row)
@ -1245,7 +1246,7 @@ var Document = function(textOrLines) {
}
};
this.replace = function(range, text) {
if (!range instanceof Range)
if (!(range instanceof Range))
range = Range.fromPoints(range.start, range.end);
if (text.length === 0 && range.isEmpty())
return range.start;
@ -10856,7 +10857,7 @@ var SAXParser = require("./html/saxparser").SAXParser;
var errorTypes = {
"expected-doctype-but-got-start-tag": "info",
"expected-doctype-but-got-chars": "info",
"non-html-root": "info",
"non-html-root": "info"
}
var Worker = exports.Worker = function(sender) {

View File

@ -5,6 +5,7 @@ if (typeof window.window != "undefined" && window.document)
if (window.require && window.define)
return;
if (!window.console) {
window.console = function() {
var msgs = Array.prototype.slice.call(arguments, 0);
postMessage({type: "log", data: msgs});
@ -13,7 +14,7 @@ window.console.error =
window.console.warn =
window.console.log =
window.console.trace = window.console;
}
window.window = window;
window.ace = window;
@ -372,7 +373,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
if (!this.isMultiLine()) {
if (row === this.start.row) {
return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0);
};
}
}
if (row < this.start.row)
@ -1055,7 +1056,7 @@ var Document = function(textOrLines) {
}
};
this.replace = function(range, text) {
if (!range instanceof Range)
if (!(range instanceof Range))
range = Range.fromPoints(range.start, range.end);
if (text.length === 0 && range.isEmpty())
return range.start;
@ -2652,8 +2653,6 @@ PHP.Parser.prototype.parseEscapeSequences = function( str, quote ) {
}
}
);
return str;
};
PHP.Parser.prototype.TOKEN_NONE = -1;

View File

@ -12,6 +12,11 @@
data-tab-size="<?= $tabSize ?>"
data-theme="<?= $theme ?>"
data-show-invisibles="<?= $showInvisibles ?>"
data-enable-basic-autocompletion="<?= $enableBasicAutocompletion ?>"
data-enable-snippets="<?= $enableSnippets ?>"
data-enable-live-autocompletion="<?= $enableLiveAutocompletion ?>"
data-display-indent-guides="<?= $displayIndentGuides ?>"
data-show-print-margin="<?= $showPrintMargin ?>"
data-highlight-active-line="<?= $highlightActiveLine ?>"
data-use-soft-tabs="<?= $useSoftTabs ?>"
data-show-gutter="<?= $showGutter ? 'true' : 'false' ?>"
@ -21,6 +26,30 @@
data-vendor-path="<?= URL::asset('/modules/backend/formwidgets/codeeditor/assets/vendor/ace') ?>">
<div class="editor-toolbar">
<ul>
<li class="searchbox-enable">
<a href="javascript:;">
<i class="icon-search"></i>
<abbr title="ctrl+f"><?= e(trans('cms::lang.editor.open_searchbox')) ?></abbr>
</a>
</li>
<li class="searchbox-disable">
<a href="javascript:;">
<i class="icon-search"></i>
<abbr title="ctrl+f or esc"><?= e(trans('cms::lang.editor.close_searchbox')) ?></abbr>
</a>
</li>
<li class="replacebox-enable">
<a href="javascript:;">
<i class="icon-random"></i>
<abbr title="ctrl+h"><?= e(trans('cms::lang.editor.open_replacebox')) ?></abbr>
</a>
</li>
<li class="replacebox-disable">
<a href="javascript:;">
<i class="icon-random"></i>
<abbr title="ctrl+h or esc"><?= e(trans('cms::lang.editor.close_replacebox')) ?></abbr>
</a>
</li>
<li class="fullscreen-enable">
<a href="javascript:;">
<i class="icon-desktop"></i>

View File

@ -281,6 +281,11 @@ return [
'auto_closing' => 'Auto close tags and special characters',
'show_invisibles' => 'Show invisible characters',
'show_gutter' => 'Show gutter',
'enable_basic_autocompletion'=> 'Enable Basic Autocompletion(Ctrl+Space)',
'enable_snippets'=> 'Enable use of Snippets',
'enable_live_autocompletion'=> 'Enable Live Autocompletion',
'display_indent_guides'=> 'Show Display Indent Guides',
'show_print_margin'=> 'Show Print Margin',
'theme' => 'Color scheme'
],
'tooltips' => [

View File

@ -269,7 +269,12 @@ return [
'highlight_active_line' => 'Resaltar línea activa',
'auto_closing' => 'Auto cerrado de etiquetas y caracteres especiales',
'show_invisibles' => 'Mostrar caracteres invisibles',
'show_gutter' => 'Mostrar canal',
'show_gutter' => 'Mostrar numeros de línea',
'enable_basic_autocompletion'=> 'Activar Autocompletado Basico(Ctrl+Espacio)',
'enable_snippets'=> 'Activar uso de Snippets',
'enable_live_autocompletion'=> 'Activar Autocompletado en Vivo',
'display_indent_guides'=> 'Mostrar Guias de Identado',
'show_print_margin'=> 'Mostrar Margen de impresión',
'theme' => 'Color del esquema'
],
'tooltips' => [

View File

@ -31,6 +31,11 @@ class EditorPreferences extends Model
$this->use_hard_tabs = $config->get('editor.use_hard_tabs', false);
$this->show_gutter = $config->get('editor.show_gutter', true);
$this->auto_closing = $config->get('editor.auto_closing', true);
$this->enable_basic_autocompletion = $config->get('editor.enable_basic_autocompletion', true);
$this->enable_snippets = $config->get('editor.enable_snippets', true);
$this->enable_live_autocompletion = $config->get('editor.enable_live_autocompletion', true);
$this->display_indent_guides = $config->get('editor.display_indent_guides', true);
$this->show_print_margin = $config->get('editor.show_print_margin', true);
}
public static function applyConfigValues()
@ -47,6 +52,11 @@ class EditorPreferences extends Model
$config->set('editor.use_hard_tabs', $settings->use_hard_tabs);
$config->set('editor.show_gutter', $settings->show_gutter);
$config->set('editor.auto_closing', $settings->auto_closing);
$config->set('editor.enable_basic_autocompletion', $settings->enable_basic_autocompletion);
$config->set('editor.editor.enable_snippets', $settings->enable_snippets);
$config->set('editor.enable_live_autocompletion', $settings->enable_live_autocompletion);
$config->set('editor.display_indent_guides', $settings->display_indent_guides);
$config->set('editor.show_print_margin', $settings->show_print_margin);
}
public function getThemeOptions()

View File

@ -71,3 +71,23 @@ fields:
show_gutter:
label: backend::lang.editor.show_gutter
type: checkbox
enable_basic_autocompletion:
label: backend::lang.editor.enable_basic_autocompletion
type: checkbox
enable_snippets:
label: backend::lang.editor.enable_snippets
type: checkbox
enable_live_autocompletion:
label: backend::lang.editor.enable_live_autocompletion
type: checkbox
display_indent_guides:
label: backend::lang.editor.display_indent_guides
type: checkbox
show_print_margin:
label: backend::lang.editor.show_print_margin
type: checkbox

View File

@ -164,7 +164,11 @@ return [
'hidden' => 'Hidden',
'hidden_comment' => 'Hidden pages are accessible only by logged-in back-end users.',
'enter_fullscreen' => 'Enter fullscreen mode',
'exit_fullscreen' => 'Exit fullscreen mode'
'exit_fullscreen' => 'Exit fullscreen mode',
'open_searchbox' => 'Open Search box',
'close_searchbox' => 'Close Search box',
'open_replacebox' => 'Open Replace box',
'close_replacebox' => 'Close Replace box'
],
'asset' => [
'menu_label' => 'Assets',

View File

@ -163,7 +163,11 @@ return [
'hidden' => 'Oculto',
'hidden_comment' => 'A las páginas ocultas sólo pueden acceder los usuarios del back-end que se encuentren logueados.',
'enter_fullscreen' => 'Ingresar en el modo pantalla completa',
'exit_fullscreen' => 'Salir de pantalla completa'
'exit_fullscreen' => 'Salir de pantalla completa',
'open_searchbox' => 'Abrir caja de busqueda',
'close_searchbox' => 'Cerrar caja de busqueda',
'open_replacebox' => 'Abrir caja de reemplazo',
'close_replacebox' => 'Cerrar caja de reemplazo'
],
'asset' => [
'menu_label' => 'Assets',