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

Side by Side Diff: lib/notificationHelper.js

Issue 29338190: Issue 3697 - Fall back to i18n.getUILanguage if @ui_locale isn't supported (Closed)
Patch Set: Remove Safari redundancy and Firefox specific codepath Created March 17, 2016, 5:38 a.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 | lib/utils.js » ('j') | lib/utils.js » ('J')
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 <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 } 204 }
205 else if ("Notification" in window && activeNotification.type != "question") 205 else if ("Notification" in window && activeNotification.type != "question")
206 { 206 {
207 if (linkCount > 0) 207 if (linkCount > 0)
208 message += " " + ext.i18n.getMessage("notification_without_buttons"); 208 message += " " + ext.i18n.getMessage("notification_without_buttons");
209 209
210 let notification = new Notification( 210 let notification = new Notification(
211 title, 211 title,
212 { 212 {
213 lang: Utils.appLocale, 213 lang: Utils.appLocale,
214 dir: ext.i18n.getMessage("@@bidi_dir"), 214 dir: Utils.readingDirection,
215 body: message, 215 body: message,
216 icon: iconUrl 216 icon: iconUrl
217 } 217 }
218 ); 218 );
219 219
220 notification.addEventListener("click", openNotificationLinks); 220 notification.addEventListener("click", openNotificationLinks);
221 notification.addEventListener("close", notificationClosed); 221 notification.addEventListener("close", notificationClosed);
222 } 222 }
223 else 223 else
224 { 224 {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 * @param {string} notificationType 275 * @param {string} notificationType
276 * @return {boolean} 276 * @return {boolean}
277 */ 277 */
278 exports.shouldDisplay = function(method, notificationType) 278 exports.shouldDisplay = function(method, notificationType)
279 { 279 {
280 let methods = displayMethods[notificationType] || defaultDisplayMethods; 280 let methods = displayMethods[notificationType] || defaultDisplayMethods;
281 return methods.indexOf(method) > -1; 281 return methods.indexOf(method) > -1;
282 }; 282 };
283 283
284 NotificationStorage.addShowListener(showNotification); 284 NotificationStorage.addShowListener(showNotification);
OLDNEW
« no previous file with comments | « no previous file | lib/utils.js » ('j') | lib/utils.js » ('J')

Powered by Google App Engine
This is Rietveld