[Yulup-commits] rev 22168 -
public/yulup/src/trunk/prototyping/chrome/content
andi at wyona.com
andi at wyona.com
Thu Jan 25 16:21:32 CET 2007
Author: andi
Date: 2007-01-25 16:21:30 +0100 (Thu, 25 Jan 2007)
New Revision: 22168
Added:
public/yulup/src/trunk/prototyping/chrome/content/clipboard-commandupdater-opener.xul
public/yulup/src/trunk/prototyping/chrome/content/clipboard-commandupdater.xul
Log:
Commandupdater testcase added.
Added: public/yulup/src/trunk/prototyping/chrome/content/clipboard-commandupdater-opener.xul
===================================================================
--- public/yulup/src/trunk/prototyping/chrome/content/clipboard-commandupdater-opener.xul 2007-01-25 14:52:05 UTC (rev 22167)
+++ public/yulup/src/trunk/prototyping/chrome/content/clipboard-commandupdater-opener.xul 2007-01-25 15:21:30 UTC (rev 22168)
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+
+<window id="clipboardCommandUpdaterOpener"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ onload="onLoadListener();">
+
+ <script type="application/x-javascript">
+ function onLoadListener() {
+ window.openDialog("chrome://test/content/clipboard-commandupdater.xul", "clipboard-commandupdater", "modal=no,resizable=yes");
+ }
+ </script>
+
+</window>
Added: public/yulup/src/trunk/prototyping/chrome/content/clipboard-commandupdater.xul
===================================================================
--- public/yulup/src/trunk/prototyping/chrome/content/clipboard-commandupdater.xul 2007-01-25 14:52:05 UTC (rev 22167)
+++ public/yulup/src/trunk/prototyping/chrome/content/clipboard-commandupdater.xul 2007-01-25 15:21:30 UTC (rev 22168)
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+
+<window id="clipboardEventWindow"
+ title="Copy some text from the textbox."
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+ <script type="application/x-javascript">
+ <![CDATA[
+function goUpdateCommand(aCommand) {
+ var label = null;
+
+ dump("goUpdateCommand(\"" + aCommand + "\") invoked\n");
+
+ label = document.createElement("label");
+ label.setAttribute("value", "goUpdateCommand(\"" + aCommand + "\") invoked");
+
+ document.getElementById("clipboardEventWindow").appendChild(label);
+}
+ ]]>
+ </script>
+
+ <commandset id="clipboardEventCommandset"
+ commandupdater="true"
+ events="clipboard"
+ oncommandupdate="goUpdateCommand('cmd_test_paste')"/>
+
+ <commandset id="uiYulupEditorEditOperationsCommandset">
+ <command id="cmd_test_paste" disabled="true"/>
+ </commandset>
+
+ <description>
+ Select some text in the textbox below, then copy it. Afterwards, goUpdateCommand() should get invoked, as indicated by a label appended at the bottom of the window.
+ </description>
+
+ <button label="Paste!" command="cmd_test_paste"/>
+
+ <textbox value="Some text you can copy."/>
+</window>
More information about the Phoenix-commits
mailing list