summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas NOEL <tnoel@entrouvert.com>2013-11-20 18:18:51 (GMT)
committerThomas NOEL <tnoel@entrouvert.com>2013-11-20 18:18:51 (GMT)
commit650eca91059c04cff1ae51656b432773c87d6198 (patch)
tree1f570e22339abc6473dcdb6d59ad58a978afec69
parent42845ca3c9be32acc4aa6074a73a17423b5c04d5 (diff)
downloadorleans-themes-wcs-650eca91059c04cff1ae51656b432773c87d6198.zip
orleans-themes-wcs-650eca91059c04cff1ae51656b432773c87d6198.tar.gz
orleans-themes-wcs-650eca91059c04cff1ae51656b432773c87d6198.tar.bz2
local.js: force type=password
-rw-r--r--js/local.js20
-rw-r--r--local.js15
-rw-r--r--template.ezt2
3 files changed, 21 insertions, 16 deletions
diff --git a/js/local.js b/js/local.js
new file mode 100644
index 0000000..16aff36
--- /dev/null
+++ b/js/local.js
@@ -0,0 +1,20 @@
+/* dirty hack pour éviter le double-clic sur un submit */
+
+var submit_buttons = document.getElementsByClassName('submit-button')[0];
+if (submit_buttons) {
+ var submit_button = submit_buttons.childNodes[0].childNodes[0];
+ submit_button.form.onsubmit = function() {
+ setTimeout(function() {submit_button.disabled = 'disabled'}, 0);
+ return true;
+ }
+}
+
+/* les input de class "wcs-password" sont forcés en type "password" */
+
+var wcs_passwords = document.getElementsByClassName('wcs-password');
+if (wcs_passwords) {
+ console.log(wcs_passwords);
+ for(var i=0; i<wcs_passwords.length; i++) {
+ wcs_passwords[i].getElementsByTagName('input')[0].type = 'password';
+ }
+}
diff --git a/local.js b/local.js
deleted file mode 100644
index 3e52b23..0000000
--- a/local.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/* eviter le double-clic sur un submit */
-
-if(document.getElementsByClassName('submit-button')) {
- var submit_buttons = document.getElementsByClassName('submit-button')[0];
- if (submit_buttons) {
- var submit_button = submit_buttons.childNodes[0].childNodes[0];
- submit_button.form.onsubmit = function() {
- setTimeout(function() {submit_button.disabled = 'disabled'}, 0);
- return true;
- }
- }
-}
-
-/* TODO: les input de class "wcs-password" sont forcés en type "password" */
-
diff --git a/template.ezt b/template.ezt
index e322dd9..063d007 100644
--- a/template.ezt
+++ b/template.ezt
@@ -114,7 +114,7 @@ height="36" width="146" alt="Logo de la mairie d'Orléans"></li>
</address>
</footer>
- <script type="text/javascript" src="/themes/orleans/local.js">
+ <script type="text/javascript" src="/themes/orleans/js/local.js">
</script>
</body>