From: Erik Brakkee Date: Sat, 28 Aug 2010 19:01:02 +0000 (+0000) Subject: (no commit message) X-Git-Tag: wamblee-utils-0.7~65 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=b4a12f3ba322f097dae9b946e10aa61c31288fbf;p=utils --- diff --git a/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-namespace.js b/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-namespace.js new file mode 100644 index 00000000..08911fd9 --- /dev/null +++ b/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-namespace.js @@ -0,0 +1,4 @@ + + +var org = org || {}; +org.wamblee = org.wamblee || {}; \ No newline at end of file diff --git a/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-preselect.js b/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-preselect.js new file mode 100644 index 00000000..c2caa7b8 --- /dev/null +++ b/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-preselect.js @@ -0,0 +1,13 @@ +org.wamblee.preselectSetup = function(id) { + var preselect = function(elem) { + if (elem.defaultValue == elem.value) { + elem.select(); + } + }; + // Add focus listeners. + $(id).find(":text, textarea").each(function() { + $(this).focus(function() { + preselect(this); + }); + }) +} \ No newline at end of file