Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
services
t3o sites
extensions.typo3.org
extensions.typo3.org
Commits
8803376d
Commit
8803376d
authored
Oct 15, 2020
by
jonas.goetze
Browse files
[BUGFIX] evaluate response from action and provide feedback if something went wrong
parent
dfc64af9
Pipeline
#9766
passed with stages
in 5 minutes and 38 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extensions/ter_fe2/Resources/Public/Javascript/Default.js
View file @
8803376d
...
...
@@ -103,12 +103,63 @@ jQuery(document).ready(function ($) {
},
dataType
:
"
json
"
,
success
:
function
(
returnData
)
{
$
(
item
).
removeClass
(
removeClass
).
addClass
(
addClass
);
$
(
item
).
data
(
'
rating-type
'
,
newRatingType
);
if
(
subRemoveClass
&&
subAddClass
)
{
$
(
item
).
find
(
'
i
'
).
removeClass
(
subRemoveClass
).
addClass
(
subAddClass
);
if
(
returnData
===
true
)
{
$
(
item
).
removeClass
(
removeClass
).
addClass
(
addClass
);
$
(
item
).
data
(
'
rating-type
'
,
newRatingType
);
if
(
subRemoveClass
&&
subAddClass
)
{
$
(
item
).
find
(
'
i
'
).
removeClass
(
subRemoveClass
).
addClass
(
subAddClass
);
}
else
{
item
.
lastChild
.
nodeValue
=
"
"
+
likes
.
toLocaleString
(
'
en
'
);
}
}
else
{
item
.
lastChild
.
nodeValue
=
"
"
+
likes
.
toLocaleString
(
'
en
'
);
$
.
notify
({
// options
icon
:
"
danger
"
,
title
:
"
No rating possible
"
,
message
:
"
Something went wrong while voting. Please try to reload the page.
"
},
{
// settings
element
:
"
body
"
,
position
:
"
fixed
"
,
type
:
"
danger
"
,
allow_dismiss
:
true
,
newest_on_top
:
false
,
showProgressbar
:
false
,
placement
:
{
from
:
"
top
"
,
align
:
"
center
"
},
offset
:
20
,
spacing
:
10
,
z_index
:
9000
,
delay
:
3000
,
timer
:
1000
,
width
:
'
50%
'
,
url_target
:
"
_blank
"
,
mouse_over
:
null
,
animate
:
{
enter
:
"
animated fadeInDown
"
,
exit
:
"
animated fadeOutUp
"
},
onShow
:
null
,
onShown
:
null
,
onClose
:
null
,
onClosed
:
null
,
icon_type
:
"
class
"
,
template
:
[
'
<div class="col-sm-9" data-notify="container">
'
,
'
<div class="alert alert-{0}" role="alert">
'
,
'
<button type="button" aria-hidden="true" class="close" data-notify="dismiss">×</button>
'
,
'
<strong class="alert-heading" data-notify="title"><i class="fa fa-info-circle"></i> {1}</strong>
'
,
'
<span class="mb-0" data-notify="message">{2}</span>
'
,
'
<div class="progress" data-notify="progressbar">
'
,
'
<div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>
'
,
'
</div>
'
,
'
<a href="{3}" target="{4}" data-notify="url"></a>
'
,
'
</div>
'
,
'
</div>
'
].
join
(
''
)
});
}
}
});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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