lemonldap-ng/lemonldap-ng-portal/site/htdocs/static/common/js/portal.min.js
2016-05-20 17:09:32 +00:00

1 line
2.3 KiB
JavaScript

(function(){var c,d,i,a,g,j,h,e,b,k,f=[].indexOf||function(o){for(var n=0,m=this.length;n<m;n++){if(n in this&&this[n]===o){return n}}return -1};k=function(l){return $("[trspan]").each(function(){return this.text(b(this.attr("trspan")))})};b=function(l){};g=window.newwindow.match("1")?true:false;d=window.antiframe.match("0")?false:true;c=window.activeTimer.match("0")?false:true;e="#appslist";i=function(){return $.ajax({type:"POST",url:scriptname,data:{storeAppsListOrder:$(e).sortable("toArray").join()},dataType:"json"})};h=function(){var n,m,q,y,l,u,p,r,o,t,w,s,x;t=$(e);if(!((t!=null)&&appslistorder)){return null}n=appslistorder.split(",");u=t.sortable("toArray");w=[];for(q=0,r=u.length;q<r;q++){x=u[q];w[x]=x}for(p=0,o=n.length;p<o;p++){l=n[p];if(f.call(w,l)>=0){y=w[l];m=$(e+".ui-sortable").children("#"+y);s=$(e+".ui-sortable").children("#"+l);m.remove();$(e+".ui-sortable").filter(":first").append(s)}}return 1};a=function(l){return $("#lmhidden_"+l).length};j=function(){return $.ajax({type:"POST",url:scriptname,data:{ping:1},dataType:"json",success:function(l){if(l.auth){return setTimeout("ping();",pingInterval)}else{return location.reload(true)}}})};window.ping=j;$(document).ready(function(){var q,m,n,p,o,l,r;if(d&&top!==self){top.location.href=location.href}$("#appslist").sortable({axis:"y",cursor:"move",opacity:0.5,revert:true,items:"> div.category",update:function(){return i()}});h();$("div.message").fadeIn("slow");$("input[name=timezone]").val(-(new Date().getTimezoneOffset()/60));l=$("#menu").tabs({active:0});o=$('#menu a[href="#'+displaytab+'"]').parent().index();if(o<0){o=0}l.tabs("option","active",o);m=$("#authMenu").tabs({active:0});if(choicetab){m.tabs("option","active",$('#authMenu a[href="#'+choicetab+'"]').parent().index())}if(login){$("input[type=password]:first").focus()}else{$("input[type!=hidden]:first").focus()}if(g){$("#appslist a").attr("target","_blank")}if($("p.removeOther").length){q=$("form.login").attr("action");r=$("form.login").attr("method");n="";if(q.indexOf("?")!==-1){q.substring(0,q.indexOf("?"))+"?"}else{n=q+"?"}$("form.login input[type=hidden]").each(function(s){return n+="&"+$(this).attr("name")+"="+$(this).val()});p=$("p.removeOther a").attr("href")+"&method="+r+"&url="+btoa(n);$("p.removeOther a").attr("href",p)}return k(lang)})}).call(this);