File "faves-manager.min.js"
Path: /ThinkIB/chem/js/user/faves-managerminjs
File size: 1.64 KB
MIME-type: text/plain
Charset: utf-8
function initCommentAreas(){autosize($(".fav textarea")),$(".fav textarea").on("change, keyup",this,(function(t){$(this).closest(".fav").find(".save-fav-comments").show("fast")}))}function bindSaveComments(){$(".save-fav-comments").click((function(){var t=$(this).closest(".item");$(this).html('<i class="fa fa-spin fa-circle-o-notch"></i> one second...'),saveBookmark(t.data("id"),t.data("ticket"),t.find("textarea").val())}))}function saveBookmark(t,e,o){$.post("pages/bookmarks.php",{action:"save",id:t,ticket:e,content:o},(function(t){1==t.success?($("#bookmark-"+t.id).find(".save-fav-comments").html('<i class="fa fa-save"></i> Saved!'),setTimeout((function(){$("#bookmark-"+t.id).find(".save-fav-comments").fadeOut("fast",(function(){$(this).html('<i class="fa fa-save"></i> Save notes')}))}),1e3)):alert("There was a problem saving your comments. Please contact support")}),"json")}function removeBookmark(t,e){$.post("pages/bookmarks.php",{id:t,ticket:e,action:"unfav"},(function(t){1==t.success&&$("#bookmark-"+t.id).fadeOut("fast",(function(){$(this).remove()}))}),"json")}$(document).ready((function(){initCommentAreas(),bindSaveComments(),$(".bookmark-remover").click((function(t){t.preventDefault(),confirm("Please confirm you want to remove this favorite")&&removeBookmark($(this).closest(".item").data("id"),$(this).closest(".item").data("ticket"))})),$("#blog-top-pagination li.disabled > a").click((function(t){t.preventDefault()})),$("#filter-favorites").on("change",(function(t){t.preventDefault(),"with-notes"==$(this).val()?window.location.href+="?show=notes":window.location.href=window.location.href.replace("&show=notes","").replace("?show=notes","")}))}));