From 7a81109006296cd016b2aef8bd287f915d350c5d Mon Sep 17 00:00:00 2001 From: Gnieark Date: Tue, 3 Jan 2017 18:34:07 +0100 Subject: [PATCH] . --- README.md | 4 ++-- _admin.php | 2 +- index.php | 64 ++++++++++++++++++++++++++++++++++-------------------- 3 files changed, 43 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 6a862b1..ce83b06 100755 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Ce module permet de la coloration syntaxique lors de la citation de codes dans u # Code tiers Minifier class was made by Tedious https://github.com/tedious/JShrink BSD License. -# Modifications apportées par ce Fork: +# Modifications apportées: Le plugin Yash insère plusieurs appels à des scripts javascripts, et ajoute des variables JS dans le footer de la page. Yash3 concatène tout ça pour ne mettre qu'un seul script en référence. @@ -27,4 +27,4 @@ Les noms de fichiers (css et js) générés sont incrémentés à chaque modific # Installation Installez ce plugin en copiant l'url suivante https://www.ventresmous.fr/public/yash/yash3.zip directement dans l'interface de Dotclear pour l'installer. -Pensez à désactiver le plugin yash si vous l'aviez installé. +Pensez à désactiver le plugin yash si vous l'aviez installé. \ No newline at end of file diff --git a/_admin.php b/_admin.php index 7336a7d..52f55ae 100755 --- a/_admin.php +++ b/_admin.php @@ -31,4 +31,4 @@ $_menu['Blog']->addItem(__('YASH3'), preg_match('/plugin.php\?p=yash3(&.*)?$/',$_SERVER['REQUEST_URI']), $core->auth->check('contentadmin',$core->blog->id)); -$core->addBehavior('adminPostEditor',array('yash3Behaviors','adminPostEditor')); +$core->addBehavior('adminPostEditor',array('yash3Behaviors','adminPostEditor')); \ No newline at end of file diff --git a/index.php b/index.php index 4c4f7d9..c7bd15a 100755 --- a/index.php +++ b/index.php @@ -44,7 +44,7 @@ if (is_null($core->blog->settings->yash3->yash3_active)) { // Getting current parameters $active = (boolean)$core->blog->settings->yash3->yash3_active; $theme = (string)$core->blog->settings->yash3->yash3_theme; -$custom_css = (string)$core->blog->settings->yash3->yash3_custom_css; +$customCss = (string)$core->blog->settings->yash3->yash3_custom_css; if (!empty($_REQUEST['popup'])) { $yash3_brushes = array( @@ -105,10 +105,10 @@ if (!empty($_POST['saveconfig'])) { $core->blog->settings->addNameSpace('yash3'); $active = (empty($_POST['active'])) ? false : true; $theme = (empty($_POST['theme'])) ? 'Default' : $_POST['theme']; - $custom_css = (empty($_POST['custom_css'])) ? '' : html::sanitizeURL($_POST['custom_css']); + $customCss = (empty($_POST['customCss'])) ? '' : $_POST['customCss']; $core->blog->settings->yash3->put('yash3_active',$active,'boolean'); $core->blog->settings->yash3->put('yash3_theme',$theme,'string'); - $core->blog->settings->yash3->put('yash3_custom_css',$custom_css,'string'); + $core->blog->settings->yash3->put('yash3_custom_css',$customCss,'string'); $new_concat_version = (integer)$core->blog->settings->yash3->yash3_concat_version + 1; @@ -166,11 +166,11 @@ if (!empty($_POST['saveconfig'])) { file_get_contents($cssPathFile); // Remove comments - //$fContent = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $fContent); + $fContent = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $fContent); // Remove space after colons - //$fContent = str_replace(': ', ':', $fContent); + $fContent = str_replace(': ', ':', $fContent); // Remove whitespace - //$fContent = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $fContent); + $fContent = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $fContent); //create the file file_put_contents( $cssFutureFileRealPath, $fContent ); @@ -208,6 +208,23 @@ if (!empty($_POST['saveconfig'])) { <?php echo __('YASH3'); ?> + + + + @@ -220,18 +237,19 @@ if (!empty($_POST['saveconfig'])) { echo dcPage::notices(); $combo_theme = array( - __('Default') => 'Default', - __('Django') => 'Django', - __('Eclipse') => 'Eclipse', - __('Emacs') => 'Emacs', - __('Fade to gray') => 'FadeToGrey', - __('Material') => 'Material', - __('MD Ultra') => 'MDUltra', - __('Midnight') => 'Midnight', - __('RDark') => 'RDark', - __('Solarized Dark') => 'SolarizedDark', - __('Solarized Light') => 'SolarizedLight', - __('Tomorrow Night') => 'TomorrowNight' + __('Default') => 'Default', + __('Css personnalisé') => 'Custom', + __('Django') => 'Django', + __('Eclipse') => 'Eclipse', + __('Emacs') => 'Emacs', + __('Fade to gray') => 'FadeToGrey', + __('Material') => 'Material', + __('MD Ultra') => 'MDUltra', + __('Midnight') => 'Midnight', + __('RDark') => 'RDark', + __('Solarized Dark') => 'SolarizedDark', + __('Solarized Light') => 'SolarizedLight', + __('Tomorrow Night') => 'TomorrowNight' ); ?> @@ -246,13 +264,12 @@ $combo_theme = array(

-

+

-
- +

@@ -261,6 +278,5 @@ $combo_theme = array(

- - + \ No newline at end of file