about summary refs log tree commit diff stats
path: root/wiki/lib/scripts/jquery/update.sh
diff options
context:
space:
mode:
authorahriman <ahriman@falte.red>2018-12-03 19:22:25 -0500
committerahriman <ahriman@falte.red>2018-12-03 19:22:25 -0500
commit0ae8cbf5c0b1a198b963490985b7738392ebcb97 (patch)
treeb2c77ae72c6b717e2b97492065196ac5ffb2d9e2 /wiki/lib/scripts/jquery/update.sh
parentf57f6cc5a2d159f90168d292437dc4bd8cd7f934 (diff)
downloadsite-0ae8cbf5c0b1a198b963490985b7738392ebcb97.tar.gz
installed dokuwiki, added to navbar, updated news
Diffstat (limited to 'wiki/lib/scripts/jquery/update.sh')
-rwxr-xr-xwiki/lib/scripts/jquery/update.sh50
1 files changed, 50 insertions, 0 deletions
diff --git a/wiki/lib/scripts/jquery/update.sh b/wiki/lib/scripts/jquery/update.sh
new file mode 100755
index 0000000..31b859e
--- /dev/null
+++ b/wiki/lib/scripts/jquery/update.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# This script loads the latest jQuery and jQuery-UI 1.* versions from jQuery's CDN
+#
+# It also loads the 'smoothness' jQuery-UI theme and all referenced images.
+#
+# @author Andreas Gohr <andi@splitbrain.org>
+# @author Stefan Grönke <stefan@gronke.net>
+# @link   http://code.jquery.com/
+
+# load version infor from external file
+source ./versions
+JQUI_HOST="https://code.jquery.com/ui/$JQUI_VERSION"
+JQUI_GIT="https://raw.githubusercontent.com/jquery/jquery-ui/$JQUI_VERSION/ui"
+
+# load jQuery
+wget -nv https://code.jquery.com/jquery-${JQ_VERSION}.min.js      -O jquery.min.js
+# load jQuery-UI
+wget -nv "$JQUI_HOST/jquery-ui.min.js" -O jquery-ui.min.js
+# load jQuery Migrate
+wget -nv https://code.jquery.com/jquery-migrate-${JQM_VERSION}.min.js      -O jquery-migrate.min.js
+
+# load the smoothness theme
+mkdir -p jquery-ui-theme/images
+wget -nv -qO- "$JQUI_HOST/themes/smoothness/jquery-ui.css" | sed "s/font-family:[^;]*;//" > 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 "$JQUI_HOST/themes/smoothness/$img" -O jquery-ui-theme/$img
+done
+
+# load the localization data for jquery ui
+for LNG in ../../../inc/lang/*
+do
+    CODE=`basename $LNG`
+    wget -nv "$JQUI_GIT/i18n/datepicker-$CODE.js" -O $LNG/jquery.ui.datepicker.js
+    if [ ! -s "$LNG/jquery.ui.datepicker.js" ]; then
+        rm -f $LNG/jquery.ui.datepicker.js
+    fi
+done
+
+# some custom language codes
+wget -nv "$JQUI_GIT/i18n/datepicker-de.js" -O ../../../inc/lang/de-informal/jquery.ui.datepicker.js
+wget -nv "$JQUI_GIT/i18n/datepicker-pt-BR.js" -O ../../../inc/lang/pt-br/jquery.ui.datepicker.js
+wget -nv "$JQUI_GIT/i18n/datepicker-zh-CN.js" -O ../../../inc/lang/zh/jquery.ui.datepicker.js
+wget -nv "$JQUI_GIT/i18n/datepicker-zh-TW.js" -O ../../../inc/lang/zh-tw/jquery.ui.datepicker.js
+wget -nv "$JQUI_GIT/i18n/datepicker-cy-GB.js" -O ../../../inc/lang/cy/jquery.ui.datepicker.js
+
+# strip source maps
+sed -i '/sourceMappingURL/d' *.min.js