Blame view

public/assets/addons/fastflow/plugins/codemirror/mode/htmlembedded/htmlembedded.js 1.61 KB
2db47680   hexiaodong   chore: 初始提交 php 遗...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
  // Distributed under an MIT license: http://codemirror.net/LICENSE
  
  (function(mod) {
    if (typeof exports == "object" && typeof module == "object") // CommonJS
      mod(require("../addons/fastflow/plugins/codemirror/lib/codemirror"), require("../addons/fastflow/plugins/codemirror/mode/htmlmixed/htmlmixed"),
          require("../addons/fastflow/plugins/codemirror/addon/mode/multiplex"));
    else if (typeof define == "function" && define.amd) // AMD
      define(["../addons/fastflow/plugins/codemirror/lib/codemirror", "../addons/fastflow/plugins/codemirror/mode/htmlmixed/htmlmixed",
              "../addons/fastflow/plugins/codemirror/addon/mode/multiplex"], mod);
    else // Plain browser env
      mod(CodeMirror);
  })(function(CodeMirror) {
    "use strict";
  
    CodeMirror.defineMode("htmlembedded", function(config, parserConfig) {
      return CodeMirror.multiplexingMode(CodeMirror.getMode(config, "htmlmixed"), {
        open: parserConfig.open || parserConfig.scriptStartRegex || "<%",
        close: parserConfig.close || parserConfig.scriptEndRegex || "%>",
        mode: CodeMirror.getMode(config, parserConfig.scriptingModeSpec)
      });
    }, "htmlmixed");
  
    CodeMirror.defineMIME("application/x-ejs", {name: "htmlembedded", scriptingModeSpec:"javascript"});
    CodeMirror.defineMIME("application/x-aspx", {name: "htmlembedded", scriptingModeSpec:"text/x-csharp"});
    CodeMirror.defineMIME("application/x-jsp", {name: "htmlembedded", scriptingModeSpec:"text/x-java"});
    CodeMirror.defineMIME("application/x-erb", {name: "htmlembedded", scriptingModeSpec:"ruby"});
    return CodeMirror;
  });