Commit 0ed1b6d8 authored by ben%netscape.com's avatar ben%netscape.com

initial checkin of ViXEn. not part of default build. a=brendan.

parent 41dcfdd4
#!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>
#!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>
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
<?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>
\ No newline at end of file
<?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>
\ No newline at end of file
<?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>
\ No newline at end of file
<?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>
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");
}
}
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://communicator/skin/"?>
<?xul-overlay href="chrome://vixen/content/vfdCommands.xul"?>
<!--<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % xuleditDTD SYSTEM "chrome://vixen/locale/xuledit.dtd" >
%xuleditDTD;
]>-->
<window id="xulEditMainWindow" class="color-dialog" orient="vertical"
title="ViXEn"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="xe_Startup()" onunload="xe_Shutdown();">
<script language="JavaScript" src="chrome://global/content/nsJSComponentManager.js"></script>
<script language="JavaScript" src="chrome://global/content/globalOverlay.js"></script>
<script language="JavaScript" src="chrome://vixen/content/xuledit.js"></script>
<toolbox id="xuledit-toolbox" flex="1">
<menubar id="xuledit-menubar">
<menu id="menu_File" value="File" accesskey="f">
<menupopup>
<menuitem value="Exit" accesskey="x"/>
</menupopup>
</menu>
</menubar>
<toolbar id="xuledit-toolbar" flex="1">
<button class="button-toolbar" value="Button" oncommand="goDoCommand('cmd_insert_button');"/>
</toolbar>
</toolbox>
</window>
\ No newline at end of file
#!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>
<!ENTITY form.title "Form1">
\ No newline at end of file
<!ENTITY appWindow.title "Netscape Visual XULEdit">
<!ENTITY fileMenu.label "File">
<!ENTITY fileMenu.accesskey "f">
<!ENTITY fileQuitMenu.label "Exit">
<!ENTITY fileQuitMenu.accesskey "x">
#!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>
#!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>
<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the packages being supplied by this jar -->
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:vixen"/>
</RDF:Seq>
<RDF:Seq about="urn:mozilla:locale:root">
<RDF:li resource="urn:mozilla:locale:en-US"/>
</RDF:Seq>
<RDF:Seq about="urn:mozilla:skin:root">
<RDF:li resource="urn:mozilla:skin:classic/1.0" />
</RDF:Seq>
<!-- package information -->
<RDF:Description about="urn:mozilla:package:vixen"
chrome:displayName="ViXEn"
chrome:author="Ben Goodger"
chrome:name="vixen">
</RDF:Description>
<!-- locale information -->
<RDF:Description about="urn:mozilla:locale:en-US"
chrome:displayName="English (US)"
chrome:author="Ben Goodger"
chrome:name="en-US">
<chrome:packages>
<RDF:Seq about="urn:mozilla:locale:en-US:packages">
<RDF:li resource="urn:mozilla:locale:en-US:vixen"/>
</RDF:Seq>
</chrome:packages>
</RDF:Description>
<!-- overlay information -->
<RDF:Seq about="urn:mozilla:overlays">
<RDF:li resource="chrome://communicator/content/tasksOverlay.xul"/>
</RDF:Seq>
<RDF:Seq about="chrome://communicator/content/tasksOverlay.xul">
<RDF:li>chrome://vixen/content/xe_NavOverlay.xul</RDF:li>
</RDF:Seq>
<!-- skin information -->
<RDF:Description about="urn:mozilla:skin:classic/1.0"
chrome:displayName="Classic"
chrome:author="mozilla.org"
chrome:name="classic/1.0">
<chrome:packages>
<RDF:Seq about="urn:mozilla:skin:classic/1.0:packages">
<RDF:li resource="urn:mozilla:skin:classic/1.0:vixen"/>
</RDF:Seq>
</chrome:packages>
</RDF:Description>
</RDF:RDF>
#!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>
@import url(chrome://communicator/skin/);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment