summaryrefslogtreecommitdiff
path: root/includes/js/dojox/wire/tests/markup/Action.html
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
commite44a7e37b6c7b5961adaffc62b9042b8d442938e (patch)
tree95b67c356e93163467db2451f2b8cce84ed5d582 /includes/js/dojox/wire/tests/markup/Action.html
parenta62b9742ee5e28bcec6872d88f50f25b820914f6 (diff)
downloadsemanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.gz
semanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.bz2
New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/wire/tests/markup/Action.html')
-rw-r--r--includes/js/dojox/wire/tests/markup/Action.html147
1 files changed, 147 insertions, 0 deletions
diff --git a/includes/js/dojox/wire/tests/markup/Action.html b/includes/js/dojox/wire/tests/markup/Action.html
new file mode 100644
index 0000000..75cbd49
--- /dev/null
+++ b/includes/js/dojox/wire/tests/markup/Action.html
@@ -0,0 +1,147 @@
+<html>
+<head>
+<title>Test Action</title>
+<script type="text/javascript" src="../../../../dojo/dojo.js" djConfig="isDebug: true, parseOnLoad: true"></script>
+<script type="text/javascript">
+dojo.provide("dojox.wire.ml.tests.markup.Action");
+
+dojo.require("dojo.parser");
+dojo.require("doh.runner");
+dojo.require("dojox.wire.ml.Action");
+dojo.require("dojox.wire.ml.Transfer");
+
+dojox.wire.ml.tests.markup.Action = {
+ transfer: function(){},
+ source: {a: "A", b: "B"}
+};
+
+dojo.addOnLoad(function(){
+ doh.register("dojox.wire.ml.tests.markup.Action", [
+ function test_Action_triggerEvent(t){
+ dojox.wire.ml.tests.markup.Action.target = {};
+ dojox.wire.ml.tests.markup.Action.transfer();
+ t.assertEqual(dojox.wire.ml.tests.markup.Action.source.a, dojox.wire.ml.tests.markup.Action.target.a);
+ t.assertEqual(dojox.wire.ml.tests.markup.Action.source.b, dojox.wire.ml.tests.markup.Action.target.b);
+ },
+
+ function test_Action_triggerTopic(t){
+ dojox.wire.ml.tests.markup.Action.target = {};
+ dojo.publish("transfer");
+ t.assertEqual(dojox.wire.ml.tests.markup.Action.source.a, dojox.wire.ml.tests.markup.Action.target.a);
+ },
+
+ function test_ActionFilter_required(t){
+ dojox.wire.ml.tests.markup.Action.target = {};
+ dojo.publish("transferFilter");
+ t.assertEqual(undefined, dojox.wire.ml.tests.markup.Action.target.a);
+ t.assertEqual("no required", dojox.wire.ml.tests.markup.Action.error);
+ dojox.wire.ml.tests.markup.Action.required = true;
+ dojo.publish("transferFilter");
+ t.assertEqual(dojox.wire.ml.tests.markup.Action.source.a, dojox.wire.ml.tests.markup.Action.target.a);
+ },
+
+ function test_ActionFilter_requiredSpecificNumber(t){
+ dojox.wire.ml.tests.markup.Action.value = null
+ dojox.wire.ml.tests.markup.Action.target = {};
+ dojo.publish("transferFilterNumber");
+
+ t.assertEqual(undefined, dojox.wire.ml.tests.markup.Action.target.a);
+
+ dojox.wire.ml.tests.markup.Action.value = 20;
+ dojo.publish("transferFilterNumber");
+ t.assertEqual(dojox.wire.ml.tests.markup.Action.source.a, dojox.wire.ml.tests.markup.Action.target.a);
+ },
+
+ function test_ActionFilter_requiredSpecificBoolean(t){
+ dojox.wire.ml.tests.markup.Action.value = null;
+ dojox.wire.ml.tests.markup.Action.target = {};
+ dojo.publish("transferFilterBoolean");
+
+ t.assertEqual(undefined, dojox.wire.ml.tests.markup.Action.target.a);
+
+ dojox.wire.ml.tests.markup.Action.value = true;
+ dojo.publish("transferFilterBoolean");
+ t.assertEqual(dojox.wire.ml.tests.markup.Action.source.a, dojox.wire.ml.tests.markup.Action.target.a);
+ },
+
+ function test_ActionFilter_requiredSpecificString(t){
+ dojox.wire.ml.tests.markup.Action.target = {};
+ dojox.wire.ml.tests.markup.Action.value = null;
+ dojo.publish("transferFilterString");
+
+ t.assertEqual(undefined, dojox.wire.ml.tests.markup.Action.target.a);
+
+ dojox.wire.ml.tests.markup.Action.value = "executeThis";
+ dojo.publish("transferFilterString");
+ t.assertEqual(dojox.wire.ml.tests.markup.Action.source.a, dojox.wire.ml.tests.markup.Action.target.a);
+ }
+ ]);
+ doh.run();
+});
+</script>
+</head>
+<body>
+<div dojoType="dojox.wire.ml.Action"
+ trigger="dojox.wire.ml.tests.markup.Action"
+ triggerEvent="transfer">
+ <div dojoType="dojox.wire.ml.Transfer"
+ source="dojox.wire.ml.tests.markup.Action.source.a"
+ target="dojox.wire.ml.tests.markup.Action.target.a"></div>
+ <div dojoType="dojox.wire.ml.Transfer"
+ source="dojox.wire.ml.tests.markup.Action.source.b"
+ target="dojox.wire.ml.tests.markup.Action.target.b"></div>
+</div>
+<div dojoType="dojox.wire.ml.Action"
+ triggerTopic="transfer">
+ <div dojoType="dojox.wire.ml.Transfer"
+ source="dojox.wire.ml.tests.markup.Action.source.a"
+ target="dojox.wire.ml.tests.markup.Action.target.a"></div>
+</div>
+<div dojoType="dojox.wire.ml.Action"
+ triggerTopic="transferFilter">
+ <div dojoType="dojox.wire.ml.ActionFilter"
+ required="dojox.wire.ml.tests.markup.Action.required"
+ message="no required"
+ error="dojox.wire.ml.tests.markup.Action.error"></div>
+ <div dojoType="dojox.wire.ml.Transfer"
+ source="dojox.wire.ml.tests.markup.Action.source.a"
+ target="dojox.wire.ml.tests.markup.Action.target.a"></div>
+</div>
+
+<div dojoType="dojox.wire.ml.Action"
+ triggerTopic="transferFilterNumber">
+ <div dojoType="dojox.wire.ml.ActionFilter"
+ required="dojox.wire.ml.tests.markup.Action.value"
+ requiredValue="20"
+ type="number">
+ </div>
+ <div dojoType="dojox.wire.ml.Transfer"
+ source="dojox.wire.ml.tests.markup.Action.source.a"
+ target="dojox.wire.ml.tests.markup.Action.target.a"></div>
+</div>
+
+<div dojoType="dojox.wire.ml.Action"
+ triggerTopic="transferFilterBoolean">
+ <div dojoType="dojox.wire.ml.ActionFilter"
+ required="dojox.wire.ml.tests.markup.Action.value"
+ requiredValue="true"
+ type="boolean">
+ </div>
+ <div dojoType="dojox.wire.ml.Transfer"
+ source="dojox.wire.ml.tests.markup.Action.source.a"
+ target="dojox.wire.ml.tests.markup.Action.target.a"></div>
+</div>
+
+<div dojoType="dojox.wire.ml.Action"
+ triggerTopic="transferFilterString">
+ <div dojoType="dojox.wire.ml.ActionFilter"
+ required="dojox.wire.ml.tests.markup.Action.value"
+ requiredValue="executeThis">
+ </div>
+ <div dojoType="dojox.wire.ml.Transfer"
+ source="dojox.wire.ml.tests.markup.Action.source.a"
+ target="dojox.wire.ml.tests.markup.Action.target.a"></div>
+</div>
+
+</body>
+</html>