Author: twilight
Date: Mon Jan 26 10:49:47 2009
New Revision: 61348

Modified:
   kukit/kukit.js/branch/1.4/doc/HISTORY.txt
   kukit/kukit.js/branch/1.4/kukit/dom.js
   kukit/kukit.js/branch/1.4/kukit/plugin.js
   kukit/kukit.js/branch/1.4/kukit/selectorreg.js
Log:
Backporting blur action

Modified: kukit/kukit.js/branch/1.4/doc/HISTORY.txt
==============================================================================
--- kukit/kukit.js/branch/1.4/doc/HISTORY.txt   (original)
+++ kukit/kukit.js/branch/1.4/doc/HISTORY.txt   Mon Jan 26 10:49:47 2009
@@ -4,7 +4,9 @@
     
 kukit.js - 1.4dev Unreleased
     
-    - ...
+    - Added blur action (which, as it doesn't need a parameter, requires the 
+      deactivation of the args.length check in selectorreg.js.)
+      [simon]
 
 kukit-js - 1.4.4 Released 2009-01-05
 

Modified: kukit/kukit.js/branch/1.4/kukit/dom.js
==============================================================================
--- kukit/kukit.js/branch/1.4/kukit/dom.js      (original)
+++ kukit/kukit.js/branch/1.4/kukit/dom.js      Mon Jan 26 10:49:47 2009
@@ -143,6 +143,16 @@
     };
 };
 
+dom.blur = function(node) {
+    tagName = node.tagName.toLowerCase();
+    if ((tagName == 'input') || (tagName == 'select')
+       || (tagName == 'textarea')) {
+        node.blur();
+;;;} else {
+;;;    kukit.logWarning('Blur on node that cannot be blurred !');
+    };
+};
+
 /*
 *  Gets the textual content of the node
 *  if recursive=false (default), does not descend into sub nodes

Modified: kukit/kukit.js/branch/1.4/kukit/plugin.js
==============================================================================
--- kukit/kukit.js/branch/1.4/kukit/plugin.js   (original)
+++ kukit/kukit.js/branch/1.4/kukit/plugin.js   Mon Jan 26 10:49:47 2009
@@ -879,6 +879,15 @@
 kukit.commandsGlobalRegistry.registerFromAction('focus',
     kukit.cr.makeSelectorCommand);
 
+kukit.actionsGlobalRegistry.register('blur', function(oper) {
+;;; oper.componentName = '[blur] action';
+    // TODO get rid of none
+    oper.evaluateParameters([], {'none': false});
+    kukit.dom.blur(oper.node);
+});
+kukit.commandsGlobalRegistry.registerFromAction('blur',
+    kukit.cr.makeSelectorCommand);
+
 kukit.actionsGlobalRegistry.register('moveNodeAfter', function(oper) {
 ;;; oper.componentName = '[moveNodeAfter] action';
 ;;; oper.evaluateParameters(['html_id'], {});

Modified: kukit/kukit.js/branch/1.4/kukit/selectorreg.js
==============================================================================
--- kukit/kukit.js/branch/1.4/kukit/selectorreg.js      (original)
+++ kukit/kukit.js/branch/1.4/kukit/selectorreg.js      Mon Jan 26 10:49:47 2009
@@ -36,9 +36,9 @@
 
 this.check = function(args) {
     // check does not need to be used here actually.
-;;; if (args.length != 1) {
-;;;     throw new Error('internal error, xxxselector() needs 1 argument');
-;;; }
+//;;; if (args.length != 1) {
+//;;;     throw new Error('internal error, xxxselector() needs 1 argument');
+//;;; }
 };
 this.eval = function(args, node, defaultParameters) {
     var f = kukit.selectorTypesGlobalRegistry.get(this.selector_type);
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to