OLD | NEW |
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 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 WebInspector.CodeMirrorTextEditor._whitespaceStyleInjected = true; | 688 WebInspector.CodeMirrorTextEditor._whitespaceStyleInjected = true; |
689 const classBase = ".show-whitespaces .CodeMirror .cm-whitespace-"; | 689 const classBase = ".show-whitespaces .CodeMirror .cm-whitespace-"; |
690 const spaceChar = "·"; | 690 const spaceChar = "·"; |
691 var spaceChars = ""; | 691 var spaceChars = ""; |
692 var rules = ""; | 692 var rules = ""; |
693 for (var i = 1; i <= WebInspector.CodeMirrorTextEditor.MaximumNumberOfWh
itespacesPerSingleSpan; ++i) { | 693 for (var i = 1; i <= WebInspector.CodeMirrorTextEditor.MaximumNumberOfWh
itespacesPerSingleSpan; ++i) { |
694 spaceChars += spaceChar; | 694 spaceChars += spaceChar; |
695 var rule = classBase + i + "::before { content: '" + spaceChars + "'
;}\n"; | 695 var rule = classBase + i + "::before { content: '" + spaceChars + "'
;}\n"; |
696 rules += rule; | 696 rules += rule; |
697 } | 697 } |
698 var style = document.createElement("style"); | 698 var style = createElement("style"); |
699 style.textContent = rules; | 699 style.textContent = rules; |
700 document.head.appendChild(style); | 700 document.head.appendChild(style); |
701 }, | 701 }, |
702 | 702 |
703 _handleKeyDown: function(e) | 703 _handleKeyDown: function(e) |
704 { | 704 { |
705 if (this._autocompleteController.keyDown(e)) | 705 if (this._autocompleteController.keyDown(e)) |
706 e.consume(true); | 706 e.consume(true); |
707 }, | 707 }, |
708 | 708 |
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2434 function tokenOverride(superToken, stream, state) | 2434 function tokenOverride(superToken, stream, state) |
2435 { | 2435 { |
2436 var token = superToken(stream, state); | 2436 var token = superToken(stream, state); |
2437 return token ? tokenPrefix + token.split(/ +/).join(" " + tokenPrefix) :
token; | 2437 return token ? tokenPrefix + token.split(/ +/).join(" " + tokenPrefix) :
token; |
2438 } | 2438 } |
2439 } | 2439 } |
2440 | 2440 |
2441 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("css", "css-")
; | 2441 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("css", "css-")
; |
2442 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("javascript",
"js-"); | 2442 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("javascript",
"js-"); |
2443 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("xml", "xml-")
; | 2443 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("xml", "xml-")
; |
OLD | NEW |