diff options
author | Paul Martin <paul@paulsputer.com> | 2015-12-09 17:58:15 +0000 |
---|---|---|
committer | Paul Martin <paul@paulsputer.com> | 2015-12-09 18:04:14 +0000 |
commit | 71a347e96308eabee696918cd276380ee30eea9d (patch) | |
tree | 8b4816cfd65e006ecdcabf89fadb3c12daa9fa4b /src/main/java/com/gitblit/wicket/pages/scripts/wicketHtml5Patch.js | |
parent | f7e28a481bcf86070b829e2574b6d5202124bb0a (diff) | |
download | gitblit-71a347e96308eabee696918cd276380ee30eea9d.tar.gz gitblit-71a347e96308eabee696918cd276380ee30eea9d.zip |
fix for #978 - HTML5 date input support
+ JS patch/hack to coerce legacy wicket into talking to a HTML5 input type
+ JS script to hide inline help on date format when using HTML5 date picker
+ Date picker shown in user locale and standard does not support custom
format.
+ Always sent in ISO8601 format
Diffstat (limited to 'src/main/java/com/gitblit/wicket/pages/scripts/wicketHtml5Patch.js')
-rw-r--r-- | src/main/java/com/gitblit/wicket/pages/scripts/wicketHtml5Patch.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/scripts/wicketHtml5Patch.js b/src/main/java/com/gitblit/wicket/pages/scripts/wicketHtml5Patch.js new file mode 100644 index 00000000..49088e13 --- /dev/null +++ b/src/main/java/com/gitblit/wicket/pages/scripts/wicketHtml5Patch.js @@ -0,0 +1,13 @@ +//This provides a basic patch/hack to allow Wicket 1.4 to support HTML5 input types + +Wicket.Form.serializeInput_original = Wicket.Form.serializeInput; + +Wicket.Form.serializeInput = function(input) +{ + if (input.type.toLowerCase() == "date") + { + return Wicket.Form.encode(input.name) + "=" + Wicket.Form.encode(input.value) + "&"; + } + + return Wicket.Form.serializeInput_original(input); +} |