diff --git a/extensions/vixen/makefile.win b/extensions/vixen/makefile.win
new file mode 100644
index 0000000000000..684846ae4c0b6
--- /dev/null
+++ b/extensions/vixen/makefile.win
@@ -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>
diff --git a/extensions/vixen/resources/content/makefile.win b/extensions/vixen/resources/content/makefile.win
new file mode 100644
index 0000000000000..cca6226de6ded
--- /dev/null
+++ b/extensions/vixen/resources/content/makefile.win
@@ -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>
diff --git a/extensions/vixen/resources/content/vfdCommands.js b/extensions/vixen/resources/content/vfdCommands.js
new file mode 100644
index 0000000000000..f8b62a237456f
--- /dev/null
+++ b/extensions/vixen/resources/content/vfdCommands.js
@@ -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;
+}
\ No newline at end of file
diff --git a/extensions/vixen/resources/content/vfdCommands.xul b/extensions/vixen/resources/content/vfdCommands.xul
new file mode 100644
index 0000000000000..de6c242ddbbef
--- /dev/null
+++ b/extensions/vixen/resources/content/vfdCommands.xul
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/extensions/vixen/resources/content/vfdScratch.xul b/extensions/vixen/resources/content/vfdScratch.xul
new file mode 100644
index 0000000000000..8d988d2906c6e
--- /dev/null
+++ b/extensions/vixen/resources/content/vfdScratch.xul
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/extensions/vixen/resources/content/vfdScratchDocument.xul b/extensions/vixen/resources/content/vfdScratchDocument.xul
new file mode 100644
index 0000000000000..cb13f38fe5eeb
--- /dev/null
+++ b/extensions/vixen/resources/content/vfdScratchDocument.xul
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/extensions/vixen/resources/content/xe_NavOverlay.xul b/extensions/vixen/resources/content/xe_NavOverlay.xul
new file mode 100644
index 0000000000000..fb1d79a994ac1
--- /dev/null
+++ b/extensions/vixen/resources/content/xe_NavOverlay.xul
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/extensions/vixen/resources/content/xuledit.js b/extensions/vixen/resources/content/xuledit.js
new file mode 100644
index 0000000000000..22e94ee974f00
--- /dev/null
+++ b/extensions/vixen/resources/content/xuledit.js
@@ -0,0 +1,171 @@
+
+const _DEBUG = true;
+function _dd(aString)
+{
+ if (_DEBUG)
+ dump("*** " + aString + "\n");
+}
+
+const kMenuHeight = 130;
+const kPropertiesWidth = 170;
+
+
+function xe_Startup()
+{
+ _dd("xe_Startup");
+ window.moveTo(0,0);
+ window.outerWidth = screen.availWidth;
+ window.outerHeight = kMenuHeight;
+
+ // initialise commands
+ controllers.insertControllerAt(0, defaultController);
+
+ // load a scratch document
+ xe_LoadForm("chrome://xuledit/content/vfdScratch.xul");
+
+ var url = Components.classes["component://netscape/network/standard-url"].createInstance();
+ if (url) url = url.QueryInterface(Components.interfaces.nsIURI);
+ url.spec = "chrome://xuledit/skin/vfdScratch.css";
+ var chromeRegistry = Components.classes["component://netscape/chrome/chrome-registry"].getService();
+ chromeRegistry = chromeRegistry.QueryInterface( Components.interfaces.nsIChromeRegistry );
+ var url2 = chromeRegistry.convertChromeURL(url);
+ dump(url2);
+}
+
+function xe_Shutdown()
+{
+ _dd("xe_Shutdown");
+
+ const WM_PROGID = "component://netscape/rdf/datasource?name=window-mediator";
+ var wm = nsJSComponentManager.getService(WM_PROGID, "nsIWindowMediator");
+ var windows = wm.getXULWindowEnumerator("xuledit:document");
+ while (windows.hasMoreElements()) {
+ var currWindow = windows.getNext();
+ currWindow.close();
+ }
+}
+
+function xe_LoadForm(aURL)
+{
+ hwnd = openDialog(aURL, "", "chrome,dialog=no,resizable");
+ hwnd.moveTo(kPropertiesWidth + 5, kMenuHeight + 5);
+ hwnd.outerWidth = screen.availWidth - (kPropertiesWidth * 2) - 5;
+ hwnd.outerHeight = screen.availHeight - kMenuHeight - 20;
+}
+
+var defaultController = {
+ supportsCommand: function(command)
+ {
+ switch (command) {
+
+ case "cmd_insert_button":
+ case "cmd_insert_toolbarbutton":
+ case "cmd_insert_menubutton":
+
+ case "cmd_insert_toplevel_menu":
+ case "cmd_insert_menu":
+ case "cmd_insert_menuseparator":
+ case "cmd_insert_menulist":
+ case "cmd_insert_combobox":
+
+ case "cmd_insert_textfield":
+ case "cmd_insert_textarea":
+ case "cmd_insert_rdf_editor":
+
+ case "cmd_insert_static":
+ case "cmd_insert_wrapping":
+ case "cmd_insert_image":
+ case "cmd_insert_browser":
+
+ case "cmd_insert_box":
+ case "cmd_insert_grid":
+ case "cmd_insert_grid_row":
+ case "cmd_insert_grid_col":
+ case "cmd_insert_grid_spring":
+ case "cmd_insert_splitter":
+ return true;
+
+ default:
+ return false;
+ }
+ },
+
+ isCommandEnabled: function(command)
+ {
+ switch (command) {
+ case "cmd_insert_button":
+ case "cmd_insert_toolbarbutton":
+ case "cmd_insert_menubutton":
+
+ case "cmd_insert_toplevel_menu":
+ case "cmd_insert_menu":
+ case "cmd_insert_menuseparator":
+ case "cmd_insert_menulist":
+ case "cmd_insert_combobox":
+
+ case "cmd_insert_textfield":
+ case "cmd_insert_textarea":
+ case "cmd_insert_rdf_editor":
+
+ case "cmd_insert_static":
+ case "cmd_insert_wrapping":
+ case "cmd_insert_image":
+ case "cmd_insert_browser":
+
+ case "cmd_insert_box":
+ case "cmd_insert_grid":
+ case "cmd_insert_grid_row":
+ case "cmd_insert_grid_col":
+ case "cmd_insert_grid_spring":
+ case "cmd_insert_splitter":
+ return true;
+
+ default:
+ return false;
+ }
+ },
+
+ doCommand: function(command)
+ {
+ switch (command)
+ {
+
+ case "cmd_insert_button":
+ nsVFD.insertButtonElement("button");
+ return true;
+ case "cmd_insert_toolbarbutton":
+ case "cmd_insert_menubutton":
+
+ case "cmd_insert_toplevel_menu":
+ case "cmd_insert_menu":
+ case "cmd_insert_menuseparator":
+ case "cmd_insert_menulist":
+ case "cmd_insert_combobox":
+
+ case "cmd_insert_textfield":
+ case "cmd_insert_textarea":
+ case "cmd_insert_rdf_editor":
+
+ case "cmd_insert_static":
+ case "cmd_insert_wrapping":
+ case "cmd_insert_image":
+ case "cmd_insert_browser":
+
+ case "cmd_insert_box":
+ case "cmd_insert_grid":
+ case "cmd_insert_grid_row":
+ case "cmd_insert_grid_col":
+ case "cmd_insert_grid_spring":
+ case "cmd_insert_splitter":
+ return true;
+
+ default:
+ return false;
+ }
+ },
+
+ onEvent: function(event)
+ {
+// dump("DefaultController:onEvent\n");
+ }
+}
diff --git a/extensions/vixen/resources/content/xuledit.xul b/extensions/vixen/resources/content/xuledit.xul
new file mode 100644
index 0000000000000..585816668eefd
--- /dev/null
+++ b/extensions/vixen/resources/content/xuledit.xul
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/extensions/vixen/resources/locale/en-US/makefile.win b/extensions/vixen/resources/locale/en-US/makefile.win
new file mode 100644
index 0000000000000..a5063c40748ab
--- /dev/null
+++ b/extensions/vixen/resources/locale/en-US/makefile.win
@@ -0,0 +1,33 @@
+#!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_LOCALE_DIR=xuledit\locale
+
+CHROME_LOCALE = \
+ .\xuledit.dtd \
+ .\vfdScratch.dtd \
+ $(NULL)
+
+include <$(DEPTH)\config\rules.mak>
diff --git a/extensions/vixen/resources/locale/en-US/vfdScratch.dtd b/extensions/vixen/resources/locale/en-US/vfdScratch.dtd
new file mode 100644
index 0000000000000..9df5b26cbf9e5
--- /dev/null
+++ b/extensions/vixen/resources/locale/en-US/vfdScratch.dtd
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/extensions/vixen/resources/locale/en-US/xuledit.dtd b/extensions/vixen/resources/locale/en-US/xuledit.dtd
new file mode 100644
index 0000000000000..bd8f479364903
--- /dev/null
+++ b/extensions/vixen/resources/locale/en-US/xuledit.dtd
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/extensions/vixen/resources/locale/makefile.win b/extensions/vixen/resources/locale/makefile.win
new file mode 100644
index 0000000000000..0a458a0f5c64f
--- /dev/null
+++ b/extensions/vixen/resources/locale/makefile.win
@@ -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 = en-US
+
+include <$(DEPTH)\config\rules.mak>
diff --git a/extensions/vixen/resources/makefile.win b/extensions/vixen/resources/makefile.win
new file mode 100644
index 0000000000000..c8b7482ef3cf5
--- /dev/null
+++ b/extensions/vixen/resources/makefile.win
@@ -0,0 +1,36 @@
+#!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 = content locale
+
+CHROME_DIR = packages\xuledit
+CHROME_MISC_DIR = .
+CHROME_TYPE = content locale skin
+
+CHROME_MISC = \
+ .\manifest.rdf \
+ $(NULL)
+
+
+include <$(DEPTH)\config\rules.mak>
diff --git a/extensions/vixen/resources/manifest.rdf b/extensions/vixen/resources/manifest.rdf
new file mode 100644
index 0000000000000..4e021c61a8599
--- /dev/null
+++ b/extensions/vixen/resources/manifest.rdf
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ chrome://vixen/content/xe_NavOverlay.xul
+
+
+
+
+
+
+
+
+
+
+
diff --git a/extensions/vixen/resources/skin/makefile.win b/extensions/vixen/resources/skin/makefile.win
new file mode 100644
index 0000000000000..185b879a02604
--- /dev/null
+++ b/extensions/vixen/resources/skin/makefile.win
@@ -0,0 +1,32 @@
+#!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_SKIN_DIR=xuledit\skin
+
+CHROME_SKIN = \
+ .\vfdScratch.css \
+ $(NULL)
+
+include <$(DEPTH)\config\rules.mak>
diff --git a/extensions/vixen/resources/skin/vfdScratch.css b/extensions/vixen/resources/skin/vfdScratch.css
new file mode 100644
index 0000000000000..aa6f5f97603fb
--- /dev/null
+++ b/extensions/vixen/resources/skin/vfdScratch.css
@@ -0,0 +1,2 @@
+@import url(chrome://communicator/skin/);
+