Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: Source/devtools/front_end/cm/htmlembedded.js

Issue 354833004: DevTools: [CodeMirror] roll CodeMirror to version @e20d175 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"), require("../htmlmixed/htmlmixed"));
7 else if (typeof define == "function" && define.amd) // AMD
8 define(["../../lib/codemirror", "../htmlmixed/htmlmixed"], mod);
9 else // Plain browser env
10 mod(CodeMirror);
11 })(function(CodeMirror) {
12 "use strict";
13
1 CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { 14 CodeMirror.defineMode("htmlembedded", function(config, parserConfig) {
2 15
3 //config settings 16 //config settings
4 var scriptStartRegex = parserConfig.scriptStartRegex || /^<%/i, 17 var scriptStartRegex = parserConfig.scriptStartRegex || /^<%/i,
5 scriptEndRegex = parserConfig.scriptEndRegex || /^%>/i; 18 scriptEndRegex = parserConfig.scriptEndRegex || /^%>/i;
6 19
7 //inner modes 20 //inner modes
8 var scriptingMode, htmlMixedMode; 21 var scriptingMode, htmlMixedMode;
9 22
10 //tokenizer when in html mode 23 //tokenizer when in html mode
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 }, 64 },
52 65
53 copyState: function(state) { 66 copyState: function(state) {
54 return { 67 return {
55 token : state.token, 68 token : state.token,
56 htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState), 69 htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState),
57 scriptState : CodeMirror.copyState(scriptingMode, state.scriptState) 70 scriptState : CodeMirror.copyState(scriptingMode, state.scriptState)
58 }; 71 };
59 }, 72 },
60 73
61 electricChars: "/{}:",
62
63 innerMode: function(state) { 74 innerMode: function(state) {
64 if (state.token == scriptingDispatch) return {state: state.scriptState, mo de: scriptingMode}; 75 if (state.token == scriptingDispatch) return {state: state.scriptState, mo de: scriptingMode};
65 else return {state: state.htmlState, mode: htmlMixedMode}; 76 else return {state: state.htmlState, mode: htmlMixedMode};
66 } 77 }
67 }; 78 };
68 }, "htmlmixed"); 79 }, "htmlmixed");
69 80
70 CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingMode Spec:"javascript"}); 81 CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingMode Spec:"javascript"});
71 CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingMod eSpec:"text/x-csharp"}); 82 CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingMod eSpec:"text/x-csharp"});
72 CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingMode Spec:"text/x-java"}); 83 CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingMode Spec:"text/x-java"});
73 CodeMirror.defineMIME("application/x-erb", { name: "htmlembedded", scriptingMode Spec:"ruby"}); 84 CodeMirror.defineMIME("application/x-erb", { name: "htmlembedded", scriptingMode Spec:"ruby"});
85
86 });
OLDNEW
« no previous file with comments | « Source/devtools/front_end/cm/headlesscodemirror.js ('k') | Source/devtools/front_end/cm/htmlmixed.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698