ZwiiCMS/core/module/theme/view/footer/footer.js.php

14 lines
7.8 KiB
PHP
Raw Normal View History

2018-04-02 08:29:19 +02:00
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
2019-05-13 20:38:07 +02:00
* @author Frédéric Tempez <frederic.tempez@outlook.com>
2024-01-14 19:31:28 +01:00
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
* @link http://zwiicms.fr/
2018-04-02 08:29:19 +02:00
*/
2023-04-15 13:33:23 +02:00
$("input, select").on("change",(function(){var e=$("#themeFooterFont :selected").val(),o=$("#themeFooterFont :selected").text(),t="@import url('https://fonts.cdnfonts.com/css/"+e+"');",i=core.colorVariants($("#themeFooterBackgroundColor").val()),r=$("#themeFooterTextColor").val();t="footer {background-color:"+i.normal+";color:"+r+"}";switch(t+="footer a{color:"+r+"}",t+=".editorWysiwyg{background-color:"+i.normal+" !important; color:"+r+" !important;}",t+="footer #footersite > div{margin:"+$("#themeFooterHeight").val()+" 0}",t+="footer #footerbody > div{margin:"+$("#themeFooterHeight").val()+" 0}",t+="#footerSocials{text-align:"+$("#themeFooterSocialsAlign").val()+"}",t+="#footerText > p {text-align:"+$("#themeFooterTextAlign").val()+"}",t+="#footerCopyright{text-align:"+$("#themeFooterCopyrightAlign").val()+"}",t+="footer span, #footerText > p {color:"+$("#themeFooterTextColor").val()+";font-family:'"+o+"',sans-serif;font-weight:"+$("#themeFooterFontWeight").val()+";font-size:"+$("#themeFooterFontSize").val()+";text-transform:"+$("#themeFooterTextTransform").val()+"}",$("#themeFooterMargin").is(":checked")?t+="footer{padding: 0 20px;}":t+="footer{padding:0}",$("#themePreview").remove(),$("<style>").attr("type","text/css").attr("id","themePreview").text(t).appendTo("footer"),$("#themeFooterPosition").val()){case"hide":$("footer").hide();break;case"site":$("footer").show().appendTo("#site"),$("footer > div:first-child").removeAttr("class"),$("footer > div:first-child").addClass("container");break;case"body":$("footer").show().appendTo("body"),$("footer > div:first-child").removeAttr("class"),$("footer > div:first-child").addClass("container-large");break}$("#footerText > p").css("margin-top","0"),$("#footerText > p").css("margin-bottom","0")})),$(".themeFooterContent").on("change",(function(){var e=$("#themeFooterPosition").val();switch($("#themeFooterTextPosition").val()){case"hide":$("#footerText").hide();break;default:textPosition=$("#themeFooterTextPosition").val(),textPosition=textPosition.substr(0,1).toUpperCase()+textPosition.substr(1),$("#footerText").show().appendTo("#footer"+e+textPosition);break}switch($("#themeFooterSocialsPosition").val()){case"hide":$("#footerSocials").hide();break;default:socialsPosition=$("#themeFooterSocialsPosition").val(),socialsPosition=socialsPosition.substr(0,1).toUpperCase()+socialsPosition.substr(1),$("#footerSocials").show().appendTo("#footer"+e+socialsPosition);break}switch($("#themeFooterCopyrightPosition").val()){case"hide":$("#footerCopyright").hide();break;default:copyrightPosition=$("#themeFooterCopyrightPosition").val(),copyrightPosition=copyrightPosition.substr(0,1).toUpperCase()+copyrightPosition.substr(1),$("#footerCopyright").show().appendTo("#footer"+e+copyrightPosition);break}})).trigger("change"),$("#themeFooterTemplate").on("change",(function(){var e=$(".themeFooterContent");e.empty(),$.each({4:{hide:"Masqué",left:"En haut",center:"Au milieu",right:"En bas"},3:{hide:"Masqué",left:"A gauche",center:"Au centre",right:"A droite"},2:{hide:"Masqué",left:"A gauche",right:"A droite"},1:{hide:"Masqué",center:"Affiché"}}[$("#themeFooterTemplate").val()],(function(o,t){e.append($("<option></option>").attr("value",o).text(t))}));var o=$("#themeFooterPosition").val();switch($("#footerCopyright").hide(),$("#footerText").hide(),$("#footerSocials").hide(),$("#themeFooterTemplate").val()){case"1":$("#footer"+o+"Left").css("display","none"),$("#footer"+o+"Center").removeAttr("class").addClass("col12").css("display",""),$("#footer"+o+"Right").css("display","none");break;case"2":$("#footer"+o+"Left").removeAttr("class").addClass("col6").css("display",""),$("#footer"+o+"Center").css("display","none").removeAttr("class"),$("#footer"+o+"Right").removeAttr("class").addClass("col6").css("display","");break;case"3":$("#footer"+o+"Left").removeAttr("class").addClass("col4").css("display",""),$("#footer"+o+"Center").removeAttr("class").addClass("col4").css("display",""),$("#footer"+o+"Right").removeAttr("class").addClass("col4").css("display","");break;case"4":$("#footer"+o+"Left").remo