From 9a364aed7ae993db852495d74983ec7f8562b3ae Mon Sep 17 00:00:00 2001 From: "ben%netscape.com" Date: Tue, 30 Oct 2001 11:02:56 +0000 Subject: [PATCH] 102477 - Download Manager adding initial XUL & js files for window, basic listview/toolbar UI, controllers etc. NOT PART OF BUILD! --- xpfe/components/download-manager/makefile.win | 28 +++ .../content/downloadItemProperties.xul | 76 +++++++ .../resources/content/downloadmanager.js | 120 +++++++++++ .../resources/content/downloadmanager.xul | 200 ++++++++++++++++++ .../download-manager/resources/content/jar.mn | 4 + .../resources/content/makefile.win | 24 +++ .../resources/locale/downloadmanager.ent | 21 ++ .../download-manager/resources/locale/jar.mn | 3 + .../resources/locale/makefile.win | 24 +++ .../resources/locale/win/jar.mn | 3 + .../resources/locale/win/makefile.win | 24 +++ .../resources/locale/win/platformStrings.ent | 4 + 12 files changed, 531 insertions(+) create mode 100644 xpfe/components/download-manager/makefile.win create mode 100644 xpfe/components/download-manager/resources/content/downloadItemProperties.xul create mode 100644 xpfe/components/download-manager/resources/content/downloadmanager.js create mode 100644 xpfe/components/download-manager/resources/content/downloadmanager.xul create mode 100644 xpfe/components/download-manager/resources/content/jar.mn create mode 100644 xpfe/components/download-manager/resources/content/makefile.win create mode 100644 xpfe/components/download-manager/resources/locale/downloadmanager.ent create mode 100644 xpfe/components/download-manager/resources/locale/jar.mn create mode 100644 xpfe/components/download-manager/resources/locale/makefile.win create mode 100644 xpfe/components/download-manager/resources/locale/win/jar.mn create mode 100644 xpfe/components/download-manager/resources/locale/win/makefile.win create mode 100644 xpfe/components/download-manager/resources/locale/win/platformStrings.ent diff --git a/xpfe/components/download-manager/makefile.win b/xpfe/components/download-manager/makefile.win new file mode 100644 index 000000000000..38711569b37b --- /dev/null +++ b/xpfe/components/download-manager/makefile.win @@ -0,0 +1,28 @@ +#!nmake +# +# 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): + +DEPTH=..\..\.. + +DIRS=resources\content resources\locale resources\locale\win + +include <$(DEPTH)\config\rules.mak> + + diff --git a/xpfe/components/download-manager/resources/content/downloadItemProperties.xul b/xpfe/components/download-manager/resources/content/downloadItemProperties.xul new file mode 100644 index 000000000000..fde51d48e2bb --- /dev/null +++ b/xpfe/components/download-manager/resources/content/downloadItemProperties.xul @@ -0,0 +1,76 @@ + + + + + +%platformDTD; + +%downloadItemProperties; +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xpfe/components/download-manager/resources/content/downloadmanager.js b/xpfe/components/download-manager/resources/content/downloadmanager.js new file mode 100644 index 000000000000..b842b0964d60 --- /dev/null +++ b/xpfe/components/download-manager/resources/content/downloadmanager.js @@ -0,0 +1,120 @@ + +var gDownloadView = null; +var gDownloadViewChildren = null; + +function Startup() +{ + gDownloadView = document.getElementById("downloadView"); + gDownloadViewChildren = document.getElementById("downloadViewChildren"); + + // Select the first item in the view, if any. + if (gDownloadViewChildren.hasChildNodes()) + gDownloadView.selectItem(gDownloadViewChildren.firstChild); + + gDownloadView.controllers.appendController(downloadViewController); +} + +function Shutdown() +{ + +} + +var downloadView = { + onClick: function downloadView_click(aEvent) + { + + }, + + onSelect: function downloadView_select(aEvent) + { + + }, + +}; + +var downloadViewController = { + supportsCommand: function dVC_supportsCommand (aCommand) + { + switch (aCommand) { + case "cmd_downloadFile": + case "cmd_properties": + case "cmd_pause": + case "cmd_delete": + case "cmd_openfile": + case "cmd_showinshell": + case "cmd_selectAll": + return true; + } + return false; + }, + + isCommandEnabled: function dVC_isCommandEnabled (aCommand) + { + var cmds = ["cmd_properties", "cmd_pause", "cmd_delete", + "cmd_openfile", "cmd_showinshell"]; + var selectionCount = gDownloadView.selectedItems.length; + switch (aCommand) { + case "cmd_downloadFile": + return true; + case "cmd_properties": + case "cmd_openfile": + case "cmd_showinshell": + return selectionCount == 1; + case "cmd_pause": + case "cmd_delete": + return selectionCount > 0; + case "cmd_selectAll": + return gDownloadViewChildren.childNodes.length != selectionCount; + default: + } + }, + + doCommand: function dVC_doCommand (aCommand) + { + dump("*** command = " + aCommand + "\n"); + switch (aCommand) { + case "cmd_downloadFile": + dump("*** show a dialog that lets a user specify a URL to download\n"); + break; + case "cmd_properties": + dump("*** show properties for selected item\n"); + break; + case "cmd_openfile": + dump("*** launch the file for the selected item\n"); + break; + case "cmd_showinshell": + dump("*** show the containing folder for the selected item\n"); + break; + case "cmd_pause": + dump("*** pause the transfer for the selected item\n"); + break; + case "cmd_delete": + dump("*** delete entries for the selection\n"); + // a) Prompt user to confirm end of transfers in progress + // b) End transfers + // c) Delete entries from datasource + break; + case "cmd_selectAll": + gDownloadView.selectAll(); + break; + default: + } + }, + + onEvent: function dVC_onEvent (aEvent) + { + switch (aEvent) { + case "tree-select": + this.onCommandUpdate(); + } + }, + + onCommandUpdate: function dVC_onCommandUpdate () + { + var cmds = ["cmd_properties", "cmd_pause", "cmd_delete", + "cmd_openfile", "cmd_showinshell"]; + for (var command in cmds) + goUpdateCommand(cmds[command]); + } +}; + diff --git a/xpfe/components/download-manager/resources/content/downloadmanager.xul b/xpfe/components/download-manager/resources/content/downloadmanager.xul new file mode 100644 index 000000000000..f657c10ca704 --- /dev/null +++ b/xpfe/components/download-manager/resources/content/downloadmanager.xul @@ -0,0 +1,200 @@ + + + + + + + + +%platformDTD; + +%downloadManagerDTD; +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xpfe/components/download-manager/resources/content/jar.mn b/xpfe/components/download-manager/resources/content/jar.mn new file mode 100644 index 000000000000..54a267d51eaf --- /dev/null +++ b/xpfe/components/download-manager/resources/content/jar.mn @@ -0,0 +1,4 @@ +comm.jar: + content/communicator/downloadmanager/downloadmanager.xul + content/communicator/downloadmanager/downloadmanager.js + diff --git a/xpfe/components/download-manager/resources/content/makefile.win b/xpfe/components/download-manager/resources/content/makefile.win new file mode 100644 index 000000000000..9e65ac7cab31 --- /dev/null +++ b/xpfe/components/download-manager/resources/content/makefile.win @@ -0,0 +1,24 @@ +#!nmake +# 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 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) 1999 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# +DEPTH = ..\..\..\..\.. + +include <$(DEPTH)\config\rules.mak> diff --git a/xpfe/components/download-manager/resources/locale/downloadmanager.ent b/xpfe/components/download-manager/resources/locale/downloadmanager.ent new file mode 100644 index 000000000000..4441a9c3cfb7 --- /dev/null +++ b/xpfe/components/download-manager/resources/locale/downloadmanager.ent @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/xpfe/components/download-manager/resources/locale/jar.mn b/xpfe/components/download-manager/resources/locale/jar.mn new file mode 100644 index 000000000000..d6da79eb757e --- /dev/null +++ b/xpfe/components/download-manager/resources/locale/jar.mn @@ -0,0 +1,3 @@ +en-US.jar: + locale/en-US/communicator/downloadmanager/downloadmanager.ent + diff --git a/xpfe/components/download-manager/resources/locale/makefile.win b/xpfe/components/download-manager/resources/locale/makefile.win new file mode 100644 index 000000000000..9e65ac7cab31 --- /dev/null +++ b/xpfe/components/download-manager/resources/locale/makefile.win @@ -0,0 +1,24 @@ +#!nmake +# 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 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) 1999 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# +DEPTH = ..\..\..\..\.. + +include <$(DEPTH)\config\rules.mak> diff --git a/xpfe/components/download-manager/resources/locale/win/jar.mn b/xpfe/components/download-manager/resources/locale/win/jar.mn new file mode 100644 index 000000000000..28ec85197665 --- /dev/null +++ b/xpfe/components/download-manager/resources/locale/win/jar.mn @@ -0,0 +1,3 @@ +en-US.jar: + locale/en-US/communicator/downloadmanager/platformStrings.ent + diff --git a/xpfe/components/download-manager/resources/locale/win/makefile.win b/xpfe/components/download-manager/resources/locale/win/makefile.win new file mode 100644 index 000000000000..32d95cb4db06 --- /dev/null +++ b/xpfe/components/download-manager/resources/locale/win/makefile.win @@ -0,0 +1,24 @@ +#!nmake +# 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 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) 1999 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# +DEPTH = ..\..\..\..\..\.. + +include <$(DEPTH)\config\rules.mak> diff --git a/xpfe/components/download-manager/resources/locale/win/platformStrings.ent b/xpfe/components/download-manager/resources/locale/win/platformStrings.ent new file mode 100644 index 000000000000..4795538d9443 --- /dev/null +++ b/xpfe/components/download-manager/resources/locale/win/platformStrings.ent @@ -0,0 +1,4 @@ + + + +