Nouvelles polices cdnfonts
Correction de bugs

Mise à jour à corriger
This commit is contained in:
fredtempez 2022-02-04 16:26:39 +01:00
parent 09fdb34b7f
commit 93ae867328
15 changed files with 146 additions and 69 deletions

View File

@ -619,9 +619,10 @@ class template {
$attributes['selected'] = common::$inputBefore[$attributes['id']];
}
// Liste des polices à intégrer
//var_dump(core::$fonts);
if ($attributes['fonts'] === true) {
foreach ($options as $fontId) {
echo "<link href='https://fonts.googleapis.com/css?family=".str_replace(" ", "+", $fontId)."' rel='stylesheet' type='text/css'>\n";
foreach (core::$fonts as $fontId => $font) {
echo "<link href='https://fonts.cdnfonts.com/css/" . $fontId . "' rel='stylesheet' type='text/css'>\n";
}
}
// Début du wrapper
@ -648,7 +649,7 @@ class template {
'<option value="%s"%s style="font-family: %s;">%s</option>',
$value,
$attributes['selected'] == $value ? ' selected' : '', // Double == pour ignorer le type de variable car $_POST change les types en string
str_replace('+',' ',$value),
core::$fonts[$value],
$text
) : sprintf(
'<option value="%s"%s>%s</option>',

View File

@ -181,6 +181,37 @@ class common {
'blacklist' => '',
'locale' => ''
];
// Fontes
public static $fonts = [
'abril-fatface' => 'Abril Fatface',
'arimo' => 'Arimo',
'arvo' => 'Arvo',
'berkshire-swash' => 'Berkshire Swash',
'dancing-script' => 'Dancing Script',
'droid-sans-2' => 'Droid Sans',
'droid-serif-2' => 'Droid Serif',
'fira-sans' => 'Fira Sans',
'genera' => 'Genera',
'inconsolata-2' => 'Inconsolata',
'indie-flower' => 'Indie Flower',
'josefin-sans-std' => 'Josefin Sans',
'lobster-2' => 'Lobster',
'lora' => 'Lora',
'lato' => 'Lato',
'montserrat-ace' => 'Montserrat Ace',
'old-standard-tt-3' => 'Old Standard TT',
'open-sans' => 'Open Sans',
'oswald-4' => 'Oswald',
'pt-mono' => 'PT Mono',
'pt-serif' => 'PT Serif',
'raleway-5' => 'Raleway',
'rancho' => 'Rancho',
'roboto' => 'Roboto',
'signika' => 'Signika',
'ubuntu' => 'Ubuntu',
'vollkorn' => 'Vollkorn'
];
/**
* Constructeur commun
@ -2235,11 +2266,14 @@ class core extends common {
// Version
$css = '/*' . md5(json_encode($this->getData(['theme']))) . '*/';
// Import des polices de caractères
$css .= '@import url("https://fonts.googleapis.com/css?family=' . $this->getData(['theme', 'text', 'font']) . '|' . $this->getData(['theme', 'title', 'font']) . '|' . $this->getData(['theme', 'header', 'font']) . '|' . $this->getData(['theme', 'menu', 'font']) . '");';
$css .= '@import url("http://fonts.cdnfonts.com/css/' . $this->getData(['theme', 'text', 'font']) . '");';
$css .= '@import url("http://fonts.cdnfonts.com/css/' . $this->getData(['theme', 'title', 'font']) . '");';
$css .= '@import url("http://fonts.cdnfonts.com/css/' . $this->getData(['theme', 'header', 'font']) . '");';
$css .= '@import url("http://fonts.cdnfonts.com/css/' . $this->getData(['theme', 'menu', 'font']) . '");';
// Fond du body
$colors = helper::colorVariants($this->getData(['theme', 'body', 'backgroundColor']));
// Body
$css .= 'body{font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'text', 'font'])) . '",sans-serif}';
$css .= 'body{font-family:"' . self::$fonts[$this->getData(['theme', 'text', 'font'])] . '",sans-serif}';
if($themeBodyImage = $this->getData(['theme', 'body', 'image'])) {
// Image dans html pour éviter les déformations.
$css .= 'html {background-image:url("../file/source/' . $themeBodyImage . '");background-position:' . $this->getData(['theme', 'body', 'imagePosition']) . ';background-attachment:' . $this->getData(['theme', 'body', 'imageAttachment']) . ';background-size:' . $this->getData(['theme', 'body', 'imageSize']) . ';background-repeat:' . $this->getData(['theme', 'body', 'imageRepeat']) . '}';
@ -2257,7 +2291,7 @@ class core extends common {
$colors = helper::colorVariants($this->getData(['theme', 'text', 'linkColor']));
$css .= 'a{color:' . $colors['normal'] . '}';
// Couleurs de site dans TinyMCe
$css .= 'div.mce-edit-area {font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'text', 'font'])) . '",sans-serif}';
$css .= 'div.mce-edit-area {font-family:"' . self::$fonts[$this->getData(['theme', 'text', 'font'])] . '",sans-serif}';
// Site dans TinyMCE
$css .= '.editorWysiwyg {background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';}';
$css .= 'span.mce-text{background-color: unset !important;}';
@ -2298,7 +2332,7 @@ class core extends common {
$css .= '.helpButton span:hover{color:' . $colors['darken'] . '}';
$css .= '.button:active,button[type=\'submit\']:active,.pagination a:active{background-color:' . $colors['veryDarken'] . '}';
$colors = helper::colorVariants($this->getData(['theme', 'title', 'textColor']));
$css .= 'h1,h2,h3,h4,h5,h6,h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{color:' . $colors['normal'] . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'title', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'title', 'fontWeight']) . ';text-transform:' . $this->getData(['theme', 'title', 'textTransform']) . '}';
$css .= 'h1,h2,h3,h4,h5,h6,h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{color:' . $colors['normal'] . ';font-family:"' . self::$fonts[$this->getData(['theme', 'title', 'font'])] . '",sans-serif;font-weight:' . $this->getData(['theme', 'title', 'fontWeight']) . ';text-transform:' . $this->getData(['theme', 'title', 'textTransform']) . '}';
$css .= 'h1 a:hover,h2 a:hover,h3 a:hover,h4 a:hover,h5 a:hover,h6 a:hover{color:' . $colors['darken'] . '}';
// Les blocs
$colors = helper::colorVariants($this->getData(['theme', 'block', 'backgroundColor']));
@ -2332,7 +2366,7 @@ class core extends common {
$css .= 'header{background-image:url("../file/source/' . $themeHeaderImage . '");background-position:' . $this->getData(['theme', 'header', 'imagePosition']) . ';background-repeat:' . $this->getData(['theme', 'header', 'imageRepeat']) . '}';
}
$colors = helper::colorVariants($this->getData(['theme', 'header', 'textColor']));
$css .= 'header span{color:' . $colors['normal'] . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'header', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'header', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'header', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'header', 'textTransform']) . '}';
$css .= 'header span{color:' . $colors['normal'] . ';font-family:"' . self::$fonts[$this->getData(['theme', 'header', 'font'])] . '",sans-serif;font-weight:' . $this->getData(['theme', 'header', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'header', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'header', 'textTransform']) . '}';
}
// Bannière au contenu personnalisé
@ -2381,7 +2415,7 @@ class core extends common {
$css .= 'nav{padding:0 10px;}';
}
$css .= '#toggle span,#menu a{padding:' . $this->getData(['theme', 'menu', 'height']) .';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'menu', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'menu', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'menu', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'menu', 'textTransform']) . '}';
$css .= '#toggle span,#menu a{padding:' . $this->getData(['theme', 'menu', 'height']) .';font-family:"' . self::$fonts[$this->getData(['theme', 'menu', 'font'])] . '",sans-serif;font-weight:' . $this->getData(['theme', 'menu', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'menu', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'menu', 'textTransform']) . '}';
// Pied de page
$colors = helper::colorVariants($this->getData(['theme', 'footer', 'backgroundColor']));
@ -2391,7 +2425,7 @@ class core extends common {
$css .= 'footer{padding:0}';
}
$css .= 'footer span, #footerText > p {color:' . $this->getData(['theme', 'footer', 'textColor']) . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'footer', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'footer', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'footer', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'footer', 'textTransform']) . '}';
$css .= 'footer span, #footerText > p {color:' . $this->getData(['theme', 'footer', 'textColor']) . ';font-family:"' . self::$fonts[$this->getData(['theme', 'footer', 'font'])] . '",sans-serif;font-weight:' . $this->getData(['theme', 'footer', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'footer', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'footer', 'textTransform']) . '}';
$css .= 'footer {background-color:' . $colors['normal'] . ';color:' . $this->getData(['theme', 'footer', 'textColor']) . '}';
$css .= 'footer a{color:' . $this->getData(['theme', 'footer', 'textColor']) . '}';
$css .= 'footer #footersite > div {margin:' . $this->getData(['theme', 'footer', 'height']) . ' 0}';

View File

@ -739,4 +739,67 @@ if ($this->getData(['core', 'dataVersion']) < 11202) {
// Mise à jour
$this->setData(['core', 'dataVersion', 11202]);
}
// Version 11.2.06
if ($this->getData(['core', 'dataVersion']) < 11206) {
// tableau de substitution
$fonts = [
'Abril+Fatface' => 'abril-fatface',
'Arimo' => 'arimo',
'Arvo' => 'arvo',
'Berkshire+Swash' => 'berkshire-swash',
'Cabin' => 'genera',
'Dancing+Script' => 'dancing-script',
'Droid+Sans' => 'droid-sans-2',
'Droid+Serif' => 'droid-serif-2',
'Fira+Sans' => 'fira-sans',
'Inconsolata' => 'inconsolata-2',
'Indie+Flower' =>'indie-flower',
'Josefin+Slab' => 'josefin-sans-std',
'Lobster' => 'lobster-2',
'Lora' => 'lora',
'Lato' =>'lato',
'Marvel' => 'montserrat-ace',
'Old+Standard+TT' => 'old-standard-tt-3',
'Open+Sans' =>'open-sans',
// Corriger l'erreur de nom de police installée par défaut, il manquait un O en majuscule
'open+Sans' =>'open-sans',
'Oswald' =>'oswald-4',
'PT+Mono' => 'pt-mono',
'PT+Serif' =>'pt-serif',
'Raleway' => 'raleway-5',
'Rancho' => 'rancho',
'Roboto' => 'Roboto',
'Signika' => 'signika',
'Ubuntu' => 'ubuntu',
'Vollkorn' => 'vollkorn'
];
if (array_key_exists($fonts[$this->getData (['theme', 'footer', 'font'])], $fonts) ) {
$this->setData(['theme', 'footer', 'font', $fonts[$this->getData (['theme', 'footer', 'font']) ] ]);
}
if (array_key_exists($fonts[$this->getData (['theme', 'header', 'font'])], $fonts) ) {
$this->setData(['theme', 'header', 'font', $fonts[$this->getData (['theme', 'header', 'font' ]) ] ]);
}
if (array_key_exists($fonts[$this->getData (['theme', 'menu', 'font'])], $fonts) ) {
$this->setData(['theme', 'menu', 'font', $fonts[$this->getData (['theme', 'menu', 'font' ]) ] ]);
}
if (array_key_exists($fonts[$this->getData (['theme', 'text', 'font'])], $fonts) ) {
$this->setData(['theme', 'text', 'font', $fonts[$this->getData (['theme', 'text', 'font' ]) ] ]);
}
if (array_key_exists($fonts[$this->getData (['theme', 'title', 'font'])], $fonts) ) {
$this->setData(['theme', 'title', 'font', $fonts[ $this->getData (['theme', 'title', 'font' ]) ] ]);
}
if (array_key_exists($fonts[$this->getData (['admin', 'fontTitle'])], $fonts) ) {
$this->setData(['admin', 'fontTitle', $fonts[ $this->getData (['admin', 'fontTitle' ]) ] ]);
}
if (array_key_exists($fonts[$this->getData (['admin', 'fontText'])], $fonts) ) {
$this->setData(['admin', 'fontText', $fonts[$this->getData (['admin','fontText' ]) ] ]);
}
// Mise à jour
$this->setData(['core', 'dataVersion', 11206]);
}

View File

@ -56,7 +56,7 @@ class init extends common {
]
],
'core' => [
'dataVersion' => 11202,
'dataVersion' => 11206,
'lastBackup' => 0,
'lastClearTmp' => 0,
'lastAutoUpdate' => 0,
@ -127,7 +127,7 @@ class init extends common {
],
'footer' => [
'backgroundColor' => 'rgba(255, 255, 255, 1)',
'font' => 'Open+Sans',
'font' => 'open-sans',
'fontSize' => '.8em',
'fontWeight' => 'normal',
'height' => '5px',
@ -154,7 +154,7 @@ class init extends common {
],
'header' => [
'backgroundColor' => 'rgba(32, 59, 82, 1)',
'font' => 'Oswald',
'font' => 'oswald-4',
'fontSize' => '2em',
'fontWeight' => 'normal',
'height' => '150px',
@ -177,7 +177,7 @@ class init extends common {
'menu' => [
'backgroundColor' => 'rgba(32, 59, 82, 1)',
'backgroundColorSub' => 'rgba(32, 59, 82, 1)',
'font' => 'Open+Sans',
'font' => 'open-sans',
'fontSize' => '1em',
'fontWeight' => 'normal',
'height' => '15px 10px',
@ -208,13 +208,13 @@ class init extends common {
'borderColor' => 'rgba(236, 239, 241, 1)'
],
'text' => [
'font' => 'Open+Sans',
'font' => 'open-sans',
'fontSize' => '13px',
'textColor' => 'rgba(33, 34, 35, 1)',
'linkColor' => 'rgba(74, 105, 189, 1)'
],
'title' => [
'font' => 'Oswald',
'font' => 'oswald-4',
'fontWeight' => 'normal',
'textColor' => 'rgba(74, 105, 189, 1)',
'textTransform' => 'none'
@ -226,9 +226,9 @@ class init extends common {
],
'admin' => [
'backgroundColor' => 'rgba(255, 255, 255, 1)',
'fontText' => 'open+Sans',
'fontText' => 'open-Sans',
'fontSize' => '13px',
'fontTitle' => 'Oswald',
'fontTitle' => 'oswald-4',
'colorText' => 'rgba(33, 34, 35, 1)',
'colorTitle' => 'rgba(74, 105, 189, 1)',
'backgroundColorButton' => 'rgba(74, 105, 189, 1)',

View File

@ -40,35 +40,6 @@ class theme extends common {
'scroll' => 'Standard',
'fixed' => 'Fixe'
];
public static $fonts = [
'Abril+Fatface' => 'Abril Fatface',
'Arimo' => 'Arimo',
'Arvo' => 'Arvo',
'Berkshire+Swash' => 'Berkshire Swash',
'Cabin' => 'Cabin',
'Dancing+Script' => 'Dancing Script',
'Droid+Sans' => 'Droid Sans',
'Droid+Serif' => 'Droid Serif',
'Fira+Sans' => 'Fira Sans',
'Inconsolata' => 'Inconsolata',
'Indie+Flower' => 'Indie Flower',
'Josefin+Slab' => 'Josefin Slab',
'Lobster' => 'Lobster',
'Lora' => 'Lora',
'Lato' => 'Lato',
'Marvel' => 'Marvel',
'Old+Standard+TT' => 'Old Standard TT',
'Open+Sans' => 'Open Sans',
'Oswald' => 'Oswald',
'PT+Mono' => 'PT Mono',
'PT+Serif' => 'PT Serif',
'Raleway' => 'Raleway',
'Rancho' => 'Rancho',
'Roboto' => 'Roboto',
'Signika' => 'Signika',
'Ubuntu' => 'Ubuntu',
'Vollkorn' => 'Vollkorn'
];
public static $containerWides = [
'container' => 'Limitée au site',
'none' => 'Etendue sur la page'

View File

@ -17,7 +17,8 @@ $("input, select").on("change", function() {
var titleFont = $("#adminFontTitle").val();
var textFont = $("#adminFontText").val();
var css = "@import url('https://fonts.googleapis.com/css?family=" + titleFont + "|" + textFont + "');";
var css = "@import url('http://fonts.cdnfonts.com/css/" + titleFont + "');";
var css = "@import url('http://fonts.cdnfonts.com/css/" + textFont + "');";
var colors = core.colorVariants($("#adminBackgroundColor").val());
var css = "#site{background-color:" + colors.normal + ";}";
css += "body, .row > div {font:" + $("#adminFontTextSize").val() + " '" + textFont + "', sans-serif;}";

View File

@ -127,7 +127,7 @@
<h4>Mise en forme du texte</h4>
<div class="row">
<div class="col4">
<?php echo template::select('adminFontText', $module::$fonts, [
<?php echo template::select('adminFontText', self::$fonts, [
'label' => 'Police du texte',
'selected' => $this->getData(['admin', 'fontText']),
'fonts' => true
@ -140,7 +140,7 @@
]); ?>
</div>
<div class="col4">
<?php echo template::select('adminFontTitle', $module::$fonts, [
<?php echo template::select('adminFontTitle', self::$fonts, [
'label' => 'Police des titres',
'selected' => $this->getData(['admin', 'fontTitle']),
'fonts' => true

View File

@ -17,8 +17,9 @@
*/
$("input, select").on("change", function() {
// Import des polices de caractères
var footerFont = $("#themeFooterFont").val();
var css = "@import url('https://fonts.googleapis.com/css?family=" + footerFont + "');";
var footerFont = $("#themeFooterFont :selected").val();
var footerFontText = $("#themeFooterFont :selected").text();
var css = "@import url('http://fonts.cdnfonts.com/css/" + footerFont + "');";
// Couleurs du pied de page
var colors = core.colorVariants($("#themeFooterBackgroundColor").val());
var textColor = $("#themeFooterTextColor").val();
@ -35,7 +36,7 @@ $("input, select").on("change", function() {
css += "#footerText > p {text-align:" + $("#themeFooterTextAlign").val() + "}";
css += "#footerCopyright{text-align:" + $("#themeFooterCopyrightAlign").val() + "}";
// Taille, couleur, épaisseur et capitalisation du titre de la bannière
css += "footer span, #footerText > p {color:" + $("#themeFooterTextColor").val() + ";font-family:'" + footerFont.replace(/\+/g, " ") + "',sans-serif;font-weight:" + $("#themeFooterFontWeight").val() + ";font-size:" + $("#themeFooterFontSize").val() + ";text-transform:" + $("#themeFooterTextTransform").val() + "}";
css += "footer span, #footerText > p {color:" + $("#themeFooterTextColor").val() + ";font-family:'" + footerFontText + "',sans-serif;font-weight:" + $("#themeFooterFontWeight").val() + ";font-size:" + $("#themeFooterFontSize").val() + ";text-transform:" + $("#themeFooterTextTransform").val() + "}";
// Marge
if($("#themeFooterMargin").is(":checked")) {
css += 'footer{padding: 0 20px;}';

View File

@ -173,7 +173,7 @@
<h4>Mise en forme du texte</h4>
<div class="row">
<div class="col3">
<?php echo template::select('themeFooterFont', $module::$fonts, [
<?php echo template::select('themeFooterFont', self::$fonts, [
'label' => 'Police',
'selected' => $this->getData(['theme', 'footer', 'font']),
'fonts' => true

View File

@ -80,8 +80,9 @@ $("input, select").on("change", function() {
tmpImg.src= "<?php echo helper::baseUrl(false); ?>" + "site/file/source/" + $("#themeHeaderImage").val();
// Import des polices de caractères
var headerFont = $("#themeHeaderFont").val();
var css = "@import url('https://fonts.googleapis.com/css?family=" + headerFont + "');";
var headerFont = $("#themeHeaderFont :selected").val();
var headerFontText = $("#themeHeaderFont :selected").text();
var css = "@import url('http://fonts.cdnfonts.com/css/" + headerFont + "');";
css += "header{text-align:" + $("#themeHeaderTextAlign").val() + ";";
if ($("#themeHeaderImage").val()) {
@ -97,7 +98,7 @@ $("input, select").on("change", function() {
// Taille, couleur, épaisseur et capitalisation du titre de la bannière
css += "header span{font-family:'" + headerFont.replace(/\+/g, " ") + "',sans-serif;font-weight:" + $("#themeHeaderFontWeight").val() + ";font-size:" + $("#themeHeaderFontSize").val() + ";text-transform:" + $("#themeHeaderTextTransform").val() + ";color:" + $("#themeHeaderTextColor").val() + "}";
css += "header span{font-family:'" + headerFontText + "',sans-serif;font-weight:" + $("#themeHeaderFontWeight").val() + ";font-size:" + $("#themeHeaderFontSize").val() + ";text-transform:" + $("#themeHeaderTextTransform").val() + ";color:" + $("#themeHeaderTextColor").val() + "}";
// Cache le titre de la bannière
if($("#themeHeaderTextHide").is(":checked")) {

View File

@ -108,7 +108,7 @@
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeHeaderFont', $module::$fonts, [
<?php echo template::select('themeHeaderFont', self::$fonts, [
'label' => 'Police',
'selected' => $this->getData(['theme', 'header', 'font']),
'fonts' => true

View File

@ -40,8 +40,9 @@ $(document).ready(function(){
*/
$("input, select").on("change", function() {
// Import des polices de caractères
var menuFont = $("#themeMenuFont").val();
var css = "@import url('https://fonts.googleapis.com/css?family=" + menuFont + "');";
var menuFont = $("#themeMenuFont :selected").val();
var menuFontText = $("#themeMenuFont :selected").text();
var css = "@import url('http://fonts.cdnfonts.com/css/" + menuFont + "');";
var colors = core.colorVariants($("#themeMenuBackgroundColor").val());
// Couleurs du menu
css += "nav,nav.navLevel1 a{background-color:" + colors.normal + "}";
@ -56,7 +57,7 @@ $("input, select").on("change", function() {
var colors = core.colorVariants($("#themeMenuBackgroundColorSub").val());
css += 'nav .navSub a{background-color:' + colors.normal + '}';
// Taille, hauteur, épaisseur et capitalisation de caractères du menu
css += "#toggle span,#menu a{padding:" + $("#themeMenuHeight").val() + ";font-family:'" + menuFont.replace(/\+/g, " ") + "',sans-serif;font-weight:" + $("#themeMenuFontWeight").val() + ";font-size:" + $("#themeMenuFontSize").val() + ";text-transform:" + $("#themeMenuTextTransform").val() + "}";
css += "#toggle span,#menu a{padding:" + $("#themeMenuHeight").val() + ";font-family:'" + menuFontText + "',sans-serif;font-weight:" + $("#themeMenuFontWeight").val() + ";font-size:" + $("#themeMenuFontSize").val() + ";text-transform:" + $("#themeMenuTextTransform").val() + "}";
// Alignement du menu
css += "#menu{text-align:" + $("#themeMenuTextAlign").val() + "}";
// Marge

View File

@ -185,7 +185,7 @@
<h4>Mise en forme du texte</h4>
<div class="row">
<div class="col6">
<?php echo template::select('themeMenuFont', $module::$fonts, [
<?php echo template::select('themeMenuFont', self::$fonts, [
'label' => 'Police',
'selected' => $this->getData(['theme', 'menu', 'font']),
'fonts' => true

View File

@ -33,9 +33,13 @@ $("input, select").on("change",function() {
*/
// Import des polices de caractères
var titleFont = $("#themeTitleFont").val();
var textFont = $("#themeTextFont").val();
var css = "@import url('https://fonts.googleapis.com/css?family=" + titleFont + "|" + textFont + "');";
var titleFont = $("#themeTitleFont :selected").val();
var titleFontText = $("#themeTitleFont :selected").text();
var textFont = $("#themeTextFont :selected").val();
var textFontText = $("#themeTextFont :selected").text();
console.log(textFontText);
var css = "@import url('http://fonts.cdnfonts.com/css/" + titleFont + "');";
var css = "@import url('http://fonts.cdnfonts.com/css/" + textFont + "');";
// Couleurs des boutons
var colors = core.colorVariants($("#themeButtonBackgroundColor").val());
css += ".button.buttonSubmitPreview{background-color:" + colors.normal + ";}";
@ -47,10 +51,10 @@ $("input, select").on("change",function() {
css += "a.urlPreview{color:" + colors.normal + "}";
css += "a.urlPreview:hover{color:" + colors.darken + "}";
// Couleur, polices, épaisseur et capitalisation de caractères des titres
css += ".headerPreview,.headerPreview{color:" + $("#themeTitleTextColor").val() + ";font-family:'" + titleFont.replace(/\+/g, " ") + "',sans-serif;font-weight:" + $("#themeTitleFontWeight").val() + ";text-transform:" + $("#themeTitleTextTransform").val() + "}";
css += ".headerPreview,.headerPreview{color:" + $("#themeTitleTextColor").val() + ";font-family:'" + titleFontText + "',sans-serif;font-weight:" + $("#themeTitleFontWeight").val() + ";text-transform:" + $("#themeTitleTextTransform").val() + "}";
// Police de caractères
// Police + couleur
css += ".textPreview,.urlPreview{color:" + $("#themeTextTextColor").val() + ";font-family:'" + textFont.replace(/\+/g, " ") + "',sans-serif; font-size:" + $("#themeTextFontSize").val() + ";}";
css += ".textPreview,.urlPreview{color:" + $("#themeTextTextColor").val() + ";font-family:'" + textFontText + "',sans-serif; font-size:" + $("#themeTextFontSize").val() + ";}";
// Couleur des liens
//css += "a.preview,.buttonSubmitPreview{font-family:'" + textFont.replace(/\+/g, " ") + "',sans-serif}";

View File

@ -160,7 +160,7 @@
<h4>Mise en forme du texte</h4>
<div class="row">
<div class="col6">
<?php echo template::select('themeTextFont', $module::$fonts, [
<?php echo template::select('themeTextFont', self::$fonts, [
'label' => 'Police',
'selected' => $this->getData(['theme', 'text', 'font']),
'fonts' => true
@ -181,7 +181,7 @@
<h4>Mise en forme des titres</h4>
<div class="row">
<div class="col4">
<?php echo template::select('themeTitleFont', $module::$fonts, [
<?php echo template::select('themeTitleFont', self::$fonts, [
'label' => 'Police',
'selected' => $this->getData(['theme', 'title', 'font']),
'fonts' => true