From 0c518cadf5ee7acbde70d6ad2bbab7e76075e266 Mon Sep 17 00:00:00 2001 From: muxator Date: Sun, 26 Aug 2018 01:11:02 +0200 Subject: [PATCH] skins: replace {js,css}.template with actual files. Simplify startup scripts. Currently, an Etherpad skin requires the existence of 6 files: - index.{css,js} - pad.{css,js} - timeslider.{css,js} In the default empty skin (in static/custom), there were 2 small placeholders ({js,css}.template) to be copied in place by the startup script in case no skin was in use. Now that we are moving to multiple directories (see #3471) we can simply commit the example files and remove the copying code from the startup script. --- bin/installDeps.sh | 13 ------------- bin/installOnWindows.bat | 10 +--------- src/static/custom/.gitignore | 3 --- src/static/custom/{css.template => index.css} | 0 src/static/custom/{js.template => index.js} | 0 src/static/custom/pad.css | 8 ++++++++ src/static/custom/pad.js | 6 ++++++ src/static/custom/timeslider.css | 8 ++++++++ src/static/custom/timeslider.js | 6 ++++++ 9 files changed, 29 insertions(+), 25 deletions(-) delete mode 100644 src/static/custom/.gitignore rename src/static/custom/{css.template => index.css} (100%) rename src/static/custom/{js.template => index.js} (100%) create mode 100644 src/static/custom/pad.css create mode 100644 src/static/custom/pad.js create mode 100644 src/static/custom/timeslider.css create mode 100644 src/static/custom/timeslider.js diff --git a/bin/installDeps.sh b/bin/installDeps.sh index 47373a5f6..dd7052390 100755 --- a/bin/installDeps.sh +++ b/bin/installDeps.sh @@ -143,17 +143,4 @@ fi echo "Clearing minified cache..." rm -f var/minified* -echo "Ensure custom css/js files are created..." - -for f in "index" "pad" "timeslider" -do - if [ ! -f "src/static/custom/$f.js" ]; then - cp "src/static/custom/js.template" "src/static/custom/$f.js" || exit 1 - fi - - if [ ! -f "src/static/custom/$f.css" ]; then - cp "src/static/custom/css.template" "src/static/custom/$f.css" || exit 1 - fi -done - exit 0 diff --git a/bin/installOnWindows.bat b/bin/installOnWindows.bat index 5ba057365..75982aaff 100644 --- a/bin/installOnWindows.bat +++ b/bin/installOnWindows.bat @@ -18,14 +18,6 @@ cmd /C npm install --loglevel warn || exit /B 1 cd /D "%~dp0\.." -echo _ -echo Copying custom templates... -set custom_dir=node_modules\ep_etherpad-lite\static\custom -FOR %%f IN (index pad timeslider) DO ( - if NOT EXIST "%custom_dir%\%%f.js" copy "%custom_dir%\js.template" "%custom_dir%\%%f.js" - if NOT EXIST "%custom_dir%\%%f.css" copy "%custom_dir%\css.template" "%custom_dir%\%%f.css" -) - echo _ echo Clearing cache... del /S var\minified* @@ -39,4 +31,4 @@ IF NOT EXIST settings.json ( ) echo _ -echo Installed Etherpad! To run Etherpad type start.bat \ No newline at end of file +echo Installed Etherpad! To run Etherpad type start.bat diff --git a/src/static/custom/.gitignore b/src/static/custom/.gitignore deleted file mode 100644 index aae16bb24..000000000 --- a/src/static/custom/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!.gitignore -!*.template diff --git a/src/static/custom/css.template b/src/static/custom/index.css similarity index 100% rename from src/static/custom/css.template rename to src/static/custom/index.css diff --git a/src/static/custom/js.template b/src/static/custom/index.js similarity index 100% rename from src/static/custom/js.template rename to src/static/custom/index.js diff --git a/src/static/custom/pad.css b/src/static/custom/pad.css new file mode 100644 index 000000000..236251d9c --- /dev/null +++ b/src/static/custom/pad.css @@ -0,0 +1,8 @@ +/* + custom css files are loaded after core css files. Simply use the same selector to override a style. + Example: + #editbar LI {border:1px solid #000;} + overrides + #editbar LI {border:1px solid #d5d5d5;} + from pad.css +*/ diff --git a/src/static/custom/pad.js b/src/static/custom/pad.js new file mode 100644 index 000000000..152c3d5d7 --- /dev/null +++ b/src/static/custom/pad.js @@ -0,0 +1,6 @@ +function customStart() +{ + //define your javascript here + //jquery is available - except index.js + //you can load extra scripts with $.getScript http://api.jquery.com/jQuery.getScript/ +} diff --git a/src/static/custom/timeslider.css b/src/static/custom/timeslider.css new file mode 100644 index 000000000..236251d9c --- /dev/null +++ b/src/static/custom/timeslider.css @@ -0,0 +1,8 @@ +/* + custom css files are loaded after core css files. Simply use the same selector to override a style. + Example: + #editbar LI {border:1px solid #000;} + overrides + #editbar LI {border:1px solid #d5d5d5;} + from pad.css +*/ diff --git a/src/static/custom/timeslider.js b/src/static/custom/timeslider.js new file mode 100644 index 000000000..152c3d5d7 --- /dev/null +++ b/src/static/custom/timeslider.js @@ -0,0 +1,6 @@ +function customStart() +{ + //define your javascript here + //jquery is available - except index.js + //you can load extra scripts with $.getScript http://api.jquery.com/jQuery.getScript/ +}