Bug 665290 - Switch suite/mailnews to use Services.urlFormatter r=neil/standard8
This commit is contained in:
Родитель
87962bad0c
Коммит
99cdc09e2c
|
@ -451,29 +451,17 @@ function EditDictionary()
|
|||
|
||||
function SelectLanguage()
|
||||
{
|
||||
try {
|
||||
var item = gDialog.LanguageMenulist.selectedItem;
|
||||
if (item.value != "more-cmd") {
|
||||
gSpellChecker.SetCurrentDictionary(item.value);
|
||||
gLastSelectedLang = item;
|
||||
}
|
||||
else {
|
||||
openURL(getDictionaryURL());
|
||||
|
||||
if (gLastSelectedLang)
|
||||
gDialog.LanguageMenulist.selectedItem = gLastSelectedLang;
|
||||
}
|
||||
} catch (ex) {
|
||||
dump(ex);
|
||||
var item = gDialog.LanguageMenulist.selectedItem;
|
||||
if (item.value != "more-cmd") {
|
||||
gSpellChecker.SetCurrentDictionary(item.value);
|
||||
gLastSelectedLang = item;
|
||||
}
|
||||
}
|
||||
else {
|
||||
openDictionaryList();
|
||||
|
||||
function getDictionaryURL()
|
||||
{
|
||||
var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
|
||||
.getService(Components.interfaces.nsIURLFormatter);
|
||||
|
||||
return formatter.formatURLPref("spellchecker.dictionaries.download.url");
|
||||
if (gLastSelectedLang)
|
||||
gDialog.LanguageMenulist.selectedItem = gLastSelectedLang;
|
||||
}
|
||||
}
|
||||
|
||||
function Recheck()
|
||||
|
|
|
@ -2188,9 +2188,7 @@ function getNewThemes()
|
|||
{
|
||||
// get URL for more themes from prefs
|
||||
try {
|
||||
var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
|
||||
.getService(Components.interfaces.nsIURLFormatter);
|
||||
openTopWin(formatter.formatURLPref("extensions.getMoreThemesURL"));
|
||||
openTopWin(Services.urlFormatter.formatURLPref("extensions.getMoreThemesURL"));
|
||||
}
|
||||
catch (ex) {
|
||||
dump(ex);
|
||||
|
|
|
@ -315,7 +315,7 @@
|
|||
<menuitem id="spell-add-dictionaries-main"
|
||||
label="&spellAddDictionaries.label;"
|
||||
accesskey="&spellAddDictionaries.accesskey;"
|
||||
oncommand="gContextMenu.addDictionaries();"/>
|
||||
oncommand="openDictionaryList();"/>
|
||||
<menu id="spell-dictionaries"
|
||||
label="&spellDictionaries.label;"
|
||||
accesskey="&spellDictionaries.accesskey;">
|
||||
|
@ -324,7 +324,7 @@
|
|||
<menuitem id="spell-add-dictionaries"
|
||||
label="&spellAddDictionaries.label;"
|
||||
accesskey="&spellAddDictionaries.accesskey;"
|
||||
oncommand="gContextMenu.addDictionaries();"/>
|
||||
oncommand="openDictionaryList();"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuseparator hidden="true" id="context-sep-bidi"/>
|
||||
|
|
|
@ -91,11 +91,9 @@ function contentClick(event) {
|
|||
if (target.href.lastIndexOf("chrome:", 0) == 0)
|
||||
return true;
|
||||
|
||||
var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
|
||||
.getService(Components.interfaces.nsIURLFormatter);
|
||||
var uri = target.href;
|
||||
if (/^x-moz-url-link:/.test(uri))
|
||||
uri = formatter.formatURLPref(RegExp.rightContext);
|
||||
uri = Services.urlFormatter.formatURLPref(RegExp.rightContext);
|
||||
|
||||
const loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_IS_LINK;
|
||||
try {
|
||||
|
|
|
@ -1310,16 +1310,6 @@ nsContextMenu.prototype = {
|
|||
return false;
|
||||
},
|
||||
|
||||
addDictionaries: function() {
|
||||
try {
|
||||
var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
|
||||
.getService(Components.interfaces.nsIURLFormatter);
|
||||
var url = formatter.formatURLPref("spellchecker.dictionaries.download.url");
|
||||
window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", url);
|
||||
}
|
||||
catch (ex) {}
|
||||
},
|
||||
|
||||
mediaCommand: function(aCommand) {
|
||||
var media = this.target;
|
||||
|
||||
|
|
|
@ -486,9 +486,7 @@ SuiteGlue.prototype = {
|
|||
_showPluginUpdatePage: function(aWindow) {
|
||||
Services.prefs.setBoolPref("plugins.update.notifyUser", false);
|
||||
|
||||
var url = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
|
||||
.getService(Components.interfaces.nsIURLFormatter)
|
||||
.formatURLPref("plugins.update.url");
|
||||
var url = Services.urlFormatter.formatURLPref("plugins.update.url");
|
||||
|
||||
aWindow.getBrowser().addTab(url, { focusNewTab: true });
|
||||
},
|
||||
|
|
|
@ -671,13 +671,21 @@ function goReleaseNotes()
|
|||
{
|
||||
// get release notes URL from prefs
|
||||
try {
|
||||
var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
|
||||
.getService(Components.interfaces.nsIURLFormatter);
|
||||
openUILink(formatter.formatURLPref("app.releaseNotesURL"));
|
||||
openUILink(Services.urlFormatter.formatURLPref("app.releaseNotesURL"));
|
||||
}
|
||||
catch (ex) { dump(ex); }
|
||||
}
|
||||
|
||||
function openDictionaryList()
|
||||
{
|
||||
try {
|
||||
openAsExternal(Services.urlFormatter.formatURLPref("spellchecker.dictionaries.download.url"));
|
||||
}
|
||||
catch (ex) {
|
||||
dump(ex);
|
||||
}
|
||||
}
|
||||
|
||||
// Prompt user to restart the browser in safe mode
|
||||
function safeModeRestart()
|
||||
{
|
||||
|
|
|
@ -162,17 +162,11 @@ function InitLanguageMenu() {
|
|||
}
|
||||
|
||||
function SelectLanguage(aTarget) {
|
||||
try {
|
||||
if (aTarget.value != "more-cmd")
|
||||
gLastSelectedLang = aTarget;
|
||||
else {
|
||||
var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
|
||||
.getService(Components.interfaces.nsIURLFormatter);
|
||||
window.open(formatter.formatURLPref("spellchecker.dictionaries.download.url"));
|
||||
if (gLastSelectedLang)
|
||||
document.getElementById("languageMenuList").selectedItem = gLastSelectedLang;
|
||||
}
|
||||
} catch (ex) {
|
||||
dump(ex);
|
||||
if (aTarget.value != "more-cmd")
|
||||
gLastSelectedLang = aTarget;
|
||||
else {
|
||||
openDictionaryList();
|
||||
if (gLastSelectedLang)
|
||||
document.getElementById("languageMenuList").selectedItem = gLastSelectedLang;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче