gecko-dev/profile/resources/pm.xul

190 lines
4.9 KiB
Plaintext
Raw Normal View History

1999-06-08 00:30:00 +00:00
<?xml version="1.0"?>
1999-06-08 17:08:18 +00:00
<?xml-stylesheet href="pm.css" type="text/css"?>
1999-06-08 00:30:00 +00:00
<window
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<html:script>
var profileCore = "";
var profileList = "";
var lastNum = -1;
var lastName = "";
function CreateProfile()
{
// Need to call CreateNewProfile xuls
this.location.replace("resource:/res/profile/cpwManager.xul");
}
1999-06-08 21:34:19 +00:00
function RenameProfile(w)
1999-06-08 00:30:00 +00:00
{
1999-06-08 21:34:19 +00:00
dump("RenameProfile\n");
var newName = w.document.getElementById("NewName").value;
dump("RenameProfile : " + lastName + " to " + newName + "\n");
1999-06-08 00:30:00 +00:00
if (lastName != "")
{
dump("Rename '" + lastName + "'\n");
1999-06-08 21:34:19 +00:00
profileCore.RenameProfile(lastName, newName);
1999-06-08 00:30:00 +00:00
this.location.replace(this.location);
}
else
dump("Select a profile before clicking the rename button.\n");
}
function DeleteProfile()
{
if (lastName != "")
{
dump("Delete '" + lastName + "'\n");
profileCore.DeleteProfile(lastName);
this.location.replace(this.location);
}
else
dump("Select a profile before clicking the delete button.\n");
}
function ExitManager()
{
var toolkitCore = XPAppCoresManager.Find("toolkitCore");
if (!toolkitCore) {
toolkitCore = new ToolkitCore();
if (toolkitCore) {
toolkitCore.Init("toolkitCore");
}
}
if (toolkitCore) {
toolkitCore.CloseWindow(parent);
}
}
1999-06-08 21:34:19 +00:00
function addTreeItem(num, name)
1999-06-08 00:30:00 +00:00
{
dump("Adding element " + num + " : " + name + "\n");
var body = document.getElementById("theTreeBody");
var newitem = document.createElement('treeitem');
newitem.setAttribute("rowID", num);
newitem.setAttribute("rowName", name);
var elem = document.createElement('treecell');
// Hack in a differentation for migration
if (num % 2 == 0)
var text = document.createTextNode('Migrate');
else
var text = document.createTextNode('');
elem.appendChild(text);
newitem.appendChild(elem);
var elem = document.createElement('treecell');
var text = document.createTextNode(name);
elem.appendChild(text);
newitem.appendChild(elem);
body.appendChild(newitem);
}
function showSelection(node)
{
// (see tree's onclick definition)
// Tree events originate in the smallest clickable object which is the cell. The object
// originating the event is available as event.target. We want the cell's row, so we go
// one further and get event.target.parentNode.
lastNum = node.getAttribute("rowID");
lastName = node.getAttribute("rowName");
dump("Selected " + lastNum + " : " + lastName + "\n");
}
function loadElements()
{
dump("hacked onload handler adds elements to tree widget\n");
profileCore = XPAppCoresManager.Find("ProfileCore");
if (!profileCore)
{
dump("!profileCore\n");
profileCore = new ProfileCore();
if (profileCore) {
dump("after ! yes profileCore in if loop\n");
profileCore.Init("ProfileCore");
}
else {
dump("profile not created\n");
}
}
if (profileCore)
profileList = profileCore.GetProfileList();
profileList = profileList.split(",");
for (var i=0; i &lt; profileList.length; i++)
1999-06-08 21:34:19 +00:00
addTreeItem(i, profileList[i]);
1999-06-08 00:30:00 +00:00
}
// -------------------------------------------- begin Hack for OnLoad handling
setTimeout("loadElements()", 0);
// -------------------------------------------- end Hack for OnLoad handling
</html:script>
1999-06-08 21:34:19 +00:00
[[[[ Please ignore these fields until popups behave better
1999-06-08 00:30:00 +00:00
<popup id="renamePopup">
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="200" height="50">
1999-06-08 21:34:19 +00:00
If you don't type in the input field, it works.
<html:input type="text" id="NewName" size="20" value="zz" />
<titledbutton value="Ok" class="push" onclick="opener.RenameProfile(window);window.close();" />
1999-06-08 01:09:00 +00:00
<titledbutton value="Cancel" class="push" onclick="window.close();" />
1999-06-08 00:30:00 +00:00
</window>
</popup>
1999-06-08 21:34:19 +00:00
]]]]
1999-06-08 00:30:00 +00:00
<html:center>
<html:table>
<html:tr><html:td>
Communicator stores information about your settings, preferences,
bookmarks, and stored messages in your personal profile.
</html:td></html:tr>
<html:tr><html:td>
<html:ul>
<html:li>Click New to create a new profile.
</html:li>
<html:li>Select a profile, click delete to remove that profile.
</html:li>
<html:li>Select a profile, click Rename to rename the profile.
</html:li>
</html:ul>
</html:td></html:tr>
<html:tr><html:td>
</html:td></html:tr>
</html:table>
<tree id="tree" onclick="return showSelection(event.target.parentNode);">
<treecol style="width: 100"/>
<treecol style="width: 300"/>
<treehead>
<treeitem>
<treecell>Migration</treecell>
<treecell>User Name</treecell>
</treeitem>
</treehead>
<treebody id="theTreeBody">
</treebody>
</tree>
1999-06-08 01:09:00 +00:00
<titledbutton value="New" class="push" onclick="CreateProfile();" />
<titledbutton value="Rename" class="push" popup="renamePopup" />
1999-06-08 00:30:00 +00:00
<html:button onclick="DeleteProfile();">Delete</html:button>
<html:button onclick="ExitManager();">Exit</html:button>
</html:center>
</window>