| Index: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
|
| index 2b6e8ea46aed21c329cc08efccbef1f0628c5f70..2f04b51a1e50e18d4d3c03b5103fed38c1f62dd3 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
|
| @@ -1850,5 +1850,49 @@ WebInspector.uiLabelForPriority = function(priority)
|
| return labelMap.get(priority) || WebInspector.UIString("Unknown");
|
| }
|
|
|
| +/**
|
| + * @param {string} url
|
| + * @param {string=} linkText
|
| + * @param {string=} classes
|
| + * @param {boolean=} isExternal
|
| + * @param {string=} tooltipText
|
| + * @return {!Element}
|
| + */
|
| +WebInspector.linkifyURLAsNode = function(url, linkText, classes, isExternal, tooltipText)
|
| +{
|
| + if (!linkText)
|
| + linkText = url;
|
| +
|
| + var a = createElementWithClass("a", classes);
|
| + var href = url;
|
| + if (url.trim().toLowerCase().startsWith("javascript:"))
|
| + href = null;
|
| + if (isExternal && WebInspector.ParsedURL.isRelativeURL(url))
|
| + href = null;
|
| + if (href !== null) {
|
| + a.href = href;
|
| + a.classList.add(isExternal ? "webkit-html-external-link" : "webkit-html-resource-link");
|
| + }
|
| + if (!tooltipText && linkText !== url)
|
| + a.title = url;
|
| + else if (tooltipText)
|
| + a.title = tooltipText;
|
| + a.textContent = linkText.trimMiddle(150);
|
| + if (isExternal)
|
| + a.setAttribute("target", "_blank");
|
| +
|
| + return a;
|
| +}
|
| +
|
| +/**
|
| + * @param {string} article
|
| + * @param {string} title
|
| + * @return {!Element}
|
| + */
|
| +WebInspector.linkifyDocumentationURLAsNode = function(article, title)
|
| +{
|
| + return WebInspector.linkifyURLAsNode("https://developers.google.com/web/tools/chrome-devtools/" + article, title, undefined, true);
|
| +}
|
| +
|
| /** @type {!WebInspector.ThemeSupport} */
|
| WebInspector.themeSupport;
|
|
|