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 11 matching lines...) Expand all Loading... |
22 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 22 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
23 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY | 23 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
24 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 24 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
25 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 25 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
27 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
| 32 WebInspector.highlightedSearchResultClassName = "highlighted-search-result"; |
| 33 |
32 /** | 34 /** |
33 * @param {!Element} element | 35 * @param {!Element} element |
34 * @param {?function(!MouseEvent): boolean} elementDragStart | 36 * @param {?function(!MouseEvent): boolean} elementDragStart |
35 * @param {function(!MouseEvent)} elementDrag | 37 * @param {function(!MouseEvent)} elementDrag |
36 * @param {?function(!MouseEvent)} elementDragEnd | 38 * @param {?function(!MouseEvent)} elementDragEnd |
37 * @param {string} cursor | 39 * @param {string} cursor |
38 * @param {?string=} hoverCursor | 40 * @param {?string=} hoverCursor |
39 */ | 41 */ |
40 WebInspector.installDragHandle = function(element, elementDragStart, elementDrag
, elementDragEnd, cursor, hoverCursor) | 42 WebInspector.installDragHandle = function(element, elementDragStart, elementDrag
, elementDragEnd, cursor, hoverCursor) |
41 { | 43 { |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 } | 794 } |
793 | 795 |
794 /** | 796 /** |
795 * @param {!Element} element | 797 * @param {!Element} element |
796 * @param {!Array.<!WebInspector.SourceRange>} resultRanges | 798 * @param {!Array.<!WebInspector.SourceRange>} resultRanges |
797 * @param {!Array.<!Object>=} changes | 799 * @param {!Array.<!Object>=} changes |
798 * @return {!Array.<!Element>} | 800 * @return {!Array.<!Element>} |
799 */ | 801 */ |
800 WebInspector.highlightSearchResults = function(element, resultRanges, changes) | 802 WebInspector.highlightSearchResults = function(element, resultRanges, changes) |
801 { | 803 { |
802 return WebInspector.highlightRangesWithStyleClass(element, resultRanges, "hi
ghlighted-search-result", changes); | 804 return WebInspector.highlightRangesWithStyleClass(element, resultRanges, Web
Inspector.highlightedSearchResultClassName, changes); |
803 } | 805 } |
804 | 806 |
805 /** | 807 /** |
806 * @param {!Element} element | 808 * @param {!Element} element |
| 809 * @param {string} styleClass |
807 */ | 810 */ |
808 WebInspector.removeSearchResultsHighlight = function(element) | 811 WebInspector.removeSearchResultsHighlight = function(element, styleClass) |
809 { | 812 { |
810 var highlightBits = element.querySelectorAll(".highlighted-search-result"); | 813 var highlightBits = element.querySelectorAll("." + styleClass); |
811 for (var i = 0; i < highlightBits.length; ++i) { | 814 for (var i = 0; i < highlightBits.length; ++i) { |
812 var span = highlightBits[i]; | 815 var span = highlightBits[i]; |
813 span.parentElement.replaceChild(createTextNode(span.textContent), span); | 816 span.parentElement.replaceChild(createTextNode(span.textContent), span); |
814 } | 817 } |
815 } | 818 } |
816 | 819 |
817 /** | 820 /** |
818 * @param {!Element} element | 821 * @param {!Element} element |
819 * @param {string} className | 822 * @param {string} className |
820 */ | 823 */ |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 } | 1248 } |
1246 | 1249 |
1247 /** | 1250 /** |
1248 * @param {string} name | 1251 * @param {string} name |
1249 * @return {string} | 1252 * @return {string} |
1250 */ | 1253 */ |
1251 WebInspector.beautifyFunctionName = function(name) | 1254 WebInspector.beautifyFunctionName = function(name) |
1252 { | 1255 { |
1253 return name || WebInspector.UIString("(anonymous function)"); | 1256 return name || WebInspector.UIString("(anonymous function)"); |
1254 } | 1257 } |
OLD | NEW |