Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js

Issue 2571713005: DevTools: untruncate links on console export (Closed)
Patch Set: test desc Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after
1933 event.consume(true); 1933 event.consume(true);
1934 InspectorFrontendHost.openInNewTab(/** @type {string} */ (href)); 1934 InspectorFrontendHost.openInNewTab(/** @type {string} */ (href));
1935 }, false); 1935 }, false);
1936 } else { 1936 } else {
1937 a.classList.add('devtools-link-prevent-click'); 1937 a.classList.add('devtools-link-prevent-click');
1938 } 1938 }
1939 a[UI._externalLinkSymbol] = true; 1939 a[UI._externalLinkSymbol] = true;
1940 } 1940 }
1941 if (linkText !== url) 1941 if (linkText !== url)
1942 a.title = url; 1942 a.title = url;
1943 a.textContent = linkText.trimMiddle(150); 1943 a.textContent = linkText.trimMiddle(UI.MaxLengthForDisplayedURLs);
1944 a.setAttribute('target', '_blank'); 1944 a.setAttribute('target', '_blank');
1945 1945
1946 return a; 1946 return a;
1947 }; 1947 };
1948 1948
1949 UI._externalLinkSymbol = Symbol('UI._externalLink'); 1949 UI._externalLinkSymbol = Symbol('UI._externalLink');
1950 1950
1951 /** 1951 /**
1952 * @implements {UI.ContextMenu.Provider} 1952 * @implements {UI.ContextMenu.Provider}
1953 * @unrestricted 1953 * @unrestricted
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1988 return new Promise(fulfill => { 1988 return new Promise(fulfill => {
1989 var image = new Image(); 1989 var image = new Image();
1990 image.addEventListener('load', () => fulfill(image)); 1990 image.addEventListener('load', () => fulfill(image));
1991 image.addEventListener('error', () => fulfill(null)); 1991 image.addEventListener('error', () => fulfill(null));
1992 image.src = url; 1992 image.src = url;
1993 }); 1993 });
1994 }; 1994 };
1995 1995
1996 /** @type {!UI.ThemeSupport} */ 1996 /** @type {!UI.ThemeSupport} */
1997 UI.themeSupport; 1997 UI.themeSupport;
1998
1999 /**
2000 * The maximum number of characters to display in a URL.
dgozman 2017/01/10 01:03:30 Let's remove the comment.
luoe 2017/01/10 22:21:44 Done.
2001 * @const
2002 * @type {number}
2003 */
2004 UI.MaxLengthForDisplayedURLs = 150;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698