Skip to content

Commit 0ed1b6d

Browse files
author
ben%netscape.com
committed
initial checkin of ViXEn. not part of default build. a=brendan.
1 parent 41dcfdd commit 0ed1b6d

File tree

17 files changed

+687
-0
lines changed

17 files changed

+687
-0
lines changed

extensions/vixen/makefile.win

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!nmake
2+
#
3+
# The contents of this file are subject to the Netscape Public
4+
# License Version 1.1 (the "License"); you may not use this file
5+
# except in compliance with the License. You may obtain a copy of
6+
# the License at http://www.mozilla.org/NPL/
7+
#
8+
# Software distributed under the License is distributed on an "AS
9+
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10+
# implied. See the License for the specific language governing
11+
# rights and limitations under the License.
12+
#
13+
# The Original Code is mozilla.org code.
14+
#
15+
# The Initial Developer of the Original Code is Netscape
16+
# Communications Corporation. Portions created by Netscape are
17+
# Copyright (C) 1998 Netscape Communications Corporation. All
18+
# Rights Reserved.
19+
#
20+
# Contributor(s):
21+
22+
DEPTH=..\..
23+
include <$(DEPTH)/config/config.mak>
24+
25+
DIRS = resources
26+
27+
include <$(DEPTH)\config\rules.mak>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!nmake
2+
#
3+
# The contents of this file are subject to the Netscape Public
4+
# License Version 1.1 (the "License"); you may not use this file
5+
# except in compliance with the License. You may obtain a copy of
6+
# the License at http://www.mozilla.org/NPL/
7+
#
8+
# Software distributed under the License is distributed on an "AS
9+
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10+
# implied. See the License for the specific language governing
11+
# rights and limitations under the License.
12+
#
13+
# The Original Code is mozilla.org code.
14+
#
15+
# The Initial Developer of the Original Code is Netscape
16+
# Communications Corporation. Portions created by Netscape are
17+
# Copyright (C) 1998 Netscape Communications Corporation. All
18+
# Rights Reserved.
19+
#
20+
# Contributor(s):
21+
22+
DEPTH=..\..\..\..
23+
include <$(DEPTH)/config/config.mak>
24+
25+
CHROME_DIR=packages\xuledit
26+
CHROME_CONTENT_DIR=xuledit\content
27+
28+
CHROME_CONTENT = \
29+
.\vfdCommands.xul \
30+
.\vfdCommands.js \
31+
.\vfdScratch.xul \
32+
.\vfdScratchDocument.xul \
33+
.\xuledit.xul \
34+
.\xuledit.js \
35+
.\xe_NavOverlay.xul \
36+
$(NULL)
37+
38+
include <$(DEPTH)\config\rules.mak>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
3+
4+
var nsVFD = {
5+
6+
insertButtonElement: function (aButtonElementType)
7+
{
8+
switch (aButtonElementType) {
9+
case "button":
10+
var button = document.createElementNS(XUL_NS, "button");
11+
// insert some smarts to autogenerate button labels
12+
button.setAttribute("value", "Button1");
13+
button.setAttribute("flex", "1");
14+
button.setAttribute("crop", "right");
15+
16+
this.genericInsertElement(button);
17+
break;
18+
case "toolbar-button":
19+
break;
20+
case "menu-button":
21+
break;
22+
}
23+
},
24+
25+
genericInsertElement: function (aElement)
26+
{
27+
var domDocument = getDocument();
28+
29+
// get the focused element so we know where to insert
30+
31+
// otherwise, just use the window
32+
var scratchWindow = getDocumentWindow(domDocument);
33+
34+
scratchWindow.appendChild(aElement);
35+
},
36+
};
37+
38+
function getDocumentWindow(aDocument)
39+
{
40+
if (!aDocument)
41+
aDocument = getDocument();
42+
43+
for (var i = 0; i < aDocument.childNodes.length; i++)
44+
if (aDocument.childNodes[i].localName == "window")
45+
return aDocument.childNodes[i];
46+
return null;
47+
}
48+
49+
function getDocument()
50+
{
51+
const WM_PROGID = "component://netscape/rdf/datasource?name=window-mediator";
52+
var wm = nsJSComponentManager.getService(WM_PROGID, "nsIWindowMediator");
53+
return wm.getMostRecentWindow("xuledit:document").frames["vfView"].document;
54+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0"?>
2+
3+
<overlay id="vfdCommandsOverlay"
4+
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
5+
6+
<script language="JavaScript" src="chrome://global/content/nsJSComponentManager.js"></script>
7+
<script language="JavaScript" src="chrome://vixen/content/vfdCommands.js"></script>
8+
9+
<commandset id="vfdCommands"
10+
commandupdate="true"
11+
events=""
12+
oncommandupdate="vfd_oncommandUpdate()">
13+
14+
<!-- button commands -->
15+
<command id="cmd_insert_button"
16+
oncommand="nsVFD.insertButtonElement('button');"/>
17+
<command id="cmd_insert_toolbarbutton"
18+
oncommand="nsVFD.insertButtonElement('toolbar-button');"/>
19+
<command id="cmd_insert_menubutton"
20+
oncommand="nsVFD.insertButtonElement('menu-button');"/>
21+
22+
<!-- menu commands -->
23+
<command id="cmd_insert_toplevel_menu"
24+
oncommand="nsVFD.insertMenuElement('toplevel-menu');"/>
25+
<command id="cmd_insert_menu"
26+
oncommand="nsVFD.insertMenuElement('menu');"/>
27+
<command id="cmd_insert_menuseparator"
28+
oncommand="nsVFD.insertMenuElement('menuseparator');"/>
29+
<command id="cmd_insert_menulist"
30+
oncommand="nsVFD.insertMenuElement('menulist');"/>
31+
<command id="cmd_insert_combobox"
32+
oncommand="nsVFD.insertMenuElement('combobox');"/>
33+
34+
<!-- text input commands -->
35+
<command id="cmd_insert_textfield"
36+
oncommand="nsVFD.insertTextElement('textfield');"/>
37+
<command id="cmd_insert_textarea"
38+
oncommand="nsVFD.insertTextElement('textarea');"/>
39+
<command id="cmd_insert_rtf_editor"
40+
oncommand="nsVFD.insertTextElement('editor');"/>
41+
42+
43+
<!-- display commands -->
44+
<command id="cmd_insert_static"
45+
oncommand="nsVFD.insertDisplayElement('static');"/>
46+
<command id="cmd_insert_wrapping"
47+
oncommand="nsVFD.insertDisplayElement('wrapping-text');"/>
48+
<command id="cmd_insert_image"
49+
oncommand="nsVFD.insertDisplayElement('image');"/>
50+
<command id="cmd_insert_browser"
51+
oncommand="nsVFD.insertDisplayElement('browser');"/>
52+
53+
<!-- box commands -->
54+
<command id="cmd_insert_box"
55+
oncommand="nsVFD.insertBoxElement('box');"/>
56+
<command id="cmd_insert_grid"
57+
oncommand="nsVFD.insertBoxElement('grid');"/>
58+
<command id="cmd_insert_grid_row"
59+
oncommand="nsVFD.insertBoxElement('grid-row');"/>
60+
<command id="cmd_insert_grid_col"
61+
oncommand="nsVFD.insertBoxElement('grid-col');"/>
62+
<command id="cmd_insert_spring"
63+
oncommand="nsVFD.insertBoxElement('spring');"/>
64+
<command id="cmd_insert_splitter"
65+
oncommand="nsVFD.insertBoxElement('splitter');"/>
66+
67+
</commandset>
68+
69+
70+
</overlay>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0"?>
2+
3+
<?xml-stylesheet href="chrome://communicator/skin/"?>
4+
<?xml-stylesheet href="chrome://vixen/skin/vfdScratch.css"?>
5+
6+
<!DOCTYPE window SYSTEM "chrome://vixen/locale/vfdScratch.dtd">
7+
8+
<window id="scratchWindow" class="color-dialog"
9+
title="&form.title;" orient="vertical"
10+
windowtype="xuledit:document"
11+
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
12+
13+
<tabcontrol id="scratchView" flex="1" orient="vertical">
14+
<tabpanel flex="1">
15+
<box orient="vertical">
16+
<iframe name="vfView" id="vfView" flex="1"
17+
style="overflow: auto;"
18+
src="chrome://vixen/content/vfdScratchDocument.xul"/>
19+
</box>
20+
<box orient="vertical">
21+
<tree id="domTree" style="height: 0px; width: 0px;" flex="1">
22+
<treehead>
23+
<treerow>
24+
<treecell value="Node/Attribute Name" class="treecell-header treecell-inset-header"/>
25+
<treecell value="Attribute Value" class="treecell-header treecell-inset-header"/>
26+
</treerow>
27+
</treehead>
28+
<treecolgroup>
29+
<treecol/>
30+
<treecol flex="1"/>
31+
</treecolgroup>
32+
<treechildren>
33+
<treeitem>
34+
<treerow>
35+
<treecell value="foopy"/>
36+
<splitter class="tree-splitter"/>
37+
<treecell value="noopy"/>
38+
</treerow>
39+
</treeitem>
40+
</treechildren>
41+
</tree>
42+
<box>
43+
<button class="button-toolbar" value="Insert Node"/>
44+
<button class="button-toolbar" value="Remove Node"/>
45+
<toolbarseparator/>
46+
<button class="button-toolbar" value="Add Attribute"/>
47+
<button class="button-toolbar" value="Remove Attribute"/>
48+
<spring flex="1"/>
49+
</box>
50+
</box>
51+
</tabpanel>
52+
<tabbox>
53+
<tab value="Designer"/>
54+
<tab value="DOM Tree"/>
55+
</tabbox>
56+
</tabcontrol>
57+
</window>
58+
59+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
3+
<?xml-stylesheet href="chrome://communicator/skin/"?>
4+
5+
<window id="scratchDocument" class="dialog"
6+
title="Foopy Noopy"
7+
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
8+
9+
10+
</window>
11+
12+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0"?>
2+
3+
<overlay id="dsjlaskjd"
4+
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
5+
6+
<script language="JavaScript">
7+
<![CDATA[
8+
function loadXULEdit()
9+
{
10+
openDialog("chrome://vixen/content/xuledit.xul", "", "chrome,resizable,dialog=no");
11+
}
12+
]]>
13+
</script>
14+
15+
<menupopup id="taskPopup">
16+
<menuitem
17+
position="7"
18+
value="XULEDIT"
19+
oncommand="loadXULEdit();"/>
20+
</menupopup>
21+
22+
</overlay>

0 commit comments

Comments
 (0)