2024-11-10 06:58:04 +01:00
|
|
|
#!/bin/bash
|
|
|
|
# MyPlayer - Copyright 2014 - 2024 tilt@linuxfoo.de GPLv3
|
2024-09-21 16:05:22 +02:00
|
|
|
# Build Script; recompiles the MyPlayer JavaScript from source.
|
|
|
|
|
2024-11-10 06:58:04 +01:00
|
|
|
dir=$(readlink -f "$(dirname "$0")")
|
|
|
|
|
2024-11-10 07:48:37 +01:00
|
|
|
jsdir=$(readlink -f "$dir/../dist/js")
|
2024-11-10 06:58:04 +01:00
|
|
|
|
|
|
|
if ! cd "$dir" ; then
|
|
|
|
echo "ERROR: Could not change working directory; aborted." >&2 ;
|
|
|
|
exit 1 ;
|
2024-11-10 07:48:37 +01:00
|
|
|
elif ! mkdir -p "$jsdir" ; then
|
|
|
|
echo "ERROR: Could not create directory $jsdir; aborted." >&2 ;
|
|
|
|
exit 1 ;
|
|
|
|
elif ! type yui-compressor > /dev/null ; then
|
|
|
|
echo "ERROR: Executable \"yui-compressor\" not found in PATH; aborted." >&2 ;
|
|
|
|
exit 1 ;
|
2024-11-10 06:58:04 +01:00
|
|
|
fi
|
2024-09-21 16:05:22 +02:00
|
|
|
|
|
|
|
echo '/*
|
|
|
|
jQuery
|
|
|
|
Copyright 2014 jQuery Foundation and other contributors
|
|
|
|
http://jquery.com/
|
|
|
|
MediaElement.js
|
|
|
|
Copyright 2010-2013, John Dyer (http://j.hn)
|
|
|
|
MediaElement Playlist Feature (plugin) -
|
|
|
|
Andrew Berezovsky <andrew.berezovsky@gmail.com>
|
|
|
|
and Junaid Qadir Baloch <shekhanzai.baloch@gmail.com>
|
|
|
|
JavaScript-ID3-Reader
|
|
|
|
Copyright (c) 2008 Jacob Seidelin, http://blog.nihilogic.dk/ BSD License
|
|
|
|
Copyright (c) 2009 Opera Software ASA BSD License
|
2024-11-10 06:58:04 +01:00
|
|
|
Copyright (c) 2010 Antonio Afonso BSD License
|
2024-09-21 16:05:22 +02:00
|
|
|
Copyright (c) 2010 Joshua Kifer BSD License
|
|
|
|
MyPlayer
|
2024-11-10 06:58:04 +01:00
|
|
|
Copyright (c) 2014 - 2024 tilt@linuxfoo.de MIT License
|
|
|
|
*/' > "$jsdir"/myplayer.min.js
|
|
|
|
|
|
|
|
rm -f "$jsdir"/myplayer.min.js
|
|
|
|
|
|
|
|
for js in \
|
|
|
|
../mediaelement/build/mediaelement-and-player.min.js \
|
2024-11-10 15:10:00 +01:00
|
|
|
../mediaelement-plugins/dist/playlist/playlist.min.js \
|
|
|
|
../jsmediatags/dist/jsmediatags.js
|
2024-11-10 06:58:04 +01:00
|
|
|
do
|
|
|
|
echo "INFO: Appending $js ..." >&2
|
|
|
|
cat $js >> "$jsdir"/myplayer.min.js
|
|
|
|
done
|
|
|
|
|
2024-11-10 15:10:00 +01:00
|
|
|
echo "INFO: Compressing player.js ..." >&2
|
|
|
|
yui-compressor player.js >> "$jsdir"/myplayer.min.js
|
2024-11-10 06:58:04 +01:00
|
|
|
|
|
|
|
chmod 644 "$jsdir"/myplayer.min.js
|
|
|
|
|
|
|
|
echo "INFO: Javascript source was minimized to $jsdir/myplayer.min.js" >&2
|
|
|
|
|
2024-11-10 15:10:00 +01:00
|
|
|
rm -f "$jsdir"/myplayer.js
|
2024-11-10 06:58:04 +01:00
|
|
|
|
|
|
|
for js in \
|
|
|
|
../mediaelement/build/mediaelement-and-player.js \
|
|
|
|
../mediaelement-plugins/dist/playlist/playlist.js \
|
2024-11-10 15:10:00 +01:00
|
|
|
../jsmediatags/dist/jsmediatags.min.js \
|
2024-11-10 06:58:04 +01:00
|
|
|
player.js
|
|
|
|
do
|
|
|
|
echo "INFO: Appending $js ..." >&2
|
|
|
|
cat $js >> "$jsdir"/myplayer.js
|
|
|
|
done
|
|
|
|
|
|
|
|
chmod 644 "$jsdir"/myplayer.js
|
|
|
|
|
|
|
|
echo "INFO: Uncompressed javascript source was collected in $jsdir/myplayer.js" >&2
|