Title: [188184] trunk/Source/WebInspectorUI
- Revision
- 188184
- Author
- [email protected]
- Date
- 2015-08-07 20:45:21 -0700 (Fri, 07 Aug 2015)
Log Message
Web Inspector: Don't include zero-width space into a copied text from the console
https://bugs.webkit.org/show_bug.cgi?id=147767
Reviewed by Timothy Hatcher.
Now removes work break characters in generated _javascript_ text when copying
to the clipboard. Also replaced var with let in the modified functions.
* UserInterface/Views/ConsoleCommandView.js:
(WebInspector.ConsoleCommandView.prototype.toClipboardString):
(WebInspector.ConsoleCommandView):
* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView.prototype.toClipboardString):
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (188183 => 188184)
--- trunk/Source/WebInspectorUI/ChangeLog 2015-08-08 03:06:52 UTC (rev 188183)
+++ trunk/Source/WebInspectorUI/ChangeLog 2015-08-08 03:45:21 UTC (rev 188184)
@@ -1,3 +1,19 @@
+2015-08-07 Devin Rousso <[email protected]>
+
+ Web Inspector: Don't include zero-width space into a copied text from the console
+ https://bugs.webkit.org/show_bug.cgi?id=147767
+
+ Reviewed by Timothy Hatcher.
+
+ Now removes work break characters in generated _javascript_ text when copying
+ to the clipboard. Also replaced var with let in the modified functions.
+
+ * UserInterface/Views/ConsoleCommandView.js:
+ (WebInspector.ConsoleCommandView.prototype.toClipboardString):
+ (WebInspector.ConsoleCommandView):
+ * UserInterface/Views/ConsoleMessageView.js:
+ (WebInspector.ConsoleMessageView.prototype.toClipboardString):
+
2015-08-07 Nikita Vasilyev <[email protected]>
Web Inspector: Simplify OS-specific CSS class names
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandView.js (188183 => 188184)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandView.js 2015-08-08 03:06:52 UTC (rev 188183)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandView.js 2015-08-08 03:45:21 UTC (rev 188184)
@@ -64,6 +64,6 @@
toClipboardString(isPrefixOptional)
{
- return (isPrefixOptional ? "" : "> ") + this._commandText;
+ return (isPrefixOptional ? "" : "> ") + this._commandText.removeWordBreakCharacters();
}
};
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js (188183 => 188184)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js 2015-08-08 03:06:52 UTC (rev 188183)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js 2015-08-08 03:45:21 UTC (rev 188184)
@@ -185,12 +185,14 @@
toClipboardString(isPrefixOptional)
{
- var clipboardString = this._messageTextElement.innerText;
+ let clipboardString = this._messageTextElement.innerText.removeWordBreakCharacters();
+ if (this._message.savedResultIndex)
+ clipboardString = clipboardString.replace(/\s*=\s*(\$\d+)$/, " = $1");
if (this._message.type === WebInspector.ConsoleMessage.MessageType.Trace)
clipboardString = "console.trace()";
- var hasStackTrace = this._shouldShowStackTrace();
+ let hasStackTrace = this._shouldShowStackTrace();
if (hasStackTrace) {
this._message.stackTrace.callFrames.forEach(function(frame) {
clipboardString += "\n\t" + (frame.functionName || WebInspector.UIString("(anonymous function)"));
@@ -198,10 +200,10 @@
clipboardString += " (" + WebInspector.displayNameForURL(frame.url) + ", line " + frame.lineNumber + ")";
});
} else {
- var repeatString = this.repeatCount > 1 ? "x" + this.repeatCount : "";
- var urlLine = "";
+ let repeatString = this.repeatCount > 1 ? "x" + this.repeatCount : "";
+ let urlLine = "";
if (this._message.url) {
- var components = [WebInspector.displayNameForURL(this._message.url), "line " + this._message.line];
+ let components = [WebInspector.displayNameForURL(this._message.url), "line " + this._message.line];
if (repeatString)
components.push(repeatString);
urlLine = " (" + components.join(", ") + ")";
@@ -209,7 +211,7 @@
urlLine = " (" + repeatString + ")";
if (urlLine) {
- var lines = clipboardString.split("\n");
+ let lines = clipboardString.split("\n");
lines[0] += urlLine;
clipboardString = lines.join("\n");
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes