browsereview.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. $(document).ready(function()
  2. {
  3. $(document).on('click', '.pass', function()
  4. {
  5. if(confirm(confirmReview.pass))
  6. {
  7. var selecter = $(this);
  8. $.getJSON(selecter.attr('href'), function(data)
  9. {
  10. if(data.result == 'success')
  11. {
  12. if(selecter.parents('#ajaxModal').size()) return $.reloadAjaxModal(1200);
  13. if(data.locate) return location.href = data.locate;
  14. return location.reload();
  15. }
  16. else
  17. {
  18. alert(data.message);
  19. return location.reload();
  20. }
  21. });
  22. }
  23. return false;
  24. });
  25. $(document).on('click', '.reject', function()
  26. {
  27. if(confirm(confirmReview.reject))
  28. {
  29. var selecter = $(this);
  30. $.getJSON(selecter.attr('href'), function(data)
  31. {
  32. if(data.result == 'success')
  33. {
  34. if(selecter.parents('#ajaxModal').size()) return $.reloadAjaxModal(1200);
  35. if(data.locate) return location.href = data.locate;
  36. return location.reload();
  37. }
  38. else
  39. {
  40. alert(data.message);
  41. return location.reload();
  42. }
  43. });
  44. }
  45. return false;
  46. });
  47. $('.batchPass').on('click', function()
  48. {
  49. $.setAjaxForm('#batchReviewForm');
  50. $('#batchReviewForm').submit();
  51. });
  52. });