make the write form use the StringBundle module instead of the stringbundle XBL binding so it doesn't need a special stringbundleset overlay node

This commit is contained in:
Myk Melez 2008-12-11 15:07:49 -08:00
Родитель 281ba91ab2
Коммит dacb2b868f
4 изменённых файлов: 10 добавлений и 20 удалений

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

@ -65,9 +65,6 @@
<script type="application/javascript" src="chrome://snowl/content/strands.js"/> <script type="application/javascript" src="chrome://snowl/content/strands.js"/>
<script type="application/javascript" src="chrome://snowl/content/river.js"/> <script type="application/javascript" src="chrome://snowl/content/river.js"/>
<!-- write.xul overlays a string bundle into this. -->
<stringbundleset id="stringbundleset"/>
<keyset> <keyset>
<key id="pageLeftKey" keycode="VK_PAGE_UP" oncommand="SnowlMessageView.doPageMove(-1)" disabled="true"/> <key id="pageLeftKey" keycode="VK_PAGE_UP" oncommand="SnowlMessageView.doPageMove(-1)" disabled="true"/>
<key id="pageRightKey" keycode="VK_PAGE_DOWN" oncommand="SnowlMessageView.doPageMove(1)" disabled="true"/> <key id="pageRightKey" keycode="VK_PAGE_DOWN" oncommand="SnowlMessageView.doPageMove(1)" disabled="true"/>

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

@ -59,10 +59,6 @@
<script type="application/javascript" src="chrome://snowl/content/strands.js"/> <script type="application/javascript" src="chrome://snowl/content/strands.js"/>
<script type="application/javascript" src="chrome://snowl/content/stream.js"/> <script type="application/javascript" src="chrome://snowl/content/stream.js"/>
<!-- write.xul overlays a string bundle into this. -->
<!-- FIXME: use the StringBundle module instead. -->
<stringbundleset id="stringbundleset"/>
<toolbar> <toolbar>
<toolbarbutton id="snowlRefreshButton" <toolbarbutton id="snowlRefreshButton"
image="chrome://snowl/content/icons/arrow_refresh_small.png" image="chrome://snowl/content/icons/arrow_refresh_small.png"

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

@ -44,6 +44,7 @@
// modules that are generic // modules that are generic
Cu.import("resource://snowl/modules/Observers.js"); Cu.import("resource://snowl/modules/Observers.js");
Cu.import("resource://snowl/modules/StringBundle.js");
// modules that are Snowl-specific // modules that are Snowl-specific
Cu.import("resource://snowl/modules/service.js"); Cu.import("resource://snowl/modules/service.js");
@ -53,7 +54,12 @@ Cu.import("resource://snowl/modules/service.js");
*/ */
let WriteForm = { let WriteForm = {
//**************************************************************************// //**************************************************************************//
// Convenience Getters // Shortcuts
get _strings() {
delete this._strings;
return this._strings = new StringBundle("chrome://snowl/locale/write.properties");
},
get _writeTextbox() { get _writeTextbox() {
delete this._writeTextbox; delete this._writeTextbox;
@ -70,11 +76,6 @@ let WriteForm = {
return this._sendButton = document.getElementById("sendButton"); return this._sendButton = document.getElementById("sendButton");
}, },
get _stringBundle() {
delete this._stringBundle;
return this._stringBundle = document.getElementById("snowlWriteBundle");
},
get _targetMenu() { get _targetMenu() {
delete this._targetMenu; delete this._targetMenu;
return this._targetMenu = document.getElementById("targetMenu"); return this._targetMenu = document.getElementById("targetMenu");
@ -120,7 +121,7 @@ let WriteForm = {
onSendMessage: function() { onSendMessage: function() {
this._sendButton.setAttribute("state", "sending"); this._sendButton.setAttribute("state", "sending");
this._sendButton.label = this._stringBundle.getString("sendButton.label.sending"); this._sendButton.label = this._strings.get("sendButton.label.sending");
this._sendButton.disabled = true; this._sendButton.disabled = true;
this._writeTextbox.disabled = true; this._writeTextbox.disabled = true;
@ -134,7 +135,7 @@ let WriteForm = {
onMessageSent: function() { onMessageSent: function() {
this._sendButton.setAttribute("state", "sent"); this._sendButton.setAttribute("state", "sent");
this._sendButton.label = this._stringBundle.getString("sendButton.label.sent"); this._sendButton.label = this._strings.get("sendButton.label.sent");
this._writeTextbox.disabled = false; this._writeTextbox.disabled = false;
this._targetMenu.disabled = false; this._targetMenu.disabled = false;
@ -222,7 +223,7 @@ let WriteForm = {
this._resetSendStatusTimeoutID = null; this._resetSendStatusTimeoutID = null;
this._sendButton.removeAttribute("state"); this._sendButton.removeAttribute("state");
this._sendButton.label = this._stringBundle.getString("sendButton.label"); this._sendButton.label = this._strings.get("sendButton.label");
this._sendButton.disabled = false; this._sendButton.disabled = false;
} }

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

@ -45,10 +45,6 @@
<script type="application/javascript" src="chrome://snowl/content/write.js"/> <script type="application/javascript" src="chrome://snowl/content/write.js"/>
<stringbundleset id="stringbundleset">
<stringbundle id="snowlWriteBundle" src="chrome://snowl/locale/write.properties"/>
</stringbundleset>
<vbox id="writeForm"> <vbox id="writeForm">
<menulist id="targetMenu" oncommand="WriteForm.onSelectTarget()"> <menulist id="targetMenu" oncommand="WriteForm.onSelectTarget()">
<menupopup/> <menupopup/>