gecko-dev/xpfe/browser/resources/content/unknownContent.xul

104 строки
3.4 KiB
XML

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://navigator/skin/navigator.css" type="text/css"?>
<window xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="Unknown File Type"
width="425"
height="180"
onload="onLoad()">
<data>
<broadcaster id="data.location" type="url" value="url...to be replaced"/>
<broadcaster id="data.contentType" type="string" value="content-type...to be replaced"/>
<!-- Commands: more/pick/save/close -->
<broadcaster id="data.execute" command=""/>
</data>
<html:script>
var data;
var dialog;
function initData() {
// Create data object and initialize.
data = new Object;
data.location = document.getElementById("data.location");
data.contentType = document.getElementById("data.contentType");
data.execute = document.getElementById("data.execute");
}
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.
dialog.contentType.childNodes[0].nodeValue = " " + data.contentType.getAttribute( "value" );
}
function onLoad() {
// Init data.
initData();
// Init dialog.
initDialog();
// Fill dialog.
loadDialog();
}
function more() {
dump( "unknownContent::more not implemented\n" );
}
function pick() {
dump( "unknownContent::pick not implemented\n" );
}
function save() {
// Execute "save to disk" logic.
data.execute.setAttribute("command","save");
}
function cancel() {
// Close the window.
data.execute.setAttribute("command","close");
}
</html:script>
<html:table style="width:100%;">
<html:tr>
<html:td colspan="4">
You have started to download a file of type
<html:div id="dialog.contentType" style="display:inline">
contentType goes here
</html:div>
</html:td>
</html:tr>
<html:tr>
<html:td style="width:25%">
<html:button id="dialog.more" onclick="more()" disabled="">More Info...</html:button>
</html:td>
<html:td style="width:25%">
<html:button id="dialog.pick" onclick="pick()" disabled="">Pick App...</html:button>
</html:td>
<html:td style="width:25%">
<html:button id="dialog.save" onclick="save()">Save File...</html:button>
</html:td>
<html:td style="width:25%">
<html:button id="dialog.cancel" onclick="cancel()">Cancel</html:button>
</html:td>
</html:tr>
</html:table>
</window>