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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * | 10 * |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
235 */ | 235 */ |
236 populateTextAreaContextMenu: function(contextMenu, lineNumber, columnNumber) | 236 populateTextAreaContextMenu: function(contextMenu, lineNumber, columnNumber) |
237 { | 237 { |
238 /** | 238 /** |
239 * @this {WebInspector.UISourceCodeFrame} | 239 * @this {WebInspector.UISourceCodeFrame} |
240 */ | 240 */ |
241 function appendItems() | 241 function appendItems() |
242 { | 242 { |
243 contextMenu.appendApplicableItems(this._uiSourceCode); | 243 contextMenu.appendApplicableItems(this._uiSourceCode); |
244 contextMenu.appendApplicableItems(new WebInspector.UILocation(this._ uiSourceCode, lineNumber, columnNumber)); | 244 contextMenu.appendApplicableItems(new WebInspector.UILocation(this._ uiSourceCode, lineNumber, columnNumber)); |
245 contextMenu.appendSeparator(); | 245 var textSelection = this._textEditor.selection(); |
246 if (textSelection && !textSelection.isEmpty()) { | |
247 var rangeWithContent = new WebInspector.TextRangeWithContent(tex tSelection, this._textEditor.copyRange(textSelection)); | |
dgozman
2016/08/15 21:31:03
Let's extract content via callback.
| |
248 contextMenu.appendApplicableItems(rangeWithContent); | |
dgozman
2016/08/15 21:31:03
So, shortcuts don't work anymore?
| |
249 } | |
246 } | 250 } |
247 | 251 |
248 return WebInspector.SourceFrame.prototype.populateTextAreaContextMenu.ca ll(this, contextMenu, lineNumber, columnNumber) | 252 return WebInspector.SourceFrame.prototype.populateTextAreaContextMenu.ca ll(this, contextMenu, lineNumber, columnNumber) |
249 .then(appendItems.bind(this)); | 253 .then(appendItems.bind(this)); |
250 }, | 254 }, |
251 | 255 |
252 /** | 256 /** |
253 * @param {!Array.<!WebInspector.Infobar|undefined>} infobars | 257 * @param {!Array.<!WebInspector.Infobar|undefined>} infobars |
254 */ | 258 */ |
255 attachInfobars: function(infobars) | 259 attachInfobars: function(infobars) |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
646 | 650 |
647 /** | 651 /** |
648 * @param {!WebInspector.UISourceCode.Message} a | 652 * @param {!WebInspector.UISourceCode.Message} a |
649 * @param {!WebInspector.UISourceCode.Message} b | 653 * @param {!WebInspector.UISourceCode.Message} b |
650 * @return {number} | 654 * @return {number} |
651 */ | 655 */ |
652 WebInspector.UISourceCode.Message.messageLevelComparator = function(a, b) | 656 WebInspector.UISourceCode.Message.messageLevelComparator = function(a, b) |
653 { | 657 { |
654 return WebInspector.UISourceCode.Message._messageLevelPriority[a.level()] - WebInspector.UISourceCode.Message._messageLevelPriority[b.level()]; | 658 return WebInspector.UISourceCode.Message._messageLevelPriority[a.level()] - WebInspector.UISourceCode.Message._messageLevelPriority[b.level()]; |
655 } | 659 } |
OLD | NEW |