first commit

This commit is contained in:
Roman Pyrih
2023-07-24 08:30:51 +02:00
commit c2e100a763
7128 changed files with 1622619 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
jQuery(document).ready(function($) {
"use strict";
//like button
jQuery("a.like_button").click(function(e){
e.preventDefault();
var $this = jQuery(this);
if(!$this.hasClass('like_active_button')) {
//return;
}
var $parent = $this.parent();
var id = $parent.data('id'),
data = {
action: 'add_like',
security : MyAjax.security,
pID: id
};
// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
var post_result = $.post(MyAjax.ajaxurl, data, function(response) {
$parent.html('<span class="like_button highlight4"><i class="fa fa-check"></i></span>');
jQuery('.votes_count_'+id).html(response);
}).done(function() {
}).fail(function(xhr, textStatus, errorThrown) {
console.log(xhr.responseText);
}).always(function() {
});
});
//$(".like_button").click(function(e){
// var id = $(this).parent().data('id'),
// data = {
// action: 'add_like',
// security : MyAjax.security,
// pID: id
// },
// parent = $(this).parent();
//
// // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
// var post_result = $.post(MyAjax.ajaxurl, data, function(response) {
// parent.html('<i class="rt-icon icon-heart3"></i>');
// $('.votes_count_'+id).html(response);
// }).done(function() {
//
// }).fail(function(xhr, textStatus, errorThrown) {
// console.log(xhr.responseText);
// }).always(function() {
// });
//
// e.preventDefault();
//});
});