OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the Adblock Plus, | 2 * This file is part of the Adblock Plus, |
3 * Copyright (C) 2006-2012 Eyeo GmbH | 3 * Copyright (C) 2006-2012 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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 let protocolService = Cc["@mozilla.org/uriloader/external-protocol-service
;1"].getService(Ci.nsIExternalProtocolService); | 620 let protocolService = Cc["@mozilla.org/uriloader/external-protocol-service
;1"].getService(Ci.nsIExternalProtocolService); |
621 protocolService.loadURI(Services.io.newURI(url, null, null), null); | 621 protocolService.loadURI(Services.io.newURI(url, null, null), null); |
622 } | 622 } |
623 }, | 623 }, |
624 | 624 |
625 /** | 625 /** |
626 * Opens a pre-defined documentation link in the browser window. This will | 626 * Opens a pre-defined documentation link in the browser window. This will |
627 * send the UI language to adblockplus.org so that the correct language | 627 * send the UI language to adblockplus.org so that the correct language |
628 * version of the page can be selected. | 628 * version of the page can be selected. |
629 */ | 629 */ |
630 loadDocLink: function(/**String*/ linkID, /**Window*/ window) | 630 loadDocLink: function(/**String*/ linkID, /**String*/ anchorID, /**Window*/ wi
ndow) |
631 { | 631 { |
632 let {Prefs} = require("prefs"); | 632 let {Prefs} = require("prefs"); |
633 let link = Prefs.documentation_link.replace(/%LINK%/g, linkID).replace(/%LAN
G%/g, Utils.appLocale); | 633 let anchor = anchorID && anchorID.length > 0 ? '#' + anchorID : ''; |
| 634 let link = Prefs.documentation_link.replace(/%LINK%/g, linkID).replace(/%ANC
HOR%/g, anchor).replace(/%LANG%/g, Utils.appLocale); |
634 this.loadInBrowser(link, window); | 635 this.loadInBrowser(link, window); |
635 }, | 636 }, |
636 | 637 |
637 | 638 |
638 /** | 639 /** |
639 * Brings up the filter composer dialog to block an item. | 640 * Brings up the filter composer dialog to block an item. |
640 */ | 641 */ |
641 blockItem: function(/**Window*/ window, /**Node*/ node, /**RequestEntry*/ item
) | 642 blockItem: function(/**Window*/ window, /**Node*/ node, /**RequestEntry*/ item
) |
642 { | 643 { |
643 if (!item) | 644 if (!item) |
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1922 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], | 1923 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], |
1923 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] | 1924 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] |
1924 ]; | 1925 ]; |
1925 | 1926 |
1926 onShutdown.add(function() | 1927 onShutdown.add(function() |
1927 { | 1928 { |
1928 for (let window in UI.applicationWindows) | 1929 for (let window in UI.applicationWindows) |
1929 if (UI.isBottombarOpen(window)) | 1930 if (UI.isBottombarOpen(window)) |
1930 UI.toggleBottombar(window); | 1931 UI.toggleBottombar(window); |
1931 }); | 1932 }); |
OLD | NEW |