2000-01-03 07:09:55 +03:00
|
|
|
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* sspitzer@netscape.com
|
|
|
|
*/
|
|
|
|
|
|
|
|
var newmessages = "";
|
|
|
|
var newsgroupname = "";
|
|
|
|
var Bundle = srGetStrBundle("chrome://messenger/locale/news.properties");
|
2000-01-03 08:11:51 +03:00
|
|
|
var prefs = Components.classes['component://netscape/preferences'].getService();
|
|
|
|
prefs = prefs.QueryInterface(Components.interfaces.nsIPref);
|
2000-01-03 07:09:55 +03:00
|
|
|
|
2000-01-13 11:12:12 +03:00
|
|
|
var serverid = null;
|
|
|
|
var markreadElement = null;
|
|
|
|
var numberElement = null;
|
|
|
|
|
2000-01-13 11:37:26 +03:00
|
|
|
var accountManager = Components.classes["component://netscape/messenger/account-manager"].getService(Components.interfaces.nsIMsgAccountManager);
|
|
|
|
var server = accountManager.getIncomingServer(serverid);
|
|
|
|
var nntpServer = server.QueryInterface(Components.interfaces.nsINntpIncomingServer);
|
|
|
|
|
|
|
|
|
1999-12-29 02:08:33 +03:00
|
|
|
function OnLoad()
|
|
|
|
{
|
2000-01-13 11:12:12 +03:00
|
|
|
doSetOKCancel(OkButtonCallback, null);
|
1999-12-29 06:48:46 +03:00
|
|
|
|
|
|
|
if (window.arguments && window.arguments[0]) {
|
2000-01-13 11:12:12 +03:00
|
|
|
var args = window.arguments[0].split(",");
|
2000-01-13 11:37:26 +03:00
|
|
|
// args will be of the form <number>,<newsgroup name>,<serverid>
|
2000-01-13 11:12:12 +03:00
|
|
|
newmessages = args[0];
|
|
|
|
newsgroupname = args[1];
|
2000-01-13 11:37:26 +03:00
|
|
|
serverid = args[2];
|
2000-01-03 07:09:55 +03:00
|
|
|
|
2000-01-13 11:12:12 +03:00
|
|
|
dump("new message count = " + newmessages + "\n");
|
|
|
|
dump("newsgroup name = " + newsgroupname + "\n");
|
|
|
|
dump("serverid = " + serverid + "\n");
|
2000-01-03 07:09:55 +03:00
|
|
|
|
|
|
|
var downloadHeadersTitlePrefix = Bundle.GetStringFromName("downloadHeadersTitlePrefix");
|
|
|
|
var downloadHeadersInfoText1 = Bundle.GetStringFromName("downloadHeadersInfoText1");
|
|
|
|
var downloadHeadersInfoText2 = Bundle.GetStringFromName("downloadHeadersInfoText2");
|
|
|
|
|
|
|
|
// doesn't JS have a printf?
|
|
|
|
window.title = downloadHeadersTitlePrefix + " " + newsgroupname;
|
|
|
|
var infotext = downloadHeadersInfoText1 + " " + newmessages + " " + downloadHeadersInfoText2;
|
|
|
|
setDivText('info',infotext);
|
1999-12-29 06:48:46 +03:00
|
|
|
}
|
2000-01-03 08:11:51 +03:00
|
|
|
|
|
|
|
|
2000-01-13 11:12:12 +03:00
|
|
|
numberElement = document.getElementById("number");
|
2000-01-13 11:37:26 +03:00
|
|
|
numberElement.value = nntpServer.maxArticles;
|
2000-01-03 08:11:51 +03:00
|
|
|
|
2000-01-13 11:12:12 +03:00
|
|
|
markreadElement = document.getElementById("markread");
|
2000-01-13 11:37:26 +03:00
|
|
|
markreadElement.checked = nntpServer.markOldRead;
|
2000-01-03 08:11:51 +03:00
|
|
|
|
1999-12-29 02:08:33 +03:00
|
|
|
return true;
|
|
|
|
}
|
2000-01-03 07:09:55 +03:00
|
|
|
|
|
|
|
function setDivText(divname, value) {
|
|
|
|
var div = document.getElementById(divname);
|
|
|
|
if (!div) return;
|
|
|
|
if (div.firstChild)
|
|
|
|
div.removeChild(div.firstChild);
|
|
|
|
div.appendChild(document.createTextNode(value));
|
|
|
|
}
|
|
|
|
|
2000-01-13 11:12:12 +03:00
|
|
|
function OkButtonCallback() {
|
|
|
|
nntpServer.maxArticles = numberElement.value;
|
2000-01-13 11:37:26 +03:00
|
|
|
nntpServer.markOldRead = markreadElement.checked;
|
2000-01-13 11:12:12 +03:00
|
|
|
}
|