From: erik Date: Sat, 28 Aug 2010 19:01:02 +0000 (+0000) Subject: (no commit message) X-Git-Tag: wamblee-utils-0.6~27 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=d1957d15c7cfa8f2495bea60c87b6a4f11b01130;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