OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
5 * Copyright (C) 2009 Joseph Pecoraro | 5 * Copyright (C) 2009 Joseph Pecoraro |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * | 10 * |
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
777 WebInspector.highlightSearchResult = function(element, offset, length, domChange s) | 777 WebInspector.highlightSearchResult = function(element, offset, length, domChange s) |
778 { | 778 { |
779 var result = WebInspector.highlightSearchResults(element, [new WebInspector. SourceRange(offset, length)], domChanges); | 779 var result = WebInspector.highlightSearchResults(element, [new WebInspector. SourceRange(offset, length)], domChanges); |
780 return result.length ? result[0] : null; | 780 return result.length ? result[0] : null; |
781 } | 781 } |
782 | 782 |
783 /** | 783 /** |
784 * @param {!Element} element | 784 * @param {!Element} element |
785 * @param {!Array.<!WebInspector.SourceRange>} resultRanges | 785 * @param {!Array.<!WebInspector.SourceRange>} resultRanges |
786 * @param {!Array.<!Object>=} changes | 786 * @param {!Array.<!Object>=} changes |
787 * @param {?Boolean=} isCurrent | |
robwu
2014/10/25 23:13:00
Booleans are primitive types, use a lowercase "boo
aknudsen
2014/10/26 11:22:40
I made it boolean= instead since the argument is i
| |
787 * @return {!Array.<!Element>} | 788 * @return {!Array.<!Element>} |
788 */ | 789 */ |
789 WebInspector.highlightSearchResults = function(element, resultRanges, changes) | 790 WebInspector.highlightSearchResults = function(element, resultRanges, changes, i sCurrent) |
790 { | 791 { |
791 return WebInspector.highlightRangesWithStyleClass(element, resultRanges, "hi ghlighted-search-result", changes); | 792 var style = isCurrent ? "current-search-result" : "highlighted-search-result "; |
robwu
2014/10/25 23:13:00
Rename "style" to className.
aknudsen
2014/10/26 11:22:41
Done.
| |
793 return WebInspector.highlightRangesWithStyleClass(element, resultRanges, sty le, changes); | |
792 } | 794 } |
793 | 795 |
794 /** | 796 /** |
795 * @param {!Element} element | 797 * @param {!Element} element |
796 */ | 798 */ |
797 WebInspector.removeSearchResultsHighlight = function(element) | 799 WebInspector.removeSearchResultsHighlight = function(element) |
798 { | 800 { |
799 var highlightBits = element.querySelectorAll(".highlighted-search-result"); | 801 var highlightBits = element.querySelectorAll(".highlighted-search-result"); |
800 for (var i = 0; i < highlightBits.length; ++i) { | 802 for (var i = 0; i < highlightBits.length; ++i) { |
801 var span = highlightBits[i]; | 803 var span = highlightBits[i]; |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1210 /** | 1212 /** |
1211 * @param {!Window} window | 1213 * @param {!Window} window |
1212 */ | 1214 */ |
1213 WebInspector.initializeUIUtils = function(window) | 1215 WebInspector.initializeUIUtils = function(window) |
1214 { | 1216 { |
1215 window.addEventListener("focus", WebInspector._windowFocused.bind(WebInspect or, window.document), false); | 1217 window.addEventListener("focus", WebInspector._windowFocused.bind(WebInspect or, window.document), false); |
1216 window.addEventListener("blur", WebInspector._windowBlurred.bind(WebInspecto r, window.document), false); | 1218 window.addEventListener("blur", WebInspector._windowBlurred.bind(WebInspecto r, window.document), false); |
1217 window.document.addEventListener("focus", WebInspector._focusChanged.bind(We bInspector, window.document), true); | 1219 window.document.addEventListener("focus", WebInspector._focusChanged.bind(We bInspector, window.document), true); |
1218 window.document.addEventListener("blur", WebInspector._documentBlurred.bind( WebInspector, window.document), true); | 1220 window.document.addEventListener("blur", WebInspector._documentBlurred.bind( WebInspector, window.document), true); |
1219 } | 1221 } |
OLD | NEW |