From b20cb6576485017970f025e6f294ac8c09f39e69 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 20 Mar 2014 17:27:00 +0000 Subject: Add a searchable dropdown of clinic names to postcode form uses select2 for the dropdown and a cobrand call to fetch the list of report titles as the clinic names. Relies on a redirect in httpd.conf to make the non JS version work. Still leaves the postcode search in place as select2 won't accept custom terms if you base it on a select box, which we want to do so it works if JavaScript is disabled Fixes #723 --- web/js/select2/release.sh | 73 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100755 web/js/select2/release.sh (limited to 'web/js/select2/release.sh') diff --git a/web/js/select2/release.sh b/web/js/select2/release.sh new file mode 100755 index 000000000..92fe0e959 --- /dev/null +++ b/web/js/select2/release.sh @@ -0,0 +1,73 @@ +#!/bin/bash +set -e + +echo -n "Enter the version for this release: " + +read ver + +if [ ! $ver ]; then + echo "Invalid version." + exit +fi + +name="select2" +js="$name.js" +mini="$name.min.js" +css="$name.css" +release="$name-$ver" +tag="$ver" +branch="build-$ver" +curbranch=`git branch | grep "*" | sed "s/* //"` +timestamp=$(date) +tokens="s/@@ver@@/$ver/g;s/\@@timestamp@@/$timestamp/g" +remote="github" + +echo "Pulling from origin" + +git pull + +echo "Updating Version Identifiers" + +sed -E -e "s/\"version\": \"([0-9\.]+)\",/\"version\": \"$ver\",/g" -i "" bower.json select2.jquery.json +git add bower.json +git add select2.jquery.json +git commit -m "modified version identifiers in descriptors for release $ver" +git push + +git branch "$branch" +git checkout "$branch" + +echo "Tokenizing..." + +find . -name "$js" | xargs -I{} sed -e "$tokens" -i "" {} +find . -name "$css" | xargs -I{} sed -e "$tokens" -i "" {} +sed -e "s/latest/$ver/g" -i "" bower.json + +git add "$js" +git add "$css" + +echo "Minifying..." + +echo "/*" > "$mini" +cat LICENSE | sed "$tokens" >> "$mini" +echo "*/" >> "$mini" + +curl -s \ + --data-urlencode "js_code@$js" \ + http://marijnhaverbeke.nl/uglifyjs \ + >> "$mini" + +git add "$mini" + +git commit -m "release $ver" + +echo "Tagging..." +git tag -a "$tag" -m "tagged version $ver" +git push "$remote" --tags + +echo "Cleaning Up..." + +git checkout "$curbranch" +git branch -D "$branch" + +echo "Done" -- cgit v1.2.3