Index: desktop-options.js |
=================================================================== |
--- a/desktop-options.js |
+++ b/desktop-options.js |
@@ -10,17 +10,17 @@ |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU General Public License for more details. |
* |
* You should have received a copy of the GNU General Public License |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
-/* global $, i18n, i18nTimeDateStrings */ |
+/* global $, i18nTimeDateStrings */ |
"use strict"; |
/** |
* Creates a wrapping function used to conveniently send a type of message. |
* |
* @param {Object} baseMessage The part of the message that's always sent |
* @param {...string} paramKeys Any message keys that have dynamic values. The |
@@ -86,17 +86,17 @@ |
let delayedSubscriptionSelection = null; |
let acceptableAdsUrl; |
// Loads options from localStorage and sets UI elements accordingly |
function loadOptions() |
{ |
// Set page title to i18n version of "Adblock Plus Options" |
- document.title = i18n.getMessage("options"); |
+ document.title = chrome.i18n.getMessage("options"); |
// Set links |
getPref("subscriptions_exceptionsurl", url => |
{ |
acceptableAdsUrl = url; |
$("#acceptableAdsLink").attr("href", acceptableAdsUrl); |
}); |
getDocLink("acceptable_ads", url => |
@@ -300,17 +300,17 @@ |
selectedPrefix = prefix; |
} |
} |
} |
list.appendChild(option); |
} |
let option = new Option(); |
- let label = i18n.getMessage("filters_addSubscriptionOther_label"); |
+ let label = chrome.i18n.getMessage("filters_addSubscriptionOther_label"); |
option.text = label + "\u2026"; |
option._data = null; |
list.appendChild(option); |
list.selectedIndex = selectedIndex; |
if (delayedSubscriptionSelection) |
startSubscriptionSelection(...delayedSubscriptionSelection); |
@@ -360,17 +360,17 @@ |
if (data) |
addSubscription(data.url, data.title, data.homepage); |
else |
{ |
let url = document.getElementById("customSubscriptionLocation") |
.value.trim(); |
if (!/^https?:/i.test(url)) |
{ |
- alert(i18n.getMessage("global_subscription_invalid_location")); |
+ alert(chrome.i18n.getMessage("global_subscription_invalid_location")); |
$("#customSubscriptionLocation").focus(); |
return; |
} |
let title = document.getElementById("customSubscriptionTitle").value.trim(); |
if (!title) |
title = url; |
@@ -416,37 +416,37 @@ |
enabled.checked = !subscription.disabled; |
let lastUpdate = element.getElementsByClassName("subscriptionUpdate")[0]; |
lastUpdate.classList.remove("error"); |
let {downloadStatus} = subscription; |
if (subscription.isDownloading) |
{ |
- lastUpdate.textContent = i18n.getMessage( |
+ lastUpdate.textContent = chrome.i18n.getMessage( |
"filters_subscription_lastDownload_inProgress" |
); |
} |
else if (downloadStatus && downloadStatus != "synchronize_ok") |
{ |
if (statusMessages.has(downloadStatus)) |
{ |
- lastUpdate.textContent = i18n.getMessage( |
+ lastUpdate.textContent = chrome.i18n.getMessage( |
statusMessages.get(downloadStatus) |
); |
} |
else |
lastUpdate.textContent = downloadStatus; |
lastUpdate.classList.add("error"); |
} |
else if (subscription.lastDownload > 0) |
{ |
let timeDate = i18nTimeDateStrings(subscription.lastDownload * 1000); |
let messageID = (timeDate[1] ? "last_updated_at" : "last_updated_at_today"); |
- lastUpdate.textContent = i18n.getMessage(messageID, timeDate); |
+ lastUpdate.textContent = chrome.i18n.getMessage(messageID, timeDate); |
} |
} |
function onSubscriptionMessage(action, subscription) |
{ |
let element = findSubscriptionElement(subscription); |
switch (action) |
@@ -651,17 +651,17 @@ |
let removeButton = element.getElementsByClassName( |
"subscriptionRemoveButton" |
)[0]; |
removeButton.setAttribute("title", removeButton.textContent); |
removeButton.textContent = "\xD7"; |
removeButton.addEventListener("click", () => |
{ |
- if (!confirm(i18n.getMessage("global_remove_subscription_warning"))) |
+ if (!confirm(chrome.i18n.getMessage("global_remove_subscription_warning"))) |
return; |
removeSubscription(subscription.url); |
}, false); |
getPref("additional_subscriptions", additionalSubscriptions => |
{ |
if (additionalSubscriptions.includes(subscription.url)) |