diff --git a/editor/ui/dialogs/content/EdSpellCheck.js b/editor/ui/dialogs/content/EdSpellCheck.js
index f30f1d1409..57d6efc066 100644
--- a/editor/ui/dialogs/content/EdSpellCheck.js
+++ b/editor/ui/dialogs/content/EdSpellCheck.js
@@ -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()
diff --git a/suite/browser/navigator.js b/suite/browser/navigator.js
index 79615f2e61..f3bd35cbda 100644
--- a/suite/browser/navigator.js
+++ b/suite/browser/navigator.js
@@ -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);
diff --git a/suite/common/contentAreaContextOverlay.xul b/suite/common/contentAreaContextOverlay.xul
index 6bc5d07774..0012b72b7c 100644
--- a/suite/common/contentAreaContextOverlay.xul
+++ b/suite/common/contentAreaContextOverlay.xul
@@ -315,7 +315,7 @@
+ oncommand="openDictionaryList();"/>
diff --git a/suite/common/helpOverlay.js b/suite/common/helpOverlay.js
index 58c7f26e0e..d25b70a3d3 100644
--- a/suite/common/helpOverlay.js
+++ b/suite/common/helpOverlay.js
@@ -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 {
diff --git a/suite/common/nsContextMenu.js b/suite/common/nsContextMenu.js
index d24a321c24..441746e2eb 100644
--- a/suite/common/nsContextMenu.js
+++ b/suite/common/nsContextMenu.js
@@ -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;
diff --git a/suite/common/src/nsSuiteGlue.js b/suite/common/src/nsSuiteGlue.js
index bd96142f1e..e551b332f7 100644
--- a/suite/common/src/nsSuiteGlue.js
+++ b/suite/common/src/nsSuiteGlue.js
@@ -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 });
},
diff --git a/suite/common/utilityOverlay.js b/suite/common/utilityOverlay.js
index b38ecd53ea..8cf1c6f241 100644
--- a/suite/common/utilityOverlay.js
+++ b/suite/common/utilityOverlay.js
@@ -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()
{
diff --git a/suite/mailnews/compose/prefs/pref-composing_messages.js b/suite/mailnews/compose/prefs/pref-composing_messages.js
index f7f26844f3..98a0494966 100644
--- a/suite/mailnews/compose/prefs/pref-composing_messages.js
+++ b/suite/mailnews/compose/prefs/pref-composing_messages.js
@@ -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;
}
}