Subversion-Projekte lars-tiefland.ci

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
776 lars 1
// CodeMirror, copyright (c) by Marijn Haverbeke and others
2
// Distributed under an MIT license: http://codemirror.net/LICENSE
3
 
4
(function(mod) {
5
  if (typeof exports == "object" && typeof module == "object") // CommonJS
6
    mod(require("../lib/codemirror"));
7
  else if (typeof define == "function" && define.amd) // AMD
8
    define(["../lib/codemirror"], mod);
9
  else // Plain browser env
10
    mod(CodeMirror);
11
})(function(CodeMirror) {
12
  "use strict";
13
 
14
  CodeMirror.modeInfo = [
15
    {name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]},
16
    {name: "PGP", mimes: ["application/pgp", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["pgp"]},
17
    {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn", "asn1"]},
18
    {name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i},
19
    {name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]},
20
    {name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]},
21
    {name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
22
    {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]},
23
    {name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]},
24
    {name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj"]},
25
    {name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/},
26
    {name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]},
27
    {name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]},
28
    {name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]},
29
    {name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]},
30
    {name: "CSS", mime: "text/css", mode: "css", ext: ["css"]},
31
    {name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]},
32
    {name: "D", mime: "text/x-d", mode: "d", ext: ["d"]},
33
    {name: "Dart", mimes: ["application/dart", "text/x-dart"], mode: "dart", ext: ["dart"]},
34
    {name: "diff", mime: "text/x-diff", mode: "diff", ext: ["diff", "patch"]},
35
    {name: "Django", mime: "text/x-django", mode: "django"},
36
    {name: "Dockerfile", mime: "text/x-dockerfile", mode: "dockerfile", file: /^Dockerfile$/},
37
    {name: "DTD", mime: "application/xml-dtd", mode: "dtd", ext: ["dtd"]},
38
    {name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]},
39
    {name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"},
40
    {name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]},
41
    {name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]},
42
    {name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]},
43
    {name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
44
    {name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]},
45
    {name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]},
46
    {name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]},
47
    {name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},
48
    {name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]},
49
    {name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
50
    {name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]},
51
    {name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]},
52
    {name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history).md$/i},
53
    {name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]},
54
    {name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy"]},
55
    {name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]},
56
    {name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]},
57
    {name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]},
58
    {name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]},
59
    {name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]},
60
    {name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm"], alias: ["xhtml"]},
61
    {name: "HTTP", mime: "message/http", mode: "http"},
62
    {name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]},
63
    {name: "Jade", mime: "text/x-jade", mode: "jade", ext: ["jade"]},
64
    {name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]},
65
    {name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"]},
66
    {name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"],
67
     mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]},
68
    {name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]},
69
    {name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
70
    {name: "Jinja2", mime: "null", mode: "jinja2"},
71
    {name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
72
    {name: "Kotlin", mime: "text/x-kotlin", mode: "kotlin", ext: ["kt"]},
73
    {name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]},
74
    {name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]},
75
    {name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]},
76
    {name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]},
77
    {name: "mIRC", mime: "text/mirc", mode: "mirc"},
78
    {name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"},
79
    {name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb"]},
80
    {name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]},
81
    {name: "MUMPS", mime: "text/x-mumps", mode: "mumps"},
82
    {name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
83
    {name: "MySQL", mime: "text/x-mysql", mode: "sql"},
84
    {name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
85
    {name: "NTriples", mime: "text/n-triples", mode: "ntriples", ext: ["nt"]},
86
    {name: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"]},
87
    {name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]},
88
    {name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]},
89
    {name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]},
90
    {name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]},
91
    {name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]},
92
    {name: "PHP", mime: "application/x-httpd-php", mode: "php", ext: ["php", "php3", "php4", "php5", "phtml"]},
93
    {name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]},
94
    {name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]},
95
    {name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]},
96
    {name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]},
97
    {name: "Python", mime: "text/x-python", mode: "python", ext: ["py", "pyw"]},
98
    {name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]},
99
    {name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]},
100
    {name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r"], alias: ["rscript"]},
101
    {name: "reStructuredText", mime: "text/x-rst", mode: "rst", ext: ["rst"], alias: ["rst"]},
102
    {name: "RPM Changes", mime: "text/x-rpm-changes", mode: "rpm"},
103
    {name: "RPM Spec", mime: "text/x-rpm-spec", mode: "rpm", ext: ["spec"]},
104
    {name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"], alias: ["jruby", "macruby", "rake", "rb", "rbx"]},
105
    {name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"]},
106
    {name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"]},
107
    {name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]},
108
    {name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]},
109
    {name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]},
110
    {name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"]},
111
    {name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]},
112
    {name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]},
113
    {name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]},
114
    {name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]},
115
    {name: "Solr", mime: "text/x-solr", mode: "solr"},
116
    {name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]},
117
    {name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]},
118
    {name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]},
119
    {name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]},
120
    {name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]},
121
    {name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]},
122
    {name: "MariaDB", mime: "text/x-mariadb", mode: "sql"},
123
    {name: "sTeX", mime: "text/x-stex", mode: "stex"},
124
    {name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx"], alias: ["tex"]},
125
    {name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v"]},
126
    {name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]},
127
    {name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"]},
128
    {name: "TiddlyWiki ", mime: "text/x-tiddlywiki", mode: "tiddlywiki"},
129
    {name: "Tiki wiki", mime: "text/tiki", mode: "tiki"},
130
    {name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]},
131
    {name: "Tornado", mime: "text/x-tornado", mode: "tornado"},
132
    {name: "troff", mime: "troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]},
133
    {name: "TTCN", mime: "text/x-ttcn", mode: "ttcn", ext: ["ttcn", "ttcn3", "ttcnpp"]},
134
    {name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"]},
135
    {name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]},
136
    {name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]},
137
    {name: "Twig", mime: "text/x-twig", mode: "twig"},
138
    {name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]},
139
    {name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]},
140
    {name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]},
141
    {name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]},
142
    {name: "VHDL", mime: "text/x-vhdl", mode: "vhdl", ext: ["vhd", "vhdl"]},
143
    {name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd"], alias: ["rss", "wsdl", "xsd"]},
144
    {name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]},
145
    {name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]},
146
    {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]}
147
  ];
148
  // Ensure all modes have a mime property for backwards compatibility
149
  for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
150
    var info = CodeMirror.modeInfo[i];
151
    if (info.mimes) info.mime = info.mimes[0];
152
  }
153
 
154
  CodeMirror.findModeByMIME = function(mime) {
155
    mime = mime.toLowerCase();
156
    for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
157
      var info = CodeMirror.modeInfo[i];
158
      if (info.mime == mime) return info;
159
      if (info.mimes) for (var j = 0; j < info.mimes.length; j++)
160
        if (info.mimes[j] == mime) return info;
161
    }
162
  };
163
 
164
  CodeMirror.findModeByExtension = function(ext) {
165
    for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
166
      var info = CodeMirror.modeInfo[i];
167
      if (info.ext) for (var j = 0; j < info.ext.length; j++)
168
        if (info.ext[j] == ext) return info;
169
    }
170
  };
171
 
172
  CodeMirror.findModeByFileName = function(filename) {
173
    for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
174
      var info = CodeMirror.modeInfo[i];
175
      if (info.file && info.file.test(filename)) return info;
176
    }
177
    var dot = filename.lastIndexOf(".");
178
    var ext = dot > -1 && filename.substring(dot + 1, filename.length);
179
    if (ext) return CodeMirror.findModeByExtension(ext);
180
  };
181
 
182
  CodeMirror.findModeByName = function(name) {
183
    name = name.toLowerCase();
184
    for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
185
      var info = CodeMirror.modeInfo[i];
186
      if (info.name.toLowerCase() == name) return info;
187
      if (info.alias) for (var j = 0; j < info.alias.length; j++)
188
        if (info.alias[j].toLowerCase() == name) return info;
189
    }
190
  };
191
});