зеркало из https://github.com/mozilla/pjs.git
Bug 127337. Restore Default for Home Page button in Navigator. Patch by Stephen Walker <walk84@yahoo.com> r=samir, sr=alecf.
This commit is contained in:
Родитель
ca010d46df
Коммит
a7c75d51bc
|
@ -4,9 +4,12 @@
|
|||
|
||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
const nsIWindowMediator = Components.interfaces.nsIWindowMediator;
|
||||
const nsIPrefService = Components.interfaces.nsIPrefService;
|
||||
const nsIPrefLocalizedString = Components.interfaces.nsIPrefLocalizedString;
|
||||
|
||||
const FILEPICKER_CONTRACTID = "@mozilla.org/filepicker;1";
|
||||
const WINDOWMEDIATOR_CONTRACTID = "@mozilla.org/appshell/window-mediator;1";
|
||||
const PREFSERVICE_CONTRACTID = "@mozilla.org/preferences-service;1";
|
||||
|
||||
function selectFile()
|
||||
{
|
||||
|
@ -42,3 +45,16 @@ function setHomePageToCurrentPage()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setHomePageToDefaultPage()
|
||||
{
|
||||
var prefService = Components.classes[PREFSERVICE_CONTRACTID]
|
||||
.getService(nsIPrefService);
|
||||
var pref = prefService.getDefaultBranch(null);
|
||||
var url = pref.getComplexValue("browser.startup.homepage",
|
||||
nsIPrefLocalizedString).data;
|
||||
var homePageField = document.getElementById("browserStartupHomepage");
|
||||
homePageField.value = url;
|
||||
}
|
||||
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
var _elementIDs = ["startupPage", "browserStartupHomepage",
|
||||
"bookmarksButton", "goButton",
|
||||
"homeButton", "printButton",
|
||||
"searchButton" ];
|
||||
"searchButton"];
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
@ -75,6 +75,10 @@
|
|||
oncommand="selectFile();"
|
||||
id="browserChooseFile"
|
||||
prefstring="pref.browser.homepage.disable_button.select_file"/>
|
||||
<button label="&useDefault.label;" accesskey="&useDefault.accesskey;"
|
||||
oncommand="setHomePageToDefaultPage();"
|
||||
id="browserUseDefault"
|
||||
prefstring="pref.browser.homepage.disable_button.default_page"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
<!ENTITY useCurrent.accesskey "u">
|
||||
<!ENTITY browseFile.label "Choose File...">
|
||||
<!ENTITY browseFile.accesskey "c">
|
||||
<!ENTITY useDefault.label "Restore Default">
|
||||
<!ENTITY useDefault.accesskey "r">
|
||||
|
||||
<!ENTITY toolbarIntro.label "Select the buttons you want to see in the toolbars">
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче