Using xul <stringbundle/> in mailnews instead of including strres.js everywhere (56680). Patch by Mark Olson (maolson@earthlink.net). r=jag sr=bienvenu
This commit is contained in:
Родитель
35825b2bf5
Коммит
a24ffe4299
|
@ -9,7 +9,6 @@
|
|||
flex="100%" class="dialog" title="&openSaveAttachment.title;"
|
||||
align="vertical" onload="onLoad();" onclose="onCancel();" >
|
||||
|
||||
<script language="JavaScript" src="chrome://global/content/strres.js"/>
|
||||
<script src="chrome://messenger/content/openSaveAttachment.js"/>
|
||||
|
||||
<box width="360px">
|
||||
|
@ -37,4 +36,4 @@
|
|||
</box>
|
||||
<separator class="thin"/>
|
||||
<box id="okCancelButtons"/>
|
||||
</window>
|
||||
</window>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
class="dialog"
|
||||
onload="onLoad();">
|
||||
|
||||
<script type="text/javascript" src="chrome://global/content/strres.js"/>
|
||||
<stringbundleset id="stringbundleset"/>
|
||||
<script type="text/javascript" src="chrome://messenger/content/mailCommands.js"/>
|
||||
<script type="text/javascript" src="chrome://messenger/content/renameFolderDialog.js"/>
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@ var subscribeDS = RDF.GetDataSource("rdf:subscribe");
|
|||
var lastTreeChildrenValue = null;
|
||||
var lastTreeChildren = null;
|
||||
|
||||
var gSubscribeBundle;
|
||||
|
||||
function goDoCommand()
|
||||
{
|
||||
}
|
||||
|
@ -30,8 +32,6 @@ function Stop()
|
|||
}
|
||||
}
|
||||
|
||||
var Bundle = srGetStrBundle("chrome://messenger/locale/subscribe.properties");
|
||||
|
||||
function SetServerTypeSpecificTextValues()
|
||||
{
|
||||
if (!gServerURI) return;
|
||||
|
@ -42,11 +42,11 @@ function SetServerTypeSpecificTextValues()
|
|||
|
||||
var element = document.getElementById("foldertextlabel");
|
||||
var stringName = "foldertextfor-" + serverType;
|
||||
var stringval = Bundle.GetStringFromName(stringName);
|
||||
var stringval = gSubscribeBundle.getString(stringName);
|
||||
element.setAttribute('value',stringval);
|
||||
|
||||
stringName = "foldersheaderfor-" + serverType;
|
||||
stringval = Bundle.GetStringFromName(stringName);
|
||||
stringval = gSubscribeBundle.getString(stringName);
|
||||
element = document.getElementById("foldersheaderlabel");
|
||||
element.setAttribute('value',stringval);
|
||||
|
||||
|
@ -95,7 +95,7 @@ function SetUpServerMenu()
|
|||
var MySubscribeListener = {
|
||||
OnDonePopulating: function() {
|
||||
gStatusFeedback.showProgress(100);
|
||||
gStatusFeedback.showStatusString(Bundle.GetStringFromName("doneString"));
|
||||
gStatusFeedback.showStatusString(gSubscribeBundle.getString("doneString"));
|
||||
gStatusBar.setAttribute("mode","normal");
|
||||
|
||||
// only re-root the tree, if it is null.
|
||||
|
@ -138,7 +138,7 @@ function SetUpTree(forceToServer)
|
|||
gSubscribableServer.subscribeListener = MySubscribeListener;
|
||||
|
||||
gStatusFeedback.showProgress(0);
|
||||
gStatusFeedback.showStatusString(Bundle.GetStringFromName("pleaseWaitString"));
|
||||
gStatusFeedback.showStatusString(gSubscribeBundle.getString("pleaseWaitString"));
|
||||
gStatusBar.setAttribute("mode","undetermined");
|
||||
|
||||
gSubscribableServer.startPopulating(msgWindow, forceToServer);
|
||||
|
@ -152,6 +152,7 @@ function SetUpTree(forceToServer)
|
|||
function SubscribeOnLoad()
|
||||
{
|
||||
//dump("SubscribeOnLoad()\n");
|
||||
gSubscribeBundle = document.getElementById("bundle_subscribe");
|
||||
|
||||
gSubscribeTree = document.getElementById('subscribetree');
|
||||
gNameField = document.getElementById('namefield');
|
||||
|
@ -316,7 +317,7 @@ function SubscribeOnClick(event)
|
|||
//dump("do twisty for " + uri + "\n");
|
||||
|
||||
gStatusFeedback.showProgress(0);
|
||||
gStatusFeedback.showStatusString(Bundle.GetStringFromName("pleaseWaitString"));
|
||||
gStatusFeedback.showStatusString(gSubscribeBundle.getString("pleaseWaitString"));
|
||||
gStatusBar.setAttribute("mode","undetermined");
|
||||
|
||||
gSubscribableServer.startPopulatingWithUri(msgWindow, true /* force to server */, uri);
|
||||
|
|
|
@ -39,7 +39,9 @@ Rights Reserved.
|
|||
onload="SubscribeOnLoad()"
|
||||
onclose="Stop()">
|
||||
|
||||
<script language="JavaScript" src="chrome://global/content/strres.js"/>
|
||||
<stringbundle id="bundle_subscribe" src="chrome://messenger/locale/subscribe.properties"/>
|
||||
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
|
||||
<stringbundle id="bundle_brand" src="chrome://global/locale/brand.properties"/>
|
||||
<script language="JavaScript" src="chrome://messenger/content/mailCommands.js"/>
|
||||
<script language="JavaScript" src="chrome://messenger/content/mailWindow.js"/>
|
||||
<script language="JavaScript" src="chrome://messenger/content/subscribe.js"/>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
//The eventual goal is for this file to go away and its contents to be brought into
|
||||
//mailWindowOverlay.js. This is currently being done.
|
||||
|
||||
|
||||
//NOTE: gMessengerBundle must be defined and set or this Overlay won't work
|
||||
|
||||
function ConvertDOMListToResourceArray(nodeList)
|
||||
{
|
||||
|
@ -239,7 +239,7 @@ function MsgFolderProperties()
|
|||
var name = GetFolderNameFromUri(preselectedURI, folderTree);
|
||||
|
||||
dump("preselectedURI = " + preselectedURI + "\n");
|
||||
var windowTitle = Bundle.GetStringFromName("folderProperties");
|
||||
var windowTitle = gMessengerBundle.getString("folderProperties");
|
||||
var dialog = window.openDialog(
|
||||
"chrome://messenger/content/imapFolderProps.xul",
|
||||
"",
|
||||
|
@ -316,7 +316,7 @@ function MsgSetFolderCharset()
|
|||
var preselectedURI = GetSelectedFolderURI();
|
||||
var folderTree = GetFolderTree();
|
||||
var name = GetFolderNameFromUri(preselectedURI, folderTree);
|
||||
var windowTitle = Bundle.GetStringFromName("folderProperties");
|
||||
var windowTitle = gMessengerBundle.getString("folderProperties");
|
||||
var dialog = window.openDialog(
|
||||
"chrome://messenger/content/imapFolderProps.xul",
|
||||
"",
|
||||
|
|
|
@ -31,7 +31,7 @@ var gActionElement;
|
|||
var gActionTargetElement;
|
||||
var gActionValueDeck;
|
||||
var gActionPriority;
|
||||
var Bundle;
|
||||
var gFilterBundle;
|
||||
|
||||
var nsIMsgSearchValidityManager = Components.interfaces.nsIMsgSearchValidityManager;
|
||||
|
||||
|
@ -42,7 +42,7 @@ function filterEditorOnLoad()
|
|||
initializeSearchWidgets();
|
||||
initializeFilterWidgets();
|
||||
|
||||
Bundle = srGetStrBundle("chrome://messenger/locale/filter.properties");
|
||||
gFilterBundle = document.getElementById("bundle_filter");
|
||||
|
||||
if ("arguments" in window && window.arguments[0]) {
|
||||
var args = window.arguments[0];
|
||||
|
@ -61,7 +61,7 @@ function filterEditorOnLoad()
|
|||
|
||||
gFilterNameElement.focus();
|
||||
doSetOKCancel(onOk, null);
|
||||
moveToAlertPosition();
|
||||
moveToAlertPosition();
|
||||
}
|
||||
|
||||
function onOk()
|
||||
|
@ -76,8 +76,8 @@ function onOk()
|
|||
if (commonDialogsService)
|
||||
{
|
||||
commonDialogsService.Alert(window,
|
||||
Bundle.GetStringFromName("cannotHaveDuplicateFilterTitle"),
|
||||
Bundle.GetStringFromName("cannotHaveDuplicateFilterMessage")
|
||||
gFilterBundle.getString("cannotHaveDuplicateFilterTitle"),
|
||||
gFilterBundle.getString("cannotHaveDuplicateFilterMessage")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ function isDuplicateFilterNameExists()
|
|||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function getScopeFromFilterList(filterList)
|
||||
|
@ -119,7 +119,7 @@ function getScopeFromFilterList(filterList)
|
|||
if (!filterList) return false;
|
||||
var type = filterList.folder.server.type;
|
||||
if (type == "nntp") return nsIMsgSearchValidityManager.news;
|
||||
if (type == "pop3") return nsIMsgSearchValidityManager.offlineMail;
|
||||
if (type == "pop3") return nsIMsgSearchValidityManager.offlineMail;
|
||||
return nsIMsgSearchValidityManager.onlineMailFilter;
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ function initializeFilterWidgets()
|
|||
|
||||
function initializeDialog(filter)
|
||||
{
|
||||
var selectedPriority;
|
||||
var selectedPriority;
|
||||
gFilterNameElement.value = filter.filterName;
|
||||
|
||||
gActionElement.selectedItem=gActionElement.getElementsByAttribute("data", filter.action)[0];
|
||||
|
@ -154,7 +154,7 @@ function initializeDialog(filter)
|
|||
if (target.localName == "menuitem"){
|
||||
gActionTargetElement.selectedItem = target;
|
||||
PickedMsgFolder(gActionTargetElement.selectedItem, gActionTargetElement.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (filter.action == nsMsgFilterAction.ChangePriority) {
|
||||
// initialize priority
|
||||
|
@ -170,8 +170,8 @@ function initializeDialog(filter)
|
|||
var scope = getScope(filter);
|
||||
setSearchScope(scope);
|
||||
initializeSearchRows(scope, filter.searchTerms);
|
||||
if (filter.searchTerms.Count() > 1)
|
||||
gSearchLessButton.removeAttribute("disabled", "false");
|
||||
if (filter.searchTerms.Count() > 1)
|
||||
gSearchLessButton.removeAttribute("disabled", "false");
|
||||
|
||||
}
|
||||
|
||||
|
@ -180,11 +180,11 @@ function initializeDialog(filter)
|
|||
|
||||
function saveFilter() {
|
||||
var isNewFilter;
|
||||
var str;
|
||||
var str;
|
||||
|
||||
var filterName= gFilterNameElement.value;
|
||||
if (!filterName || filterName == "") {
|
||||
str = Bundle.GetStringFromName("mustEnterName");
|
||||
str = gFilterBundle.getString("mustEnterName");
|
||||
window.alert(str);
|
||||
gFilterNameElement.focus();
|
||||
return false;
|
||||
|
@ -197,7 +197,7 @@ function saveFilter() {
|
|||
if (gActionTargetElement)
|
||||
targetUri = gActionTargetElement.selectedItem.getAttribute("data");
|
||||
if (!targetUri || targetUri == "") {
|
||||
str = Bundle.GetStringFromName("mustSelectFolder");
|
||||
str = gFilterBundle.getString("mustSelectFolder");
|
||||
window.alert(str);
|
||||
return false;
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ function saveFilter() {
|
|||
|
||||
else if (action == nsMsgFilterAction.ChangePriority) {
|
||||
if (!gActionPriority.selectedItem) {
|
||||
var str = Bundle.GetStringFromName("mustSelectPriority");
|
||||
str = gFilterBundle.getString("mustSelectPriority");
|
||||
window.alert(str);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,11 @@ Rights Reserved.
|
|||
onload="filterEditorOnLoad('msgFccFolderPicker');">
|
||||
|
||||
<dummy class="usesMailWidgets"/>
|
||||
<script language="JavaScript" src="chrome://global/content/strres.js"/>
|
||||
<stringbundleset id="stringbundleset">
|
||||
<stringbundle id="bundle_filter" src="chrome://messenger/locale/filter.properties"/>
|
||||
</stringbundleset>
|
||||
<!-- XXX: only mailWidgets.xml requires strres.js (<script> isn't valid in XBL yet - see hyatt)-->
|
||||
<script type="text/javascript" src="chrome://global/content/strres.js"/>
|
||||
<script language="JavaScript" src="chrome://messenger/content/FilterEditor.js"/>
|
||||
|
||||
<keyset id="keyset"/>
|
||||
|
|
|
@ -287,7 +287,7 @@ function getServerThatCanHaveFilters()
|
|||
|
||||
var defaultAccount = accountManager.defaultAccount;
|
||||
var defaultIncomingServer = defaultAccount.incomingServer;
|
||||
|
||||
|
||||
// check to see if default server can have filters
|
||||
if (defaultIncomingServer.canHaveFilters) {
|
||||
firstItem = defaultIncomingServer.serverURI;
|
||||
|
|
|
@ -38,7 +38,7 @@ var gStatusBar = null;
|
|||
var gStatusFeedback = new nsMsgStatusFeedback;
|
||||
var gNumOfSearchHits = 0;
|
||||
var RDF;
|
||||
var Bundle;
|
||||
var gSearchBundle;
|
||||
|
||||
// Datasource search listener -- made global as it has to be registered
|
||||
// and unregistered in different functions.
|
||||
|
@ -99,16 +99,16 @@ var gSearchNotificationListener =
|
|||
|
||||
onSearchDone: function(status)
|
||||
{
|
||||
gButton.setAttribute("value", Bundle.GetStringFromName("labelForSearchButton"));
|
||||
gButton.setAttribute("value", gSearchBundle.getString("labelForSearchButton"));
|
||||
|
||||
var statusMsg;
|
||||
// if there are no hits, it means no matches were found in the search.
|
||||
if (gNumOfSearchHits == 0) {
|
||||
statusMsg = Bundle.GetStringFromName("searchFailureMessage");
|
||||
statusMsg = gSearchBundle.getString("searchFailureMessage");
|
||||
}
|
||||
else
|
||||
{
|
||||
statusMsg = gNumOfSearchHits+" "+Bundle.GetStringFromName("searchSuccessMessage");
|
||||
statusMsg = gNumOfSearchHits + " " + gSearchBundle.getString("searchSuccessMessage");
|
||||
gNumOfSearchHits = 0;
|
||||
}
|
||||
|
||||
|
@ -119,13 +119,13 @@ var gSearchNotificationListener =
|
|||
|
||||
onNewSearch: function()
|
||||
{
|
||||
gButton.setAttribute("value", Bundle.GetStringFromName("labelForStopButton"));
|
||||
gButton.setAttribute("value", gSearchBundle.getString("labelForStopButton"));
|
||||
if (gThreadTree)
|
||||
gThreadTree.clearItemSelection();
|
||||
ThreadTreeUpdate_Search();
|
||||
|
||||
gStatusFeedback.showProgress(0);
|
||||
gStatusFeedback.showStatusString(Bundle.GetStringFromName("searchingMessage"));
|
||||
gStatusFeedback.showStatusString(gSearchBundle.getString("searchingMessage"));
|
||||
gStatusBar.setAttribute("mode","undetermined");
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ function searchOnLoad()
|
|||
initializeSearchWidgets();
|
||||
initializeSearchWindowWidgets();
|
||||
|
||||
Bundle = srGetStrBundle("chrome://messenger/locale/search.properties");
|
||||
gSearchBundle = document.getElementById("bundle_search");
|
||||
setupDatasource();
|
||||
setupSearchListener();
|
||||
|
||||
|
@ -143,7 +143,7 @@ function searchOnLoad()
|
|||
selectFolder(window.arguments[0].folder);
|
||||
|
||||
onMore(null);
|
||||
moveToAlertPosition();
|
||||
moveToAlertPosition();
|
||||
|
||||
}
|
||||
|
||||
|
@ -213,8 +213,6 @@ function selectFolder(folder) {
|
|||
// the URI of the folder is in the data attribute of the menuitem
|
||||
var folderResource =
|
||||
folder.QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
dump("Selecting " + folderResource.Value + "\n");
|
||||
|
||||
|
||||
var elements =
|
||||
gFolderPicker.getElementsByAttribute("data", folderResource.Value);
|
||||
|
@ -228,7 +226,6 @@ function updateSearchFolderPicker() {
|
|||
|
||||
var selectedItem = gFolderPicker.selectedItem;
|
||||
if (selectedItem.localName != "menuitem") return;
|
||||
dump("id = " + selectedItem.id + "\n");
|
||||
SetFolderPicker(selectedItem.id, gFolderPicker.id);
|
||||
|
||||
// use the URI to get the real folder
|
||||
|
@ -246,18 +243,17 @@ function onChooseFolder(event) {
|
|||
|
||||
function onSearch(event)
|
||||
{
|
||||
dump("setting up search..\n");
|
||||
gSearchSession.clearScopes();
|
||||
// tell the search session what the new scope is
|
||||
if (!gCurrentFolder.isServer)
|
||||
gSearchSession.addScopeTerm(GetScopeForFolder(gCurrentFolder),
|
||||
gCurrentFolder);
|
||||
if (!gCurrentFolder.isServer)
|
||||
gSearchSession.addScopeTerm(GetScopeForFolder(gCurrentFolder),
|
||||
gCurrentFolder);
|
||||
|
||||
var searchSubfolders = document.getElementById("checkSearchSubFolders").checked;
|
||||
if (gCurrentFolder && (searchSubfolders || gCurrentFolder.isServer))
|
||||
{
|
||||
AddSubFolders(gCurrentFolder);
|
||||
}
|
||||
if (gCurrentFolder && (searchSubfolders || gCurrentFolder.isServer))
|
||||
{
|
||||
AddSubFolders(gCurrentFolder);
|
||||
}
|
||||
// reflect the search widgets back into the search session
|
||||
saveSearchTerms(gSearchSession.searchTerms, gSearchSession);
|
||||
|
||||
|
@ -265,7 +261,6 @@ function onSearch(event)
|
|||
// refresh the tree after the search starts, because initiating the
|
||||
// search will cause the datasource to clear itself
|
||||
gThreadTree.setAttribute("ref", gThreadTree.getAttribute("ref"));
|
||||
dump("Kicking it off with " + gThreadTree.getAttribute("ref") + "\n");
|
||||
}
|
||||
|
||||
function AddSubFolders(folder) {
|
||||
|
@ -310,7 +305,6 @@ function setupDatasource() {
|
|||
|
||||
gSearchDatasource = Components.classes[rdfDatasourcePrefix + "msgsearch"].createInstance(Components.interfaces.nsIRDFDataSource);
|
||||
|
||||
dump("The root is " + gSearchDatasource.URI + "\n");
|
||||
gThreadTree.setAttribute("ref", gSearchDatasource.URI);
|
||||
|
||||
// the thread pane needs to use the search datasource (to get the
|
||||
|
@ -381,7 +375,6 @@ function IsThreadAndMessagePaneSplitterCollapsed()
|
|||
|
||||
function setMsgDatasourceWindow(ds, msgwindow)
|
||||
{
|
||||
dump("setMsgDatasourceWindow(" + ds + ")\n");
|
||||
try {
|
||||
var msgDatasource = ds.QueryInterface(nsIMsgRDFDataSource);
|
||||
msgDatasource.window = msgwindow;
|
||||
|
@ -393,7 +386,7 @@ function setMsgDatasourceWindow(ds, msgwindow)
|
|||
// used to toggle functionality for Search/Stop button.
|
||||
function onSearchButton(event)
|
||||
{
|
||||
if (event.target.value == Bundle.GetStringFromName("labelForSearchButton"))
|
||||
if (event.target.value == gSearchBundle.getString("labelForSearchButton"))
|
||||
onSearch(event);
|
||||
else
|
||||
onSearchStop(event);
|
||||
|
|
|
@ -43,7 +43,11 @@ Rights Reserved.
|
|||
|
||||
<keyset id="keyset"/>
|
||||
|
||||
<script src="chrome://global/content/strres.js"/>
|
||||
<stringbundle id="bundle_search" src="chrome://messenger/locale/search.properties"/>
|
||||
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
|
||||
<stringbundle id="bundle_brand" src="chrome://global/locale/brand.properties"/>
|
||||
<!-- XXX: only mailWidgets.xml requires strres.js (<script> isn't valid in XBL yet - see hyatt)-->
|
||||
<script type="text/javascript" src="chrome://global/content/strres.js"/>
|
||||
<script src="chrome://messenger/content/mailWindow.js"/>
|
||||
<script src="chrome://messenger/content/threadPane.js"/>
|
||||
<script src="chrome://messenger/content/msgMail3PaneWindow.js"/>
|
||||
|
|
|
@ -98,7 +98,7 @@ searchTermContainer.prototype = {
|
|||
},
|
||||
|
||||
booleanNodes: null,
|
||||
stringBundle: srGetStrBundle("chrome://messenger/locale/search.properties"),
|
||||
stringBundle: document.getElementById("bundle_search"),
|
||||
get booleanAnd() { return this.internalBooleanAnd; },
|
||||
set booleanAnd(val) {
|
||||
// whenever you set this, all nodes in booleanNodes
|
||||
|
@ -115,7 +115,7 @@ searchTermContainer.prototype = {
|
|||
for (var i=0; i<booleanNodes.length; i++) {
|
||||
try {
|
||||
var staticString =
|
||||
stringBundle.GetStringFromName("search" + andString + i);
|
||||
stringBundle.getString("search" + andString + i);
|
||||
if (staticString && staticString.length>0)
|
||||
booleanNodes[i].setAttribute("value", staticString);
|
||||
} catch (ex) { /* no error, means string not found */}
|
||||
|
@ -195,9 +195,7 @@ function onLess(event)
|
|||
|
||||
// set scope on all visible searhattribute tags
|
||||
function setSearchScope(scope) {
|
||||
dump("Setting search scope to " + scope + "\n");
|
||||
gSearchScope = scope;
|
||||
dump("..on " + gSearchTerms.length + " elements.\n");
|
||||
for (var i=0; i<gSearchTerms.length; i++) {
|
||||
gSearchTerms[i].searchattribute.searchScope = scope;
|
||||
}
|
||||
|
@ -213,7 +211,6 @@ function booleanChanged(event) {
|
|||
var searchTerm = gSearchTerms[i];
|
||||
searchTerm.booleanAnd = newBoolValue;
|
||||
}
|
||||
dump("Boolean is now " + event.target.data + "\n");
|
||||
}
|
||||
|
||||
|
||||
|
@ -266,15 +263,10 @@ function createSearchRow(index, scope, searchTerm)
|
|||
|
||||
gSearchRowContainer.appendChild(searchrow);
|
||||
|
||||
dump("createSearchRow: Setting searchScope = " + scope + "\n");
|
||||
searchTermObj.searchScope = scope;
|
||||
// the search term will initialize the searchTerm element, including
|
||||
// .booleanAnd
|
||||
if (searchTerm) {
|
||||
dump("\nHave a searchterm (" +
|
||||
searchTerm.attrib + "/" +
|
||||
searchTerm.op + "/" +
|
||||
searchTerm.value + ")\n");
|
||||
searchTermObj.searchTerm = searchTerm;
|
||||
}
|
||||
|
||||
|
@ -300,9 +292,6 @@ function constructRow(treeCellChildren)
|
|||
treecell.setAttribute("allowevents", "true");
|
||||
treeCellChildren[i].setAttribute("flex", "1");
|
||||
treecell.appendChild(treeCellChildren[i]);
|
||||
var child = treeCellChildren[i];
|
||||
dump("Appended a " + child.localName + "\n");
|
||||
|
||||
}
|
||||
row.appendChild(treecell);
|
||||
}
|
||||
|
@ -312,17 +301,14 @@ function constructRow(treeCellChildren)
|
|||
|
||||
function removeSearchRow(index)
|
||||
{
|
||||
dump("removing search term " + index + "\n");
|
||||
var searchTermObj = gSearchTerms[index];
|
||||
if (!searchTermObj) {
|
||||
dump("removeSearchRow: couldn't find search term " + index + "\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// need to remove row from tree, so walk upwards from the
|
||||
// searchattribute to find the first <treeitem>
|
||||
var treeItemRow = searchTermObj.searchattribute;
|
||||
//dump("removeSearchRow: " + treeItemRow + "\n");
|
||||
while (treeItemRow) {
|
||||
if (treeItemRow.localName == "treeitem") break;
|
||||
treeItemRow = treeItemRow.parentNode;
|
||||
|
@ -335,18 +321,15 @@ function removeSearchRow(index)
|
|||
|
||||
|
||||
if (searchTermObj.searchTerm) {
|
||||
dump("That was a real row! queuing " + searchTermObj.searchTerm + " for disposal\n");
|
||||
gSearchRemovedTerms[gSearchRemovedTerms.length] = searchTermObj.searchTerm;
|
||||
} else {
|
||||
dump("That wasn't real. ignoring \n");
|
||||
//dump("That wasn't real. ignoring \n");
|
||||
}
|
||||
|
||||
treeItemRow.parentNode.removeChild(treeItemRow);
|
||||
// remove it from the list of terms - XXX this does it?
|
||||
dump("Removing row " + index + " from " + gSearchTerms.length + " items\n");
|
||||
// remove the last element
|
||||
gSearchTerms.length--;
|
||||
dump("Now there are " + gSearchTerms.length + " items\n");
|
||||
}
|
||||
|
||||
function getBooleanAnd()
|
||||
|
@ -368,19 +351,16 @@ function saveSearchTerms(searchTerms, termOwner)
|
|||
var i;
|
||||
for (i = 0; i<gSearchTerms.length; i++) {
|
||||
try {
|
||||
dump("Saving search element " + i + "\n");
|
||||
var searchTerm = gSearchTerms[i].searchTerm;
|
||||
if (searchTerm)
|
||||
gSearchTerms[i].save();
|
||||
else {
|
||||
// need to create a new searchTerm, and somehow save it to that
|
||||
dump("Need to create searchterm " + i + "\n");
|
||||
searchTerm = termOwner.createTerm();
|
||||
gSearchTerms[i].saveTo(searchTerm);
|
||||
termOwner.appendTerm(searchTerm);
|
||||
}
|
||||
} catch (ex) {
|
||||
|
||||
dump("** Error saving element " + i + ": " + ex + "\n");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ var contentChanged = false;
|
|||
var currentIdentity = null;
|
||||
var defaultSaveOperation = "draft";
|
||||
|
||||
var Bundle = srGetStrBundle("chrome://messenger/locale/messengercompose/composeMsgs.properties");
|
||||
var gComposeMsgsBundle;
|
||||
|
||||
var other_header = "";
|
||||
var update_compose_title_as_you_type = true;
|
||||
|
@ -830,7 +830,7 @@ function WizCallback(state)
|
|||
|
||||
function ComposeLoad()
|
||||
{
|
||||
dump("\nComposeLoad from XUL\n");
|
||||
gComposeMsgsBundle = document.getElementById("bundle_composeMsgs");
|
||||
|
||||
try {
|
||||
SetupCommandUpdateHandlers();
|
||||
|
@ -851,8 +851,8 @@ function ComposeLoad()
|
|||
}
|
||||
catch (ex) {
|
||||
dump("###ERROR WHILE LOADING MESSAGE COMPOSE: " + ex + "\n");
|
||||
var errorTitle = Bundle.GetStringFromName("initErrorDlogTitle");
|
||||
var errorMsg = Bundle.GetStringFromName("initErrorDlogMessage");
|
||||
var errorTitle = gComposeMsgsBundle.getString("initErrorDlogTitle");
|
||||
var errorMsg = gComposeMsgsBundle.getString("initErrorDlogMessage");
|
||||
errorMsg = errorMsg.replace(/%1\$s/, ex);
|
||||
if (commonDialogsService)
|
||||
commonDialogsService.Alert(window, errorTitle, errorMsg);
|
||||
|
@ -1049,9 +1049,9 @@ function GenericSendMessage( msgType )
|
|||
var result = {value:0};
|
||||
if (commonDialogsService.Prompt(
|
||||
window,
|
||||
Bundle.GetStringFromName("subjectDlogTitle"),
|
||||
Bundle.GetStringFromName("subjectDlogMessage"),
|
||||
Bundle.GetStringFromName("defaultSubject"),
|
||||
gComposeMsgsBundle.getString("subjectDlogTitle"),
|
||||
gComposeMsgsBundle.getString("subjectDlogMessage"),
|
||||
gComposeMsgsBundle.getString("defaultSubject"),
|
||||
result
|
||||
))
|
||||
{
|
||||
|
@ -1383,12 +1383,12 @@ function SetComposeWindowTitle(event)
|
|||
/* dump("newTitle = " + newTitle + "\n"); */
|
||||
|
||||
if (newTitle == "" ) {
|
||||
newTitle = Bundle.GetStringFromName("defaultSubject");
|
||||
newTitle = gComposeMsgsBundle.getString("defaultSubject");
|
||||
}
|
||||
|
||||
newTitle += GetCharsetUIString();
|
||||
|
||||
window.title = Bundle.GetStringFromName("windowTitlePrefix") + " " + newTitle;
|
||||
window.title = gComposeMsgsBundle.getString("windowTitlePrefix") + " " + newTitle;
|
||||
}
|
||||
|
||||
// Check for changes to document and allow saving before closing
|
||||
|
@ -1404,12 +1404,12 @@ function ComposeCanClose()
|
|||
commonDialogsService.UniversalDialog(
|
||||
window,
|
||||
null,
|
||||
Bundle.GetStringFromName("saveDlogTitle"),
|
||||
Bundle.GetStringFromName("saveDlogMessage"),
|
||||
gComposeMsgsBundle.getString("saveDlogTitle"),
|
||||
gComposeMsgsBundle.getString("saveDlogMessage"),
|
||||
null,
|
||||
Bundle.GetStringFromName("saveDlogSaveBtn"),
|
||||
Bundle.GetStringFromName("saveDlogCancelBtn"),
|
||||
Bundle.GetStringFromName("saveDlogDontSaveBtn"),
|
||||
gComposeMsgsBundle.getString("saveDlogSaveBtn"),
|
||||
gComposeMsgsBundle.getString("saveDlogCancelBtn"),
|
||||
gComposeMsgsBundle.getString("saveDlogDontSaveBtn"),
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
|
@ -1459,7 +1459,7 @@ function AttachFile()
|
|||
//Get file using nsIFilePicker and convert to URL
|
||||
try {
|
||||
var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
|
||||
fp.init(window, Bundle.GetStringFromName("chooseFileToAttach"), nsIFilePicker.modeOpen);
|
||||
fp.init(window, gComposeMsgsBundle.getString("chooseFileToAttach"), nsIFilePicker.modeOpen);
|
||||
fp.appendFilters(nsIFilePicker.filterAll);
|
||||
if (fp.show() == nsIFilePicker.returnOK) {
|
||||
currentAttachment = fp.fileURL.spec;
|
||||
|
@ -1474,8 +1474,8 @@ function AttachFile()
|
|||
else
|
||||
{
|
||||
dump("###ERROR ADDING DUPLICATE FILE \n");
|
||||
var errorTitle = Bundle.GetStringFromName("DuplicateFileErrorDlogTitle");
|
||||
var errorMsg = Bundle.GetStringFromName("DuplicateFileErrorDlogMessage");
|
||||
var errorTitle = gComposeMsgsBundle.getString("DuplicateFileErrorDlogTitle");
|
||||
var errorMsg = gComposeMsgsBundle.getString("DuplicateFileErrorDlogMessage");
|
||||
|
||||
if (commonDialogsService)
|
||||
commonDialogsService.Alert(window, errorTitle, errorMsg);
|
||||
|
@ -1516,8 +1516,8 @@ function AttachPage()
|
|||
var result = {value:0};
|
||||
if (commonDialogsService.Prompt(
|
||||
window,
|
||||
Bundle.GetStringFromName("attachPageDlogTitle"),
|
||||
Bundle.GetStringFromName("attachPageDlogMessage"),
|
||||
gComposeMsgsBundle.getString("attachPageDlogTitle"),
|
||||
gComposeMsgsBundle.getString("attachPageDlogMessage"),
|
||||
null,
|
||||
result))
|
||||
{
|
||||
|
@ -1827,8 +1827,8 @@ var attachmentBucketObserver = {
|
|||
if (!(DuplicateFileCheck(rawData)))
|
||||
AddAttachment(rawData, prettyName);
|
||||
else {
|
||||
var errorTitle = Bundle.GetStringFromName("DuplicateFileErrorDlogTitle");
|
||||
var errorMsg = Bundle.GetStringFromName("DuplicateFileErrorDlogMessage");
|
||||
var errorTitle = gComposeMsgsBundle.getString("DuplicateFileErrorDlogTitle");
|
||||
var errorMsg = gComposeMsgsBundle.getString("DuplicateFileErrorDlogMessage");
|
||||
|
||||
if (commonDialogsService)
|
||||
commonDialogsService.Alert(window, errorTitle, errorMsg);
|
||||
|
|
|
@ -49,20 +49,22 @@
|
|||
width="640" height="480"
|
||||
persist="screenX screenY width height sizemode">
|
||||
|
||||
<script language="JavaScript" src="chrome://global/content/strres.js"></script>
|
||||
<script language="JavaScript" src="chrome://messenger/content/accountUtils.js"></script>
|
||||
<script language="JavaScript" src="chrome://messenger/content/widgetglue.js"></script>
|
||||
<script language="JavaScript" src="chrome://editor/content/editor.js"></script>
|
||||
<script language="JavaScript" src="chrome://editor/content/ComposerCommands.js"></script>
|
||||
<script language="JavaScript" src="chrome://editor/content/EditorCommandsDebug.js"></script>
|
||||
<script language="JavaScript" src="chrome://messenger/content/messengercompose/MsgComposeCommands.js"></script>
|
||||
|
||||
<stringbundleset id="stringbundleset">
|
||||
<stringbundle id="bundle_composeMsgs" src="chrome://messenger/locale/messengercompose/composeMsgs.properties"/>
|
||||
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
|
||||
</stringbundleset>
|
||||
<script type="text/javascript" src="chrome://messenger/content/accountUtils.js"/>
|
||||
<script type="text/javascript" src="chrome://messenger/content/widgetglue.js"/>
|
||||
<script type="text/javascript" src="chrome://editor/content/editor.js"/>
|
||||
<script type="text/javascript" src="chrome://editor/content/ComposerCommands.js"/>
|
||||
<script type="text/javascript" src="chrome://editor/content/EditorCommandsDebug.js"/>
|
||||
<script type="text/javascript" src="chrome://messenger/content/messengercompose/MsgComposeCommands.js"/>
|
||||
|
||||
<!-- drag and drop -->
|
||||
<script language="JavaScript" src="chrome://global/content/nsDragAndDrop.js"></script>
|
||||
<script language="JavaScript" src="chrome://global/content/nsJSSupportsUtils.js"></script>
|
||||
<script language="JavaScript" src="chrome://global/content/nsJSComponentManager.js"></script>
|
||||
<script language="JavaScript" src="chrome://global/content/nsTransferable.js"></script>
|
||||
<script type="text/javascript" src="chrome://global/content/nsDragAndDrop.js"/>
|
||||
<script type="text/javascript" src="chrome://global/content/nsJSSupportsUtils.js"/>
|
||||
<script type="text/javascript" src="chrome://global/content/nsJSComponentManager.js"/>
|
||||
<script type="text/javascript" src="chrome://global/content/nsTransferable.js"/>
|
||||
|
||||
<commands id="commands">
|
||||
<commandset id="msgComposeCommandUpdate"
|
||||
|
|
|
@ -25,7 +25,6 @@ var fieldMap = null;
|
|||
|
||||
function OnLoadFieldMapExport()
|
||||
{
|
||||
// top.bundle = srGetStrBundle("chrome://messenger/locale/importMsgs.properties");
|
||||
top.importService = Components.classes["@mozilla.org/import/import-service;1"].getService();
|
||||
top.importService = top.importService.QueryInterface(Components.interfaces.nsIImportService);
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@ Rights Reserved.
|
|||
onload="OnLoadFieldMapExport()"
|
||||
align="vertical">
|
||||
|
||||
<html:script src="chrome://global/content/strres.js"/>
|
||||
<html:script src="chrome://messenger/content/fieldMapExport.js"/>
|
||||
<!--html:script language="JavaScript" src="resource:/res/samples/DumpDOM.js"/-->
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ var dragData = null;
|
|||
|
||||
function OnLoadFieldMapImport()
|
||||
{
|
||||
// top.bundle = srGetStrBundle("chrome://messenger/locale/importMsgs.properties");
|
||||
top.importService = Components.classes["@mozilla.org/import/import-service;1"].getService();
|
||||
top.importService = top.importService.QueryInterface(Components.interfaces.nsIImportService);
|
||||
top.transferType = "moz/fieldmap";
|
||||
|
|
|
@ -34,8 +34,7 @@ Rights Reserved.
|
|||
onload="OnLoadFieldMapImport()"
|
||||
align="vertical">
|
||||
|
||||
<script src="chrome://global/content/strres.js"/>
|
||||
<script src="chrome://messenger/content/fieldMapImport.js"/>
|
||||
<script type="text/javascript" src="chrome://messenger/content/fieldMapImport.js"/>
|
||||
|
||||
<keyset id="keyset"/>
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
var importType = null;
|
||||
var bundle = 0;
|
||||
var gImportMsgsBundle;
|
||||
var importService = 0;
|
||||
var successStr = null;
|
||||
var errorStr = null;
|
||||
|
@ -29,29 +29,9 @@ var progressInfo = null;
|
|||
var selectedModuleName = null;
|
||||
|
||||
|
||||
|
||||
function GetBundleString( strId)
|
||||
{
|
||||
try {
|
||||
return( top.bundle.GetStringFromName( strId));
|
||||
} catch( ex) {
|
||||
}
|
||||
|
||||
return( "String Bundle Bad");
|
||||
}
|
||||
|
||||
function GetFormattedBundleString( strId, formatStr)
|
||||
{
|
||||
try {
|
||||
return( top.bundle.formatStringFromName( strId, [ formatStr ], 1));
|
||||
} catch( ex) {
|
||||
}
|
||||
return( "String Bundle Bad");
|
||||
}
|
||||
|
||||
function OnLoadImportDialog()
|
||||
{
|
||||
bundle = srGetStrBundle("chrome://messenger/locale/importMsgs.properties");
|
||||
gImportMsgsBundle = document.getElementById("bundle_importMsgs");
|
||||
importService = Components.classes["@mozilla.org/import/import-service;1"].getService();
|
||||
importService = top.importService.QueryInterface(Components.interfaces.nsIImportService);
|
||||
|
||||
|
@ -166,7 +146,8 @@ function ImportDialogOKButton()
|
|||
return( true);
|
||||
}
|
||||
else {
|
||||
meterText = GetFormattedBundleString('MailProgressMeterText', name);
|
||||
meterText = gImportMsgsBundle.getFormattedString('MailProgressMeterText',
|
||||
[ name ]);
|
||||
header.setAttribute("description", meterText);
|
||||
|
||||
progressStatusEl.setAttribute("value", "");
|
||||
|
@ -203,7 +184,8 @@ function ImportDialogOKButton()
|
|||
return( true);
|
||||
}
|
||||
else {
|
||||
meterText = GetFormattedBundleString('MailProgressMeterText', name);
|
||||
meterText = gImportMsgsBundle.getFormattedString('MailProgressMeterText',
|
||||
[ name ]);
|
||||
header.setAttribute("description", meterText);
|
||||
|
||||
progressStatusEl.setAttribute("value", "");
|
||||
|
@ -230,13 +212,13 @@ function ImportDialogOKButton()
|
|||
if (!ImportSettings( module, newAccount, error))
|
||||
{
|
||||
if (error.value)
|
||||
ShowImportResultsRaw(GetBundleString( 'ImportSettingsFailed'), null);
|
||||
ShowImportResultsRaw(gImportMsgsBundle.getString('ImportSettingsFailed'), null);
|
||||
// the user canceled the operation, shoud we dismiss
|
||||
// this dialog or not?
|
||||
return false;
|
||||
}
|
||||
else
|
||||
ShowImportResultsRaw(GetFormattedBundleString( 'ImportSettingsSuccess', name), null);
|
||||
ShowImportResultsRaw(gImportMsgsBundle.getFormattedString('ImportSettingsSuccess', [ name ]), null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -364,11 +346,11 @@ function ShowImportResults(good, module)
|
|||
var modFailed = 'Import' + module + 'Failed';
|
||||
var results, title;
|
||||
if (good) {
|
||||
title = GetFormattedBundleString(modSuccess, selectedModuleName ? selectedModuleName : '');
|
||||
title = gImportMsgsBundle.getFormattedString(modSuccess, [ selectedModuleName ? selectedModuleName : '' ]);
|
||||
results = successStr.data;
|
||||
}
|
||||
else if (errorStr.data) {
|
||||
title = GetFormattedBundleString(modFailed, selectedModuleName ? selectedModuleName : '');
|
||||
title = gImportMsgsBundle.getFormattedString(modFailed, [ selectedModuleName ? selectedModuleName : '' ]);
|
||||
results = errorStr.data;
|
||||
}
|
||||
|
||||
|
@ -415,18 +397,18 @@ function ShowAddressComplete( good)
|
|||
var str = null;
|
||||
if (good == true) {
|
||||
if ((top.selectedModuleName != null) && (top.selectedModuleName.length > 0))
|
||||
str = GetFormattedBundleString( 'ImportAddressSuccess', top.selectedModuleName);
|
||||
str = gImportMsgsBundle.getFormattedString('ImportAddressSuccess', [ top.selectedModuleName ]);
|
||||
else
|
||||
str = GetFormattedBundleString( 'ImportAddressSuccess', "");
|
||||
str = gImportMsgsBundle.getFormattedString('ImportAddressSuccess', [ "" ]);
|
||||
str += "\n";
|
||||
str += "\n" + top.successStr.data;
|
||||
}
|
||||
else {
|
||||
if ((top.errorStr.data != null) && (top.errorStr.data.length > 0)) {
|
||||
if ((top.selectedModuleName != null) && (top.selectedModuleName.length > 0))
|
||||
str = GetFormattedBundleString( 'ImportAddressFailed', top.selectedModuleName);
|
||||
str = gImportMsgsBundle.getFormattedString('ImportAddressFailed', [ top.selectedModuleName ]);
|
||||
else
|
||||
str = GetFormattedBundleString( 'ImportAddressFailed', "");
|
||||
str = gImportMsgsBundle.getFormattedString('ImportAddressFailed', [ "" ]);
|
||||
str += "\n" + top.errorStr.data;
|
||||
}
|
||||
}
|
||||
|
@ -461,7 +443,7 @@ function ImportSettings( module, newAccount, error) {
|
|||
if (setIntf != null)
|
||||
setIntf = setIntf.QueryInterface( Components.interfaces.nsIImportSettings);
|
||||
if (setIntf == null) {
|
||||
error.value = GetBundleString( 'ImportSettingsBadModule');
|
||||
error.value = gImportMsgsBundle.getString('ImportSettingsBadModule');
|
||||
return( false);
|
||||
}
|
||||
|
||||
|
@ -480,7 +462,7 @@ function ImportSettings( module, newAccount, error) {
|
|||
if (filePicker != null) {
|
||||
var file = null;
|
||||
try {
|
||||
filePicker.init( top.window, GetBundleString( 'ImportSelectSettings'), Components.interfaces.nsIFilePicker.modeOpen);
|
||||
filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectSettings'), Components.interfaces.nsIFilePicker.modeOpen);
|
||||
filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll);
|
||||
filePicker.show();
|
||||
if (filePicker.file && (filePicker.file.path.length > 0))
|
||||
|
@ -502,17 +484,17 @@ function ImportSettings( module, newAccount, error) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
error.value = GetBundleString( 'ImportSettingsNotFound');
|
||||
error.value = gImportMsgsBundle.getString('ImportSettingsNotFound');
|
||||
return( false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
error.value = GetBundleString( 'ImportSettingsNotFound');
|
||||
error.value = gImportMsgsBundle.getString('ImportSettingsNotFound');
|
||||
return( false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
error.value = GetBundleString( 'ImportSettingsNotFound');
|
||||
error.value = gImportMsgsBundle.getString('ImportSettingsNotFound');
|
||||
return( false);
|
||||
}
|
||||
}
|
||||
|
@ -522,7 +504,7 @@ function ImportSettings( module, newAccount, error) {
|
|||
// that's really only useful for "Upgrade"
|
||||
result = setIntf.Import( newAccount);
|
||||
if (result == false) {
|
||||
error.value = GetBundleString( 'ImportSettingsFailed');
|
||||
error.value = gImportMsgsBundle.getString('ImportSettingsFailed');
|
||||
}
|
||||
return( result);
|
||||
}
|
||||
|
@ -542,7 +524,7 @@ function CreateNewFileSpec( inFile)
|
|||
|
||||
function ImportMail( module, success, error) {
|
||||
if (top.progressInfo.importInterface || top.progressInfo.intervalState) {
|
||||
error.data = GetBundleString( 'ImportAlreadyInProgress');
|
||||
error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress');
|
||||
return( false);
|
||||
}
|
||||
|
||||
|
@ -552,7 +534,7 @@ function ImportMail( module, success, error) {
|
|||
if (mailInterface != null)
|
||||
mailInterface = mailInterface.QueryInterface( Components.interfaces.nsIImportGeneric);
|
||||
if (mailInterface == null) {
|
||||
error.data = GetBundleString( 'ImportMailBadModule');
|
||||
error.data = gImportMsgsBundle.getString('ImportMailBadModule');
|
||||
return( false);
|
||||
}
|
||||
|
||||
|
@ -566,7 +548,7 @@ function ImportMail( module, success, error) {
|
|||
filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker);
|
||||
if (filePicker != null) {
|
||||
try {
|
||||
filePicker.init( top.window, GetBundleString( 'ImportSelectMailDir'), Components.interfaces.nsIFilePicker.modeGetFolder);
|
||||
filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectMailDir'), Components.interfaces.nsIFilePicker.modeGetFolder);
|
||||
filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll);
|
||||
filePicker.show();
|
||||
if (filePicker.file && (filePicker.file.path.length > 0))
|
||||
|
@ -579,17 +561,17 @@ function ImportMail( module, success, error) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
error.data = GetBundleString( 'ImportMailNotFound');
|
||||
error.data = gImportMsgsBundle.getString('ImportMailNotFound');
|
||||
return( false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
error.data = GetBundleString( 'ImportMailNotFound');
|
||||
error.data = gImportMsgsBundle.getString('ImportMailNotFound');
|
||||
return( false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
error.data = GetBundleString( 'ImportMailNotFound');
|
||||
error.data = gImportMsgsBundle.getString('ImportMailNotFound');
|
||||
return( false);
|
||||
}
|
||||
}
|
||||
|
@ -612,7 +594,7 @@ function ImportMail( module, success, error) {
|
|||
// due to field maps...
|
||||
function ImportAddress( module, success, error) {
|
||||
if (top.progressInfo.importInterface || top.progressInfo.intervalState) {
|
||||
error.data = GetBundleString( 'ImportAlreadyInProgress');
|
||||
error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress');
|
||||
return( false);
|
||||
}
|
||||
|
||||
|
@ -622,7 +604,7 @@ function ImportAddress( module, success, error) {
|
|||
if (addInterface != null)
|
||||
addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric);
|
||||
if (addInterface == null) {
|
||||
error.data = GetBundleString( 'ImportAddressBadModule');
|
||||
error.data = gImportMsgsBundle.getString('ImportAddressBadModule');
|
||||
return( false);
|
||||
}
|
||||
|
||||
|
@ -644,7 +626,7 @@ function ImportAddress( module, success, error) {
|
|||
// as the user for the location or not?
|
||||
if (addInterface.GetStatus( "canUserSetLocation") == 0) {
|
||||
// an autofind address book that could not be found!
|
||||
error.data = GetBundleString( 'ImportAddressNotFound');
|
||||
error.data = gImportMsgsBundle.getString('ImportAddressNotFound');
|
||||
return( false);
|
||||
}
|
||||
|
||||
|
@ -652,12 +634,12 @@ function ImportAddress( module, success, error) {
|
|||
if (filePicker != null) {
|
||||
filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker);
|
||||
if (filePicker == null) {
|
||||
error.data = GetBundleString( 'ImportAddressNotFound');
|
||||
error.data = gImportMsgsBundle.getString('ImportAddressNotFound');
|
||||
return( false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
error.data = GetBundleString( 'ImportAddressNotFound');
|
||||
error.data = gImportMsgsBundle.getString('ImportAddressNotFound');
|
||||
return( false);
|
||||
}
|
||||
|
||||
|
@ -668,7 +650,7 @@ function ImportAddress( module, success, error) {
|
|||
if (addInterface.GetStatus( "supportsMultiple") != 0) {
|
||||
// ask for dir
|
||||
try {
|
||||
filePicker.init( top.window, GetBundleString( 'ImportSelectAddrDir'), Components.interfaces.nsIFilePicker.modeGetFolder);
|
||||
filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrDir'), Components.interfaces.nsIFilePicker.modeGetFolder);
|
||||
filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll);
|
||||
filePicker.show();
|
||||
if (filePicker.file && (filePicker.file.path.length > 0))
|
||||
|
@ -682,7 +664,7 @@ function ImportAddress( module, success, error) {
|
|||
else {
|
||||
// ask for file
|
||||
try {
|
||||
filePicker.init( top.window, GetBundleString( 'ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen);
|
||||
filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen);
|
||||
filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll);
|
||||
filePicker.show();
|
||||
if (filePicker.file && (filePicker.file.path.length > 0))
|
||||
|
|
|
@ -36,8 +36,8 @@ Rights Reserved.
|
|||
orient="vertical" style="width: 40em;"
|
||||
title="&importDialog.windowTitle;">
|
||||
|
||||
<script src="chrome://global/content/strres.js"/>
|
||||
<script src="chrome://messenger/content/importDialog.js"/>
|
||||
<stringbundle id="bundle_importMsgs" src="chrome://messenger/locale/importMsgs.properties"/>
|
||||
<script type="text/javascript" src="chrome://messenger/content/importDialog.js"/>
|
||||
|
||||
<keyset id="keyset"/>
|
||||
|
||||
|
|
|
@ -32,8 +32,7 @@ Rights Reserved.
|
|||
onload="OnLoadProgressDialog()"
|
||||
orient="vertical">
|
||||
|
||||
<script src="chrome://global/content/strres.js"/>
|
||||
<script src="chrome://messenger/content/importProgress.js"/>
|
||||
<script type="text/javascript" src="chrome://messenger/content/importProgress.js"/>
|
||||
|
||||
<keyset id="keyset"/>
|
||||
|
||||
|
|
|
@ -18,13 +18,13 @@
|
|||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Seth Spitzer <sspitzer@netscape.com>
|
||||
* Seth Spitzer <sspitzer@netscape.com>
|
||||
* Ben Goodger <ben@netscape.com>
|
||||
*/
|
||||
|
||||
var newmessages = "";
|
||||
var newsgroupname = "";
|
||||
var Bundle = srGetStrBundle("chrome://messenger/locale/news.properties");
|
||||
var gNewsBundle;
|
||||
var prefs = Components.classes['@mozilla.org/preferences;1'].getService();
|
||||
prefs = prefs.QueryInterface(Components.interfaces.nsIPref);
|
||||
|
||||
|
@ -38,55 +38,54 @@ var args = null;
|
|||
|
||||
function OnLoad()
|
||||
{
|
||||
doSetOKCancel(OkButtonCallback, CancelButtonCallback);
|
||||
doSetOKCancel(OkButtonCallback, CancelButtonCallback);
|
||||
gNewsBundle = document.getElementById("bundle_news");
|
||||
|
||||
if (window.arguments && window.arguments[0]) {
|
||||
if ("arguments" in window && window.arguments[0]) {
|
||||
args = window.arguments[0].QueryInterface( Components.interfaces.nsINewsDownloadDialogArgs);
|
||||
|
||||
args.hitOK = false; /* by default, act like the user hit cancel */
|
||||
args.downloadAll = false; /* by default, act like the user did not select download all */
|
||||
|
||||
var accountManager = Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager);
|
||||
server = accountManager.getIncomingServer(args.serverKey);
|
||||
nntpServer = server.QueryInterface(Components.interfaces.nsINntpIncomingServer);
|
||||
var accountManager = Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager);
|
||||
server = accountManager.getIncomingServer(args.serverKey);
|
||||
nntpServer = server.QueryInterface(Components.interfaces.nsINntpIncomingServer);
|
||||
|
||||
var downloadHeadersTitlePrefix = Bundle.GetStringFromName("downloadHeadersTitlePrefix");
|
||||
var downloadHeadersInfoText1 = Bundle.GetStringFromName("downloadHeadersInfoText1");
|
||||
var downloadHeadersInfoText2 = Bundle.GetStringFromName("downloadHeadersInfoText2");
|
||||
var okButtonText = Bundle.GetStringFromName("okButtonText");
|
||||
var downloadHeadersTitlePrefix = gNewsBundle.getString("downloadHeadersTitlePrefix");
|
||||
var downloadHeadersInfoText1 = gNewsBundle.getString("downloadHeadersInfoText1");
|
||||
var downloadHeadersInfoText2 = gNewsBundle.getString("downloadHeadersInfoText2");
|
||||
var okButtonText = gNewsBundle.getString("okButtonText");
|
||||
|
||||
window.title = downloadHeadersTitlePrefix;
|
||||
window.title = downloadHeadersTitlePrefix;
|
||||
|
||||
// this is not i18n friendly, fix this
|
||||
var infotext = downloadHeadersInfoText1 + " " + args.articleCount + " " + downloadHeadersInfoText2;
|
||||
setText('info',infotext);
|
||||
var infotext = downloadHeadersInfoText1 + " " + args.articleCount + " " + downloadHeadersInfoText2;
|
||||
setText('info',infotext);
|
||||
var okbutton = document.getElementById("ok");
|
||||
okbutton.setAttribute("value", okButtonText);
|
||||
setText("newsgroupLabel", args.groupName);
|
||||
}
|
||||
}
|
||||
|
||||
numberElement = document.getElementById("number");
|
||||
numberElement.value = nntpServer.maxArticles;
|
||||
numberElement = document.getElementById("number");
|
||||
numberElement.value = nntpServer.maxArticles;
|
||||
|
||||
markreadElement = document.getElementById("markread");
|
||||
markreadElement.checked = nntpServer.markOldRead;
|
||||
markreadElement = document.getElementById("markread");
|
||||
markreadElement.checked = nntpServer.markOldRead;
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
function setText(id, value) {
|
||||
var element = document.getElementById(id);
|
||||
if (!element) return;
|
||||
if (element.hasChildNodes())
|
||||
element.removeChild(element.firstChild);
|
||||
if (element.hasChildNodes())
|
||||
element.removeChild(element.firstChild);
|
||||
var textNode = document.createTextNode(value);
|
||||
element.appendChild(textNode);
|
||||
}
|
||||
|
||||
function OkButtonCallback() {
|
||||
nntpServer.maxArticles = numberElement.value;
|
||||
//dump("mark read checked?="+markreadElement.checked+"\n");
|
||||
nntpServer.markOldRead = markreadElement.checked;
|
||||
nntpServer.maxArticles = numberElement.value;
|
||||
nntpServer.markOldRead = markreadElement.checked;
|
||||
|
||||
var radio = document.getElementById("all");
|
||||
if (radio) {
|
||||
|
@ -94,24 +93,24 @@ function OkButtonCallback() {
|
|||
}
|
||||
|
||||
args.hitOK = true;
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
function CancelButtonCallback() {
|
||||
args.hitOK = false;
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
function setupDownloadUI(enable) {
|
||||
var checkbox = document.getElementById("markread");
|
||||
var numberFld = document.getElementById("number");
|
||||
var checkbox = document.getElementById("markread");
|
||||
var numberFld = document.getElementById("number");
|
||||
|
||||
if (enable) {
|
||||
checkbox.removeAttribute("disabled");
|
||||
numberFld.removeAttribute("disabled");
|
||||
}
|
||||
else {
|
||||
checkbox.setAttribute("disabled", "true");
|
||||
numberFld.setAttribute("disabled", "true");
|
||||
}
|
||||
if (enable) {
|
||||
checkbox.removeAttribute("disabled");
|
||||
numberFld.removeAttribute("disabled");
|
||||
}
|
||||
else {
|
||||
checkbox.setAttribute("disabled", "true");
|
||||
numberFld.setAttribute("disabled", "true");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,8 +34,8 @@ Contributor(s):
|
|||
orient="vertical"
|
||||
onload="OnLoad()">
|
||||
|
||||
<script language="JavaScript" src="chrome://global/content/strres.js" />
|
||||
<script language="JavaScript" src="chrome://messenger/content/downloadheaders.js" />
|
||||
<stringbundle id="bundle_news" src="chrome://messenger/locale/news.properties"/>
|
||||
<script type="text/javascript" src="chrome://messenger/content/downloadheaders.js" />
|
||||
|
||||
<keyset id="keyset"/>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче