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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 // Otherwise just do case-insensitive search. | 87 // Otherwise just do case-insensitive search. |
88 if (!regex) | 88 if (!regex) |
89 regex = createPlainTextSearchRegex(query, "i" + modifiers); | 89 regex = createPlainTextSearchRegex(query, "i" + modifiers); |
90 | 90 |
91 return regex; | 91 return regex; |
92 } | 92 } |
93 | 93 |
94 WebInspector.SourceFrame.Events = { | 94 WebInspector.SourceFrame.Events = { |
95 ScrollChanged: "ScrollChanged", | 95 ScrollChanged: "ScrollChanged", |
96 SelectionChanged: "SelectionChanged" | 96 SelectionChanged: "SelectionChanged", |
| 97 JumpHappened: "JumpHappened" |
97 } | 98 } |
98 | 99 |
99 WebInspector.SourceFrame.prototype = { | 100 WebInspector.SourceFrame.prototype = { |
100 /** | 101 /** |
101 * @param {number} key | 102 * @param {number} key |
102 * @param {function()} handler | 103 * @param {function()} handler |
103 */ | 104 */ |
104 addShortcut: function(key, handler) | 105 addShortcut: function(key, handler) |
105 { | 106 { |
106 this._shortcuts[key] = handler; | 107 this._shortcuts[key] = handler; |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 }, | 728 }, |
728 | 729 |
729 populateLineGutterContextMenu: function(contextMenu, lineNumber) | 730 populateLineGutterContextMenu: function(contextMenu, lineNumber) |
730 { | 731 { |
731 }, | 732 }, |
732 | 733 |
733 populateTextAreaContextMenu: function(contextMenu, lineNumber) | 734 populateTextAreaContextMenu: function(contextMenu, lineNumber) |
734 { | 735 { |
735 }, | 736 }, |
736 | 737 |
| 738 /** |
| 739 * @param {?WebInspector.TextRange} from |
| 740 * @param {?WebInspector.TextRange} to |
| 741 */ |
| 742 onJumpToPosition: function(from, to) |
| 743 { |
| 744 this.dispatchEventToListeners(WebInspector.SourceFrame.Events.JumpHappen
ed, { |
| 745 from: from, |
| 746 to: to |
| 747 }); |
| 748 }, |
| 749 |
737 inheritScrollPositions: function(sourceFrame) | 750 inheritScrollPositions: function(sourceFrame) |
738 { | 751 { |
739 this._textEditor.inheritScrollPositions(sourceFrame._textEditor); | 752 this._textEditor.inheritScrollPositions(sourceFrame._textEditor); |
740 }, | 753 }, |
741 | 754 |
742 /** | 755 /** |
743 * @return {boolean} | 756 * @return {boolean} |
744 */ | 757 */ |
745 canEditSource: function() | 758 canEditSource: function() |
746 { | 759 { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 | 876 |
864 /** | 877 /** |
865 * @param {string} hrefValue | 878 * @param {string} hrefValue |
866 * @param {boolean} isExternal | 879 * @param {boolean} isExternal |
867 * @return {!Element} | 880 * @return {!Element} |
868 */ | 881 */ |
869 createLink: function(hrefValue, isExternal) | 882 createLink: function(hrefValue, isExternal) |
870 { | 883 { |
871 var targetLocation = WebInspector.ParsedURL.completeURL(this._sourceFram
e._url, hrefValue); | 884 var targetLocation = WebInspector.ParsedURL.completeURL(this._sourceFram
e._url, hrefValue); |
872 return WebInspector.linkifyURLAsNode(targetLocation || hrefValue, hrefVa
lue, undefined, isExternal); | 885 return WebInspector.linkifyURLAsNode(targetLocation || hrefValue, hrefVa
lue, undefined, isExternal); |
| 886 }, |
| 887 |
| 888 /** |
| 889 * @param {?WebInspector.TextRange} from |
| 890 * @param {?WebInspector.TextRange} to |
| 891 */ |
| 892 onJumpToPosition: function(from, to) |
| 893 { |
| 894 this._sourceFrame.onJumpToPosition(from, to); |
873 } | 895 } |
874 } | 896 } |
OLD | NEW |