Chromium Code Reviews| Index: Source/devtools/front_end/ui/UIUtils.js |
| diff --git a/Source/devtools/front_end/ui/UIUtils.js b/Source/devtools/front_end/ui/UIUtils.js |
| index 80c89a9923fc735c80e03fafff8738c19e7eaaed..e5d4e073329e85615aa5b86914718b940624dd8b 100644 |
| --- a/Source/devtools/front_end/ui/UIUtils.js |
| +++ b/Source/devtools/front_end/ui/UIUtils.js |
| @@ -34,7 +34,7 @@ |
| * @param {?function(!MouseEvent): boolean} elementDragStart |
| * @param {function(!MouseEvent)} elementDrag |
| * @param {?function(!MouseEvent)} elementDragEnd |
| - * @param {!string} cursor |
| + * @param {string} cursor |
| * @param {?string=} hoverCursor |
| */ |
| WebInspector.installDragHandle = function(element, elementDragStart, elementDrag, elementDragEnd, cursor, hoverCursor) |
| @@ -167,8 +167,15 @@ WebInspector.GlassPane.prototype = { |
| */ |
| WebInspector.GlassPane.DefaultFocusedViewStack = []; |
| -WebInspector.isBeingEdited = function(node) |
| +/** |
| + * @param {?EventTarget=} target |
|
aandrey
2014/06/17 20:58:37
why EventTarget?
apavlov
2014/06/18 07:55:13
Same thing, added a cast in ShortcutRegistry.js
|
| + * @return {boolean} |
| + */ |
| +WebInspector.isBeingEdited = function(target) |
| { |
| + if (!target) |
| + return false; |
| + var node = /** @type {!Node} */ (target); |
| if (node.nodeType !== Node.ELEMENT_NODE) |
| return false; |
| var element = /** {!Element} */ (node); |
| @@ -186,6 +193,11 @@ WebInspector.isBeingEdited = function(node) |
| return false; |
| } |
| +/** |
| + * @param {!Element} element |
| + * @param {boolean} value |
| + * @return {boolean} |
| + */ |
| WebInspector.markBeingEdited = function(element, value) |
| { |
| if (value) { |
| @@ -469,6 +481,10 @@ Number.bytesToString = function(bytes) |
| return WebInspector.UIString("%.0f\u2009MB", megabytes); |
| } |
| +/** |
| + * @param {number} num |
| + * @return {string} |
| + */ |
| Number.withThousandsSeparator = function(num) |
| { |
| var str = num + ""; |
| @@ -478,21 +494,38 @@ Number.withThousandsSeparator = function(num) |
| return str; |
| } |
| +/** |
| + * @return {boolean} |
| + */ |
| WebInspector.useLowerCaseMenuTitles = function() |
| { |
| return WebInspector.platform() === "windows"; |
| } |
| +/** |
| + * @param {string} format |
| + * @param {?Array.<string>} substitutions |
| + * @param {!Object.<string, function(string, ...):*>} formatters |
| + * @param {string} initialValue |
| + * @param {function(string, string): ?} append |
| + * @return {!{formattedResult: string, unusedSubstitutions: ?Array.<string>}}; |
| + */ |
| WebInspector.formatLocalized = function(format, substitutions, formatters, initialValue, append) |
| { |
| return String.format(WebInspector.UIString(format), substitutions, formatters, initialValue, append); |
| } |
| +/** |
| + * @return {string} |
| + */ |
| WebInspector.openLinkExternallyLabel = function() |
| { |
| return WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Open link in new tab" : "Open Link in New Tab"); |
| } |
| +/** |
| + * @return {string} |
| + */ |
| WebInspector.copyLinkAddressLabel = function() |
| { |
| return WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy link address" : "Copy Link Address"); |
| @@ -521,11 +554,17 @@ WebInspector._windowBlurred = function(event) |
| document.body.classList.add("inactive"); |
| } |
| +/** |
| + * @return {!Element} |
| + */ |
| WebInspector.previousFocusElement = function() |
| { |
| return WebInspector._previousFocusElement; |
| } |
| +/** |
| + * @return {!Element} |
| + */ |
| WebInspector.currentFocusElement = function() |
| { |
| return WebInspector._currentFocusElement; |
| @@ -627,6 +666,7 @@ WebInspector.resetToolbarColors = function() |
| * @param {number} offset |
| * @param {number} length |
| * @param {!Array.<!Object>=} domChanges |
| + * @return {?Element} |
| */ |
| WebInspector.highlightSearchResult = function(element, offset, length, domChanges) |
| { |
| @@ -638,6 +678,7 @@ WebInspector.highlightSearchResult = function(element, offset, length, domChange |
| * @param {!Element} element |
| * @param {!Array.<!WebInspector.SourceRange>} resultRanges |
| * @param {!Array.<!Object>=} changes |
| + * @return {!Array.<!Element>} |
| */ |
| WebInspector.highlightSearchResults = function(element, resultRanges, changes) |
| { |