Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
joshine
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
joshine
Commits
c47a2538
Commit
c47a2538
authored
Apr 24, 2023
by
dhn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验证
parent
7b798d95
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
37 deletions
+46
-37
app/code/Magento/Checkout/view/frontend/web/js/view/part.js
+3
-3
app/code/Magento/Theme/view/base/requirejs-config.js
+0
-1
app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js
+0
-1
lib/web/jquery/jquery.validate.js
+43
-31
lib/web/mage/validation.js
+0
-1
No files found.
app/code/Magento/Checkout/view/frontend/web/js/view/part.js
View file @
c47a2538
...
...
@@ -27,7 +27,7 @@ define([
var
loginForm
=
$
(
'.form.form-login'
);
var
addressForm
=
$
(
'#checkout-step-shipping>#co-shipping-form'
);
if
(
loginForm
.
length
>
0
&&
!
loginForm
.
validate
s
().
form
())
{
if
(
loginForm
.
length
>
0
&&
!
loginForm
.
validate
().
form
())
{
return
false
;
}
if
(
addressForm
.
length
>
0
)
{
...
...
@@ -51,7 +51,7 @@ define([
$
(
selectInput
[
i
]).
attr
(
'name'
,
selectName
)
}
}
if
(
!
addressForm
.
validate
s
().
form
())
{
if
(
!
addressForm
.
validate
().
form
())
{
if
(
selectInput
.
length
>
0
){
for
(
var
i
=
0
;
i
<
selectInput
.
length
;
i
++
){
$
(
selectInput
[
i
]).
removeAttr
(
'name'
)
...
...
@@ -112,7 +112,7 @@ define([
$
(
selectInput
[
i
]).
attr
(
'name'
,
selectName
)
}
}
if
(
!
billadressForm
.
validate
s
().
form
())
{
if
(
!
billadressForm
.
validate
().
form
())
{
if
(
selectInput
.
length
>
0
){
for
(
var
i
=
0
;
i
<
selectInput
.
length
;
i
++
){
$
(
selectInput
[
i
]).
removeAttr
(
'name'
)
...
...
app/code/Magento/Theme/view/base/requirejs-config.js
View file @
c47a2538
...
...
@@ -30,7 +30,6 @@ var config = {
},
paths
:
{
'jquery/validate'
:
'jquery/jquery.validate'
,
'jquery/validates'
:
'jquery/jquery.validates'
,
'jquery/hover-intent'
:
'jquery/jquery.hoverIntent'
,
'jquery/file-uploader'
:
'jquery/fileUploader/jquery.fileuploader'
,
'prototype'
:
'legacy-build.min'
,
...
...
app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js
View file @
c47a2538
...
...
@@ -13,7 +13,6 @@ define([
'moment'
,
'tinycolor'
,
'jquery/validate'
,
'jquery/validates'
,
'mage/translate'
],
function
(
$
,
_
,
utils
,
moment
,
tinycolor
)
{
'use strict'
;
...
...
lib/web/jquery/jquery.validate.js
View file @
c47a2538
...
...
@@ -695,43 +695,55 @@
},
showLabel
:
function
(
element
,
message
)
{
var
label
=
this
.
errorsFor
(
element
);
if
(
label
.
length
)
{
// refresh error/success class
label
.
removeClass
(
this
.
settings
.
validClass
).
addClass
(
this
.
settings
.
errorClass
);
// check if we have a generated label, replace the message then
if
(
label
.
attr
(
"generated"
))
{
label
.
hide
().
html
(
message
);
if
(
$
(
'body'
).
hasClass
(
'checkout-index-index'
))
{
if
(
$
(
element
).
is
(
'select'
)){
$
(
element
).
prev
(
'input'
).
addClass
(
'error-border-style'
);
}
else
if
(
$
(
element
).
is
(
'input'
)){
$
(
element
).
addClass
(
'error-border-style'
);
}
}
else
{
// create label
label
=
$
(
"<"
+
this
.
settings
.
errorElement
+
"/>"
)
.
attr
({
"for"
:
this
.
idOrName
(
element
),
generated
:
true
})
.
addClass
(
this
.
settings
.
errorClass
)
.
html
(
message
||
""
);
if
(
this
.
settings
.
wrapper
)
{
// make sure the element is visible, even in IE
// actually showing the wrapped element is handled elsewhere
label
=
label
.
hide
().
show
().
wrap
(
"<"
+
this
.
settings
.
wrapper
+
"/>"
).
parent
();
this
.
toShow
=
this
.
toShow
.
add
(
''
);
}
else
{
var
label
=
this
.
errorsFor
(
element
);
if
(
label
.
length
)
{
// refresh error/success class
label
.
removeClass
(
this
.
settings
.
validClass
).
addClass
(
this
.
settings
.
errorClass
);
// check if we have a generated label, replace the message then
if
(
label
.
attr
(
"generated"
))
{
label
.
hide
().
html
(
message
);
}
}
else
{
// create label
label
=
$
(
"<"
+
this
.
settings
.
errorElement
+
"/>"
)
.
attr
({
"for"
:
this
.
idOrName
(
element
),
generated
:
true
})
.
addClass
(
this
.
settings
.
errorClass
)
.
html
(
message
||
""
);
if
(
this
.
settings
.
wrapper
)
{
// make sure the element is visible, even in IE
// actually showing the wrapped element is handled elsewhere
label
=
label
.
hide
().
show
().
wrap
(
"<"
+
this
.
settings
.
wrapper
+
"/>"
).
parent
();
}
if
(
!
this
.
labelContainer
.
append
(
label
).
length
)
{
if
(
this
.
settings
.
errorPlacement
)
{
this
.
settings
.
errorPlacement
(
label
,
$
(
element
));
}
else
{
label
.
insertAfter
(
element
);
}
}
}
if
(
!
this
.
labelContainer
.
append
(
label
).
length
)
{
if
(
this
.
settings
.
errorPlacement
)
{
this
.
settings
.
errorPlacement
(
label
,
$
(
element
));
if
(
!
message
&&
this
.
settings
.
success
)
{
label
.
text
(
""
);
if
(
typeof
this
.
settings
.
success
===
"string"
)
{
label
.
addClass
(
this
.
settings
.
success
);
}
else
{
label
.
insertAfter
(
element
);
this
.
settings
.
success
(
label
,
element
);
}
}
this
.
toShow
=
this
.
toShow
.
add
(
label
);
}
if
(
!
message
&&
this
.
settings
.
success
)
{
label
.
text
(
""
);
if
(
typeof
this
.
settings
.
success
===
"string"
)
{
label
.
addClass
(
this
.
settings
.
success
);
}
else
{
this
.
settings
.
success
(
label
,
element
);
}
}
this
.
toShow
=
this
.
toShow
.
add
(
label
);
},
errorsFor
:
function
(
element
)
{
...
...
lib/web/mage/validation.js
View file @
c47a2538
...
...
@@ -9,7 +9,6 @@ define([
'mageUtils'
,
'jquery-ui-modules/widget'
,
'jquery/validate'
,
'jquery/validates'
,
'mage/translate'
],
function
(
$
,
moment
,
utils
)
{
'use strict'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment