2019-09-16 22:58:01 +02:00
|
|
|
(function(){var r,o,t;r=function(o){return $.ajax({type:"POST",url:portal+"favapps",data:{id:o.attr("aid"),uri:o.attr("uri"),name:o.attr("name"),logo:o.attr("logo"),desc:o.attr("desc")},dataType:"json",success:function(r){return r.error?(console.log("Max number reached"),t(o,0)):0===r.error?(console.log("Not authorized"),t(o,0)):r.result?(console.log("App. registered"),t(o,1)):(console.log("App. unregistered"),t(o,0))},error:t(o,"0")})},o=function(){return $.ajax({type:"DELETE",url:portal+"favapps",success:function(r){return r.result?(console.log("Favorite Apps. reset"),window.location.reload()):console.log("Error")}})},t=function(r,o){return r.attr("src",window.staticPrefix+"common/icons/star"+o+".png")},$(document).ready(function(){return $("body").on("click",".star",function(){return r($(this))}),$("#reset").on("click",function(){return o()})})}).call(this);
|