1999-05-11 18:51:36 +00:00
|
|
|
<?xml version="1.0"?>
|
1999-07-16 23:50:25 +00:00
|
|
|
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
1999-05-11 18:51:36 +00:00
|
|
|
|
1999-05-17 22:56:09 +00:00
|
|
|
<!DOCTYPE window
|
|
|
|
[
|
|
|
|
<!ENTITY unknownWindow.title "Unknown File Type">
|
|
|
|
<!ENTITY startDownload "You have started to download a file of type">
|
|
|
|
<!ENTITY contentType.label "contentType goes here">
|
|
|
|
<!ENTITY dialogMore.label "More Info...">
|
|
|
|
<!ENTITY dialogPick.label "Pick App...">
|
|
|
|
<!ENTITY dialogSave.label "Save File...">
|
|
|
|
<!ENTITY dialogCancel.label "Cancel">
|
|
|
|
|
|
|
|
]>
|
1999-05-11 18:51:36 +00:00
|
|
|
|
|
|
|
<window xmlns:html="http://www.w3.org/TR/REC-html40"
|
|
|
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
1999-05-17 22:56:09 +00:00
|
|
|
title="&unknownWindow.title;"
|
1999-07-16 23:50:25 +00:00
|
|
|
onload="onLoad()"
|
|
|
|
onunload="onUnload()">
|
1999-05-11 18:51:36 +00:00
|
|
|
|
|
|
|
<html:script>
|
|
|
|
var data;
|
|
|
|
var dialog;
|
|
|
|
|
|
|
|
function initData() {
|
|
|
|
// Create data object and initialize.
|
|
|
|
data = new Object;
|
1999-07-16 23:50:25 +00:00
|
|
|
data.location = window.arguments[0];
|
|
|
|
data.contentType = window.arguments[1];
|
1999-05-11 18:51:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function initDialog() {
|
|
|
|
// Create dialog object and initialize.
|
|
|
|
dialog = new Object;
|
|
|
|
dialog.contentType = document.getElementById("dialog.contentType");
|
|
|
|
dialog.more = document.getElementById("dialog.more");
|
|
|
|
dialog.pick = document.getElementById("dialog.pick");
|
|
|
|
dialog.save = document.getElementById("dialog.save");
|
|
|
|
dialog.cancel = document.getElementById("dialog.cancel");
|
|
|
|
}
|
|
|
|
|
|
|
|
function loadDialog() {
|
|
|
|
// Set initial dialog field contents.
|
1999-07-16 23:50:25 +00:00
|
|
|
dialog.contentType.childNodes[0].nodeValue = " " + data.contentType;
|
1999-05-11 18:51:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function onLoad() {
|
|
|
|
// Init data.
|
|
|
|
initData();
|
|
|
|
|
|
|
|
// Init dialog.
|
|
|
|
initDialog();
|
|
|
|
|
|
|
|
// Fill dialog.
|
|
|
|
loadDialog();
|
|
|
|
}
|
|
|
|
|
1999-07-16 23:50:25 +00:00
|
|
|
function onUnload() {
|
|
|
|
// Nothing for now.
|
|
|
|
}
|
|
|
|
|
1999-05-11 18:51:36 +00:00
|
|
|
function more() {
|
1999-07-16 23:50:25 +00:00
|
|
|
// Have parent browser window go to appropriate web page.
|
|
|
|
var moreInfo = "http://cgi.netscape.com/cgi-bin/plug-in_finder.cgi?";
|
|
|
|
moreInfo += data.contentType;
|
|
|
|
window.opener.content.location = moreInfo;
|
1999-05-11 18:51:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function pick() {
|
1999-07-16 23:50:25 +00:00
|
|
|
alert( "PickApp not implemented yet!" );
|
1999-05-11 18:51:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function save() {
|
1999-07-16 23:50:25 +00:00
|
|
|
// Use stream xfer component to prompt for destination and save.
|
|
|
|
var xfer = Components.classes[ "component://netscape/appshell/component/xfer" ].getService();
|
|
|
|
xfer = xfer.QueryInterface( Components.interfaces.nsIStreamTransfer );
|
|
|
|
try {
|
|
|
|
// When Necko lands, we need to receive the real nsIChannel and
|
|
|
|
// do SelectFileAndTransferLocation!
|
|
|
|
|
|
|
|
// Use this for now...
|
|
|
|
xfer.SelectFileAndTransferLocationSpec( data.location );
|
|
|
|
} catch( exception ) {
|
|
|
|
// Failed (or cancelled), give them another chance.
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// Save underway, close this dialog.
|
|
|
|
window.close();
|
1999-05-11 18:51:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function cancel() {
|
|
|
|
// Close the window.
|
1999-07-16 23:50:25 +00:00
|
|
|
window.close();
|
1999-05-11 18:51:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
</html:script>
|
|
|
|
|
|
|
|
<html:table style="width:100%;">
|
|
|
|
<html:tr>
|
|
|
|
<html:td colspan="4">
|
1999-05-17 22:56:09 +00:00
|
|
|
&startDownload;
|
1999-07-16 23:50:25 +00:00
|
|
|
<html:strong>
|
|
|
|
<html:div id="dialog.contentType" style="display:inline;">
|
1999-05-17 22:56:09 +00:00
|
|
|
&contentType.label;
|
1999-05-11 18:51:36 +00:00
|
|
|
</html:div>
|
1999-07-16 23:50:25 +00:00
|
|
|
</html:strong>
|
1999-05-11 18:51:36 +00:00
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
|
|
|
|
|
|
|
<html:tr>
|
|
|
|
<html:td style="width:25%">
|
1999-06-10 23:45:54 +00:00
|
|
|
<html:button id="dialog.more" onclick="more()">&dialogMore.label;</html:button>
|
1999-05-11 18:51:36 +00:00
|
|
|
</html:td>
|
|
|
|
<html:td style="width:25%">
|
1999-06-10 23:45:54 +00:00
|
|
|
<html:button id="dialog.pick" onclick="pick()">&dialogPick.label;</html:button>
|
1999-05-11 18:51:36 +00:00
|
|
|
</html:td>
|
|
|
|
<html:td style="width:25%">
|
1999-05-17 22:56:09 +00:00
|
|
|
<html:button id="dialog.save" onclick="save()">&dialogSave.label;</html:button>
|
1999-05-11 18:51:36 +00:00
|
|
|
</html:td>
|
|
|
|
<html:td style="width:25%">
|
1999-05-17 22:56:09 +00:00
|
|
|
<html:button id="dialog.cancel" onclick="cancel()">&dialogCancel.label;</html:button>
|
1999-05-11 18:51:36 +00:00
|
|
|
</html:td>
|
|
|
|
</html:tr>
|
|
|
|
</html:table>
|
|
|
|
|
|
|
|
</window>
|