aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dijit/tests/_base/test_typematic.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/dijit/tests/_base/test_typematic.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/dijit/tests/_base/test_typematic.html')
-rw-r--r--includes/js/dijit/tests/_base/test_typematic.html56
1 files changed, 56 insertions, 0 deletions
diff --git a/includes/js/dijit/tests/_base/test_typematic.html b/includes/js/dijit/tests/_base/test_typematic.html
new file mode 100644
index 0000000..4a85027
--- /dev/null
+++ b/includes/js/dijit/tests/_base/test_typematic.html
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <title>Typematic Test</title>
+ <style type="text/css">
+ @import "../../../dojo/resources/dojo.css";
+ @import "../../themes/tundra/tundra.css";
+ @import "../css/dijitTests.css";
+ </style>
+
+ <script type="text/javascript" src="../../../dojo/dojo.js"
+ djConfig="isDebug: true, debugAtAllCosts: true"></script>
+ <script type="text/javascript">
+ dojo.require("dijit._base.typematic");
+
+ var lastCount = 0;
+ function typematicCallBack(count, node, evt){
+ var inputNode = dojo.byId('typematicInput');
+ if (node == inputNode){
+ key = "a";
+ }else{
+ key = "b";
+ }
+ if(-1 == count){
+ console.debug((lastCount+1) + ' ' + key + ' events');
+ }else{
+ lastCount = count;
+ inputNode.value += key;
+ }
+ inputNode.focus();
+ }
+ dojo.addOnLoad(function(){
+ var keyNode = dojo.byId('typematicInput');
+ var mouseNode = dojo.byId('typematicButton');
+ dijit.typematic.addKeyListener(keyNode,
+ {
+ keyCode:dojo.keys.F10,
+ ctrlKey:true
+ },
+ this, typematicCallBack, 200, 200);
+ dijit.typematic.addMouseListener(mouseNode,
+ this, typematicCallBack, 0.9, 200);
+ keyNode.focus(); // make it easier to type
+ });
+ </script>
+</head>
+<body class="tundra">
+
+ <h2>Dijit typematic tests</h2>
+ Press and hold the <b>ctrl+F10</b> keys to see a's typed (constant rate) in the input field,<br>
+ or left-mouse click the button and hold down to see b's typed (increasing rate) in the input field.<br>
+ <input id="typematicInput" size="500"><button id="typematicButton">to B or not to B</button>
+
+</body>
+</html>