From 9e4e33053f4b174648ecfb7578b8f94c3fa03e5c Mon Sep 17 00:00:00 2001 From: "dbragg%netscape.com" Date: Mon, 29 Nov 1999 21:11:26 +0000 Subject: [PATCH] New confirmation dialog for xpinstall. Fixes bug #17506. r=dougt git-svn-id: svn://10.0.0.236/trunk@54586 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpinstall/res/content/MANIFEST | 2 + mozilla/xpinstall/res/content/Makefile.in | 2 + mozilla/xpinstall/res/content/institems.js | 93 +++++++++++++++++++ mozilla/xpinstall/res/content/institems.xul | 72 ++++++++++++++ mozilla/xpinstall/res/content/makefile.win | 12 ++- mozilla/xpinstall/res/locale/en-US/MANIFEST | 1 + .../xpinstall/res/locale/en-US/Makefile.in | 1 + .../xpinstall/res/locale/en-US/institems.dtd | 8 ++ .../xpinstall/res/locale/en-US/makefile.win | 6 +- 9 files changed, 194 insertions(+), 3 deletions(-) create mode 100644 mozilla/xpinstall/res/content/institems.js create mode 100644 mozilla/xpinstall/res/content/institems.xul create mode 100644 mozilla/xpinstall/res/locale/en-US/institems.dtd diff --git a/mozilla/xpinstall/res/content/MANIFEST b/mozilla/xpinstall/res/content/MANIFEST index 245bb639481..3786eb8aeb1 100644 --- a/mozilla/xpinstall/res/content/MANIFEST +++ b/mozilla/xpinstall/res/content/MANIFEST @@ -1,3 +1,5 @@ xpistatus.xul xpistatus.js progress.xul +institems.xul +institems.js diff --git a/mozilla/xpinstall/res/content/Makefile.in b/mozilla/xpinstall/res/content/Makefile.in index 9c38f32b365..d740aecfacf 100644 --- a/mozilla/xpinstall/res/content/Makefile.in +++ b/mozilla/xpinstall/res/content/Makefile.in @@ -31,6 +31,8 @@ EXPORT_RESOURCE_XPINSTALL = \ $(srcdir)/progress.html \ $(srcdir)/xpistatus.xul \ $(srcdir)/xpistatus.js \ + $(srcdir)/institems.xul \ + $(srcdir)/institems.js \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xpinstall/res/content/institems.js b/mozilla/xpinstall/res/content/institems.js new file mode 100644 index 00000000000..0e31543dde1 --- /dev/null +++ b/mozilla/xpinstall/res/content/institems.js @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (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 Communicator client code, released March + * 31, 1998. + * + * 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. + */ + +var toolkit; +var browser; +var dialog; + +// dialog param block +var param; + +function addTreeItem(num, modName, url) +{ + dump("Adding element " + num + " : " + name + "\n"); + var body = document.getElementById("theTreeBody"); + + var newitem = document.createElement('treeitem'); + var newrow = document.createElement('treerow'); + + newrow.setAttribute("rowNum", num); + newrow.setAttribute("rowName", modName); + + var elem = document.createElement('treecell'); + var text = document.createTextNode(modName); + elem.appendChild(text); + newrow.appendChild(elem); + + var elem = document.createElement('treecell'); + var text = document.createTextNode(url); + elem.appendChild(text); + newrow.appendChild(elem); + + newitem.appendChild(newrow); + body.appendChild(newitem); +} + + +function onLoad() +{ + param = window.arguments[0].QueryInterface( Components.interfaces.nsIDialogParamBlock ); + if( !param ) + { + dump( " error getting param block interface\n" ); + return; + } + + var i = 0; + var row = 0; + var moduleName; + var URL; + while (moduleName != "") + { + moduleName = param.GetString(i++); + URL = param.GetString(i++); + addTreeItem(row++, moduleName, URL); + } +} + + +function onOk() +{ + // set the okay button in the param block + if (param) + param.SetInt(0, 0 ); + + window.close(); +} + +function cancel() +{ + // set the cancel button in the param block + if (param) + param.SetInt(0, 1 ); + + window.close(); +} + diff --git a/mozilla/xpinstall/res/content/institems.xul b/mozilla/xpinstall/res/content/institems.xul new file mode 100644 index 00000000000..5f0b5cd3dda --- /dev/null +++ b/mozilla/xpinstall/res/content/institems.xul @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + &items.label; + + + + + + + + + + + + + + &componentList.label; + + + + + + + + + + + + &moduleName.label; + &moduleSource.label; + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/xpinstall/res/content/makefile.win b/mozilla/xpinstall/res/content/makefile.win index 4c9789f29f9..9d8c7e49f9a 100644 --- a/mozilla/xpinstall/res/content/makefile.win +++ b/mozilla/xpinstall/res/content/makefile.win @@ -25,11 +25,19 @@ DEPTH=..\..\.. include <$(DEPTH)\config\rules.mak> install:: $(DLL) - $(MAKE_INSTALL) progress.xul $(DIST)\bin\chrome\xpinstall\content\default + $(MAKE_INSTALL) progress.xul $(DIST)\bin\chrome\xpinstall\content\default $(MAKE_INSTALL) progress.html $(DIST)\bin\chrome\xpinstall\content\default $(MAKE_INSTALL) xpistatus.xul $(DIST)\bin\chrome\xpinstall\content\default $(MAKE_INSTALL) xpistatus.js $(DIST)\bin\chrome\xpinstall\content\default + $(MAKE_INSTALL) institems.xul $(DIST)\bin\chrome\xpinstall\content\default + $(MAKE_INSTALL) institems.js $(DIST)\bin\chrome\xpinstall\content\default clobber:: - rm -f $(DIST)\bin\chrome\xpinstall\content\*.* + rm -f $(DIST)\bin\chrome\xpinstall\content\default\progress.xul + rm -f $(DIST)\bin\chrome\xpinstall\content\default\progress.html + rm -f $(DIST)\bin\chrome\xpinstall\content\default\xpistatus.xul + rm -f $(DIST)\bin\chrome\xpinstall\content\default\xpistatus.js + rm -f $(DIST)\bin\chrome\xpinstall\content\default\institems.xul + rm -f $(DIST)\bin\chrome\xpinstall\content\default\institems.js + diff --git a/mozilla/xpinstall/res/locale/en-US/MANIFEST b/mozilla/xpinstall/res/locale/en-US/MANIFEST index 05bbe5da4be..6f8878988f8 100644 --- a/mozilla/xpinstall/res/locale/en-US/MANIFEST +++ b/mozilla/xpinstall/res/locale/en-US/MANIFEST @@ -1,3 +1,4 @@ xpinstall.properties progress.dtd xpistatus.dtd +institems.dtd diff --git a/mozilla/xpinstall/res/locale/en-US/Makefile.in b/mozilla/xpinstall/res/locale/en-US/Makefile.in index 3ace1b1f35d..c5ec77271fb 100644 --- a/mozilla/xpinstall/res/locale/en-US/Makefile.in +++ b/mozilla/xpinstall/res/locale/en-US/Makefile.in @@ -30,6 +30,7 @@ EXPORT_RESOURCE_XPINSTALL = \ $(srcdir)/xpinstall.properties \ $(srcdir)/progress.dtd \ $(srcdir)/xpistatus.dtd \ + $(srcdir)/institems.dtd \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xpinstall/res/locale/en-US/institems.dtd b/mozilla/xpinstall/res/locale/en-US/institems.dtd new file mode 100644 index 00000000000..3f1c53cf0d8 --- /dev/null +++ b/mozilla/xpinstall/res/locale/en-US/institems.dtd @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/mozilla/xpinstall/res/locale/en-US/makefile.win b/mozilla/xpinstall/res/locale/en-US/makefile.win index a6fd17e338f..212aa8b5978 100644 --- a/mozilla/xpinstall/res/locale/en-US/makefile.win +++ b/mozilla/xpinstall/res/locale/en-US/makefile.win @@ -29,7 +29,11 @@ install:: $(MAKE_INSTALL) progress.dtd $(DIST)\bin\chrome\xpinstall\locale\en-US $(MAKE_INSTALL) xpistatus.dtd $(DIST)\bin\chrome\xpinstall\locale\en-US $(MAKE_INSTALL) xpinstall.properties $(DIST)\bin\chrome\xpinstall\locale\en-US + $(MAKE_INSTALL) institems.dtd $(DIST)\bin\chrome\xpinstall\locale\en-US clobber:: - rm -f $(DIST)\bin\chrome\xpinstall\locale\en-US\*.* + rm -f $(DIST)\bin\chrome\xpinstall\locale\en-US\progress.dtd + rm -f $(DIST)\bin\chrome\xpinstall\locale\en-US\xpistatus.dtd + rm -f $(DIST)\bin\chrome\xpinstall\locale\en-US\xpinstall.properties + rm -f $(DIST)\bin\chrome\xpinstall\locale\en-US\institems.dtd