corrade-nucleus-nucleons – Blame information for rev 4
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
2 | office | 1 | ace.define("ace/mode/textile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { |
2 | "use strict"; |
||
3 | |||
4 | var oop = require("../lib/oop"); |
||
5 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
||
6 | |||
7 | var TextileHighlightRules = function() { |
||
8 | this.$rules = { |
||
9 | "start" : [ |
||
10 | { |
||
11 | token : function(value) { |
||
12 | if (value.charAt(0) == "h") |
||
13 | return "markup.heading." + value.charAt(1); |
||
14 | else |
||
15 | return "markup.heading"; |
||
16 | }, |
||
17 | regex : "h1|h2|h3|h4|h5|h6|bq|p|bc|pre", |
||
18 | next : "blocktag" |
||
19 | }, |
||
20 | { |
||
21 | token : "keyword", |
||
22 | regex : "[\\*]+|[#]+" |
||
23 | }, |
||
24 | { |
||
25 | token : "text", |
||
26 | regex : ".+" |
||
27 | } |
||
28 | ], |
||
29 | "blocktag" : [ |
||
30 | { |
||
31 | token : "keyword", |
||
32 | regex : "\\. ", |
||
33 | next : "start" |
||
34 | }, |
||
35 | { |
||
36 | token : "keyword", |
||
37 | regex : "\\(", |
||
38 | next : "blocktagproperties" |
||
39 | } |
||
40 | ], |
||
41 | "blocktagproperties" : [ |
||
42 | { |
||
43 | token : "keyword", |
||
44 | regex : "\\)", |
||
45 | next : "blocktag" |
||
46 | }, |
||
47 | { |
||
48 | token : "string", |
||
49 | regex : "[a-zA-Z0-9\\-_]+" |
||
50 | }, |
||
51 | { |
||
52 | token : "keyword", |
||
53 | regex : "#" |
||
54 | } |
||
55 | ] |
||
56 | }; |
||
57 | }; |
||
58 | |||
59 | oop.inherits(TextileHighlightRules, TextHighlightRules); |
||
60 | |||
61 | exports.TextileHighlightRules = TextileHighlightRules; |
||
62 | |||
63 | }); |
||
64 | |||
65 | ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { |
||
66 | "use strict"; |
||
67 | |||
68 | var Range = require("../range").Range; |
||
69 | |||
70 | var MatchingBraceOutdent = function() {}; |
||
71 | |||
72 | (function() { |
||
73 | |||
74 | this.checkOutdent = function(line, input) { |
||
75 | if (! /^\s+$/.test(line)) |
||
76 | return false; |
||
77 | |||
78 | return /^\s*\}/.test(input); |
||
79 | }; |
||
80 | |||
81 | this.autoOutdent = function(doc, row) { |
||
82 | var line = doc.getLine(row); |
||
83 | var match = line.match(/^(\s*\})/); |
||
84 | |||
85 | if (!match) return 0; |
||
86 | |||
87 | var column = match[1].length; |
||
88 | var openBracePos = doc.findMatchingBracket({row: row, column: column}); |
||
89 | |||
90 | if (!openBracePos || openBracePos.row == row) return 0; |
||
91 | |||
92 | var indent = this.$getIndent(doc.getLine(openBracePos.row)); |
||
93 | doc.replace(new Range(row, 0, row, column-1), indent); |
||
94 | }; |
||
95 | |||
96 | this.$getIndent = function(line) { |
||
97 | return line.match(/^\s*/)[0]; |
||
98 | }; |
||
99 | |||
100 | }).call(MatchingBraceOutdent.prototype); |
||
101 | |||
102 | exports.MatchingBraceOutdent = MatchingBraceOutdent; |
||
103 | }); |
||
104 | |||
105 | ace.define("ace/mode/textile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/textile_highlight_rules","ace/mode/matching_brace_outdent"], function(require, exports, module) { |
||
106 | "use strict"; |
||
107 | |||
108 | var oop = require("../lib/oop"); |
||
109 | var TextMode = require("./text").Mode; |
||
110 | var TextileHighlightRules = require("./textile_highlight_rules").TextileHighlightRules; |
||
111 | var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; |
||
112 | |||
113 | var Mode = function() { |
||
114 | this.HighlightRules = TextileHighlightRules; |
||
115 | this.$outdent = new MatchingBraceOutdent(); |
||
116 | this.$behaviour = this.$defaultBehaviour; |
||
117 | }; |
||
118 | oop.inherits(Mode, TextMode); |
||
119 | |||
120 | (function() { |
||
121 | this.type = "text"; |
||
122 | this.getNextLineIndent = function(state, line, tab) { |
||
123 | if (state == "intag") |
||
124 | return tab; |
||
125 | |||
126 | return ""; |
||
127 | }; |
||
128 | |||
129 | this.checkOutdent = function(state, line, input) { |
||
130 | return this.$outdent.checkOutdent(line, input); |
||
131 | }; |
||
132 | |||
133 | this.autoOutdent = function(state, doc, row) { |
||
134 | this.$outdent.autoOutdent(doc, row); |
||
135 | }; |
||
136 | |||
137 | this.$id = "ace/mode/textile"; |
||
138 | }).call(Mode.prototype); |
||
139 | |||
140 | exports.Mode = Mode; |
||
141 | |||
142 | }); |