use a downloaded jQuery instead of using googles CDN, and fixed btw a bug that let pad.js fails randomly

This commit is contained in:
Peter 'Pita' Martischka 2011-06-30 18:06:07 +01:00
parent c98db5a4c1
commit 95b47b4940
5 changed files with 21 additions and 6 deletions

View file

@ -37,6 +37,21 @@ fi
echo "Ensure that all dependencies are up to date..."
npm install
echo "Ensure jQuery is downloaded and up to date..."
DOWNLOAD_JQUERY="true"
NEEDED_VERSION="1.6.1"
if [ -f "static/js/jquery.min.js" ]; then
VERSION=$(cat static/js/jquery.min.js | head -n 2 | tail -n 1 | grep -o "v[0-9]*\.[0-9]*\.[0-9]*");
if [[ ${VERSION:1} = $NEEDED_VERSION ]]; then
DOWNLOAD_JQUERY="false"
fi
fi
if [[ $DOWNLOAD_JQUERY = "true" ]]; then
wget -O static/js/jquery.min.js http://code.jquery.com/jquery-$NEEDED_VERSION.min.js
fi
#Remove all minified data to force node creating it new
echo "Clear minfified cache..."
rm var/minified* 2> /dev/null