Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function comment_vote(id, type, date) {
  2.   $("#vote_up_"+id).removeAttr("href").removeAttr("title");
  3.     $("#vote_down_"+id).removeAttr("href").removeAttr("title");;
  4.     $("#vote_up_"+id).addClass("disabled");
  5.     $("#vote_down_"+id).addClass("disabled");
  6.     $("#vote_wrap_"+id).hint({
  7.         msg: '<img src="/resources/images/icons/loading_mini.gif" /> Radim...',
  8.         align: 'center',
  9.         autoremove: true
  10.     });
  11.  
  12.     $.ajax({
  13.         type: "POST",
  14.         url: "http://www.blic.rs/resources/templates/comments/comments_vote.php",
  15.         data: "id="+id+"&type="+type+"&date="+date+"&comments_table=blic_article_comments",
  16.         success: function(serverData) {
  17.             data=serverData.split("###");
  18.             if (data[0] == "OK") {
  19.                 if (type == "up") $("#vote_p_"+id).html( (($("#vote_p_"+id).html()*1)+1).toString() );
  20.                 if (type == "down") $("#vote_n_"+id).html( (($("#vote_n_"+id).html()*1)+1).toString() );
  21.                 $(".pointer").remove();
  22.                 $("#vote_wrap_"+id).hint({
  23.                 msg: 'Hvala na Vašoj preporuci.',
  24.                 align: 'center',
  25.                 autoremove: true
  26.             });
  27.             }
  28.             else if (data[0] == "VOTED") {
  29.             $(".pointer").remove();
  30.             $("#vote_wrap_"+id).hint({
  31.                 msg: 'Već ste preporučili komentar. Hvala.',
  32.                 align: 'center',
  33.                 autoremove: true
  34.             });
  35.             }
  36.             else if (data[0] == "LOGIN_ERROR") {
  37.             $(".pointer").remove();
  38.             $("#vote_wrap_"+id).hint({
  39.                 msg: 'Morate biti ulogovani da bi preporučili komentar.',
  40.                 autoremove: true
  41.             });
  42.             }
  43.         },
  44.         error: function() {
  45.         }
  46.     });
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement