freeipa/install/ui/util/make-jquery.sh
Serhii Tsymbaliuk 29b41aef0a
WebUI: Fix jQuery DOM manipulation issues
The commit includes the following jQuery patches:
- Manipulation: Make jQuery.htmlPrefilter an identity function
  (https://github.com/jquery/jquery/pull/4642)
- Manipulation: Skip the select wrapper for <option> outside of IE 9
  (https://github.com/jquery/jquery/pull/4647)

In addition there is included a script that helps to patch and build
the new version of jQuery:

  $ install/ui/util/make-jquery.js 3.4.1

Ticket: https://pagure.io/freeipa/issue/8507

Signed-off-by: Serhii Tsymbaliuk <stsymbal@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2020-09-24 16:21:04 +02:00

30 lines
667 B
Bash
Executable File

#!/bin/bash -eu
if [ $# -ne 1 ]; then
echo 'The script requires exactly one argument (a jQuery version):'
echo
echo ' $ ./make-jquery.sh 3.4.1'
echo
exit 1
fi
WD=$(realpath $(dirname "${BASH_SOURCE[0]}"))
JQUERY_VERSION=$1
# Clone jQuery and apply patches
JQUERY_CLONE=$(mktemp -d)
git clone -b ${JQUERY_VERSION} --depth 1 https://github.com/jquery/jquery.git $JQUERY_CLONE
pushd $JQUERY_CLONE
git am ${WD}/jquery-patches/${JQUERY_VERSION}/*
# Build jQuery
npm install
npm run-script build
# Replace the project version of jQuery with the built one
cp -fv dist/jquery.min.js ${WD}/../src/libs/jquery.js
# Clean up
popd
rm -rf $JQUERY_CLONE