Skip to content
Permalink
Browse files
initial checkin of ViXEn. not part of default build. a=brendan.
  • Loading branch information
ben%netscape.com committed Sep 3, 2000
1 parent 41dcfdd commit 0ed1b6d8a2b59df30fa3a3cf3cbd68dd0285c0bb
@@ -0,0 +1,27 @@
#!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=..\..
include <$(DEPTH)/config/config.mak>

DIRS = resources

include <$(DEPTH)\config\rules.mak>
@@ -0,0 +1,38 @@
#!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=..\..\..\..
include <$(DEPTH)/config/config.mak>

CHROME_DIR=packages\xuledit
CHROME_CONTENT_DIR=xuledit\content

CHROME_CONTENT = \
.\vfdCommands.xul \
.\vfdCommands.js \
.\vfdScratch.xul \
.\vfdScratchDocument.xul \
.\xuledit.xul \
.\xuledit.js \
.\xe_NavOverlay.xul \
$(NULL)

include <$(DEPTH)\config\rules.mak>
@@ -0,0 +1,54 @@

const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

var nsVFD = {

insertButtonElement: function (aButtonElementType)
{
switch (aButtonElementType) {
case "button":
var button = document.createElementNS(XUL_NS, "button");
// insert some smarts to autogenerate button labels
button.setAttribute("value", "Button1");
button.setAttribute("flex", "1");
button.setAttribute("crop", "right");

this.genericInsertElement(button);
break;
case "toolbar-button":
break;
case "menu-button":
break;
}
},

genericInsertElement: function (aElement)
{
var domDocument = getDocument();

// get the focused element so we know where to insert

// otherwise, just use the window
var scratchWindow = getDocumentWindow(domDocument);

scratchWindow.appendChild(aElement);
},
};

function getDocumentWindow(aDocument)
{
if (!aDocument)
aDocument = getDocument();

for (var i = 0; i < aDocument.childNodes.length; i++)
if (aDocument.childNodes[i].localName == "window")
return aDocument.childNodes[i];
return null;
}

function getDocument()
{
const WM_PROGID = "component://netscape/rdf/datasource?name=window-mediator";
var wm = nsJSComponentManager.getService(WM_PROGID, "nsIWindowMediator");
return wm.getMostRecentWindow("xuledit:document").frames["vfView"].document;
}
@@ -0,0 +1,70 @@
<?xml version="1.0"?>

<overlay id="vfdCommandsOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script language="JavaScript" src="chrome://global/content/nsJSComponentManager.js"></script>
<script language="JavaScript" src="chrome://vixen/content/vfdCommands.js"></script>

<commandset id="vfdCommands"
commandupdate="true"
events=""
oncommandupdate="vfd_oncommandUpdate()">

<!-- button commands -->
<command id="cmd_insert_button"
oncommand="nsVFD.insertButtonElement('button');"/>
<command id="cmd_insert_toolbarbutton"
oncommand="nsVFD.insertButtonElement('toolbar-button');"/>
<command id="cmd_insert_menubutton"
oncommand="nsVFD.insertButtonElement('menu-button');"/>

<!-- menu commands -->
<command id="cmd_insert_toplevel_menu"
oncommand="nsVFD.insertMenuElement('toplevel-menu');"/>
<command id="cmd_insert_menu"
oncommand="nsVFD.insertMenuElement('menu');"/>
<command id="cmd_insert_menuseparator"
oncommand="nsVFD.insertMenuElement('menuseparator');"/>
<command id="cmd_insert_menulist"
oncommand="nsVFD.insertMenuElement('menulist');"/>
<command id="cmd_insert_combobox"
oncommand="nsVFD.insertMenuElement('combobox');"/>

<!-- text input commands -->
<command id="cmd_insert_textfield"
oncommand="nsVFD.insertTextElement('textfield');"/>
<command id="cmd_insert_textarea"
oncommand="nsVFD.insertTextElement('textarea');"/>
<command id="cmd_insert_rtf_editor"
oncommand="nsVFD.insertTextElement('editor');"/>


<!-- display commands -->
<command id="cmd_insert_static"
oncommand="nsVFD.insertDisplayElement('static');"/>
<command id="cmd_insert_wrapping"
oncommand="nsVFD.insertDisplayElement('wrapping-text');"/>
<command id="cmd_insert_image"
oncommand="nsVFD.insertDisplayElement('image');"/>
<command id="cmd_insert_browser"
oncommand="nsVFD.insertDisplayElement('browser');"/>

<!-- box commands -->
<command id="cmd_insert_box"
oncommand="nsVFD.insertBoxElement('box');"/>
<command id="cmd_insert_grid"
oncommand="nsVFD.insertBoxElement('grid');"/>
<command id="cmd_insert_grid_row"
oncommand="nsVFD.insertBoxElement('grid-row');"/>
<command id="cmd_insert_grid_col"
oncommand="nsVFD.insertBoxElement('grid-col');"/>
<command id="cmd_insert_spring"
oncommand="nsVFD.insertBoxElement('spring');"/>
<command id="cmd_insert_splitter"
oncommand="nsVFD.insertBoxElement('splitter');"/>

</commandset>


</overlay>
@@ -0,0 +1,59 @@
<?xml version="1.0"?>

<?xml-stylesheet href="chrome://communicator/skin/"?>
<?xml-stylesheet href="chrome://vixen/skin/vfdScratch.css"?>

<!DOCTYPE window SYSTEM "chrome://vixen/locale/vfdScratch.dtd">

<window id="scratchWindow" class="color-dialog"
title="&form.title;" orient="vertical"
windowtype="xuledit:document"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<tabcontrol id="scratchView" flex="1" orient="vertical">
<tabpanel flex="1">
<box orient="vertical">
<iframe name="vfView" id="vfView" flex="1"
style="overflow: auto;"
src="chrome://vixen/content/vfdScratchDocument.xul"/>
</box>
<box orient="vertical">
<tree id="domTree" style="height: 0px; width: 0px;" flex="1">
<treehead>
<treerow>
<treecell value="Node/Attribute Name" class="treecell-header treecell-inset-header"/>
<treecell value="Attribute Value" class="treecell-header treecell-inset-header"/>
</treerow>
</treehead>
<treecolgroup>
<treecol/>
<treecol flex="1"/>
</treecolgroup>
<treechildren>
<treeitem>
<treerow>
<treecell value="foopy"/>
<splitter class="tree-splitter"/>
<treecell value="noopy"/>
</treerow>
</treeitem>
</treechildren>
</tree>
<box>
<button class="button-toolbar" value="Insert Node"/>
<button class="button-toolbar" value="Remove Node"/>
<toolbarseparator/>
<button class="button-toolbar" value="Add Attribute"/>
<button class="button-toolbar" value="Remove Attribute"/>
<spring flex="1"/>
</box>
</box>
</tabpanel>
<tabbox>
<tab value="Designer"/>
<tab value="DOM Tree"/>
</tabbox>
</tabcontrol>
</window>


@@ -0,0 +1,12 @@
<?xml version="1.0"?>

<?xml-stylesheet href="chrome://communicator/skin/"?>

<window id="scratchDocument" class="dialog"
title="Foopy Noopy"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">


</window>


@@ -0,0 +1,22 @@
<?xml version="1.0"?>

<overlay id="dsjlaskjd"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script language="JavaScript">
<![CDATA[
function loadXULEdit()
{
openDialog("chrome://vixen/content/xuledit.xul", "", "chrome,resizable,dialog=no");
}
]]>
</script>

<menupopup id="taskPopup">
<menuitem
position="7"
value="XULEDIT"
oncommand="loadXULEdit();"/>
</menupopup>

</overlay>
Loading

0 comments on commit 0ed1b6d

Please sign in to comment.