| 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 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 { | 1054 { |
| 1055 this.dispatchEventToListeners(WebInspector.CodeMirrorTextEditor.Events.G
utterClick, { lineNumber: lineNumber, event: event }); | 1055 this.dispatchEventToListeners(WebInspector.CodeMirrorTextEditor.Events.G
utterClick, { lineNumber: lineNumber, event: event }); |
| 1056 }, | 1056 }, |
| 1057 | 1057 |
| 1058 _contextMenu: function(event) | 1058 _contextMenu: function(event) |
| 1059 { | 1059 { |
| 1060 var contextMenu = new WebInspector.ContextMenu(event); | 1060 var contextMenu = new WebInspector.ContextMenu(event); |
| 1061 var target = event.target.enclosingNodeOrSelfWithClass("CodeMirror-gutte
r-elt"); | 1061 var target = event.target.enclosingNodeOrSelfWithClass("CodeMirror-gutte
r-elt"); |
| 1062 if (target) | 1062 if (target) |
| 1063 this._delegate.populateLineGutterContextMenu(contextMenu, parseInt(t
arget.textContent, 10) - 1); | 1063 this._delegate.populateLineGutterContextMenu(contextMenu, parseInt(t
arget.textContent, 10) - 1); |
| 1064 else | 1064 else { |
| 1065 this._delegate.populateTextAreaContextMenu(contextMenu, 0); | 1065 var textSelection = this.selection(); |
| 1066 this._delegate.populateTextAreaContextMenu(contextMenu, textSelectio
n.startLine, textSelection.startColumn); |
| 1067 } |
| 1066 contextMenu.appendApplicableItems(this); | 1068 contextMenu.appendApplicableItems(this); |
| 1067 contextMenu.show(); | 1069 contextMenu.show(); |
| 1068 }, | 1070 }, |
| 1069 | 1071 |
| 1070 /** | 1072 /** |
| 1071 * @param {number} lineNumber | 1073 * @param {number} lineNumber |
| 1072 * @param {boolean} disabled | 1074 * @param {boolean} disabled |
| 1073 * @param {boolean} conditional | 1075 * @param {boolean} conditional |
| 1074 */ | 1076 */ |
| 1075 addBreakpoint: function(lineNumber, disabled, conditional) | 1077 addBreakpoint: function(lineNumber, disabled, conditional) |
| (...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2161 | 2163 |
| 2162 /** | 2164 /** |
| 2163 * @param {!WebInspector.ContextMenu} contextMenu | 2165 * @param {!WebInspector.ContextMenu} contextMenu |
| 2164 * @param {number} lineNumber | 2166 * @param {number} lineNumber |
| 2165 */ | 2167 */ |
| 2166 populateLineGutterContextMenu: function(contextMenu, lineNumber) { }, | 2168 populateLineGutterContextMenu: function(contextMenu, lineNumber) { }, |
| 2167 | 2169 |
| 2168 /** | 2170 /** |
| 2169 * @param {!WebInspector.ContextMenu} contextMenu | 2171 * @param {!WebInspector.ContextMenu} contextMenu |
| 2170 * @param {number} lineNumber | 2172 * @param {number} lineNumber |
| 2173 * @param {number} columnNumber |
| 2171 */ | 2174 */ |
| 2172 populateTextAreaContextMenu: function(contextMenu, lineNumber) { }, | 2175 populateTextAreaContextMenu: function(contextMenu, lineNumber, columnNumber)
{ }, |
| 2173 | 2176 |
| 2174 /** | 2177 /** |
| 2175 * @param {?WebInspector.TextRange} from | 2178 * @param {?WebInspector.TextRange} from |
| 2176 * @param {?WebInspector.TextRange} to | 2179 * @param {?WebInspector.TextRange} to |
| 2177 */ | 2180 */ |
| 2178 onJumpToPosition: function(from, to) { } | 2181 onJumpToPosition: function(from, to) { } |
| 2179 } | 2182 } |
| 2180 | 2183 |
| 2181 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("css", "css-")
; | 2184 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("css", "css-")
; |
| 2182 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("javascript",
"js-"); | 2185 WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens("javascript",
"js-"); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2247 WebInspector.CodeMirrorMimeMode = function() | 2250 WebInspector.CodeMirrorMimeMode = function() |
| 2248 { | 2251 { |
| 2249 } | 2252 } |
| 2250 | 2253 |
| 2251 WebInspector.CodeMirrorMimeMode.prototype = { | 2254 WebInspector.CodeMirrorMimeMode.prototype = { |
| 2252 /** | 2255 /** |
| 2253 * @param {!Runtime.Extension} extension | 2256 * @param {!Runtime.Extension} extension |
| 2254 */ | 2257 */ |
| 2255 install: function(extension) { } | 2258 install: function(extension) { } |
| 2256 } | 2259 } |
| OLD | NEW |