(function(){var t,r,e,o,n,i,a,s,u,c,d;this.passwords={},this.ready=function(){return $(“.hidden”).hide(),$(“#cookies-information-close-button”).click(function(){return i()}),show_hide_passwords(),$(“.favorite-switch”).change(function(){return e($(this))}),$(“.password”).each(function(){return $(this).data(“favorite”)?u($(this)):void 0}),$(“#edit-mode-button”).click(function(){return d($(this))}),$(document).bind(“ajaxError”,“form#new_directory”,function(t,r){return $(“.reveal-modal.open.confirm-deletion”).foundation(“reveal”,“close”),a($.parseJSON(r.responseText))}),$(“#edit-modal”).on(“opened”,function(){return $(this).find(“form :input:enabled:visible:first”).focus()}),setup_alert_box(),$.ajaxSetup({timeout:1e4}),Sorter.sort(“.sortable”),s(),Turbolinks.enableTransitionCache(),$(“.tarkin-description”).shorten(),$(“#item_”+$(location).attr(“hash”).split(“#”)).effect(“highlight”,{color:“#4499ff”},5e3)},s=function(){return $(“#search”).autocomplete({source:api_v1__find_path(),autoFocus:!1,minLength:2,select:function(t,r){return Turbolinks.visit(r.item.redirect_to)}}),$(“#search”).focus(),$(window).scroll(function(){return $(“.ui-autocomplete.ui-menu”).position({my:“left top”,at:“left bottom”,of:“#search”})})},this.Sorter={},this.Sorter.sort=function(t,r){return Sorter.direction=“desc”===r?-1:1,$(t).each(function(){var t;return t=$(this).find(“> div”).sort(function(t,r){return $(t).data(“sortby”).toString().toLowerCase()>$®.data(“sortby”).toString().toLowerCase()?Sorter.direction:-Sorter.direction}),$(this).append(t)})},r=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},this.show_hide_passwords=function(){return $(“.item.highlightable”).hover(function(){return c($(this))},function(){return n($(this))})},this.setup_alert_box=function(){return $(“#edit-form-close-button”).click(function(){return $(“#edit-modal”).foundation(“reveal”,“close”)}),t(“”)},t=function(t){return $(“#edit-modal-alert-box-text”).html(t),“”===t?$(“#edit-modal-alert-box”).fadeOut(250):$(“#edit-modal-alert-box”).fadeIn(250)},a=function®{var e,o,n;o=“”;for(n in r)e=r,o+=e+“.
”;return t(o)},d=function(t){return t.toggleClass(“active”),$(“.favorite-switch”).toggle(),$(“.edit-button”).toggle(),$(“.buttons-panel”).toggle()},e=function(t){return $.ajax({url:“/_aj/switch_favorite”,type:“post”,data:{type:t.data(“type”),id:t.data(“id”)},success:function(t){return $(“#favorites-holder”).html(t.html),$(document).foundation()},error:function(){return alert(“Server not responding”)}})},c=function(t){var r;return r=t.find(“.password”),u®},u=function(t){var r;if(0!==t.length&&(r=t.data(“id”))){if(passwords)return t.text(passwords),t.attr(“showing”,!0),t.fadeIn(100);if(!t.attr(“processing”))return t.attr(“processing”,!0),o(t)}},n=function(t){var r,e;return e=t.find(“.favorite-switch”),r=t.find(“.password”),0===r.length||e.is(“:checked”)?void 0:(r.fadeOut(100,function(){return r.empty()}),r.attr(“showing”,!1))},o=function(t){return $.ajax({url:api_v1__password_path({format:“json”,id:t.data(“id”)}),type:“get”,context:t,success:function®{return passwords=r.password,t.attr(“showing”)?void 0:($(this).text(r.password),$(this).attr(“processing”,!1),$(this).fadeIn(100))},error:function(){return alert(“Server not responding”)}})},i=function(){return $.ajax({url:ok_with_cookies_path(),type:“post”,data:!0,error:function(){return alert(“Server not responding”)}})},$(document).ready(this.ready)}).call(this);