datagram 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.env.sample +7 -0
- data/.gitignore +20 -0
- data/.rbenv-version +1 -0
- data/Gemfile +12 -0
- data/LICENSE.txt +22 -0
- data/Procfile +1 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/config.ru +5 -0
- data/datagram.gemspec +23 -0
- data/db/migrate/1_create_queries.rb +9 -0
- data/db/migrate/2_add_name_to_queries.rb +5 -0
- data/lib/datagram/version.rb +3 -0
- data/lib/datagram.rb +135 -0
- data/lib/views/application.coffee +222 -0
- data/lib/views/index.haml +47 -0
- data/lib/views/layout.haml +17 -0
- data/lib/views/style.sass +179 -0
- data/public/ace/ace.js +15209 -0
- data/public/ace/ext-elastic_tabstops_lite.js +301 -0
- data/public/ace/ext-emmet.js +253 -0
- data/public/ace/ext-searchbox.js +441 -0
- data/public/ace/ext-spellcheck.js +67 -0
- data/public/ace/ext-static_highlight.js +96 -0
- data/public/ace/ext-textarea.js +492 -0
- data/public/ace/ext-whitespace.js +204 -0
- data/public/ace/keybinding-emacs.js +962 -0
- data/public/ace/keybinding-vim.js +1704 -0
- data/public/ace/mode-abap.js +260 -0
- data/public/ace/mode-asciidoc.js +372 -0
- data/public/ace/mode-c9search.js +182 -0
- data/public/ace/mode-c_cpp.js +737 -0
- data/public/ace/mode-clojure.js +299 -0
- data/public/ace/mode-coffee.js +426 -0
- data/public/ace/mode-coldfusion.js +1753 -0
- data/public/ace/mode-csharp.js +612 -0
- data/public/ace/mode-css.js +773 -0
- data/public/ace/mode-curly.js +1950 -0
- data/public/ace/mode-dart.js +945 -0
- data/public/ace/mode-diff.js +166 -0
- data/public/ace/mode-django.js +1969 -0
- data/public/ace/mode-dot.js +320 -0
- data/public/ace/mode-ftl.js +907 -0
- data/public/ace/mode-glsl.js +810 -0
- data/public/ace/mode-golang.js +632 -0
- data/public/ace/mode-groovy.js +1037 -0
- data/public/ace/mode-haml.js +487 -0
- data/public/ace/mode-haxe.js +609 -0
- data/public/ace/mode-html.js +1881 -0
- data/public/ace/mode-jade.js +1951 -0
- data/public/ace/mode-java.js +996 -0
- data/public/ace/mode-javascript.js +876 -0
- data/public/ace/mode-json.js +578 -0
- data/public/ace/mode-jsp.js +1351 -0
- data/public/ace/mode-jsx.js +635 -0
- data/public/ace/mode-latex.js +189 -0
- data/public/ace/mode-less.js +807 -0
- data/public/ace/mode-liquid.js +862 -0
- data/public/ace/mode-lisp.js +138 -0
- data/public/ace/mode-livescript.js +288 -0
- data/public/ace/mode-logiql.js +664 -0
- data/public/ace/mode-lsl.js +828 -0
- data/public/ace/mode-lua.js +455 -0
- data/public/ace/mode-luapage.js +2340 -0
- data/public/ace/mode-lucene.js +64 -0
- data/public/ace/mode-makefile.js +313 -0
- data/public/ace/mode-markdown.js +2280 -0
- data/public/ace/mode-mushcode.js +704 -0
- data/public/ace/mode-mushcode_high_rules.js +569 -0
- data/public/ace/mode-objectivec.js +659 -0
- data/public/ace/mode-ocaml.js +443 -0
- data/public/ace/mode-pascal.js +233 -0
- data/public/ace/mode-perl.js +316 -0
- data/public/ace/mode-pgsql.js +908 -0
- data/public/ace/mode-php.js +2291 -0
- data/public/ace/mode-powershell.js +618 -0
- data/public/ace/mode-python.js +264 -0
- data/public/ace/mode-r.js +404 -0
- data/public/ace/mode-rdoc.js +184 -0
- data/public/ace/mode-rhtml.js +2168 -0
- data/public/ace/mode-ruby.js +431 -0
- data/public/ace/mode-sass.js +442 -0
- data/public/ace/mode-scad.js +670 -0
- data/public/ace/mode-scala.js +1025 -0
- data/public/ace/mode-scheme.js +144 -0
- data/public/ace/mode-scss.js +832 -0
- data/public/ace/mode-sh.js +204 -0
- data/public/ace/mode-sql.js +118 -0
- data/public/ace/mode-stylus.js +483 -0
- data/public/ace/mode-svg.js +1442 -0
- data/public/ace/mode-tcl.js +319 -0
- data/public/ace/mode-tex.js +166 -0
- data/public/ace/mode-text.js +0 -0
- data/public/ace/mode-textile.js +170 -0
- data/public/ace/mode-tmsnippet.js +200 -0
- data/public/ace/mode-toml.js +180 -0
- data/public/ace/mode-typescript.js +961 -0
- data/public/ace/mode-vbscript.js +281 -0
- data/public/ace/mode-velocity.js +962 -0
- data/public/ace/mode-xml.js +789 -0
- data/public/ace/mode-xquery.js +2750 -0
- data/public/ace/mode-yaml.js +289 -0
- data/public/ace/theme-ambiance.js +202 -0
- data/public/ace/theme-chaos.js +182 -0
- data/public/ace/theme-chrome.js +161 -0
- data/public/ace/theme-clouds.js +135 -0
- data/public/ace/theme-clouds_midnight.js +136 -0
- data/public/ace/theme-cobalt.js +150 -0
- data/public/ace/theme-crimson_editor.js +154 -0
- data/public/ace/theme-dawn.js +146 -0
- data/public/ace/theme-dreamweaver.js +173 -0
- data/public/ace/theme-eclipse.js +122 -0
- data/public/ace/theme-github.js +136 -0
- data/public/ace/theme-idle_fingers.js +136 -0
- data/public/ace/theme-kr.js +143 -0
- data/public/ace/theme-merbivore.js +135 -0
- data/public/ace/theme-merbivore_soft.js +136 -0
- data/public/ace/theme-mono_industrial.js +148 -0
- data/public/ace/theme-monokai.js +140 -0
- data/public/ace/theme-pastel_on_dark.js +148 -0
- data/public/ace/theme-solarized_dark.js +128 -0
- data/public/ace/theme-solarized_light.js +131 -0
- data/public/ace/theme-terminal.js +154 -0
- data/public/ace/theme-textmate.js +0 -0
- data/public/ace/theme-tomorrow.js +147 -0
- data/public/ace/theme-tomorrow_night.js +147 -0
- data/public/ace/theme-tomorrow_night_blue.js +145 -0
- data/public/ace/theme-tomorrow_night_bright.js +147 -0
- data/public/ace/theme-tomorrow_night_eighties.js +144 -0
- data/public/ace/theme-twilight.js +147 -0
- data/public/ace/theme-vibrant_ink.js +131 -0
- data/public/ace/theme-xcode.js +125 -0
- data/public/ace/worker-coffee.js +7091 -0
- data/public/ace/worker-css.js +8289 -0
- data/public/ace/worker-javascript.js +6496 -0
- data/public/ace/worker-json.js +2305 -0
- data/public/ace/worker-lua.js +3313 -0
- data/public/ace/worker-php.js +6743 -0
- data/public/ace/worker-xquery.js +21897 -0
- data/public/font/FontAwesome.otf +0 -0
- data/public/font/fontawesome-webfont.eot +0 -0
- data/public/font/fontawesome-webfont.svg +284 -0
- data/public/font/fontawesome-webfont.ttf +0 -0
- data/public/font/fontawesome-webfont.woff +0 -0
- data/public/font-awesome.css +540 -0
- data/public/jquery.js +9597 -0
- data/script/migrate.sh +2 -0
- metadata +242 -0
@@ -0,0 +1,320 @@
|
|
1
|
+
define('ace/mode/dot', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/matching_brace_outdent', 'ace/mode/dot_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) {
|
2
|
+
|
3
|
+
|
4
|
+
var oop = require("../lib/oop");
|
5
|
+
var TextMode = require("./text").Mode;
|
6
|
+
var Tokenizer = require("../tokenizer").Tokenizer;
|
7
|
+
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
8
|
+
var DotHighlightRules = require("./dot_highlight_rules").DotHighlightRules;
|
9
|
+
var DotFoldMode = require("./folding/cstyle").FoldMode;
|
10
|
+
|
11
|
+
var Mode = function() {
|
12
|
+
var highlighter = new DotHighlightRules();
|
13
|
+
this.$outdent = new MatchingBraceOutdent();
|
14
|
+
this.foldingRules = new DotFoldMode();
|
15
|
+
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
16
|
+
};
|
17
|
+
oop.inherits(Mode, TextMode);
|
18
|
+
|
19
|
+
(function() {
|
20
|
+
|
21
|
+
this.lineCommentStart = ["//", "#"];
|
22
|
+
this.blockComment = {start: "/*", end: "*/"};
|
23
|
+
|
24
|
+
this.getNextLineIndent = function(state, line, tab) {
|
25
|
+
var indent = this.$getIndent(line);
|
26
|
+
|
27
|
+
var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
|
28
|
+
var tokens = tokenizedLine.tokens;
|
29
|
+
var endState = tokenizedLine.state;
|
30
|
+
|
31
|
+
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
32
|
+
return indent;
|
33
|
+
}
|
34
|
+
|
35
|
+
if (state == "start") {
|
36
|
+
var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
|
37
|
+
if (match) {
|
38
|
+
indent += tab;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
return indent;
|
43
|
+
};
|
44
|
+
|
45
|
+
this.checkOutdent = function(state, line, input) {
|
46
|
+
return this.$outdent.checkOutdent(line, input);
|
47
|
+
};
|
48
|
+
|
49
|
+
this.autoOutdent = function(state, doc, row) {
|
50
|
+
this.$outdent.autoOutdent(doc, row);
|
51
|
+
};
|
52
|
+
|
53
|
+
}).call(Mode.prototype);
|
54
|
+
|
55
|
+
exports.Mode = Mode;
|
56
|
+
});
|
57
|
+
|
58
|
+
define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
59
|
+
|
60
|
+
|
61
|
+
var Range = require("../range").Range;
|
62
|
+
|
63
|
+
var MatchingBraceOutdent = function() {};
|
64
|
+
|
65
|
+
(function() {
|
66
|
+
|
67
|
+
this.checkOutdent = function(line, input) {
|
68
|
+
if (! /^\s+$/.test(line))
|
69
|
+
return false;
|
70
|
+
|
71
|
+
return /^\s*\}/.test(input);
|
72
|
+
};
|
73
|
+
|
74
|
+
this.autoOutdent = function(doc, row) {
|
75
|
+
var line = doc.getLine(row);
|
76
|
+
var match = line.match(/^(\s*\})/);
|
77
|
+
|
78
|
+
if (!match) return 0;
|
79
|
+
|
80
|
+
var column = match[1].length;
|
81
|
+
var openBracePos = doc.findMatchingBracket({row: row, column: column});
|
82
|
+
|
83
|
+
if (!openBracePos || openBracePos.row == row) return 0;
|
84
|
+
|
85
|
+
var indent = this.$getIndent(doc.getLine(openBracePos.row));
|
86
|
+
doc.replace(new Range(row, 0, row, column-1), indent);
|
87
|
+
};
|
88
|
+
|
89
|
+
this.$getIndent = function(line) {
|
90
|
+
return line.match(/^\s*/)[0];
|
91
|
+
};
|
92
|
+
|
93
|
+
}).call(MatchingBraceOutdent.prototype);
|
94
|
+
|
95
|
+
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
96
|
+
});
|
97
|
+
define('ace/mode/dot_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules', 'ace/mode/doc_comment_highlight_rules'], function(require, exports, module) {
|
98
|
+
|
99
|
+
|
100
|
+
var oop = require("../lib/oop");
|
101
|
+
var lang = require("../lib/lang");
|
102
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
103
|
+
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
104
|
+
|
105
|
+
var DotHighlightRules = function() {
|
106
|
+
|
107
|
+
var keywords = lang.arrayToMap(
|
108
|
+
("strict|node|edge|graph|digraph|subgraph").split("|")
|
109
|
+
);
|
110
|
+
|
111
|
+
var attributes = lang.arrayToMap(
|
112
|
+
("damping|k|url|area|arrowhead|arrowsize|arrowtail|aspect|bb|bgcolor|center|charset|clusterrank|color|colorscheme|comment|compound|concentrate|constraint|decorate|defaultdist|dim|dimen|dir|diredgeconstraints|distortion|dpi|edgeurl|edgehref|edgetarget|edgetooltip|epsilon|esep|fillcolor|fixedsize|fontcolor|fontname|fontnames|fontpath|fontsize|forcelabels|gradientangle|group|headurl|head_lp|headclip|headhref|headlabel|headport|headtarget|headtooltip|height|href|id|image|imagepath|imagescale|label|labelurl|label_scheme|labelangle|labeldistance|labelfloat|labelfontcolor|labelfontname|labelfontsize|labelhref|labeljust|labelloc|labeltarget|labeltooltip|landscape|layer|layerlistsep|layers|layerselect|layersep|layout|len|levels|levelsgap|lhead|lheight|lp|ltail|lwidth|margin|maxiter|mclimit|mindist|minlen|mode|model|mosek|nodesep|nojustify|normalize|nslimit|nslimit1|ordering|orientation|outputorder|overlap|overlap_scaling|pack|packmode|pad|page|pagedir|pencolor|penwidth|peripheries|pin|pos|quadtree|quantum|rank|rankdir|ranksep|ratio|rects|regular|remincross|repulsiveforce|resolution|root|rotate|rotation|samehead|sametail|samplepoints|scale|searchsize|sep|shape|shapefile|showboxes|sides|size|skew|smoothing|sortv|splines|start|style|stylesheet|tailurl|tail_lp|tailclip|tailhref|taillabel|tailport|tailtarget|tailtooltip|target|tooltip|truecolor|vertices|viewport|voro_margin|weight|width|xlabel|xlp|z").split("|")
|
113
|
+
);
|
114
|
+
|
115
|
+
this.$rules = {
|
116
|
+
"start" : [
|
117
|
+
{
|
118
|
+
token : "comment",
|
119
|
+
regex : /\/\/.*$/
|
120
|
+
}, {
|
121
|
+
token : "comment",
|
122
|
+
regex : /#.*$/
|
123
|
+
}, {
|
124
|
+
token : "comment", // multi line comment
|
125
|
+
merge : true,
|
126
|
+
regex : /\/\*/,
|
127
|
+
next : "comment"
|
128
|
+
}, {
|
129
|
+
token : "string",
|
130
|
+
regex : "'(?=.)",
|
131
|
+
next : "qstring"
|
132
|
+
}, {
|
133
|
+
token : "string",
|
134
|
+
regex : '"(?=.)',
|
135
|
+
next : "qqstring"
|
136
|
+
}, {
|
137
|
+
token : "constant.numeric",
|
138
|
+
regex : /[+\-]?\d+(?:(?:\.\d*)?(?:[eE][+\-]?\d+)?)?\b/
|
139
|
+
}, {
|
140
|
+
token : "keyword.operator",
|
141
|
+
regex : /\+|=|\->/
|
142
|
+
}, {
|
143
|
+
token : "punctuation.operator",
|
144
|
+
regex : /,|;/
|
145
|
+
}, {
|
146
|
+
token : "paren.lparen",
|
147
|
+
regex : /[\[{]/
|
148
|
+
}, {
|
149
|
+
token : "paren.rparen",
|
150
|
+
regex : /[\]}]/
|
151
|
+
}, {
|
152
|
+
token: "comment",
|
153
|
+
regex: /^#!.*$/
|
154
|
+
}, {
|
155
|
+
token: function(value) {
|
156
|
+
if (keywords.hasOwnProperty(value.toLowerCase())) {
|
157
|
+
return "keyword";
|
158
|
+
}
|
159
|
+
else if (attributes.hasOwnProperty(value.toLowerCase())) {
|
160
|
+
return "variable";
|
161
|
+
}
|
162
|
+
else {
|
163
|
+
return "text";
|
164
|
+
}
|
165
|
+
},
|
166
|
+
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
|
167
|
+
}
|
168
|
+
],
|
169
|
+
"comment" : [
|
170
|
+
{
|
171
|
+
token : "comment", // closing comment
|
172
|
+
regex : ".*?\\*\\/",
|
173
|
+
merge : true,
|
174
|
+
next : "start"
|
175
|
+
}, {
|
176
|
+
token : "comment", // comment spanning whole line
|
177
|
+
merge : true,
|
178
|
+
regex : ".+"
|
179
|
+
}
|
180
|
+
],
|
181
|
+
"qqstring" : [
|
182
|
+
{
|
183
|
+
token : "string",
|
184
|
+
regex : '[^"\\\\]+',
|
185
|
+
merge : true
|
186
|
+
}, {
|
187
|
+
token : "string",
|
188
|
+
regex : "\\\\$",
|
189
|
+
next : "qqstring",
|
190
|
+
merge : true
|
191
|
+
}, {
|
192
|
+
token : "string",
|
193
|
+
regex : '"|$',
|
194
|
+
next : "start",
|
195
|
+
merge : true
|
196
|
+
}
|
197
|
+
],
|
198
|
+
"qstring" : [
|
199
|
+
{
|
200
|
+
token : "string",
|
201
|
+
regex : "[^'\\\\]+",
|
202
|
+
merge : true
|
203
|
+
}, {
|
204
|
+
token : "string",
|
205
|
+
regex : "\\\\$",
|
206
|
+
next : "qstring",
|
207
|
+
merge : true
|
208
|
+
}, {
|
209
|
+
token : "string",
|
210
|
+
regex : "'|$",
|
211
|
+
next : "start",
|
212
|
+
merge : true
|
213
|
+
}
|
214
|
+
]
|
215
|
+
};
|
216
|
+
};
|
217
|
+
|
218
|
+
oop.inherits(DotHighlightRules, TextHighlightRules);
|
219
|
+
|
220
|
+
exports.DotHighlightRules = DotHighlightRules;
|
221
|
+
|
222
|
+
});
|
223
|
+
|
224
|
+
define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
225
|
+
|
226
|
+
|
227
|
+
var oop = require("../lib/oop");
|
228
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
229
|
+
|
230
|
+
var DocCommentHighlightRules = function() {
|
231
|
+
|
232
|
+
this.$rules = {
|
233
|
+
"start" : [ {
|
234
|
+
token : "comment.doc.tag",
|
235
|
+
regex : "@[\\w\\d_]+" // TODO: fix email addresses
|
236
|
+
}, {
|
237
|
+
token : "comment.doc.tag",
|
238
|
+
regex : "\\bTODO\\b"
|
239
|
+
}, {
|
240
|
+
defaultToken : "comment.doc"
|
241
|
+
}]
|
242
|
+
};
|
243
|
+
};
|
244
|
+
|
245
|
+
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
246
|
+
|
247
|
+
DocCommentHighlightRules.getStartRule = function(start) {
|
248
|
+
return {
|
249
|
+
token : "comment.doc", // doc comment
|
250
|
+
regex : "\\/\\*(?=\\*)",
|
251
|
+
next : start
|
252
|
+
};
|
253
|
+
};
|
254
|
+
|
255
|
+
DocCommentHighlightRules.getEndRule = function (start) {
|
256
|
+
return {
|
257
|
+
token : "comment.doc", // closing comment
|
258
|
+
regex : "\\*\\/",
|
259
|
+
next : start
|
260
|
+
};
|
261
|
+
};
|
262
|
+
|
263
|
+
|
264
|
+
exports.DocCommentHighlightRules = DocCommentHighlightRules;
|
265
|
+
|
266
|
+
});
|
267
|
+
|
268
|
+
define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
|
269
|
+
|
270
|
+
|
271
|
+
var oop = require("../../lib/oop");
|
272
|
+
var Range = require("../../range").Range;
|
273
|
+
var BaseFoldMode = require("./fold_mode").FoldMode;
|
274
|
+
|
275
|
+
var FoldMode = exports.FoldMode = function(commentRegex) {
|
276
|
+
if (commentRegex) {
|
277
|
+
this.foldingStartMarker = new RegExp(
|
278
|
+
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
|
279
|
+
);
|
280
|
+
this.foldingStopMarker = new RegExp(
|
281
|
+
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
|
282
|
+
);
|
283
|
+
}
|
284
|
+
};
|
285
|
+
oop.inherits(FoldMode, BaseFoldMode);
|
286
|
+
|
287
|
+
(function() {
|
288
|
+
|
289
|
+
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
|
290
|
+
this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
|
291
|
+
|
292
|
+
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
293
|
+
var line = session.getLine(row);
|
294
|
+
var match = line.match(this.foldingStartMarker);
|
295
|
+
if (match) {
|
296
|
+
var i = match.index;
|
297
|
+
|
298
|
+
if (match[1])
|
299
|
+
return this.openingBracketBlock(session, match[1], row, i);
|
300
|
+
|
301
|
+
return session.getCommentFoldRange(row, i + match[0].length, 1);
|
302
|
+
}
|
303
|
+
|
304
|
+
if (foldStyle !== "markbeginend")
|
305
|
+
return;
|
306
|
+
|
307
|
+
var match = line.match(this.foldingStopMarker);
|
308
|
+
if (match) {
|
309
|
+
var i = match.index + match[0].length;
|
310
|
+
|
311
|
+
if (match[1])
|
312
|
+
return this.closingBracketBlock(session, match[1], row, i);
|
313
|
+
|
314
|
+
return session.getCommentFoldRange(row, i, -1);
|
315
|
+
}
|
316
|
+
};
|
317
|
+
|
318
|
+
}).call(FoldMode.prototype);
|
319
|
+
|
320
|
+
});
|