| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * @param {!Object} revealable | 80 * @param {!Object} revealable |
| 81 * @param {string} text | 81 * @param {string} text |
| 82 * @param {string=} fallbackHref | 82 * @param {string=} fallbackHref |
| 83 * @param {number=} fallbackLineNumber | 83 * @param {number=} fallbackLineNumber |
| 84 * @param {string=} title | 84 * @param {string=} title |
| 85 * @param {string=} classes | 85 * @param {string=} classes |
| 86 * @return {!Element} | 86 * @return {!Element} |
| 87 * // FIXME: remove this suppression (crbug.com/425498). | |
| 88 * @suppressGlobalPropertiesCheck | |
| 89 */ | 87 */ |
| 90 WebInspector.Linkifier.linkifyUsingRevealer = function(revealable, text, fallbac
kHref, fallbackLineNumber, title, classes) | 88 WebInspector.Linkifier.linkifyUsingRevealer = function(revealable, text, fallbac
kHref, fallbackLineNumber, title, classes) |
| 91 { | 89 { |
| 92 var a = document.createElement("a"); | 90 var a = createElement("a"); |
| 93 a.className = (classes || "") + " webkit-html-resource-link"; | 91 a.className = (classes || "") + " webkit-html-resource-link"; |
| 94 a.textContent = text.trimMiddle(WebInspector.Linkifier.MaxLengthForDisplayed
URLs); | 92 a.textContent = text.trimMiddle(WebInspector.Linkifier.MaxLengthForDisplayed
URLs); |
| 95 a.title = title || text; | 93 a.title = title || text; |
| 96 if (fallbackHref) { | 94 if (fallbackHref) { |
| 97 a.href = fallbackHref; | 95 a.href = fallbackHref; |
| 98 a.lineNumber = fallbackLineNumber; | 96 a.lineNumber = fallbackLineNumber; |
| 99 } | 97 } |
| 100 /** | 98 /** |
| 101 * @param {!Event} event | 99 * @param {!Event} event |
| 102 * @this {Object} | 100 * @this {Object} |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 if (location) | 221 if (location) |
| 224 return this.linkifyCSSLocation(location); | 222 return this.linkifyCSSLocation(location); |
| 225 | 223 |
| 226 // The "linkedStylesheet" case. | 224 // The "linkedStylesheet" case. |
| 227 return WebInspector.linkifyResourceAsNode(media.sourceURL, undefined, un
defined, "subtitle", media.sourceURL); | 225 return WebInspector.linkifyResourceAsNode(media.sourceURL, undefined, un
defined, "subtitle", media.sourceURL); |
| 228 }, | 226 }, |
| 229 | 227 |
| 230 /** | 228 /** |
| 231 * @param {string=} classes | 229 * @param {string=} classes |
| 232 * @return {!Element} | 230 * @return {!Element} |
| 233 * // FIXME: remove this suppression (crbug.com/425498). | |
| 234 * @suppressGlobalPropertiesCheck | |
| 235 */ | 231 */ |
| 236 _createAnchor: function(classes) | 232 _createAnchor: function(classes) |
| 237 { | 233 { |
| 238 var anchor = document.createElement("a"); | 234 var anchor = createElement("a"); |
| 239 anchor.className = (classes || "") + " webkit-html-resource-link"; | 235 anchor.className = (classes || "") + " webkit-html-resource-link"; |
| 240 | 236 |
| 241 /** | 237 /** |
| 242 * @param {!Event} event | 238 * @param {!Event} event |
| 243 */ | 239 */ |
| 244 function clickHandler(event) | 240 function clickHandler(event) |
| 245 { | 241 { |
| 246 if (!anchor.__uiLocation) | 242 if (!anchor.__uiLocation) |
| 247 return; | 243 return; |
| 248 event.stopImmediatePropagation(); | 244 event.stopImmediatePropagation(); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 */ | 382 */ |
| 387 WebInspector.Linkifier.liveLocationText = function(target, scriptId, lineNumber,
columnNumber) | 383 WebInspector.Linkifier.liveLocationText = function(target, scriptId, lineNumber,
columnNumber) |
| 388 { | 384 { |
| 389 var script = target.debuggerModel.scriptForId(scriptId); | 385 var script = target.debuggerModel.scriptForId(scriptId); |
| 390 if (!script) | 386 if (!script) |
| 391 return ""; | 387 return ""; |
| 392 var location = /** @type {!WebInspector.DebuggerModel.Location} */ (target.d
ebuggerModel.createRawLocation(script, lineNumber, columnNumber || 0)); | 388 var location = /** @type {!WebInspector.DebuggerModel.Location} */ (target.d
ebuggerModel.createRawLocation(script, lineNumber, columnNumber || 0)); |
| 393 var uiLocation = /** @type {!WebInspector.UILocation} */ (WebInspector.debug
gerWorkspaceBinding.rawLocationToUILocation(location)); | 389 var uiLocation = /** @type {!WebInspector.UILocation} */ (WebInspector.debug
gerWorkspaceBinding.rawLocationToUILocation(location)); |
| 394 return uiLocation.linkText(); | 390 return uiLocation.linkText(); |
| 395 } | 391 } |
| OLD | NEW |