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 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 }, | 948 }, |
949 | 949 |
950 _contextMenu: function(event) | 950 _contextMenu: function(event) |
951 { | 951 { |
952 var contextMenu = new WebInspector.ContextMenu(event); | 952 var contextMenu = new WebInspector.ContextMenu(event); |
953 var target = event.target.enclosingNodeOrSelfWithClass("CodeMirror-gutte
r-elt"); | 953 var target = event.target.enclosingNodeOrSelfWithClass("CodeMirror-gutte
r-elt"); |
954 if (target) | 954 if (target) |
955 this._delegate.populateLineGutterContextMenu(contextMenu, parseInt(t
arget.textContent, 10) - 1); | 955 this._delegate.populateLineGutterContextMenu(contextMenu, parseInt(t
arget.textContent, 10) - 1); |
956 else | 956 else |
957 this._delegate.populateTextAreaContextMenu(contextMenu, 0); | 957 this._delegate.populateTextAreaContextMenu(contextMenu, 0); |
| 958 contextMenu.appendApplicableItems(this); |
958 contextMenu.show(); | 959 contextMenu.show(); |
959 }, | 960 }, |
960 | 961 |
961 /** | 962 /** |
962 * @param {number} lineNumber | 963 * @param {number} lineNumber |
963 * @param {boolean} disabled | 964 * @param {boolean} disabled |
964 * @param {boolean} conditional | 965 * @param {boolean} conditional |
965 */ | 966 */ |
966 addBreakpoint: function(lineNumber, disabled, conditional) | 967 addBreakpoint: function(lineNumber, disabled, conditional) |
967 { | 968 { |
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2405 var backgroundColorRule = backgroundColor ? ".CodeMirror .CodeMirror-selecte
d { background-color: " + backgroundColor + ";}" : ""; | 2406 var backgroundColorRule = backgroundColor ? ".CodeMirror .CodeMirror-selecte
d { background-color: " + backgroundColor + ";}" : ""; |
2406 var foregroundColor = InspectorFrontendHost.getSelectionForegroundColor(); | 2407 var foregroundColor = InspectorFrontendHost.getSelectionForegroundColor(); |
2407 var foregroundColorRule = foregroundColor ? ".CodeMirror .CodeMirror-selecte
dtext:not(.CodeMirror-persist-highlight) { color: " + foregroundColor + "!import
ant;}" : ""; | 2408 var foregroundColorRule = foregroundColor ? ".CodeMirror .CodeMirror-selecte
dtext:not(.CodeMirror-persist-highlight) { color: " + foregroundColor + "!import
ant;}" : ""; |
2408 if (!foregroundColorRule && !backgroundColorRule) | 2409 if (!foregroundColorRule && !backgroundColorRule) |
2409 return; | 2410 return; |
2410 | 2411 |
2411 var style = document.createElement("style"); | 2412 var style = document.createElement("style"); |
2412 style.textContent = backgroundColorRule + foregroundColorRule; | 2413 style.textContent = backgroundColorRule + foregroundColorRule; |
2413 document.head.appendChild(style); | 2414 document.head.appendChild(style); |
2414 })(); | 2415 })(); |
OLD | NEW |