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

Unified Diff: Source/WebCore/inspector/front-end/utilities.js

Issue 7218041: Merge 89666 - 2011-06-23 Mikhail Naganov <mnaganov@chromium.org> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/inspector/front-end/DetailedHeapshotView.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/front-end/utilities.js
===================================================================
--- Source/WebCore/inspector/front-end/utilities.js (revision 89996)
+++ Source/WebCore/inspector/front-end/utilities.js (working copy)
@@ -451,6 +451,15 @@
return this.replace(/[\s\xA0]+/g, " ");
}
+String.prototype.trimMiddle = function(maxLength)
+{
+ if (this.length <= maxLength)
+ return this;
+ var leftHalf = maxLength >> 1;
+ var rightHalf = maxLength - leftHalf - 1;
+ return this.substr(0, leftHalf) + "\u2026" + this.substr(this.length - rightHalf, rightHalf);
+}
+
String.prototype.trimURL = function(baseURLDomain)
{
var result = this.replace(/^(https|http|file):\/\//i, "");
« no previous file with comments | « Source/WebCore/inspector/front-end/DetailedHeapshotView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698