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

Side by Side Diff: chrome/content/ui/filters-subscriptionactions.js

Issue 5325266087837696: Issue 1675 - Use String.trim() to strip leading and trailing whitespaces (Firefox) (Closed)
Patch Set: Created Dec. 8, 2014, 5:24 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/content/ui/subscriptionSelection.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 if (!this.subscriptionEdited) 437 if (!this.subscriptionEdited)
438 return; 438 return;
439 439
440 let subscriptionNode = this.subscriptionEdited; 440 let subscriptionNode = this.subscriptionEdited;
441 this.subscriptionEdited = null; 441 this.subscriptionEdited = null;
442 442
443 let newTitle = null; 443 let newTitle = null;
444 if (save) 444 if (save)
445 { 445 {
446 newTitle = subscriptionNode.getElementsByClassName("titleEditor")[0].value ; 446 newTitle = subscriptionNode.getElementsByClassName("titleEditor")[0].value ;
447 newTitle = newTitle.replace(/^\s+/, "").replace(/\s+$/, ""); 447 newTitle = newTitle.trim();
448 } 448 }
449 449
450 let subscription = Templater.getDataForNode(subscriptionNode).subscription 450 let subscription = Templater.getDataForNode(subscriptionNode).subscription
451 if (newTitle && newTitle != subscription.title) 451 if (newTitle && newTitle != subscription.title)
452 subscription.title = newTitle; 452 subscription.title = newTitle;
453 else 453 else
454 { 454 {
455 subscriptionNode.getElementsByClassName("titleBox")[0].selectedIndex = 0; 455 subscriptionNode.getElementsByClassName("titleBox")[0].selectedIndex = 0;
456 subscriptionNode.parentNode.focus(); 456 subscriptionNode.parentNode.focus();
457 } 457 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 return; 597 return;
598 598
599 if (event.keyCode == event.DOM_VK_RETURN || event.keyCode == event.DOM_VK_EN TER) 599 if (event.keyCode == event.DOM_VK_RETURN || event.keyCode == event.DOM_VK_EN TER)
600 { 600 {
601 // This shouldn't accept our dialog, only the panel 601 // This shouldn't accept our dialog, only the panel
602 event.preventDefault(); 602 event.preventDefault();
603 E("selectSubscriptionAccept").doCommand(); 603 E("selectSubscriptionAccept").doCommand();
604 } 604 }
605 } 605 }
606 }; 606 };
OLDNEW
« no previous file with comments | « no previous file | chrome/content/ui/subscriptionSelection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld