!function(o,t){"use strict";t.FavoriteButton={exec:function(){o(document).ready(o.proxy(this.onDomReady,this)),o(document).on("fcx:template-loader:finished-loading:photo-meta",o.proxy(this.onDomReady,this))},onDomReady:function(){this.init(),this.bindEvents()},init:function(){},bindEvents:function(){o(document).off("click","#favorite-pulldown a.favorite"),o(document).on("click","#favorite-pulldown a.favorite",o.proxy(this.onFavoriteOrUnfavorite,this))},onFavoriteOrUnfavorite:function(t){t.preventDefault(),t.stopPropagation(),o.ajax({type:"POST",context:this,url:o(t.currentTarget).attr("href")}).success(this.onSuccess)},onSuccess:function(t){o("#favorite-pulldown").replaceWith(t),o(".fcx-favorite button[title]").tooltip({container:"body"}),this.reloadPublicFavorites()},reloadPublicFavorites:function(){o.ajax({type:"GET",context:this,url:o("#public-favorites").data("ajax-url")}).success(this.onReloadSuccess)},onReloadSuccess:function(t){o("#public-favorites").replaceWith(t)}},t.FavoriteButton.exec()}(window.jQuery,window.FOTOCOMMUNITY=window.FOTOCOMMUNITY||{});