corrade-nucleus-nucleons – Blame information for rev 20
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
20 | office | 1 | define("ace/ext/modelist",["require","exports","module"], function(require, exports, module) { |
2 | "use strict"; |
||
3 | |||
4 | var modes = []; |
||
5 | function getModeForPath(path) { |
||
6 | var mode = modesByName.text; |
||
7 | var fileName = path.split(/[\/\\]/).pop(); |
||
8 | for (var i = 0; i < modes.length; i++) { |
||
9 | if (modes[i].supportsFile(fileName)) { |
||
10 | mode = modes[i]; |
||
11 | break; |
||
12 | } |
||
13 | } |
||
14 | return mode; |
||
15 | } |
||
16 | |||
17 | var Mode = function(name, caption, extensions) { |
||
18 | this.name = name; |
||
19 | this.caption = caption; |
||
20 | this.mode = "ace/mode/" + name; |
||
21 | this.extensions = extensions; |
||
22 | var re; |
||
23 | if (/\^/.test(extensions)) { |
||
24 | re = extensions.replace(/\|(\^)?/g, function(a, b){ |
||
25 | return "$|" + (b ? "^" : "^.*\\."); |
||
26 | }) + "$"; |
||
27 | } else { |
||
28 | re = "^.*\\.(" + extensions + ")$"; |
||
29 | } |
||
30 | |||
31 | this.extRe = new RegExp(re, "gi"); |
||
32 | }; |
||
33 | |||
34 | Mode.prototype.supportsFile = function(filename) { |
||
35 | return filename.match(this.extRe); |
||
36 | }; |
||
37 | var supportedModes = { |
||
38 | ABAP: ["abap"], |
||
39 | ABC: ["abc"], |
||
40 | ActionScript:["as"], |
||
41 | ADA: ["ada|adb"], |
||
42 | Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"], |
||
43 | AsciiDoc: ["asciidoc|adoc"], |
||
44 | Assembly_x86:["asm|a"], |
||
45 | AutoHotKey: ["ahk"], |
||
46 | BatchFile: ["bat|cmd"], |
||
47 | Bro: ["bro"], |
||
48 | C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"], |
||
49 | C9Search: ["c9search_results"], |
||
50 | Cirru: ["cirru|cr"], |
||
51 | Clojure: ["clj|cljs"], |
||
52 | Cobol: ["CBL|COB"], |
||
53 | coffee: ["coffee|cf|cson|^Cakefile"], |
||
54 | ColdFusion: ["cfm"], |
||
55 | CSharp: ["cs"], |
||
56 | CSS: ["css"], |
||
57 | Curly: ["curly"], |
||
58 | D: ["d|di"], |
||
59 | Dart: ["dart"], |
||
60 | Diff: ["diff|patch"], |
||
61 | Dockerfile: ["^Dockerfile"], |
||
62 | Dot: ["dot"], |
||
63 | Drools: ["drl"], |
||
64 | Dummy: ["dummy"], |
||
65 | DummySyntax: ["dummy"], |
||
66 | Eiffel: ["e|ge"], |
||
67 | EJS: ["ejs"], |
||
68 | Elixir: ["ex|exs"], |
||
69 | Elm: ["elm"], |
||
70 | Erlang: ["erl|hrl"], |
||
71 | Forth: ["frt|fs|ldr|fth|4th"], |
||
72 | Fortran: ["f|f90"], |
||
73 | FTL: ["ftl"], |
||
74 | Gcode: ["gcode"], |
||
75 | Gherkin: ["feature"], |
||
76 | Gitignore: ["^.gitignore"], |
||
77 | Glsl: ["glsl|frag|vert"], |
||
78 | Gobstones: ["gbs"], |
||
79 | golang: ["go"], |
||
80 | Groovy: ["groovy"], |
||
81 | HAML: ["haml"], |
||
82 | Handlebars: ["hbs|handlebars|tpl|mustache"], |
||
83 | Haskell: ["hs"], |
||
84 | Haskell_Cabal: ["cabal"], |
||
85 | haXe: ["hx"], |
||
86 | Hjson: ["hjson"], |
||
87 | HTML: ["html|htm|xhtml"], |
||
88 | HTML_Elixir: ["eex|html.eex"], |
||
89 | HTML_Ruby: ["erb|rhtml|html.erb"], |
||
90 | INI: ["ini|conf|cfg|prefs"], |
||
91 | Io: ["io"], |
||
92 | Jack: ["jack"], |
||
93 | Jade: ["jade|pug"], |
||
94 | Java: ["java"], |
||
95 | JavaScript: ["js|jsm|jsx"], |
||
96 | JSON: ["json"], |
||
97 | JSONiq: ["jq"], |
||
98 | JSP: ["jsp"], |
||
99 | JSX: ["jsx"], |
||
100 | Julia: ["jl"], |
||
101 | Kotlin: ["kt|kts"], |
||
102 | LaTeX: ["tex|latex|ltx|bib"], |
||
103 | LESS: ["less"], |
||
104 | Liquid: ["liquid"], |
||
105 | Lisp: ["lisp"], |
||
106 | LiveScript: ["ls"], |
||
107 | LogiQL: ["logic|lql"], |
||
108 | LSL: ["lsl"], |
||
109 | Lua: ["lua"], |
||
110 | LuaPage: ["lp"], |
||
111 | Lucene: ["lucene"], |
||
112 | Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"], |
||
113 | Markdown: ["md|markdown"], |
||
114 | Mask: ["mask"], |
||
115 | MATLAB: ["matlab"], |
||
116 | Maze: ["mz"], |
||
117 | MEL: ["mel"], |
||
118 | MUSHCode: ["mc|mush"], |
||
119 | MySQL: ["mysql"], |
||
120 | Nix: ["nix"], |
||
121 | NSIS: ["nsi|nsh"], |
||
122 | ObjectiveC: ["m|mm"], |
||
123 | OCaml: ["ml|mli"], |
||
124 | Pascal: ["pas|p"], |
||
125 | Perl: ["pl|pm"], |
||
126 | pgSQL: ["pgsql"], |
||
127 | PHP: ["php|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"], |
||
128 | Powershell: ["ps1"], |
||
129 | Praat: ["praat|praatscript|psc|proc"], |
||
130 | Prolog: ["plg|prolog"], |
||
131 | Properties: ["properties"], |
||
132 | Protobuf: ["proto"], |
||
133 | Python: ["py"], |
||
134 | R: ["r"], |
||
135 | Razor: ["cshtml|asp"], |
||
136 | RDoc: ["Rd"], |
||
137 | RHTML: ["Rhtml"], |
||
138 | RST: ["rst"], |
||
139 | Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"], |
||
140 | Rust: ["rs"], |
||
141 | SASS: ["sass"], |
||
142 | SCAD: ["scad"], |
||
143 | Scala: ["scala"], |
||
144 | Scheme: ["scm|sm|rkt|oak|scheme"], |
||
145 | SCSS: ["scss"], |
||
146 | SH: ["sh|bash|^.bashrc"], |
||
147 | SJS: ["sjs"], |
||
148 | Smarty: ["smarty|tpl"], |
||
149 | snippets: ["snippets"], |
||
150 | Soy_Template:["soy"], |
||
151 | Space: ["space"], |
||
152 | SQL: ["sql"], |
||
153 | SQLServer: ["sqlserver"], |
||
154 | Stylus: ["styl|stylus"], |
||
155 | SVG: ["svg"], |
||
156 | Swift: ["swift"], |
||
157 | Tcl: ["tcl"], |
||
158 | Tex: ["tex"], |
||
159 | Text: ["txt"], |
||
160 | Textile: ["textile"], |
||
161 | Toml: ["toml"], |
||
162 | TSX: ["tsx"], |
||
163 | Twig: ["twig|swig"], |
||
164 | Typescript: ["ts|typescript|str"], |
||
165 | Vala: ["vala"], |
||
166 | VBScript: ["vbs|vb"], |
||
167 | Velocity: ["vm"], |
||
168 | Verilog: ["v|vh|sv|svh"], |
||
169 | VHDL: ["vhd|vhdl"], |
||
170 | Wollok: ["wlk|wpgm|wtest"], |
||
171 | XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"], |
||
172 | XQuery: ["xq"], |
||
173 | YAML: ["yaml|yml"], |
||
174 | Django: ["html"] |
||
175 | }; |
||
176 | |||
177 | var nameOverrides = { |
||
178 | ObjectiveC: "Objective-C", |
||
179 | CSharp: "C#", |
||
180 | golang: "Go", |
||
181 | C_Cpp: "C and C++", |
||
182 | coffee: "CoffeeScript", |
||
183 | HTML_Ruby: "HTML (Ruby)", |
||
184 | HTML_Elixir: "HTML (Elixir)", |
||
185 | FTL: "FreeMarker" |
||
186 | }; |
||
187 | var modesByName = {}; |
||
188 | for (var name in supportedModes) { |
||
189 | var data = supportedModes[name]; |
||
190 | var displayName = (nameOverrides[name] || name).replace(/_/g, " "); |
||
191 | var filename = name.toLowerCase(); |
||
192 | var mode = new Mode(filename, displayName, data[0]); |
||
193 | modesByName[filename] = mode; |
||
194 | modes.push(mode); |
||
195 | } |
||
196 | |||
197 | module.exports = { |
||
198 | getModeForPath: getModeForPath, |
||
199 | modes: modes, |
||
200 | modesByName: modesByName |
||
201 | }; |
||
202 | |||
203 | }); |
||
204 | (function() { |
||
205 | window.require(["ace/ext/modelist"], function() {}); |
||
206 | })(); |
||
207 |