Simplify GetString() method in Composer, b=133546, r=brade, sr=kin, a=asa

This commit is contained in:
cmanske%netscape.com 2002-03-26 21:19:28 +00:00
Родитель 54f6178b7a
Коммит a89a6d15ab
9 изменённых файлов: 16 добавлений и 43 удалений

Просмотреть файл

@ -57,7 +57,6 @@
<script type="application/x-javascript" src="chrome://editor/content/editor.js"/>
<script type="application/x-javascript" src="chrome://editor/content/ComposerCommands.js"/>
<script type="application/x-javascript" src="chrome://editor/content/EditorCommandsDebug.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaDD.js"/>

Просмотреть файл

@ -68,7 +68,6 @@
<script type="application/x-javascript" src="chrome://editor/content/EditorContextMenu.js"/>
<script type="application/x-javascript" src="chrome://editor/content/editorApplicationOverlay.js"/>
<script type="application/x-javascript" src="chrome://editor/content/publishprefs.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaDD.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaClick.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsJSSupportsUtils.js"/>

Просмотреть файл

@ -22,13 +22,6 @@
* Brian King
* Daniel Glazman <glazman@netscape.com>
*/
/*
if we ever need to use a different string bundle, use srGetStrBundle
by including
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
e.g.:
var bundle = srGetStrBundle("chrome://global/locale/filepicker.properties");
*/
/**** NAMESPACES ****/
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
@ -95,21 +88,20 @@ function ConfirmWithTitle(title, message, okButtonText, cancelButtonText)
function GetString(name)
{
if (editorShell)
if (!gStringBundle)
{
try {
return editorShell.GetString(name);
} catch (e) {}
var strBundleService =
Components.classes["@mozilla.org/intl/stringbundle;1"].getService();
strBundleService =
strBundleService.QueryInterface(Components.interfaces.nsIStringBundleService);
gStringBundle = strBundleService.createBundle("chrome://editor/locale/editor.properties");
} catch (ex) {}
}
else
if (gStringBundle)
{
// Non-editors (like prefs) may use these methods
if (!gStringBundle)
{
gStringBundle = srGetStrBundle("chrome://editor/locale/editor.properties");
if (!gStringBundle)
return null;
}
try {
return gStringBundle.GetStringFromName(name);
} catch (e) {}
@ -795,18 +787,13 @@ function GetHTMLOrCSSStyleValue(element, attrName, cssPropertyName)
var IsCSSPrefChecked = prefs.getBoolPref("editor.use_css");
var value;
if (IsCSSPrefChecked && editorShell.editorType == "html")
{
value = element.style.getPropertyValue(cssPropertyName);
if (value == "") {
value = element.getAttribute(attrName);
}
}
else
{
if (!value)
value = element.getAttribute(attrName);
}
if (value == null) {
value = "";
}
if (!value)
return "";
return value;
}

Просмотреть файл

@ -39,7 +39,6 @@
</script>
<script type="application/x-javascript" src="chrome://editor/content/EdDialogCommon.js"/>
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js" />
<!-- Recent files menu -->
<groupbox>

Просмотреть файл

@ -39,7 +39,6 @@
<script type="application/x-javascript" src="chrome://editor/content/pref-composer.js"/>
<script type="application/x-javascript" src="chrome://editor/content/editorUtilities.js"/>
<script type="application/x-javascript" src="chrome://editor/content/EdDialogCommon.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js" />
<vbox>
<label value="&authorName.label;"/>

Просмотреть файл

@ -52,7 +52,6 @@
<!-- global dialog functions -->
<script type="application/x-javascript" src="chrome://editor/content/EdAdvancedEdit.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js" />
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
<broadcaster id="args" value=""/>

Просмотреть файл

@ -38,7 +38,6 @@
<script type="application/x-javascript" src="chrome://editor/content/EdDialogCommon.js"/>
<script type="application/x-javascript" src="chrome://editor/content/EdColorPicker.js"/>
<script type="application/x-javascript" src="chrome://global/content/dialogOverlay.js" />
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<broadcaster id="args" value=""/>
<spacer id="location" offsetY="50" persist="offsetX offsetY"/>

Просмотреть файл

@ -21,13 +21,6 @@
* Pete Collins
* Brian King
*/
/*
if we ever need to use a different string bundle, use srGetStrBundle
by including
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
e.g.:
var bundle = srGetStrBundle("chrome://global/locale/filepicker.properties");
*/
// Each editor window must include this file
// Variables shared by all dialogs:

Просмотреть файл

@ -39,7 +39,6 @@
<script type="application/x-javascript" src="chrome://communicator/content/utilityOverlay.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/builtinURLs.js"/>
<script type="application/x-javascript" src="chrome://editor/content/EdSpellCheck.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js" />
<broadcaster id="args" value=""/>