From 6fe35cbd50d318bed8d12c5d9fc2602f8936f883 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Tue, 21 Mar 2023 13:32:12 +0100 Subject: Switched from CDN to a npm+bundler for css framework and crypto-js --- templates/layouts/mainlayout.html.ep | 7 +++---- templates/webmail/login.html.ep | 19 ++----------------- 2 files changed, 5 insertions(+), 21 deletions(-) (limited to 'templates') diff --git a/templates/layouts/mainlayout.html.ep b/templates/layouts/mainlayout.html.ep index 51f873d..2cd4671 100644 --- a/templates/layouts/mainlayout.html.ep +++ b/templates/layouts/mainlayout.html.ep @@ -6,10 +6,9 @@ - - - %= stylesheet '/style.css' + %# + %# + %= stylesheet '/css/style.css' %= title || 'JWebmail' diff --git a/templates/webmail/login.html.ep b/templates/webmail/login.html.ep index 28768e3..706dc1c 100644 --- a/templates/webmail/login.html.ep +++ b/templates/webmail/login.html.ep @@ -28,7 +28,7 @@ %= hidden_field challenge => rand % } <div class="pure-controls"> - %= submit_button ucfirst l('login') => (class => 'pure-button pure-button-primary') => (name => 'submit_button') => $uses_cram ? (disabled => '') : () + %= submit_button ucfirst l('login') => (class => 'pure-button pure-button-primary') => (name => 'submit_button') => $uses_cram ? (disabled => undef) : () </div> </fieldset> % end @@ -36,22 +36,7 @@ </div> % if ($uses_cram) { -<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js" - integrity="sha512-E8QSvWZ0eCLGk4km3hxSsNmGWbLtSCSUcewDQPQWZF6pEU8GlT8a5fF32wOl1i8ftdMhssTrF/OhyGWwonTcXA==" - crossorigin="anonymous" referrerpolicy="no-referrer"></script> -<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/hmac-md5.min.js" - integrity="sha512-gy8JaBxTrtIxNLe1FfMAXey61VjQk3Af4EyY/EpVfmWPH16iCgdRZMHEFgKIyxMrarlc6+rDf6WneGL4SWqnpg==" - crossorigin="anonymous" referrerpolicy="no-referrer"></script> - -<script> - document.login1.submit_button.disabled = false; - - document.forms.login1.addEventListener("formdata", (form_data_evt) => { - const form_data = form_data_evt.formData; - const res = CryptoJS.HmacMD5(form_data.get("challenge"), form_data.get("password")) - form_data.set("password", res) - }); -</script> +%= javascript '/src/login_cram.js' % } %= javascript begin -- cgit v1.2.3