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

Side by Side Diff: lib/ui.js

Issue 10585038: First-run page (revisited) (Closed)
Patch Set: Created May 27, 2013, 4:31 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, /**Window*/ window)
631 { 631 {
632 let {Prefs} = require("prefs"); 632 let link = Utils.getDocLink(linkID);
633 let link = Prefs.documentation_link.replace(/%LINK%/g, linkID).replace(/%LAN G%/g, Utils.appLocale);
634 this.loadInBrowser(link, window); 633 this.loadInBrowser(link, window);
635 }, 634 },
636 635
637 636
638 /** 637 /**
639 * Brings up the filter composer dialog to block an item. 638 * Brings up the filter composer dialog to block an item.
640 */ 639 */
641 blockItem: function(/**Window*/ window, /**Node*/ node, /**RequestEntry*/ item ) 640 blockItem: function(/**Window*/ window, /**Node*/ node, /**RequestEntry*/ item )
642 { 641 {
643 if (!item) 642 if (!item)
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 } 743 }
745 744
746 if (!addSubscription && !addAcceptable) 745 if (!addSubscription && !addAcceptable)
747 return; 746 return;
748 747
749 function notifyUser() 748 function notifyUser()
750 { 749 {
751 let {addTab} = require("appSupport"); 750 let {addTab} = require("appSupport");
752 if (addTab) 751 if (addTab)
753 { 752 {
754 addTab(window, "chrome://adblockplus/content/ui/firstRun.xhtml"); 753 addTab(window, "chrome://adblockplus/content/ui/firstRun.html");
755 } 754 }
756 else 755 else
757 { 756 {
758 let dialogSource = '\ 757 let dialogSource = '\
759 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>\ 758 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>\
760 <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.on ly.xul" onload="document.title=content.document.title" buttons="accept" width="5 00" height="600">\ 759 <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.on ly.xul" onload="document.title=content.document.title" buttons="accept" width="5 00" height="600">\
761 <iframe type="content-primary" flex="1" src="chrome://adblockplus/co ntent/ui/firstRun.xhtml"/>\ 760 <iframe type="content-primary" flex="1" src="chrome://adblockplus/co ntent/ui/firstRun.html"/>\
762 </dialog>'; 761 </dialog>';
763 Services.ww.openWindow(window, 762 Services.ww.openWindow(window,
764 "data:application/vnd.mozilla.xul+xml," + encodeU RIComponent(dialogSource), 763 "data:application/vnd.mozilla.xul+xml," + encodeU RIComponent(dialogSource),
765 "_blank", "chrome,centerscreen,resizable,dialog=n o", null); 764 "_blank", "chrome,centerscreen,resizable,dialog=n o", null);
766 } 765 }
767 } 766 }
768 767
769 if (addSubscription) 768 if (addSubscription)
770 { 769 {
771 // Load subscriptions data 770 // Load subscriptions data
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], 1929 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)],
1931 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] 1930 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)]
1932 ]; 1931 ];
1933 1932
1934 onShutdown.add(function() 1933 onShutdown.add(function()
1935 { 1934 {
1936 for (let window in UI.applicationWindows) 1935 for (let window in UI.applicationWindows)
1937 if (UI.isBottombarOpen(window)) 1936 if (UI.isBottombarOpen(window))
1938 UI.toggleBottombar(window); 1937 UI.toggleBottombar(window);
1939 }); 1938 });
OLDNEW
« chrome/skin/firstRun.css ('K') | « chrome/skin/social/twitter.png ('k') | lib/utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld