From 9b28c0a1d143e34794db0581c84dd47f7a650a26 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Thu, 18 Jul 2024 15:50:47 +0200 Subject: [PATCH] =?UTF-8?q?chore:=20Minifizierte=20Versionen=20der=20JS-?= =?UTF-8?q?=20und=20CSS-Dateien=20hinzugef=C3=BCgt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/Shared/_Layout.cshtml | 16 ++++---- .../Views/Shared/_Layout.cshtml.min.css | 1 - EnvelopeGenerator.Web/bundleconfig.json | 4 +- .../bundleconfig.json.bindings | 1 + .../bootstrap-cookie-consent-settings.min.js | 41 +++++++++++++++++++ 5 files changed, 52 insertions(+), 11 deletions(-) delete mode 100644 EnvelopeGenerator.Web/Views/Shared/_Layout.cshtml.min.css create mode 100644 EnvelopeGenerator.Web/bundleconfig.json.bindings create mode 100644 EnvelopeGenerator.Web/wwwroot/lib/bootstrap-cookie-consent-settings-main/bootstrap-cookie-consent-settings.min.js diff --git a/EnvelopeGenerator.Web/Views/Shared/_Layout.cshtml b/EnvelopeGenerator.Web/Views/Shared/_Layout.cshtml index 7c11b1e0..630610e3 100644 --- a/EnvelopeGenerator.Web/Views/Shared/_Layout.cshtml +++ b/EnvelopeGenerator.Web/Views/Shared/_Layout.cshtml @@ -12,8 +12,8 @@ @ViewData["Title"] - - + + @@ -28,14 +28,14 @@ - + - - + + - - + + @await RenderSectionAsync("Scripts", required: false) @{ var settings = new JsonSerializerSettings @@ -51,7 +51,7 @@ @RenderBody() - + @Html.AntiForgeryToken() \ No newline at end of file diff --git a/EnvelopeGenerator.Web/Views/Shared/_Layout.cshtml.min.css b/EnvelopeGenerator.Web/Views/Shared/_Layout.cshtml.min.css deleted file mode 100644 index 8b87f503..00000000 --- a/EnvelopeGenerator.Web/Views/Shared/_Layout.cshtml.min.css +++ /dev/null @@ -1 +0,0 @@ -a.navbar-brand{white-space:normal;text-align:center;word-break:break-all}a{color:#07c}.btn-primary{color:#fff;background-color:#1b6ec2;border-color:#1861ac}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#1b6ec2;border-color:#1861ac}.border-top{border-top:1px solid #e5e5e5}.border-bottom{border-bottom:1px solid #e5e5e5}.box-shadow{box-shadow:0 .25rem .75rem rgba(0,0,0,.05)}button.accept-policy{font-size:1rem;line-height:inherit}.footer{position:absolute;bottom:0;width:100%;white-space:nowrap;line-height:60px} \ No newline at end of file diff --git a/EnvelopeGenerator.Web/bundleconfig.json b/EnvelopeGenerator.Web/bundleconfig.json index 34dd05f2..f69c4c25 100644 --- a/EnvelopeGenerator.Web/bundleconfig.json +++ b/EnvelopeGenerator.Web/bundleconfig.json @@ -54,9 +54,9 @@ ] }, { - "outputFileName": "Views/Shared/_Layout.cshtml.min.css", + "outputFileName": "wwwroot/lib/bootstrap-cookie-consent-settings-main/bootstrap-cookie-consent-settings.min.js", "inputFiles": [ - "Views/Shared/_Layout.cshtml.css" + "wwwroot/lib/bootstrap-cookie-consent-settings-main/bootstrap-cookie-consent-settings.js" ] } ] diff --git a/EnvelopeGenerator.Web/bundleconfig.json.bindings b/EnvelopeGenerator.Web/bundleconfig.json.bindings new file mode 100644 index 00000000..fa500baf --- /dev/null +++ b/EnvelopeGenerator.Web/bundleconfig.json.bindings @@ -0,0 +1 @@ +/// \ No newline at end of file diff --git a/EnvelopeGenerator.Web/wwwroot/lib/bootstrap-cookie-consent-settings-main/bootstrap-cookie-consent-settings.min.js b/EnvelopeGenerator.Web/wwwroot/lib/bootstrap-cookie-consent-settings-main/bootstrap-cookie-consent-settings.min.js new file mode 100644 index 00000000..61b990a9 --- /dev/null +++ b/EnvelopeGenerator.Web/wwwroot/lib/bootstrap-cookie-consent-settings-main/bootstrap-cookie-consent-settings.min.js @@ -0,0 +1,41 @@ +"use strict";function BootstrapCookieConsentSettings(n){function v(){const n=t.content,r=''+n.privacyPolicy+"<\/a>",u=''+n.legalNotice+"<\/a>";t.content[t.lang]===undefined&&(t.lang=t.props.defaultLang);t.content.body=t.content.body.replace(/--privacy-policy--/,r);let i="";for(const n of t.props.categories){const r=t.content.categories[n];r||console.error("no content for category",n,"found in language file",t.lang);let u="";for(const n of r.description)u+=`
  • ${n}
  • `;i+=`
    +
    + + +
    +
      + ${u} +
    +
    `}t.modalContent=` +
    `;!e(t.props.cookieName)&&t.props.autoShowModal&&s()}function s(){b(function(){t.modalElement=document.getElementById(t.props.modalId);t.modalElement?t.modal.show():(t.modalElement=document.createElement("div"),t.modalElement.id=t.props.modalId,t.modalElement.setAttribute("class","modal fade"),t.modalElement.setAttribute("tabindex","-1"),t.modalElement.setAttribute("role","dialog"),t.modalElement.setAttribute("aria-labelledby",t.props.modalId),t.modalElement.innerHTML=t.modalContent,document.body.append(t.modalElement),t.props.postSelectionCallback&&t.modalElement.addEventListener("hidden.bs.modal",function(){t.props.postSelectionCallback()}),t.modal=new bootstrap.Modal(t.modalElement,{backdrop:"static",keyboard:!1}),t.modal.show(),t.buttonDoNotAgree=t.modalElement.querySelector("#bccs-buttonDoNotAgree"),t.buttonAgree=t.modalElement.querySelector("#bccs-buttonAgree"),t.buttonSave=t.modalElement.querySelector("#bccs-buttonSave"),t.buttonAgreeAll=t.modalElement.querySelector("#bccs-buttonAgreeAll"),u(),y(),t.modalElement.querySelector("#bccs-options").addEventListener("hide.bs.collapse",function(){r=!1;u()}),t.modalElement.querySelector("#bccs-options").addEventListener("show.bs.collapse",function(){r=!0;u()}),t.buttonDoNotAgree.addEventListener("click",function(){p()}),t.buttonAgree.addEventListener("click",function(){h()}),t.buttonSave.addEventListener("click",function(){w()}),t.buttonAgreeAll.addEventListener("click",function(){h()}))}.bind(this))}function y(){const n=t.getSettings();if(n)for(let i in n){const r=t.modalElement.querySelector("#bccs-checkbox-"+i);r.checked=n[i]==="true"}const i=t.modalElement.querySelector("#bccs-checkbox-necessary");i.checked=!0;i.disabled=!0}function u(){r?(t.buttonDoNotAgree.style.display="none",t.buttonAgree.style.display="none",t.buttonSave.style.removeProperty("display"),t.buttonAgreeAll.style.removeProperty("display")):(t.buttonDoNotAgree.style.removeProperty("display"),t.buttonAgree.style.removeProperty("display"),t.buttonSave.style.display="none",t.buttonAgreeAll.style.display="none")}function f(n=undefined){const i={};for(const r of t.props.categories)if(n===undefined){const n=t.modalElement.querySelector("#bccs-checkbox-"+r);n||console.error("checkbox not found for category",r);i[r]=n.checked}else i[r]=n;return i.necessary=!0,i}function h(){i(t.props.cookieName,f(!0),t.props.cookieStorageDays);t.modal.hide()}function p(){i(t.props.cookieName,f(!1),t.props.cookieStorageDays);t.modal.hide()}function w(){i(t.props.cookieName,f(),t.props.cookieStorageDays);t.modal.hide()}function c(n,i){const r=new XMLHttpRequest;r.overrideMimeType("application/json");const u=t.props.contentURL+"/"+n+".json";r.open("GET",u,!0);r.onreadystatechange=function(){r.readyState===4&&r.status===200&&(r.status===200?i(r.responseText):console.error(u,r.status))};r.onloadend=function(){r.status===404&&n!==t.props.defaultLang&&(console.warn("language "+n+" not found trying defaultLang "+t.props.defaultLang),c(t.props.defaultLang,i))};r.send(null)}function i(n,t,i){let r="";if(i){const n=new Date;n.setTime(n.getTime()+i*864e5);r="; expires="+n.toUTCString()}const u=new URLSearchParams(t).toString();document.cookie=n+"="+(u||"")+r+"; Path=/; SameSite=Strict;";localStorage.setItem(n,u)}function e(n){const r=n+"=",u=document.cookie.split(";");for(let n=0;n{t.content=JSON.parse(n),v()});this.showDialog=function(){s()};this.getSettings=function(n){const i=e(t.props.cookieName);return i?n===undefined?i:i?i[n]:!1:undefined};this.setSetting=function(n,r){let u=t.getSettings()||{};for(const n of this.props.categories)u[n]===undefined&&(u[n]=!0);u[n]=r;i(t.props.cookieName,u,t.props.cookieStorageDays)}} \ No newline at end of file