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

Unified Diff: new-options.js

Issue 29519650: Issue 5540 - implement notification (Closed)
Patch Set: Rebased Created Aug. 25, 2017, 1:47 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 | « new-options.html ('k') | skin/delete.svg » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: new-options.js
===================================================================
--- a/new-options.js
+++ b/new-options.js
@@ -432,6 +432,11 @@
{
filter.title = match[1];
collections.whitelist.addItem(filter);
+ if (isCustomFiltersLoaded)
+ {
+ let text = getMessage("options_whitelist_notification", [filter.title]);
+ showNotification(text);
+ }
}
else
{
@@ -585,6 +590,9 @@
case "edit-custom-filters":
setCustomFiltersView("write");
break;
+ case "hide-notification":
+ hideNotification();
+ break;
case "import-subscription": {
let url = E("blockingList-textbox").value;
addEnableSubscription(url);
@@ -975,6 +983,19 @@
focusedBeforeDialog.focus();
}
+ function showNotification(text)
+ {
+ E("notification").setAttribute("aria-hidden", false);
+ E("notification-text").textContent = text;
+ setTimeout(hideNotification, 3000);
+ }
+
+ function hideNotification()
+ {
+ E("notification").setAttribute("aria-hidden", true);
+ E("notification-text").textContent = "";
+ }
+
function setAcceptableAds()
{
let option = "none";
« no previous file with comments | « new-options.html ('k') | skin/delete.svg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld