100 lines
2.8 KiB
JavaScript
100 lines
2.8 KiB
JavaScript
|
|
||
|
let BookmarkLikeRating = function () {
|
||
|
function initButtons() {
|
||
|
$('button[data-blr-type=bookmark]').each(function (n) {
|
||
|
let btn = $(this);
|
||
|
$.ajax({
|
||
|
cache: false,
|
||
|
method: 'POST',
|
||
|
url: btn.attr('data-status-url'),
|
||
|
success: function (data) {
|
||
|
if (data.status === 'true') {
|
||
|
btn.addClass('active');
|
||
|
$('*',btn).addClass('active');
|
||
|
} else {
|
||
|
btn.removeClass('active');
|
||
|
$('*',btn).removeClass('active');
|
||
|
}
|
||
|
},
|
||
|
data: 'tx_bookmarkslikesratings_statusbookmark[objectUid]='+btn.attr('data-uid')+'&tx_bookmarkslikesratings_statusbookmark[tablename]='+btn.attr('data-table')
|
||
|
});
|
||
|
|
||
|
$(this).on('click',function() {
|
||
|
let btn = $(this);
|
||
|
$.ajax({
|
||
|
cache: false,
|
||
|
method: 'POST',
|
||
|
url: btn.attr('data-toggle-url'),
|
||
|
success: function (data) {
|
||
|
if (data.status === 'true') {
|
||
|
btn.addClass('active');
|
||
|
$('*',btn).addClass('active');
|
||
|
} else {
|
||
|
btn.removeClass('active');
|
||
|
$('*',btn).removeClass('active');
|
||
|
}
|
||
|
},
|
||
|
data: 'tx_bookmarkslikesratings_togglebookmark[objectUid]='+btn.attr('data-uid')+'&tx_bookmarkslikesratings_togglebookmark[tablename]='+btn.attr('data-table')
|
||
|
});
|
||
|
|
||
|
});
|
||
|
});
|
||
|
|
||
|
|
||
|
$('button[data-blr-type=like]').each(function (n) {
|
||
|
let btn = $(this);
|
||
|
$.ajax({
|
||
|
cache: false,
|
||
|
method: 'POST',
|
||
|
url: btn.attr('data-status-url'),
|
||
|
success: function (data) {
|
||
|
if (data.status === 'true') {
|
||
|
btn.addClass('active');
|
||
|
$('*',btn).addClass('active');
|
||
|
} else {
|
||
|
btn.removeClass('active');
|
||
|
$('*',btn).removeClass('active');
|
||
|
}
|
||
|
},
|
||
|
data: 'tx_bookmarkslikesratings_statuslike[objectUid]='+btn.attr('data-uid')+'&tx_bookmarkslikesratings_statuslike[tablename]='+btn.attr('data-table')
|
||
|
});
|
||
|
|
||
|
$(this).on('click',function() {
|
||
|
let btn = $(this);
|
||
|
$.ajax({
|
||
|
cache: false,
|
||
|
method: 'POST',
|
||
|
url: btn.attr('data-toggle-url'),
|
||
|
success: function (data) {
|
||
|
if (data.status === 'true') {
|
||
|
btn.addClass('active');
|
||
|
$('*',btn).addClass('active');
|
||
|
} else {
|
||
|
btn.removeClass('active');
|
||
|
$('*',btn).removeClass('active');
|
||
|
}
|
||
|
},
|
||
|
data: 'tx_bookmarkslikesratings_togglelike[objectUid]='+btn.attr('data-uid')+'&tx_bookmarkslikesratings_togglelike[tablename]='+btn.attr('data-table')
|
||
|
});
|
||
|
|
||
|
});
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
function updateStatus() {
|
||
|
|
||
|
}
|
||
|
|
||
|
return {
|
||
|
init: function () {
|
||
|
initButtons();
|
||
|
}
|
||
|
}
|
||
|
}();
|
||
|
|
||
|
jQuery(document).ready(function () {
|
||
|
|
||
|
BookmarkLikeRating.init();
|
||
|
});
|