# HG changeset patch # User Joshua Cranmer # Date 1527771420 -7200 # Node ID fbafd43c7a864eae5f47ddb196b196dd9b240e52 # Parent 058bced4bbe0a8498a9c8c8102ea41148dfb4608 Bug 457333 - Cleanup subscribe dialog code. r=jorgk a=jorgk DONTBUILD Applies remaining changes from jcranmer's derdf/subscribedefork and derdf/subscribe-fatrip patches. diff --git a/mailnews/base/content/subscribe.js b/mailnews/base/content/subscribe.js --- a/mailnews/base/content/subscribe.js +++ b/mailnews/base/content/subscribe.js @@ -9,28 +9,23 @@ var gSubscribeTree = null; var gSubscribeBody = null; var gSearchTree; var okCallback = null; var gChangeTable = {}; var gServerURI = null; var gSubscribableServer = null; var gNameField = null; var gNameFieldLabel = null; -var gFolderDelimiter = "."; var gStatusFeedback; var gSubscribeDeck = null; var gSearchView = null; var gSearchTreeBoxObject = null; var gItemsFound = new Map(); var gSubscribeBundle; -function goDoCommand() -{ -} - function Stop() { //dump("Stop()\n") if (gSubscribableServer) { gSubscribableServer.stopPopulating(msgWindow); } } @@ -46,26 +41,16 @@ function SetServerTypeSpecificTextValues let currentListTab = "currentListTab-" + serverType; let currentListTabLabel = gSubscribeBundle.getString(currentListTab + ".label"); let currentListTabAccesskey = gSubscribeBundle.getString(currentListTab + ".accesskey"); document.getElementById("currentListTab").setAttribute("label", currentListTabLabel); document.getElementById("currentListTab").setAttribute("accesskey", currentListTabAccesskey); document.getElementById("newGroupsTab").collapsed = (serverType != "nntp"); // show newGroupsTab only for nntp servers document.getElementById("subscribeLabel").setAttribute("value", subscribeLabelString); - - // XXX this isn't used right now. - //set the delimiter - try { - gFolderDelimiter = gSubscribableServer.delimiter; - } - catch (ex) { - //dump(ex + "\n"); - gFolderDelimiter = "."; - } } function onServerClick(aFolder) { gServerURI = aFolder.server.serverURI; let serverMenu = document.getElementById("serverMenu"); serverMenu.menupopup.selectFolder(aFolder); @@ -216,44 +201,44 @@ function SubscribeOnLoad() gNameField = document.getElementById("namefield"); gNameFieldLabel = document.getElementById("namefieldlabel"); gSubscribeDeck = document.getElementById("subscribedeck"); msgWindow = Cc["@mozilla.org/messenger/msgwindow;1"] .createInstance(Ci.nsIMsgWindow); msgWindow.domWindow = window; - gStatusFeedback = new nsMsgStatusFeedback + gStatusFeedback = new nsMsgStatusFeedback; msgWindow.statusFeedback = gStatusFeedback; msgWindow.rootDocShell.allowAuth = true; msgWindow.rootDocShell.appType = Ci.nsIDocShell.APP_TYPE_MAIL; // look in arguments[0] for parameters if (window.arguments && window.arguments[0]) { - if ( window.arguments[0].okCallback ) { + if (window.arguments[0].okCallback) { top.okCallback = window.arguments[0].okCallback; } } var serverMenu = document.getElementById("serverMenu"); gServerURI = null; - let folder = window.arguments[0].folder; + let folder = ("folder" in window.arguments[0]) ? window.arguments[0].folder : null; if (folder && folder.server instanceof Ci.nsISubscribableServer) { serverMenu.menupopup.selectFolder(folder.server.rootMsgFolder); try { - CleanUpSearchView(); + CleanUpSearchView(); gSubscribableServer = folder.server.QueryInterface(Ci.nsISubscribableServer); - // enable (or disable) the search related UI - EnableSearchUI(); + // Enable (or disable) the search related UI. + EnableSearchUI(); gServerURI = folder.server.serverURI; } catch (ex) { //dump("not a subscribable server\n"); - CleanUpSearchView(); + CleanUpSearchView(); gSubscribableServer = null; gServerURI = null; } } if (!gServerURI) { //dump("subscribe: no uri\n"); //dump("xxx todo: use the default news server. right now, I'm just using the first server\n"); diff --git a/mailnews/base/content/subscribe.xul b/mailnews/base/content/subscribe.xul --- a/mailnews/base/content/subscribe.xul +++ b/mailnews/base/content/subscribe.xul @@ -105,21 +105,22 @@ + onkeypress="onSearchTreeKeyPress(event);" + onclick="SearchOnClick(event);"> + flex="10" hideheader="true" + sortDirection="ascending"/> @@ -141,17 +142,17 @@ - +