Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita74d68a

Browse files
committed
WebUI: Fix jQuery DOM manipulation issues
The commit includes the following jQuery patches:- Manipulation: Make jQuery.htmlPrefilter an identity function (jquery/jquery#4642)- Manipulation: Skip the select wrapper for <option> outside of IE 9 (jquery/jquery#4647)In addition there is included a script that helps to patch and buildthe new version of jQuery: $ install/ui/util/make-jquery.js 3.4.1Ticket:https://pagure.io/freeipa/issue/8507Signed-off-by: Serhii Tsymbaliuk <stsymbal@redhat.com>
1 parentb606fa6 commita74d68a

File tree

4 files changed

+140
-2
lines changed

4 files changed

+140
-2
lines changed

‎install/ui/src/libs/jquery.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
From 1d61fd9407e6fbe82fe55cb0b938307aa0791f77 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?=
3+
<m.goleb@gmail.com>
4+
Date: Mon, 16 Mar 2020 21:49:29 +0100
5+
Subject: [PATCH] Manipulation: Make jQuery.htmlPrefilter an identity function
6+
7+
Closes gh-4642
8+
9+
(cherry picked from 90fed4b453a5becdb7f173d9e3c1492390a1441f)
10+
---
11+
src/manipulation.js | 9 +--------
12+
1 file changed, 1 insertion(+), 8 deletions(-)
13+
14+
diff --git a/src/manipulation.js b/src/manipulation.js
15+
index 017345af..dec21ea0 100644
16+
--- a/src/manipulation.js
17+
+++ b/src/manipulation.js
18+
@@ -33,13 +33,6 @@ define( [
19+
20+
var
21+
22+
-/* eslint-disable max-len */
23+
-
24+
-// See https://github.com/eslint/eslint/issues/3229
25+
-rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
26+
-
27+
-/* eslint-enable */
28+
-
29+
// Support: IE <=10 - 11, Edge 12 - 13 only
30+
// In IE/Edge using regex groups here causes severe slowdowns.
31+
// See https://connect.microsoft.com/IE/feedback/details/1736512/
32+
@@ -236,7 +229,7 @@ function remove( elem, selector, keepData ) {
33+
34+
jQuery.extend( {
35+
htmlPrefilter: function( html ) {
36+
-return html.replace( rxhtmlTag, "<$1></$2>" );
37+
+return html;
38+
},
39+
40+
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
41+
--
42+
2.20.1
43+
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
From 966a70909019aa09632c87c0002c522fa4a1e30e Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?=
3+
<m.goleb@gmail.com>
4+
Date: Mon, 30 Mar 2020 20:15:09 +0200
5+
Subject: [PATCH] Manipulation: Skip the select wrapper for <option> outside of
6+
IE 9
7+
8+
Closes gh-4647
9+
---
10+
src/manipulation/support.js | 6 ++++++
11+
src/manipulation/wrapMap.js | 15 ++++++++-------
12+
2 files changed, 14 insertions(+), 7 deletions(-)
13+
14+
diff --git a/src/manipulation/support.js b/src/manipulation/support.js
15+
index 4a5d9af4..62d6bb3e 100644
16+
--- a/src/manipulation/support.js
17+
+++ b/src/manipulation/support.js
18+
@@ -28,6 +28,12 @@ define( [
19+
// Make sure textarea (and checkbox) defaultValue is properly cloned
20+
div.innerHTML = "<textarea>x</textarea>";
21+
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
22+
+
23+
+// Support: IE <=9 only
24+
+// IE <=9 replaces <option> tags with their contents when inserted outside of
25+
+// the select element.
26+
+div.innerHTML = "<option></option>";
27+
+support.option = !!div.lastChild;
28+
} )();
29+
30+
return support;
31+
diff --git a/src/manipulation/wrapMap.js b/src/manipulation/wrapMap.js
32+
index 1f446f7d..da48bf9f 100644
33+
--- a/src/manipulation/wrapMap.js
34+
+++ b/src/manipulation/wrapMap.js
35+
@@ -1,13 +1,12 @@
36+
-define( function() {
37+
+define( [
38+
+"./support"
39+
+], function( support ) {
40+
41+
"use strict";
42+
43+
// We have to close these tags to support XHTML (#13200)
44+
var wrapMap = {
45+
46+
-// Support: IE <=9 only
47+
-option: [ 1, "<select multiple='multiple'>", "</select>" ],
48+
-
49+
// XHTML parsers do not magically insert elements in the
50+
// same way that tag soup parsers do. So we cannot shorten
51+
// this by omitting <tbody> or other required elements.
52+
@@ -19,11 +18,13 @@ var wrapMap = {
53+
_default: [ 0, "", "" ]
54+
};
55+
56+
-// Support: IE <=9 only
57+
-wrapMap.optgroup = wrapMap.option;
58+
-
59+
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
60+
wrapMap.th = wrapMap.td;
61+
62+
+// Support: IE <=9 only
63+
+if ( !support.option ) {
64+
+wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
65+
+}
66+
+
67+
return wrapMap;
68+
} );
69+
--
70+
2.20.1
71+

‎install/ui/util/make-jquery.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash -eu
2+
3+
if [$#-ne 1 ];then
4+
echo'The script requires exactly one argument (a jQuery version):'
5+
echo
6+
echo' $ ./make-jquery.sh 3.4.1'
7+
echo
8+
exit 1
9+
fi
10+
11+
WD=$(realpath$(dirname"${BASH_SOURCE[0]}"))
12+
JQUERY_VERSION=$1
13+
14+
# Apply patches
15+
cd /tmp
16+
git clone -b${JQUERY_VERSION} --depth 1 https://github.com/jquery/jquery.git
17+
cd jquery
18+
git am${WD}/jquery-patches/${JQUERY_VERSION}/*
19+
20+
# Build jQuery
21+
npm install
22+
npm run-script build
23+
24+
# Replace the project version of jQuery with the built one
25+
cp -fv dist/jquery.min.js${WD}/../src/libs/jquery.js

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp