diff --git a/mailnews/news/resources/content/MANIFEST b/mailnews/news/resources/content/MANIFEST index cd9dc8a89298..574db3bf5272 100644 --- a/mailnews/news/resources/content/MANIFEST +++ b/mailnews/news/resources/content/MANIFEST @@ -16,11 +16,7 @@ # Rights Reserved. # # Contributor(s): -# -# This is a list of local files which get copied to the res\mailnews\messenger directory -# +# sspitzer@netscape.com -news-test.js -news-test.xul downloadheaders.js downloadheaders.xul diff --git a/mailnews/news/resources/content/Makefile.in b/mailnews/news/resources/content/Makefile.in index ab070efaf0f3..445981aceca1 100644 --- a/mailnews/news/resources/content/Makefile.in +++ b/mailnews/news/resources/content/Makefile.in @@ -26,19 +26,17 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -SAMPLES_DIR = $(DIST)/bin/chrome/messenger/content/default +CHROME_DIR = $(DIST)/bin/chrome/messenger/content/default -EXPORT_RESOURCE_SAMPLES = \ - news-test.xul \ - news-test.js \ +EXPORT_RESOURCES = \ downloadheaders.xul \ downloadheaders.js \ $(NULL) include $(topsrcdir)/config/rules.mk -GARBAGE += $(addprefix $(SAMPLES_DIR)/, $(EXPORT_RESOURCE_SAMPLES)) +GARBAGE += $(addprefix $(CHROME_DIR)/, $(EXPORT_RESOURCES)) install:: - $(INSTALL) $(addprefix $(srcdir)/, $(EXPORT_RESOURCE_SAMPLES)) $(SAMPLES_DIR) + $(INSTALL) $(addprefix $(srcdir)/, $(EXPORT_RESOURCES)) $(CHROME_DIR) diff --git a/mailnews/news/resources/content/downloadheaders.js b/mailnews/news/resources/content/downloadheaders.js index 260de059a2ab..b33b69d1b5d8 100644 --- a/mailnews/news/resources/content/downloadheaders.js +++ b/mailnews/news/resources/content/downloadheaders.js @@ -1,9 +1,61 @@ +/* -*- 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"); + function OnLoad() { dump("OnLoad()\n"); if (window.arguments && window.arguments[0]) { - dump(window.arguments[0] + "\n"); + var args = window.arguments[0]; + // args will be of the form , + var commapos = args.indexOf(','); + newmessages = args.substring(0,commapos); + newsgroupname = args.substring(commapos+1); + + //dump("new message count = " + newmessages + "\n"); + //dump("newsgroup name = " + newsgroupname + "\n"); + + 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); } return true; } + +function setDivText(divname, value) { + var div = document.getElementById(divname); + if (!div) return; + if (div.firstChild) + div.removeChild(div.firstChild); + div.appendChild(document.createTextNode(value)); +} + diff --git a/mailnews/news/resources/content/downloadheaders.xul b/mailnews/news/resources/content/downloadheaders.xul index 3eecb22289bf..734af1cd357c 100644 --- a/mailnews/news/resources/content/downloadheaders.xul +++ b/mailnews/news/resources/content/downloadheaders.xul @@ -30,17 +30,14 @@ Rights Reserved. xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" align="vertical" class="dialog" - onload="OnLoad()" - title="&window.title;" - style="padding:10px"> + onload="OnLoad()"> + - - - + - &info.label; + &all.label; diff --git a/mailnews/news/resources/content/makefile.win b/mailnews/news/resources/content/makefile.win index c76469a79779..6393541cee7f 100644 --- a/mailnews/news/resources/content/makefile.win +++ b/mailnews/news/resources/content/makefile.win @@ -24,14 +24,10 @@ DEPTH=..\..\..\.. include <$(DEPTH)\config\rules.mak> install:: - $(MAKE_INSTALL) news-test.xul $(DIST)\bin\chrome\messenger\content\default - $(MAKE_INSTALL) news-test.js $(DIST)\bin\chrome\messenger\content\default $(MAKE_INSTALL) downloadheaders.js $(DIST)\bin\chrome\messenger\content\default $(MAKE_INSTALL) downloadheaders.xul $(DIST)\bin\chrome\messenger\content\default clobber:: - rm -f $(DIST)\bin\chrome\messenger\content\default\news-test.xul - rm -f $(DIST)\bin\chrome\messenger\content\default\news-test.js rm -f $(DIST)\bin\chrome\messenger\content\default\downloadheaders.js rm -f $(DIST)\bin\chrome\messenger\content\default\downloadheaders.xul diff --git a/mailnews/news/resources/locale/en-US/MANIFEST b/mailnews/news/resources/locale/en-US/MANIFEST index dd198dc91d43..6eecee5b3436 100644 --- a/mailnews/news/resources/locale/en-US/MANIFEST +++ b/mailnews/news/resources/locale/en-US/MANIFEST @@ -1 +1,2 @@ downloadheaders.dtd +news.properties diff --git a/mailnews/news/resources/locale/en-US/Makefile.in b/mailnews/news/resources/locale/en-US/Makefile.in index 268b10dbc9a6..030f9f0bb832 100644 --- a/mailnews/news/resources/locale/en-US/Makefile.in +++ b/mailnews/news/resources/locale/en-US/Makefile.in @@ -28,6 +28,7 @@ include $(DEPTH)/config/autoconf.mk EXPORT_RESOURCE_CONTENT = \ $(srcdir)/downloadheaders.dtd \ + $(srcdir)/news.properties \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/mailnews/news/resources/locale/en-US/downloadheaders.dtd b/mailnews/news/resources/locale/en-US/downloadheaders.dtd index e14b8667f889..f80a570b9146 100644 --- a/mailnews/news/resources/locale/en-US/downloadheaders.dtd +++ b/mailnews/news/resources/locale/en-US/downloadheaders.dtd @@ -18,8 +18,6 @@ Communications Corporation. Portions created by Netscape are Rights Reserved. --> - - diff --git a/mailnews/news/resources/locale/en-US/makefile.win b/mailnews/news/resources/locale/en-US/makefile.win index f7e65444a5cb..244c5619a9a3 100644 --- a/mailnews/news/resources/locale/en-US/makefile.win +++ b/mailnews/news/resources/locale/en-US/makefile.win @@ -27,6 +27,7 @@ LOCALEDIR=$(DIST)\bin\chrome\messenger\locale\en-US install:: $(MAKE_INSTALL) downloadheaders.dtd $(LOCALEDIR) + $(MAKE_INSTALL) news.properties $(LOCALEDIR) clobber:: rm -f $(DIST)\bin\chrome\messenger\locale\en-US\*.* diff --git a/mailnews/news/resources/locale/en-US/news.properties b/mailnews/news/resources/locale/en-US/news.properties new file mode 100644 index 000000000000..857493969417 --- /dev/null +++ b/mailnews/news/resources/locale/en-US/news.properties @@ -0,0 +1,23 @@ +# 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): +# Seth Spitzer +# +downloadHeadersTitlePrefix=Download headers for: +downloadHeadersInfoText1=There are +downloadHeadersInfoText2=new message headers to download for this newsgroup.