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: Created Aug. 24, 2017, 6:39 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
« new-options.html ('K') | « 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
{
@@ -588,6 +593,9 @@
case "edit-custom-filters":
setCustomFiltersView("write");
break;
+ case "hide-notification":
+ hideNotification();
+ break;
case "import-subscription": {
let url = E("blockingList-textbox").value;
addEnableSubscription(url);
@@ -993,6 +1001,19 @@
focusedBeforeDialog.focus();
}
+ function showNotification(text)
ire 2017/08/25 09:59:45 This doesn't need to hold up this review, but we c
saroyanm 2017/08/25 11:04:19 It's bit difficult because we don't know where is
ire 2017/08/25 12:10:07 Okay good point. In light of what you said, I thin
saroyanm 2017/08/25 12:22:55 I agree
+ {
+ 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";
« new-options.html ('K') | « new-options.html ('k') | skin/delete.svg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld