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 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
753 this._codeMirror.removeLineClass(lineNumber, "wrap", classes[i]) ; | 753 this._codeMirror.removeLineClass(lineNumber, "wrap", classes[i]) ; |
754 } | 754 } |
755 }, | 755 }, |
756 | 756 |
757 /** | 757 /** |
758 * @param {number} lineNumber | 758 * @param {number} lineNumber |
759 */ | 759 */ |
760 setExecutionLine: function(lineNumber) | 760 setExecutionLine: function(lineNumber) |
761 { | 761 { |
762 this._executionLine = this._codeMirror.getLineHandle(lineNumber); | 762 this._executionLine = this._codeMirror.getLineHandle(lineNumber); |
763 if (!this._executionLine) | |
lushnikov
2014/03/18 13:22:04
what is this needed for?
| |
764 return; | |
763 this._codeMirror.addLineClass(this._executionLine, "wrap", "cm-execution -line"); | 765 this._codeMirror.addLineClass(this._executionLine, "wrap", "cm-execution -line"); |
764 }, | 766 }, |
765 | 767 |
766 clearExecutionLine: function() | 768 clearExecutionLine: function() |
767 { | 769 { |
768 if (this._executionLine) | 770 if (this._executionLine) |
769 this._codeMirror.removeLineClass(this._executionLine, "wrap", "cm-ex ecution-line"); | 771 this._codeMirror.removeLineClass(this._executionLine, "wrap", "cm-ex ecution-line"); |
770 delete this._executionLine; | 772 delete this._executionLine; |
771 }, | 773 }, |
772 | 774 |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1716 var backgroundColorRule = backgroundColor ? ".CodeMirror .CodeMirror-selecte d { background-color: " + backgroundColor + ";}" : ""; | 1718 var backgroundColorRule = backgroundColor ? ".CodeMirror .CodeMirror-selecte d { background-color: " + backgroundColor + ";}" : ""; |
1717 var foregroundColor = InspectorFrontendHost.getSelectionForegroundColor(); | 1719 var foregroundColor = InspectorFrontendHost.getSelectionForegroundColor(); |
1718 var foregroundColorRule = foregroundColor ? ".CodeMirror .CodeMirror-selecte dtext:not(.CodeMirror-persist-highlight) { color: " + foregroundColor + "!import ant;}" : ""; | 1720 var foregroundColorRule = foregroundColor ? ".CodeMirror .CodeMirror-selecte dtext:not(.CodeMirror-persist-highlight) { color: " + foregroundColor + "!import ant;}" : ""; |
1719 if (!foregroundColorRule && !backgroundColorRule) | 1721 if (!foregroundColorRule && !backgroundColorRule) |
1720 return; | 1722 return; |
1721 | 1723 |
1722 var style = document.createElement("style"); | 1724 var style = document.createElement("style"); |
1723 style.textContent = backgroundColorRule + foregroundColorRule; | 1725 style.textContent = backgroundColorRule + foregroundColorRule; |
1724 document.head.appendChild(style); | 1726 document.head.appendChild(style); |
1725 })(); | 1727 })(); |
OLD | NEW |