mirror of
https://github.com/YunoHost-Apps/etherpad_mypads_ynh.git
synced 2024-09-03 18:36:09 +02:00
Do not use the new kikoolol theme...
This commit is contained in:
parent
d94a1d3678
commit
242cddbc23
5 changed files with 35 additions and 2 deletions
|
@ -20,6 +20,7 @@
|
|||
main.pad_configuration.pad_config_show_markdown=1|0
|
||||
main.pad_configuration.pad_config_pageview=1|0
|
||||
main.pad_configuration.pad_config_automatic_logout=0|1
|
||||
main.pad_configuration.pad_config_skinname=noskin|colibris|noskin
|
||||
main.mypads_configuration.mypads=0|1
|
||||
main.mypads_configuration.useldap=0|1
|
||||
main.is_public.is_public=1|0
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
* - "colibris": the new experimental skin (since Etherpad 1.8), candidate to
|
||||
* become the default in Etherpad 2.0
|
||||
*/
|
||||
"skinName": "colibris",
|
||||
"skinName": "no-skin",
|
||||
|
||||
/*
|
||||
* IP and port which etherpad should bind at
|
||||
|
|
|
@ -52,6 +52,12 @@ name = "Etherpad configuration"
|
|||
type = "boolean"
|
||||
default = true
|
||||
|
||||
[main.pad_configuration.pad_config_skinname]
|
||||
ask = "Theme Name"
|
||||
choices = ["noskin", "colibris"]
|
||||
default = "noskin"
|
||||
help = "noskin is the traditional Etherpad theme. colibris is the new theme."
|
||||
|
||||
|
||||
[main.mypads_configuration]
|
||||
name = "Mypads configuration"
|
||||
|
|
|
@ -31,7 +31,7 @@ config_file="$final_path/settings.json"
|
|||
get_config_value() {
|
||||
option_name="$1"
|
||||
# Get the value of this option in the config file
|
||||
grep "\"$option_name\" *:" "$config_file" | cut -d':' -f2 | sed s'/ //g' | cut -d',' -f1
|
||||
grep "^ *\"$option_name\" *:" "$config_file" | cut -d':' -f2 | sed s'/[ \"]//g' | cut -d',' -f1
|
||||
}
|
||||
|
||||
#=================================================
|
||||
|
@ -82,6 +82,16 @@ else
|
|||
fi
|
||||
pad_config_automatic_logout="${YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_AUTOMATIC_LOGOUT:-$old_pad_config_automatic_logout}"
|
||||
|
||||
# Etherpad skin
|
||||
old_pad_config_skinname="$(get_config_value skinName)"
|
||||
if [ "$old_pad_config_skinname" = "no-skin" ]; then
|
||||
old_pad_config_skinname=noskin
|
||||
fi
|
||||
pad_config_skinname="${YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_SKINNAME:-$old_pad_config_skinname}"
|
||||
if [ "$pad_config_skinname" = "no-skin" ]; then
|
||||
pad_config_skinname=noskin
|
||||
fi
|
||||
|
||||
# Mypads
|
||||
if [ -d $final_path/node_modules/ep_mypads ]
|
||||
then
|
||||
|
@ -141,6 +151,7 @@ show_config() {
|
|||
ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_SHOW_MARKDOWN=$pad_config_show_markdown"
|
||||
ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_PAGEVIEW=$pad_config_pageview"
|
||||
ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_AUTOMATIC_LOGOUT=$pad_config_automatic_logout"
|
||||
ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_SKINNAME=$pad_config_skinname"
|
||||
|
||||
ynh_return "YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_MYPADS=$mypads"
|
||||
ynh_return "YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_USELDAP=$useldap"
|
||||
|
@ -226,6 +237,17 @@ apply_config() {
|
|||
restart_etherpad=1
|
||||
fi
|
||||
|
||||
# Plugin option ep_page_view_default
|
||||
if [ "$pad_config_skinname" != "$old_pad_config_skinname" ]
|
||||
then
|
||||
if [ "$pad_config_skinname" = "noskin" ]; then
|
||||
pad_config_skinname="no-skin"
|
||||
fi
|
||||
ynh_replace_string --match_string="\( *\"skinName\" *: \).*," --replace_string="\1\"$pad_config_skinname\"," --target_file="$config_file"
|
||||
ynh_app_setting_set --app=$app --key=pad_config_skinname --value="$pad_config_skinname"
|
||||
restart_etherpad=1
|
||||
fi
|
||||
|
||||
# Export
|
||||
if [ "$export" != "$old_export" ]
|
||||
then
|
||||
|
|
|
@ -41,6 +41,7 @@ pad_config_showlinenumbers=$(ynh_app_setting_get --app=$app --key=pad_config_sho
|
|||
pad_config_chatandusers=$(ynh_app_setting_get --app=$app --key=pad_config_chatandusers)
|
||||
pad_config_alwaysshowchat=$(ynh_app_setting_get --app=$app --key=pad_config_alwaysshowchat)
|
||||
pad_config_show_markdown=$(ynh_app_setting_get --app=$app --key=pad_config_show_markdown)
|
||||
pad_config_skinname=$(ynh_app_setting_get --app=$app --key=pad_config_skinname)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
|
@ -298,6 +299,9 @@ then
|
|||
if [ -n "$pad_config_show_markdown" ]; then
|
||||
ynh_replace_string --match_string="\(\"ep_markdown_default\" *: \).*," --replace_string="\1$pad_config_show_markdown," --target_file="$final_path/settings.json"
|
||||
fi
|
||||
if [ -n "$pad_config_skinname" ]; then
|
||||
ynh_replace_string --match_string="\(\"skinName\" *: \).*," --replace_string="\1\"$pad_config_skinname\"," --target_file="$final_path/settings.json"
|
||||
fi
|
||||
|
||||
# Recalculate and store the checksum of the file for the next upgrade.
|
||||
ynh_store_file_checksum --file="$final_path/settings.json"
|
||||
|
|
Loading…
Add table
Reference in a new issue