OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 return regex; | 90 return regex; |
91 } | 91 } |
92 | 92 |
93 WebInspector.SourceFrame.Events = { | 93 WebInspector.SourceFrame.Events = { |
94 ScrollChanged: "ScrollChanged", | 94 ScrollChanged: "ScrollChanged", |
95 SelectionChanged: "SelectionChanged" | 95 SelectionChanged: "SelectionChanged" |
96 } | 96 } |
97 | 97 |
98 WebInspector.SourceFrame.prototype = { | 98 WebInspector.SourceFrame.prototype = { |
99 /** | 99 /** |
100 * @param {function(WebInspector.TextEditorPositionHandle, WebInspector.Text EditorPositionHandle)} jumpToPositionDelegate | |
101 */ | |
102 setJumpToPositionDelegate: function(jumpToPositionDelegate) | |
103 { | |
104 this._jumpToPositionDelegate = jumpToPositionDelegate; | |
vsevik
2013/09/04 09:46:22
Please make it an event instead
lushnikov
2014/01/02 14:06:09
Done.
| |
105 }, | |
106 | |
107 /** | |
100 * @param {number} key | 108 * @param {number} key |
101 * @param {function()} handler | 109 * @param {function()} handler |
102 */ | 110 */ |
103 addShortcut: function(key, handler) | 111 addShortcut: function(key, handler) |
104 { | 112 { |
105 this._shortcuts[key] = handler; | 113 this._shortcuts[key] = handler; |
106 }, | 114 }, |
107 | 115 |
108 wasShown: function() | 116 wasShown: function() |
109 { | 117 { |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
688 }, | 696 }, |
689 | 697 |
690 populateLineGutterContextMenu: function(contextMenu, lineNumber) | 698 populateLineGutterContextMenu: function(contextMenu, lineNumber) |
691 { | 699 { |
692 }, | 700 }, |
693 | 701 |
694 populateTextAreaContextMenu: function(contextMenu, lineNumber) | 702 populateTextAreaContextMenu: function(contextMenu, lineNumber) |
695 { | 703 { |
696 }, | 704 }, |
697 | 705 |
706 /** | |
707 * @param {WebInspector.TextEditorPositionHandle} from | |
708 * @param {WebInspector.TextEditorPositionHandle} to | |
709 */ | |
710 onJumpToPosition: function(from, to) | |
711 { | |
712 if (!this._jumpToPositionDelegate) | |
713 return; | |
714 this._jumpToPositionDelegate(from, to); | |
715 }, | |
716 | |
698 inheritScrollPositions: function(sourceFrame) | 717 inheritScrollPositions: function(sourceFrame) |
699 { | 718 { |
700 this._textEditor.inheritScrollPositions(sourceFrame._textEditor); | 719 this._textEditor.inheritScrollPositions(sourceFrame._textEditor); |
701 }, | 720 }, |
702 | 721 |
703 /** | 722 /** |
704 * @return {boolean} | 723 * @return {boolean} |
705 */ | 724 */ |
706 canEditSource: function() | 725 canEditSource: function() |
707 { | 726 { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
825 * @param {string} hrefValue | 844 * @param {string} hrefValue |
826 * @param {boolean} isExternal | 845 * @param {boolean} isExternal |
827 * @return {Element} | 846 * @return {Element} |
828 */ | 847 */ |
829 createLink: function(hrefValue, isExternal) | 848 createLink: function(hrefValue, isExternal) |
830 { | 849 { |
831 var targetLocation = WebInspector.ParsedURL.completeURL(this._sourceFram e._url, hrefValue); | 850 var targetLocation = WebInspector.ParsedURL.completeURL(this._sourceFram e._url, hrefValue); |
832 return WebInspector.linkifyURLAsNode(targetLocation || hrefValue, hrefVa lue, undefined, isExternal); | 851 return WebInspector.linkifyURLAsNode(targetLocation || hrefValue, hrefVa lue, undefined, isExternal); |
833 }, | 852 }, |
834 | 853 |
854 /** | |
855 * @param {WebInspector.TextEditorPositionHandle} from | |
856 * @param {WebInspector.TextEditorPositionHandle} to | |
857 */ | |
858 onJumpToPosition: function(from, to) | |
859 { | |
860 this._sourceFrame.onJumpToPosition(from, to); | |
861 }, | |
862 | |
835 __proto__: WebInspector.TextEditorDelegate.prototype | 863 __proto__: WebInspector.TextEditorDelegate.prototype |
836 } | 864 } |
OLD | NEW |