<menuitem label="stub" />
<menuitem label="Test Module" command="cmd_test"/>
<menuitem label="Javscript Console" command="cmd_console"/>
+ <menuitem label="XUL Test" command="cmd_xuleditor"/>
</menupopup>
</menu>
<command id="cmd_console" oncommand="
mw.spawn_javascript_console(document,true,{}); "/>
+ <command id="cmd_xuleditor" oncommand="
+ mw.spawn_xuleditor(document,true,{}); "/>
+
<command id="cmd_test" oncommand="
"/>
var chrome = 'chrome://global/cotnent/console.xul';
spawn_interface(d,tab_flag,'main_tabbox',chrome,getString('javascript_console_label'),passthru_params);
}
+
+function spawn_xuleditor(d,tab_flag,passthru_params) {
+ var chrome = 'chrome://evergreen/content/util/xuledit.xul';
+ spawn_interface(d,tab_flag,'main_tabbox',chrome,getString('xuleditor_label'),passthru_params);
+}
--- /dev/null
+// From Ted's Mozilla page: http://ted.mielczarek.org/code/mozilla/index.html
+var old = '';
+var timeout = -1;
+var xwin = null;
+var newwin = false;
+
+function init()
+{
+ if(xwin) // for some reason onload gets called when the browser refreshes???
+ return;
+
+ update();
+ document.getElementById('ta').select();
+}
+
+function openwin()
+{
+ toggleBrowser(false);
+ xwin = window.open('about:blank', 'xulwin', 'chrome,all,resizable=yes,width=400,height=400');
+ newwin = true;
+ update();
+}
+
+function toggleBrowser(show)
+{
+ document.getElementById("split").collapsed = !show;
+ document.getElementById("content").collapsed = !show;
+ document.getElementById("open").collapsed = !show;
+}
+
+function update()
+{
+ var textarea = document.getElementById("ta");
+
+ // either this is the first time, or
+ // they closed the window
+ if(xwin == null || (xwin instanceof Window && xwin.document == null)) {
+ toggleBrowser(true);
+ xwin = document.getElementById("content");
+ newwin = true;
+ }
+
+ if (old != textarea.value || newwin) {
+ old = textarea.value;
+ newwin = false;
+ var dataURI = "data:application/vnd.mozilla.xul+xml," + encodeURIComponent(old);
+ if(xwin instanceof Window)
+ xwin.document.location = dataURI;
+ else
+ xwin.setAttribute("src",dataURI);
+ }
+
+ timeout = window.setTimeout(update, 500);
+}
+
+function resetTimeout()
+{
+ if(timeout != -1)
+ window.clearTimeout(timeout);
+
+ timeout = window.setTimeout(update, 500);
+}
--- /dev/null
+<?xml version="1.0"?>
+<!-- From Ted's Mozilla page: http://ted.mielczarek.org/code/mozilla/index.html -->
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<window id="xuledit" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="Live XUL Editor"
+onload="init()">
+<script type="application/x-javascript" src="xuledit.js"/>
+<vbox flex="1">
+<textbox id="ta" multiline="true" wrap="true" flex="1" onkeydown="resetTimeout()"
+value='<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<label value="Put your XUL here!"/>
</window>'/>
+<splitter id="split"/>
+<iframe id="content" src="about:blank" flex="1"/>
+<hbox><button id="open" label="Open preview in new window" onclick="openwin()"/><spacer flex="1"/></hbox>
+</vbox>
+</window>
patron_stat_cat_editor_interface_label=PATRON STAT-CATS
z39_50_import_interface_label=Z39.50 IMPORT
javascript_console_label=CONSOLE
+xuleditor_label=XUL TEST