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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 change.oldValue = event.oldValue; | 556 change.oldValue = event.oldValue; |
557 if (event.newValue != null) | 557 if (event.newValue != null) |
558 change.newValue = event.newValue; | 558 change.newValue = event.newValue; |
559 | 559 |
560 ext.storage.onChanged._dispatch(changes); | 560 ext.storage.onChanged._dispatch(changes); |
561 }); | 561 }); |
562 | 562 |
563 | 563 |
564 /* Options */ | 564 /* Options */ |
565 | 565 |
566 ext.showOptions = function(callback) | 566 ext.showOptions = function(newOptionsPage, callback) |
567 { | 567 { |
568 var optionsUrl = safari.extension.baseURI + "options.html"; | 568 var optionsUrl = safari.extension.baseURI + |
| 569 (newOptionsPage ? "new-" : "") + "options.html"; |
569 | 570 |
570 for (var id in pages) | 571 for (var id in pages) |
571 { | 572 { |
572 var page = pages[id]; | 573 var page = pages[id]; |
573 var tab = page._tab; | 574 var tab = page._tab; |
574 | 575 |
575 if (page.url.href == optionsUrl && tab.browserWindow == safari.application
.activeBrowserWindow) | 576 if (page.url.href == optionsUrl && tab.browserWindow == safari.application
.activeBrowserWindow) |
576 { | 577 { |
577 tab.activate(); | 578 tab.activate(); |
578 if (callback) | 579 if (callback) |
579 callback(page); | 580 callback(page); |
580 return; | 581 return; |
581 } | 582 } |
582 } | 583 } |
583 | 584 |
584 ext.pages.open(optionsUrl, callback); | 585 ext.pages.open(optionsUrl, callback); |
585 }; | 586 }; |
586 | 587 |
587 /* Windows */ | 588 /* Windows */ |
588 ext.windows = { | 589 ext.windows = { |
589 // Safari doesn't provide as rich a windows API as Chrome does, so instead | 590 // Safari doesn't provide as rich a windows API as Chrome does, so instead |
590 // of chrome.windows.create we have to fall back to just opening a new tab. | 591 // of chrome.windows.create we have to fall back to just opening a new tab. |
591 create: function(createData, callback) | 592 create: function(createData, callback) |
592 { | 593 { |
593 ext.pages.open(createData.url, callback); | 594 ext.pages.open(createData.url, callback); |
594 } | 595 } |
595 }; | 596 }; |
596 })(); | 597 })(); |
OLD | NEW |