зеркало из https://github.com/mozilla/gecko-dev.git
Simplify GetString() method in Composer, b=133546, r=brade, sr=kin, a=asa
This commit is contained in:
Родитель
54f6178b7a
Коммит
a89a6d15ab
|
@ -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=""/>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче