revert xml highlight rules
This commit is contained in:
parent
42dd6cb274
commit
223bbbd9ea
1 changed files with 87 additions and 47 deletions
|
|
@ -1,47 +1,87 @@
|
||||||
<a:application xmlns:a="http://ajax.org/2005/aml">
|
/**
|
||||||
<a:window
|
* Ajax.org Code Editor (ACE)
|
||||||
id = "winSettings"
|
*
|
||||||
title = "Settings"
|
* @copyright 2010, Ajax.org Services B.V.
|
||||||
icon = ""
|
* @license LGPLv3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
|
||||||
center = "true"
|
* @author Fabian Jakobs <fabian AT ajax DOT org>
|
||||||
buttons = "close"
|
*/
|
||||||
kbclose = "true"
|
require.def("ace/mode/XmlHighlightRules",
|
||||||
width = "550"
|
[
|
||||||
height = "300">
|
"ace/lib/oop",
|
||||||
<a:vbox anchors="0 0 0 0">
|
"ace/mode/TextHighlightRules"
|
||||||
<a:hbox padding="8" edge="10" model="{require('ext/settings/settings').model}" actiontracker="atSettings" flex="1">
|
], function(oop, TextHighlightRules) {
|
||||||
<a:vbox width="150" padding="5">
|
|
||||||
<a:textbox initial-message="Filter" />
|
var XmlHighlightRules = function() {
|
||||||
<a:tree flex="1"
|
|
||||||
each = "[node()[local-name() and not(local-name() = 'auto')]]"
|
// regexp must not have capturing parentheses
|
||||||
eachvalue = "[@page]"
|
// regexps are ordered -> the first match is used
|
||||||
caption = "[@name]"
|
|
||||||
icon = "{[@icon] || 'folder.png'}"
|
this.$rules = {
|
||||||
startcollapsed = "false"
|
start : [ {
|
||||||
onafterselect = "
|
token : "text",
|
||||||
var page = pgSettings.getPage(this.value);
|
regex : "<\\!\\[CDATA\\[",
|
||||||
if (!page) return;
|
next : "cdata"
|
||||||
page.setAttribute('model', this.selected);
|
}, {
|
||||||
pgSettings.set(this.value);
|
token : "xml_pe",
|
||||||
"/>
|
regex : "<\\?.*?\\?>"
|
||||||
</a:vbox>
|
}, {
|
||||||
<a:splitter />
|
token : "comment",
|
||||||
<a:pages id="pgSettings" flex="1">
|
regex : "<\\!--",
|
||||||
<a:page id="pgSettingsGeneral" render="runtime">
|
next : "comment"
|
||||||
<a:frame caption="General" anchors="0 0 0 0">
|
}, {
|
||||||
<a:checkbox value="[@openfiles]">Open files at startup</a:checkbox>
|
token : "text", // opening tag
|
||||||
</a:frame>
|
regex : "<\\/?",
|
||||||
</a:page>
|
next : "tag"
|
||||||
<a:page id="pgSettingsEditor" render="runtime">
|
}, {
|
||||||
<a:frame caption="Editor" anchors="0 0 0 0"></a:frame>
|
token : "text",
|
||||||
</a:page>
|
regex : "\\s+"
|
||||||
</a:pages>
|
}, {
|
||||||
</a:hbox>
|
token : "text",
|
||||||
<a:hbox pack="end" edge="0 10 5 10" padding="5">
|
regex : "[^<]+"
|
||||||
<a:button width="80" default="2" class="ui-btn-green">OK</a:button>
|
} ],
|
||||||
<a:button width="80" onclick="winSettings.hide();">Cancel</a:button>
|
|
||||||
<a:button width="80" disabled="{!atSettings.undolength}">Apply</a:button>
|
tag : [ {
|
||||||
</a:hbox>
|
token : "text",
|
||||||
</a:vbox>
|
regex : ">",
|
||||||
</a:window>
|
next : "start"
|
||||||
</a:application>
|
}, {
|
||||||
|
token : "keyword",
|
||||||
|
regex : "[-_a-zA-Z0-9:]+"
|
||||||
|
}, {
|
||||||
|
token : "text",
|
||||||
|
regex : "\\s+"
|
||||||
|
}, {
|
||||||
|
token : "string",
|
||||||
|
regex : '".*?"'
|
||||||
|
}, {
|
||||||
|
token : "string",
|
||||||
|
regex : "'.*?'"
|
||||||
|
} ],
|
||||||
|
|
||||||
|
cdata : [ {
|
||||||
|
token : "text",
|
||||||
|
regex : "\\]\\]>",
|
||||||
|
next : "start"
|
||||||
|
}, {
|
||||||
|
token : "text",
|
||||||
|
regex : "\\s+"
|
||||||
|
}, {
|
||||||
|
token : "text",
|
||||||
|
regex : ".+"
|
||||||
|
} ],
|
||||||
|
|
||||||
|
comment : [ {
|
||||||
|
token : "comment",
|
||||||
|
regex : ".*?-->",
|
||||||
|
next : "start"
|
||||||
|
}, {
|
||||||
|
token : "comment",
|
||||||
|
regex : ".+"
|
||||||
|
} ]
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
oop.inherits(XmlHighlightRules, TextHighlightRules);
|
||||||
|
|
||||||
|
return XmlHighlightRules;
|
||||||
|
});
|
||||||
Loading…
Add table
Add a link
Reference in a new issue