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

Unified Diff: messageResponder.js

Issue 29773630: Issue 5761 - Changes require paths to relative (Closed) Base URL: https://hg.adblockplus.org/adblockplusui/
Patch Set: Address PS1 comment Created May 18, 2018, 5:18 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
« background.js ('K') | « lib/antiadblockInit.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: messageResponder.js
===================================================================
--- a/messageResponder.js
+++ b/messageResponder.js
@@ -16,39 +16,40 @@
*/
/* globals require */
"use strict";
(function(global)
{
- const {port} = require("messaging");
- const {Prefs} = require("prefs");
- const {Utils} = require("utils");
- const {FilterStorage} = require("filterStorage");
- const {FilterNotifier} = require("filterNotifier");
- const {defaultMatcher} = require("matcher");
- const {Notification: NotificationStorage} = require("notification");
+ const {port} = require("../lib/messaging");
+ const {Prefs} = require("../lib/prefs");
+ const {Utils} = require("../lib/utils");
+ const {FilterStorage} = require("../adblockpluscore/lib/filterStorage");
Thomas Greiner 2018/07/26 10:07:59 It'd be great if we could avoid hardcoding the loc
+ const {FilterNotifier} = require("../adblockpluscore/lib/filterNotifier");
+ const {defaultMatcher} = require("../adblockpluscore/lib/matcher");
+ const {Notification:
+ NotificationStorage} = require("../adblockpluscore/lib/notification");
const {getActiveNotification, shouldDisplay,
- notificationClicked} = require("notificationHelper");
+ notificationClicked} = require("../lib/notificationHelper");
const {
Filter, ActiveFilter, BlockingFilter, RegExpFilter
- } = require("filterClasses");
- const {Synchronizer} = require("synchronizer");
+ } = require("../adblockpluscore/lib/filterClasses");
+ const {Synchronizer} = require("../adblockpluscore/lib/synchronizer");
const info = require("info");
const {
Subscription,
DownloadableSubscription,
SpecialSubscription
- } = require("subscriptionClasses");
+ } = require("../adblockpluscore/lib/subscriptionClasses");
- const {showOptions} = require("options");
+ const {showOptions} = require("../lib/options");
port.on("types.get", (message, sender) =>
{
let filterTypes = Array.from(require("requestBlocker").filterTypes);
filterTypes.push(...filterTypes.splice(filterTypes.indexOf("OTHER"), 1));
return filterTypes;
});
@@ -151,17 +152,17 @@
!subscription.lastDownload)
Synchronizer.execute(subscription);
}
port.on("app.get", (message, sender) =>
{
if (message.what == "issues")
{
- let subscriptionInit = require("subscriptionInit");
+ let subscriptionInit = require("../lib/subscriptionInit");
return {
dataCorrupted: subscriptionInit.isDataCorrupted(),
filterlistsReinitialized: subscriptionInit.isReinitialized()
};
}
if (message.what == "doclink")
{
@@ -214,17 +215,17 @@
sendMessage("app", message.action, ...message.args);
});
}
});
port.on("filters.add", (message, sender) =>
{
- let result = require("filterValidation").parseFilter(message.text);
+ let result = require("../lib/filterValidation").parseFilter(message.text);
let errors = [];
if (result.error)
errors.push(result.error.toString());
else if (result.filter)
FilterStorage.addFilter(result.filter);
return errors;
});
@@ -244,17 +245,17 @@
if (!subscription)
return [];
return subscription.filters.map(convertFilter);
});
port.on("filters.importRaw", (message, sender) =>
{
- let result = require("filterValidation").parseFilters(message.text);
+ let result = require("../lib/filterValidation").parseFilters(message.text);
let errors = [];
for (let error of result.errors)
{
if (error.type != "unexpected-filter-list-header")
errors.push(error.toString());
}
if (errors.length > 0)
« background.js ('K') | « lib/antiadblockInit.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld