sample file

This commit is contained in:
gayatrib%netscape.com 1999-08-31 00:37:14 +00:00
parent bbcf28201f
commit 93aa8271de
3 changed files with 180 additions and 0 deletions

View File

@ -0,0 +1,67 @@
<?xml version="1.0"?>
<?xml-stylesheet href="../samples/xul.css" type="text/css"?>
<?xml-stylesheet href="progress.css" type="text/css"?>
<!DOCTYPE window
[
<!ENTITY downloadWindow.title "Migrating Profile">
<!ENTITY status "Status:">
<!ENTITY cancelButtonTitle "Cancel">
]
>
<window xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="Migrating Profile"
width="425"
height="225">
<data>
<broadcaster id="data.canceled" type="string" value="false"/>
</data>
<html:script>
function cancelInstall()
{
var cancelData = document.getElementById("data.canceled");
cancelData.setAttribute( "value", "true");
}
</html:script>
<html:center>
<html:table style="width:100%;">
<html:tr>
<html:td align="center">
<html:input id="dialog.uiPackageName" readonly="" style="background-color:lightgray;width:300px;"/>
</html:td>
</html:tr>
<html:tr>
<html:td nowrap="" style="border: 1px rgb(192,192,192);" align="center">
<html:input id="dialog.currentAction" readonly="" style="background-color:lightgray;width:450px;"/>
</html:td>
</html:tr>
<html:tr>
<html:td align="center" width="15%" nowrap="" style="border: 1px rgb(192,192,192);">
<progressmeter id="dialog.progress" mode="undetermined" style="width:300px;height:16px;">
</progressmeter>
</html:td>
</html:tr>
<html:tr>
<html:td align="center" width="3%" nowrap="" style="border: 1px rgb(192,192,192);">
<html:button onclick="cancelInstall()" height="12">
&cancelButtonTitle;
</html:button>
</html:td>
</html:tr>
</html:table>
</html:center>
</window>

View File

@ -0,0 +1,70 @@
<!--
This test exercises creation of DOM elements from the XUL document.
-->
<?xml-stylesheet type="text/css" href="dom-test-4.css"?>
<foo:foo xmlns:foo="http://foo.bar.com/xml#" xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<html:script>
var count = 0;
var selectIndex = 0;
function newElement(index)
{
var elem = document.createElement('foo:bar');
var text = document.createTextNode('Node ' + index);
elem.appendChild(text);
document.lastChild.appendChild(elem);
}
function addElements()
{
var i = 0;
for (i = 0; i &lt; 9; i++) {
newElement(i)
}
}
function toggleColor()
{
element = document.getElementById("SelectedElement");
var index = element.value;
var barElements = document.getElementsByTagName("bar");
var child1 = barElements[index];
dump("child: "+child1.value);
if (child1.getAttribute("enabled")) {
child1.removeAttribute("enabled");
}
else {
child1.setAttribute("enabled", "true");
}
if (selectIndex != index) {
var lastSelectedChild = barElements[selectIndex];
lastSelectedChild.removeAttribute("enabled");
}
selectIndex = index;
}
</html:script>
This is the place to test tree widgets...
<html:script>
addElements();
</html:script>
<html:input type="text" id="SelectedElement" size="15"/>
<html:input name="b2" type="button" value="Select Element" onclick="toggleColor();"/>
</foo:foo>

View File

@ -0,0 +1,43 @@
<html>
<head>
<title>XPConnect Example</title>
</head>
<body>
<script>
var profile = Components.classes["component://netscape/profile/profile-services"].createInstance();
profile = profile.QueryInterface(Components.interfaces.nsIProfileServices);
dump("profile = " + profile + "\n");
function TestMe()
{
var field = document.getElementById('Value');
//profile.CreateNewProfile("Test Succeeded!!");
var currentProfile = profile.GetCurrentProfile(); // GetCurrentProfile works
field.value = currentProfile;
//profile.RenameProfile(currentProfile, "NetscapeProfile"); // Rename works
var profileList = profile.GetProfileList(); // GetProfileList works
dump("Profile List : " + profileList + "\n");
//profile.DeleteProfile(currentProfile); // Delete works
//profile.StartCommunicator("mozProfile44"); // StartCommunicator works
//profile.CreateNewProfile("ProfileName=hello%ProfileDir="); // CreateNewProfile works
//profile.MigrateProfile("test"); // Migration works
}
</script>
<form name="form">
<input type="button" value="Test" onclick="TestMe();">
<input type="text" id="Value">
<form>
</body>
</html>