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

Side by Side Diff: Source/devtools/front_end/source_frame/CodeMirrorTextEditor.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
« no previous file with comments | « Source/devtools/front_end/script_formatter_worker/ScriptFormatterWorker.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after
2107 innerConfig.name = oldModeName; 2107 innerConfig.name = oldModeName;
2108 var codeMirrorMode = CodeMirror.getMode(config, innerConfig); 2108 var codeMirrorMode = CodeMirror.getMode(config, innerConfig);
2109 codeMirrorMode.name = modeName; 2109 codeMirrorMode.name = modeName;
2110 codeMirrorMode.token = tokenOverride.bind(null, codeMirrorMode.token); 2110 codeMirrorMode.token = tokenOverride.bind(null, codeMirrorMode.token);
2111 return codeMirrorMode; 2111 return codeMirrorMode;
2112 } 2112 }
2113 2113
2114 function tokenOverride(superToken, stream, state) 2114 function tokenOverride(superToken, stream, state)
2115 { 2115 {
2116 var token = superToken(stream, state); 2116 var token = superToken(stream, state);
2117 return token ? tokenPrefix + token : token; 2117 return token ? tokenPrefix + token.split(/ +/).join(" " + tokenPrefix) : token;
2118 } 2118 }
2119 } 2119 }
2120 2120
2121 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("css", "css-") ; 2121 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("css", "css-") ;
2122 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("javascript", "js-"); 2122 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("javascript", "js-");
2123 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("xml", "xml-") ; 2123 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("xml", "xml-") ;
2124 2124
2125 (function() { 2125 (function() {
2126 var backgroundColor = InspectorFrontendHost.getSelectionBackgroundColor(); 2126 var backgroundColor = InspectorFrontendHost.getSelectionBackgroundColor();
2127 var backgroundColorRule = backgroundColor ? ".CodeMirror .CodeMirror-selecte d { background-color: " + backgroundColor + ";}" : ""; 2127 var backgroundColorRule = backgroundColor ? ".CodeMirror .CodeMirror-selecte d { background-color: " + backgroundColor + ";}" : "";
2128 var foregroundColor = InspectorFrontendHost.getSelectionForegroundColor(); 2128 var foregroundColor = InspectorFrontendHost.getSelectionForegroundColor();
2129 var foregroundColorRule = foregroundColor ? ".CodeMirror .CodeMirror-selecte dtext:not(.CodeMirror-persist-highlight) { color: " + foregroundColor + "!import ant;}" : ""; 2129 var foregroundColorRule = foregroundColor ? ".CodeMirror .CodeMirror-selecte dtext:not(.CodeMirror-persist-highlight) { color: " + foregroundColor + "!import ant;}" : "";
2130 if (!foregroundColorRule && !backgroundColorRule) 2130 if (!foregroundColorRule && !backgroundColorRule)
2131 return; 2131 return;
2132 2132
2133 var style = document.createElement("style"); 2133 var style = document.createElement("style");
2134 style.textContent = backgroundColorRule + foregroundColorRule; 2134 style.textContent = backgroundColorRule + foregroundColorRule;
2135 document.head.appendChild(style); 2135 document.head.appendChild(style);
2136 })(); 2136 })();
OLDNEW
« no previous file with comments | « Source/devtools/front_end/script_formatter_worker/ScriptFormatterWorker.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698