diff options
-rw-r--r-- | sitestatic/archweb.js | 10 | ||||
-rw-r--r-- | templates/devel/profile.html | 13 |
2 files changed, 5 insertions, 18 deletions
diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js index ae4a1f1c..9e8ec877 100644 --- a/sitestatic/archweb.js +++ b/sitestatic/archweb.js @@ -456,13 +456,3 @@ function collapseNotes(elements) { }); }); } - -/* HTML5 input type and attribute enhancements */ -function modify_attributes(to_change) { - /* jQuery doesn't let us change the 'type' attribute directly due to IE - woes, so instead we can clone and replace, setting the type. */ - $.each(to_change, function(id, attrs) { - var obj = $(id); - obj.replaceWith(obj.clone().attr(attrs)); - }); -} diff --git a/templates/devel/profile.html b/templates/devel/profile.html index 50bb33dd..8a838caa 100644 --- a/templates/devel/profile.html +++ b/templates/devel/profile.html @@ -27,15 +27,12 @@ {% endblock %} {% block script_block %} -{% load cdn %}{% jquery %} -<script type="text/javascript" src="{% static "archweb.js" %}"></script> <script type="text/javascript" nonce={{ CSP_NONCE }}> - modify_attributes({ - '#id_email': {type: 'email'}, - '#id_alias': {autocorrect: 'off', autocapitalize: 'off'}, - '#id_public_email': {autocorrect: 'off', autocapitalize: 'off'}, - '#id_website': {type: 'url'}, - '#id_yob': {pattern: '[0-9]*'} + document.addEventListener('DOMContentLoaded', function() { + document.getElementById('id_email').setAttribute('type', 'email'); + document.getElementById('id_public_email').setAttribute('type', 'email'); + document.getElementById('id_website').setAttribute('type', 'url'); + document.getElementById('id_yob').setAttribute('pattern', '[0-9]*'); }); </script> {% endblock %} |