summaryrefslogtreecommitdiff
path: root/lib/scripts/jquery/update.sh
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2011-06-05 11:28:43 +0200
committerAndreas Gohr <andi@splitbrain.org>2011-06-05 11:28:43 +0200
commit43576758311bd64506284b15a3a12f153a1c1bc2 (patch)
tree9bcb1150b954d36621beaf17a2778e0154ba3939 /lib/scripts/jquery/update.sh
parent17582ec6bab09e9d9faf53a93d22ecb4fbf2bb47 (diff)
downloadrpg-43576758311bd64506284b15a3a12f153a1c1bc2.tar.gz
rpg-43576758311bd64506284b15a3a12f153a1c1bc2.tar.bz2
Updated jQuery-UI, added jQuery updater, load theme in CSS dispatcher
This patch adds a simple shell script to easily update the jQuery/jQuery-UI+theme bundle to the latest available version. The jQuery-UI CSS theme is now loaded in lib/exe/css.php (before plugin and template styles - 3rd party authors can override the styles).
Diffstat (limited to 'lib/scripts/jquery/update.sh')
-rwxr-xr-xlib/scripts/jquery/update.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/scripts/jquery/update.sh b/lib/scripts/jquery/update.sh
new file mode 100755
index 000000000..38f38bece
--- /dev/null
+++ b/lib/scripts/jquery/update.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# This script loads the latest jQuery and jQuery-UI 1.* versions from Google's CDN
+#
+# It also loads the 'smoothness' jQuery-UI theme and all referenced images.
+#
+# @author Andreas Gohr <andi@splitbrain.org>
+# @link https://code.google.com/apis/libraries/devguide.html#jquery
+
+# load jQuery
+wget -nv https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js -O jquery.min.js
+wget -nv https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js -O jquery.js
+
+# load jQuery-UI
+wget -nv https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js -O jquery-ui.min.js
+wget -nv https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.js -O jquery-ui.js
+
+# load the smoothness theme
+mkdir -p jquery-ui-theme/images
+wget -nv https://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/smoothness/jquery-ui.css -O jquery-ui-theme/smoothness.css
+images=`gawk 'match($0, /url\((images\/[^\)]+)\)/, m) { print m[1] }' jquery-ui-theme/smoothness.css`
+for img in $images
+do
+ wget -nv https://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/smoothness/$img -O jquery-ui-theme/$img
+done