| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This Source Code is subject to the terms of the Mozilla Public License | 2 * This Source Code is subject to the terms of the Mozilla Public License |
| 3 * version 2.0 (the "License"). You can obtain a copy of the License at | 3 * version 2.0 (the "License"). You can obtain a copy of the License at |
| 4 * http://mozilla.org/MPL/2.0/. | 4 * http://mozilla.org/MPL/2.0/. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 let {Prefs} = require("prefs"); | 7 let {Prefs} = require("prefs"); |
| 8 | 8 |
| 9 let domainData; | 9 let domainData; |
| 10 let nodeData; | 10 let nodeData; |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 if (advancedMode) | 486 if (advancedMode) |
| 487 { | 487 { |
| 488 // Add custom CSS entry | 488 // Add custom CSS entry |
| 489 node = createAttribute("advanced", nodeData.customCSS, list.getAttribute("_l
abelcustom"), nodeData.customCSS.selected); | 489 node = createAttribute("advanced", nodeData.customCSS, list.getAttribute("_l
abelcustom"), nodeData.customCSS.selected); |
| 490 list.appendChild(node); | 490 list.appendChild(node); |
| 491 } | 491 } |
| 492 } | 492 } |
| 493 | 493 |
| 494 function togglePreview(preview, forgetNode) | 494 function togglePreview(preview, forgetNode) |
| 495 { | 495 { |
| 496 Services.mm.broadcastAsyncMessage("ElemHideHelper:Preview", { | 496 let messageManager = Cc["@mozilla.org/globalmessagemanager;1"] |
| 497 .getService(Ci.nsIMessageBroadcaster); |
| 498 messageManager.broadcastAsyncMessage("ElemHideHelper:Preview", { |
| 497 nodeID: nodeID, | 499 nodeID: nodeID, |
| 498 stylesheetData: preview ? stylesheetData : null, | 500 stylesheetData: preview ? stylesheetData : null, |
| 499 forgetNode: !!forgetNode | 501 forgetNode: !!forgetNode |
| 500 }); | 502 }); |
| 501 } | 503 } |
| 502 | 504 |
| 503 function changeDomain(node) { | 505 function changeDomain(node) { |
| 504 domainData.selected = node.getAttribute("value"); | 506 domainData.selected = node.getAttribute("value"); |
| 505 updateExpression(); | 507 updateExpression(); |
| 506 } | 508 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 | 567 |
| 566 fillAttributes(item.nodeData); | 568 fillAttributes(item.nodeData); |
| 567 } | 569 } |
| 568 | 570 |
| 569 function addExpression() | 571 function addExpression() |
| 570 { | 572 { |
| 571 AdblockPlus.addPatterns([document.getElementById("expression").value]); | 573 AdblockPlus.addPatterns([document.getElementById("expression").value]); |
| 572 | 574 |
| 573 togglePreview(false); | 575 togglePreview(false); |
| 574 } | 576 } |
| OLD | NEW |