OLD | NEW |
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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 E("filtersTree").focus(); | 223 E("filtersTree").focus(); |
224 }, | 224 }, |
225 scrollByLines: function(num) | 225 scrollByLines: function(num) |
226 { | 226 { |
227 E("filtersTree").boxObject.scrollByLines(num); | 227 E("filtersTree").boxObject.scrollByLines(num); |
228 }, | 228 }, |
229 scrollByPages: function(num) | 229 scrollByPages: function(num) |
230 { | 230 { |
231 E("filtersTree").boxObject.scrollByPages(num); | 231 E("filtersTree").boxObject.scrollByPages(num); |
232 }, | 232 }, |
| 233 }, |
| 234 |
| 235 messageManager: |
| 236 { |
| 237 _messageMap: { |
| 238 "Findbar:Mouseup": "mouseup", |
| 239 "Findbar:Keypress": "keypress" |
| 240 }, |
| 241 |
| 242 _messageFromEvent: function(event) |
| 243 { |
| 244 for (let message in this._messageMap) |
| 245 if (this._messageMap[message] == event.type) |
| 246 return {target: event.currentTarget, name: message, data: event}; |
| 247 return null; |
| 248 }, |
| 249 |
| 250 addMessageListener: function(message, listener) |
| 251 { |
| 252 if (!this._messageMap.hasOwnProperty(message)) |
| 253 return; |
| 254 |
| 255 if (!("_ABPHandler" in listener)) |
| 256 listener._ABPHandler = (event) => listener.receiveMessage(this._messageF
romEvent(event)); |
| 257 |
| 258 E("filtersTree").addEventListener(this._messageMap[message], listener._ABP
Handler, false); |
| 259 }, |
| 260 |
| 261 removeMessageListener: function(message, listener) |
| 262 { |
| 263 if (this._messageMap.hasOwnProperty(message) && listener._ABPHandler) |
| 264 E("filtersTree").removeEventListener(this._messageMap[message], listener
._ABPHandler, false); |
| 265 }, |
| 266 |
| 267 sendAsyncMessage: function() {} |
233 } | 268 } |
234 }; | 269 }; |
235 | 270 |
236 window.addEventListener("load", function() | 271 window.addEventListener("load", function() |
237 { | 272 { |
238 FilterSearch.init(); | 273 FilterSearch.init(); |
239 }, false); | 274 }, false); |
OLD | NEW |