Krishna Prakash commited on
Commit
cbb5839
·
1 Parent(s): b8fccca

Add ace files to resolve 404 errors

Browse files
Files changed (2) hide show
  1. app/static/mode-sql.js +221 -0
  2. app/static/theme-monokai.js +26 -0
app/static/mode-sql.js ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ace.define(
2
+ "ace/mode/sql_highlight_rules",
3
+ [
4
+ "require",
5
+ "exports",
6
+ "module",
7
+ "ace/lib/oop",
8
+ "ace/mode/text_highlight_rules",
9
+ ],
10
+ function (e, t, n) {
11
+ "use strict";
12
+ var r = e("../lib/oop"),
13
+ i = e("./text_highlight_rules").TextHighlightRules,
14
+ s = function () {
15
+ var e =
16
+ "select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|when|then|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|foreign|not|references|default|null|inner|cross|natural|database|drop|grant|distinct|is|in|all|alter|any|array|at|authorization|between|both|cast|check|collate|column|commit|constraint|cube|current|current_date|current_time|current_timestamp|current_user|describe|escape|except|exists|external|extract|fetch|filter|for|full|function|global|grouping|intersect|interval|into|leading|like|local|no|of|only|out|overlaps|partition|position|range|revoke|rollback|rollup|row|rows|session_user|set|some|start|tablesample|time|to|trailing|truncate|unique|unknown|user|using|values|window|with",
17
+ t = "true|false",
18
+ n =
19
+ "avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|coalesce|ifnull|isnull|nvl",
20
+ r =
21
+ "int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|money|real|number|integer|string",
22
+ i = this.createKeywordMapper(
23
+ {
24
+ "support.function": n,
25
+ keyword: e,
26
+ "constant.language": t,
27
+ "storage.type": r,
28
+ },
29
+ "identifier",
30
+ !0
31
+ );
32
+ (this.$rules = {
33
+ start: [
34
+ { token: "comment", regex: "--.*$" },
35
+ { token: "comment", start: "/\\*", end: "\\*/" },
36
+ { token: "string", regex: '".*?"' },
37
+ { token: "string", regex: "'.*?'" },
38
+ { token: "string", regex: "`.*?`" },
39
+ {
40
+ token: "constant.numeric",
41
+ regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b",
42
+ },
43
+ { token: i, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" },
44
+ {
45
+ token: "keyword.operator",
46
+ regex:
47
+ "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=",
48
+ },
49
+ { token: "paren.lparen", regex: "[\\(]" },
50
+ { token: "paren.rparen", regex: "[\\)]" },
51
+ { token: "text", regex: "\\s+" },
52
+ ],
53
+ }),
54
+ this.normalizeRules();
55
+ };
56
+ r.inherits(s, i), (t.SqlHighlightRules = s);
57
+ }
58
+ ),
59
+ ace.define(
60
+ "ace/mode/folding/cstyle",
61
+ [
62
+ "require",
63
+ "exports",
64
+ "module",
65
+ "ace/lib/oop",
66
+ "ace/range",
67
+ "ace/mode/folding/fold_mode",
68
+ ],
69
+ function (e, t, n) {
70
+ "use strict";
71
+ var r = e("../../lib/oop"),
72
+ i = e("../../range").Range,
73
+ s = e("./fold_mode").FoldMode,
74
+ o = (t.FoldMode = function (e) {
75
+ e &&
76
+ ((this.foldingStartMarker = new RegExp(
77
+ this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + e.start)
78
+ )),
79
+ (this.foldingStopMarker = new RegExp(
80
+ this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + e.end)
81
+ )));
82
+ });
83
+ r.inherits(o, s),
84
+ function () {
85
+ (this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/),
86
+ (this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/),
87
+ (this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/),
88
+ (this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/),
89
+ (this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/),
90
+ (this._getFoldWidgetBase = this.getFoldWidget),
91
+ (this.getFoldWidget = function (e, t, n) {
92
+ var r = e.getLine(n);
93
+ if (
94
+ this.singleLineBlockCommentRe.test(r) &&
95
+ !this.startRegionRe.test(r) &&
96
+ !this.tripleStarBlockCommentRe.test(r)
97
+ )
98
+ return "";
99
+ var i = this._getFoldWidgetBase(e, t, n);
100
+ return !i && this.startRegionRe.test(r) ? "start" : i;
101
+ }),
102
+ (this.getFoldWidgetRange = function (e, t, n, r) {
103
+ var i = e.getLine(n);
104
+ if (this.startRegionRe.test(i))
105
+ return this.getCommentRegionBlock(e, i, n);
106
+ var s = i.match(this.foldingStartMarker);
107
+ if (s) {
108
+ var o = s.index;
109
+ if (s[1]) return this.openingBracketBlock(e, s[1], n, o);
110
+ var u = e.getCommentFoldRange(n, o + s[0].length, 1);
111
+ return (
112
+ u &&
113
+ !u.isMultiLine() &&
114
+ (r
115
+ ? (u = this.getSectionRange(e, n))
116
+ : t != "all" && (u = null)),
117
+ u
118
+ );
119
+ }
120
+ if (t === "markbegin") return;
121
+ var s = i.match(this.foldingStopMarker);
122
+ if (s) {
123
+ var o = s.index + s[0].length;
124
+ return s[1]
125
+ ? this.closingBracketBlock(e, s[1], n, o)
126
+ : e.getCommentFoldRange(n, o, -1);
127
+ }
128
+ }),
129
+ (this.getSectionRange = function (e, t) {
130
+ var n = e.getLine(t),
131
+ r = n.search(/\S/),
132
+ s = t,
133
+ o = n.length;
134
+ t += 1;
135
+ var u = t,
136
+ a = e.getLength();
137
+ while (++t < a) {
138
+ n = e.getLine(t);
139
+ var f = n.search(/\S/);
140
+ if (f === -1) continue;
141
+ if (r > f) break;
142
+ var l = this.getFoldWidgetRange(e, "all", t);
143
+ if (l) {
144
+ if (l.start.row <= s) break;
145
+ if (l.isMultiLine()) t = l.end.row;
146
+ else if (r == f) break;
147
+ }
148
+ u = t;
149
+ }
150
+ return new i(s, o, u, e.getLine(u).length);
151
+ }),
152
+ (this.getCommentRegionBlock = function (e, t, n) {
153
+ var r = t.search(/\s*$/),
154
+ s = e.getLength(),
155
+ o = n,
156
+ u = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,
157
+ a = 1;
158
+ while (++n < s) {
159
+ t = e.getLine(n);
160
+ var f = u.exec(t);
161
+ if (!f) continue;
162
+ f[1] ? a-- : a++;
163
+ if (!a) break;
164
+ }
165
+ var l = n;
166
+ if (l > o) return new i(o, r, l, t.length);
167
+ });
168
+ }.call(o.prototype);
169
+ }
170
+ ),
171
+ ace.define(
172
+ "ace/mode/folding/sql",
173
+ ["require", "exports", "module", "ace/lib/oop", "ace/mode/folding/cstyle"],
174
+ function (e, t, n) {
175
+ "use strict";
176
+ var r = e("../../lib/oop"),
177
+ i = e("./cstyle").FoldMode,
178
+ s = (t.FoldMode = function () {});
179
+ r.inherits(s, i), function () {}.call(s.prototype);
180
+ }
181
+ ),
182
+ ace.define(
183
+ "ace/mode/sql",
184
+ [
185
+ "require",
186
+ "exports",
187
+ "module",
188
+ "ace/lib/oop",
189
+ "ace/mode/text",
190
+ "ace/mode/sql_highlight_rules",
191
+ "ace/mode/folding/sql",
192
+ ],
193
+ function (e, t, n) {
194
+ "use strict";
195
+ var r = e("../lib/oop"),
196
+ i = e("./text").Mode,
197
+ s = e("./sql_highlight_rules").SqlHighlightRules,
198
+ o = e("./folding/sql").FoldMode,
199
+ u = function () {
200
+ (this.HighlightRules = s),
201
+ (this.foldingRules = new o()),
202
+ (this.$behaviour = this.$defaultBehaviour);
203
+ };
204
+ r.inherits(u, i),
205
+ function () {
206
+ (this.lineCommentStart = "--"),
207
+ (this.blockComment = { start: "/*", end: "*/" }),
208
+ (this.$id = "ace/mode/sql"),
209
+ (this.snippetFileId = "ace/snippets/sql");
210
+ }.call(u.prototype),
211
+ (t.Mode = u);
212
+ }
213
+ );
214
+ (function () {
215
+ ace.require(["ace/mode/sql"], function (m) {
216
+ if (typeof module == "object" && typeof exports == "object" && module) {
217
+ module.exports = m;
218
+ }
219
+ });
220
+ })();
221
+
app/static/theme-monokai.js ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ace.define(
2
+ "ace/theme/monokai-css",
3
+ ["require", "exports", "module"],
4
+ function (e, t, n) {
5
+ n.exports =
6
+ ".ace-monokai .ace_gutter {\n background: #2F3129;\n color: #8F908A\n}\n\n.ace-monokai .ace_print-margin {\n width: 1px;\n background: #555651\n}\n\n.ace-monokai {\n background-color: #272822;\n color: #F8F8F2\n}\n\n.ace-monokai .ace_cursor {\n color: #F8F8F0\n}\n\n.ace-monokai .ace_marker-layer .ace_selection {\n background: #49483E\n}\n\n.ace-monokai.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px #272822;\n}\n\n.ace-monokai .ace_marker-layer .ace_step {\n background: rgb(102, 82, 0)\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #49483E\n}\n\n.ace-monokai .ace_marker-layer .ace_active-line {\n background: #202020\n}\n\n.ace-monokai .ace_gutter-active-line {\n background-color: #272727\n}\n\n.ace-monokai .ace_marker-layer .ace_selected-word {\n border: 1px solid #49483E\n}\n\n.ace-monokai .ace_invisible {\n color: #52524d\n}\n\n.ace-monokai .ace_entity.ace_name.ace_tag,\n.ace-monokai .ace_keyword,\n.ace-monokai .ace_meta.ace_tag,\n.ace-monokai .ace_storage {\n color: #F92672\n}\n\n.ace-monokai .ace_punctuation,\n.ace-monokai .ace_punctuation.ace_tag {\n color: #fff\n}\n\n.ace-monokai .ace_constant.ace_character,\n.ace-monokai .ace_constant.ace_language,\n.ace-monokai .ace_constant.ace_numeric,\n.ace-monokai .ace_constant.ace_other {\n color: #AE81FF\n}\n\n.ace-monokai .ace_invalid {\n color: #F8F8F0;\n background-color: #F92672\n}\n\n.ace-monokai .ace_invalid.ace_deprecated {\n color: #F8F8F0;\n background-color: #AE81FF\n}\n\n.ace-monokai .ace_support.ace_constant,\n.ace-monokai .ace_support.ace_function {\n color: #66D9EF\n}\n\n.ace-monokai .ace_fold {\n background-color: #A6E22E;\n border-color: #F8F8F2\n}\n\n.ace-monokai .ace_storage.ace_type,\n.ace-monokai .ace_support.ace_class,\n.ace-monokai .ace_support.ace_type {\n font-style: italic;\n color: #66D9EF\n}\n\n.ace-monokai .ace_entity.ace_name.ace_function,\n.ace-monokai .ace_entity.ace_other,\n.ace-monokai .ace_entity.ace_other.ace_attribute-name,\n.ace-monokai .ace_variable {\n color: #A6E22E\n}\n\n.ace-monokai .ace_variable.ace_parameter {\n font-style: italic;\n color: #FD971F\n}\n\n.ace-monokai .ace_string {\n color: #E6DB74\n}\n\n.ace-monokai .ace_comment {\n color: #75715E\n}\n\n.ace-monokai .ace_indent-guide {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y\n}\n\n.ace-monokai .ace_indent-guide-active {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;\n}\n";
7
+ }
8
+ ),
9
+ ace.define(
10
+ "ace/theme/monokai",
11
+ ["require", "exports", "module", "ace/theme/monokai-css", "ace/lib/dom"],
12
+ function (e, t, n) {
13
+ (t.isDark = !0),
14
+ (t.cssClass = "ace-monokai"),
15
+ (t.cssText = e("./monokai-css"));
16
+ var r = e("../lib/dom");
17
+ r.importCssString(t.cssText, t.cssClass, !1);
18
+ }
19
+ );
20
+ (function () {
21
+ ace.require(["ace/theme/monokai"], function (m) {
22
+ if (typeof module == "object" && typeof exports == "object" && module) {
23
+ module.exports = m;
24
+ }
25
+ });
26
+ })();