PageRenderTime 54ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/static/dashboard/node_modules/ace-builds/src-noconflict/ext-modelist.js

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