From 54b2c5918f1bf87099f95c7b9e71caa9710c82c6 Mon Sep 17 00:00:00 2001 From: corubba Date: Fri, 27 May 2022 13:01:32 +0200 Subject: [PATCH] Serve the IE8 polyfills from local --- package.json | 4 +++- powerdnsadmin/assets.py | 6 ++++++ powerdnsadmin/templates/base.html | 5 +++-- powerdnsadmin/templates/login.html | 5 +++-- powerdnsadmin/templates/register.html | 5 +++-- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 76982c8..c60b05d 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,8 @@ "jquery-ui-dist": "^1.12.1", "jquery.quicksearch": "^2.4.0", "jtimeout": "^3.1.0", - "multiselect": "^0.9.12" + "multiselect": "^0.9.12", + "html5shiv": "^3.7.3", + "respond.js": "^1.4.2" } } diff --git a/powerdnsadmin/assets.py b/powerdnsadmin/assets.py index e7c6354..136a4f2 100644 --- a/powerdnsadmin/assets.py +++ b/powerdnsadmin/assets.py @@ -64,9 +64,15 @@ js_main = Bundle('node_modules/jquery/dist/jquery.js', filters=(ConcatFilter, 'jsmin'), output='generated/main.js') +js_ie8 = Bundle('node_modules/html5shiv/dist/html5shiv.js', + 'node_modules/respond.js/dest/respond.min.js', + filters=(ConcatFilter, 'jsmin'), + output='generated/ie8.js') + assets = Environment() assets.register('js_login', js_login) assets.register('js_validation', js_validation) assets.register('css_login', css_login) assets.register('js_main', js_main) assets.register('css_main', css_main) +assets.register('js_ie8', js_ie8) diff --git a/powerdnsadmin/templates/base.html b/powerdnsadmin/templates/base.html index cafe8eb..bf17995 100644 --- a/powerdnsadmin/templates/base.html +++ b/powerdnsadmin/templates/base.html @@ -20,12 +20,13 @@ {% if SETTING.get('custom_css') %} {% endif %} + {% assets "js_ie8" -%} + {%- endassets %} {% endblock %} diff --git a/powerdnsadmin/templates/login.html b/powerdnsadmin/templates/login.html index 45afd7f..65d71f1 100644 --- a/powerdnsadmin/templates/login.html +++ b/powerdnsadmin/templates/login.html @@ -15,12 +15,13 @@ {% if SETTING.get('custom_css') %} {% endif %} + {% assets "js_ie8" -%} + {%- endassets %} diff --git a/powerdnsadmin/templates/register.html b/powerdnsadmin/templates/register.html index 04cb1a8..ebbff7f 100644 --- a/powerdnsadmin/templates/register.html +++ b/powerdnsadmin/templates/register.html @@ -12,12 +12,13 @@ {%- endassets %} + {% assets "js_ie8" -%} + {%- endassets %}