diff --git a/conf/minimaxing.less b/conf/minimaxing.less index 645a4ce..b95f66c 100755 --- a/conf/minimaxing.less +++ b/conf/minimaxing.less @@ -51,7 +51,7 @@ You can create your own manuscript / handwriting font on http://www.myscriptfont @MainColor: #549136; /* For YunoHost config */ -@MainColor: __YNH_COLOR__; +@MainColor: #__YNH_COLOR__; diff --git a/manifest.json b/manifest.json index f414ce3..c77b9d8 100644 --- a/manifest.json +++ b/manifest.json @@ -99,14 +99,14 @@ "name": "color", "type": "string", "ask": { - "en": "Set default color base", + "en": "Set color base", "fr": "Définissez la couleur de base" }, "help": { - "en": "Use hexadecimal value", - "fr": "Utilisez une valeur hexadecimale" + "en": "Use hexadecimal value (6 figures without #)", + "fr": "Utilisez une valeur hexadecimale (6 chiffres sans # devant)" }, - "example": "#D07732" + "example": "D07732" } ] } diff --git a/scripts/_common.sh b/scripts/_common.sh index 94c90e8..ebab4f2 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,6 +5,8 @@ #================================================= # dependencies used by the app +pkg_dependencies="node-less" + #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 911aade..df8069c 100644 --- a/scripts/install +++ b/scripts/install @@ -183,6 +183,10 @@ ynh_add_fpm_config cp ../conf/config.php $final_path/ cp ../conf/minimaxing.less $final_path/templates/minimaxing/ +#cp ../conf/minimaxing.css $final_path/templates/minimaxing/ + +# we already use the default html template +#cp ../conf/minimaxing.html $final_path/templates/ # Set the password ynh_replace_string --match_string="__YNH_PASSWORD__" --replace_string="$password" --target_file="$final_path/config.php" @@ -194,7 +198,20 @@ ynh_replace_string --match_string="__YNH_LANG__" --replace_string="$language" ynh_replace_string --match_string="__YNH_LABEL__" --replace_string="$wiki" --target_file="$final_path/config.php" -ynh_replace_string --match_string="__YNH_COLOR__" --replace_string="$color" --target_file="$final_path/templates/minimaxing/minimaxing.less" +# test if the color was correctly set (6 hexadecimal values) +if echo "$color" | grep -q -E '[A-Fa-f0-9]{6}' +then + ynh_replace_string --match_string="__YNH_COLOR__" --replace_string="$color" --target_file="$final_path/templates/minimaxing/minimaxing.less" +else + ynh_replace_string --match_string="__YNH_COLOR__" --replace_string="555555" --target_file="$final_path/templates/minimaxing/minimaxing.less" +fi + +lessc --js $final_path/templates/minimaxing/minimaxing.less > $final_path/templates/minimaxing/minimaxing.css + + + + +#ynh_replace_string --match_string="__YNH_COLOR__" --replace_string="$color" --target_file="$final_path/templates/minimaxing/minimaxing.css"