Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: options.js

Issue 6438904399921152: Issue 1674 - Use String.trim() to strip leading and trailing whitespaces (Chrome/Opera/Safari) (Closed)
Patch Set: Created Dec. 8, 2014, 5:02 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include.postload.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: options.js
===================================================================
--- a/options.js
+++ b/options.js
@@ -260,7 +260,7 @@
doAddSubscription(data.url, data.title, data.homepage);
else
{
- var url = document.getElementById("customSubscriptionLocation").value.replace(/^\s+/, "").replace(/\s+$/, "");
+ var url = document.getElementById("customSubscriptionLocation").value.trim();
if (!/^https?:/i.test(url))
{
alert(i18n.getMessage("global_subscription_invalid_location"));
@@ -268,7 +268,7 @@
return;
}
- var title = document.getElementById("customSubscriptionTitle").value.replace(/^\s+/, "").replace(/\s+$/, "");
+ var title = document.getElementById("customSubscriptionTitle").value.trim();
if (!title)
title = url;
« no previous file with comments | « include.postload.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld