OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 if (!linkText) | 170 if (!linkText) |
171 linkText = url; | 171 linkText = url; |
172 classes = (classes ? classes + " " : ""); | 172 classes = (classes ? classes + " " : ""); |
173 classes += isExternal ? "webkit-html-external-link" : "webkit-html-resource- link"; | 173 classes += isExternal ? "webkit-html-external-link" : "webkit-html-resource- link"; |
174 | 174 |
175 var a = createElement("a"); | 175 var a = createElement("a"); |
176 var href = sanitizeHref(url); | 176 var href = sanitizeHref(url); |
177 if (href !== null) | 177 if (href !== null) |
178 a.href = href; | 178 a.href = href; |
179 a.className = classes; | 179 a.className = classes; |
180 if (typeof tooltipText === "undefined") | 180 if (tooltipText && tooltipText.length) |
181 a.title = url; | |
dgozman
2015/07/30 10:31:20
This one needs explanation too.
samli
2015/08/03 01:16:26
Updated. If the url is already displayed on the pa
| |
182 else if (typeof tooltipText !== "string" || tooltipText.length) | |
183 a.title = tooltipText; | 181 a.title = tooltipText; |
184 a.textContent = linkText.trimMiddle(WebInspector.Linkifier.MaxLengthForDispl ayedURLs); | 182 a.textContent = linkText.trimMiddle(WebInspector.Linkifier.MaxLengthForDispl ayedURLs); |
185 if (isExternal) | 183 if (isExternal) |
186 a.setAttribute("target", "_blank"); | 184 a.setAttribute("target", "_blank"); |
187 | 185 |
188 return a; | 186 return a; |
189 } | 187 } |
190 | 188 |
191 /** | 189 /** |
192 * @param {string} article | 190 * @param {string} article |
(...skipping 26 matching lines...) Expand all Loading... | |
219 /** | 217 /** |
220 * @param {!WebInspector.NetworkRequest} request | 218 * @param {!WebInspector.NetworkRequest} request |
221 * @return {!Element} | 219 * @return {!Element} |
222 */ | 220 */ |
223 WebInspector.linkifyRequestAsNode = function(request) | 221 WebInspector.linkifyRequestAsNode = function(request) |
224 { | 222 { |
225 var anchor = WebInspector.linkifyURLAsNode(request.url); | 223 var anchor = WebInspector.linkifyURLAsNode(request.url); |
226 anchor.requestId = request.requestId; | 224 anchor.requestId = request.requestId; |
227 return anchor; | 225 return anchor; |
228 } | 226 } |
OLD | NEW |