diff options
author | Jelle van der Waa <jelle@vdwaa.nl> | 2019-02-28 17:13:26 +0100 |
---|---|---|
committer | Jelle van der Waa <jelle@vdwaa.nl> | 2019-02-28 20:50:29 +0100 |
commit | 5d246417581631f086bfeb8176d040349b097b2b (patch) | |
tree | 3264148dbba96c49920bd97dfdffc506292187f0 /templates | |
parent | 6bcd40d3a9e51698d139e3277bed30730b115c5c (diff) | |
download | archweb-5d246417581631f086bfeb8176d040349b097b2b.tar.gz archweb-5d246417581631f086bfeb8176d040349b097b2b.zip |
templates: get rid of modify_attributes
The modify_attributes was used for IE to set attributes on DOM elements,
since Archweb no longer supports IE and this can be done easily with
plain JavaScript. Also drop non-standard HTML attributes since they
aren't worth keeping.
Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/devel/profile.html | 13 |
1 files changed, 5 insertions, 8 deletions
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 %} |