diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm index 379cb9db4..d07f541ed 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm @@ -434,11 +434,10 @@ sub mkSessionArray { $tmp .= ''; foreach my $session (@$sessions) { - $tmp .= ""; - $tmp .= "$session->{user}" if ($displayUser); - $tmp .= -""; - $tmp .= "$session->{ipAddr}"; + $tmp .= "" + .($displayUser ? "$session->{user}" : '') + . qq'' + . "$session->{ipAddr}"; $tmp .= "" . ( $session->{$_} || "" ) . "" foreach ( keys %{ $self->conf->{sessionDataToRemember} } ); $tmp .= "$session->{error}" if ($displayError); diff --git a/lemonldap-ng-portal/site/coffee/confirm.coffee b/lemonldap-ng-portal/site/coffee/confirm.coffee new file mode 100644 index 000000000..b3f08a568 --- /dev/null +++ b/lemonldap-ng-portal/site/coffee/confirm.coffee @@ -0,0 +1,21 @@ +# Timer for confirmation page + +i = 5 + +go = () -> + $("#form").submit() + +timer = () -> + h = $('#timer').html() + i-- if i>0 + h = h.replace /\d+/, i + $('#timer').html h + setTimeout timer, 1000 + +$(document).ready -> + setTimeout go, 5000 + setTimeout timer, 1000 + $(".idploop").on 'click', () -> + $("#idp").val $(this).attr("val") + $("#refuse").on 'click', () -> + $("#confirm").attr "value", $(this).attr("val") diff --git a/lemonldap-ng-portal/site/coffee/info.coffee b/lemonldap-ng-portal/site/coffee/info.coffee index 17df7b495..90ca4f9b9 100644 --- a/lemonldap-ng-portal/site/coffee/info.coffee +++ b/lemonldap-ng-portal/site/coffee/info.coffee @@ -23,3 +23,5 @@ $(document).ready -> window.setTimeout timer, 1000 else stop + $("#wait").on 'click', () -> + stop() diff --git a/lemonldap-ng-portal/site/coffee/portal.coffee b/lemonldap-ng-portal/site/coffee/portal.coffee index c7d92b497..0d3e83e2e 100644 --- a/lemonldap-ng-portal/site/coffee/portal.coffee +++ b/lemonldap-ng-portal/site/coffee/portal.coffee @@ -60,7 +60,7 @@ restoreOrder = -> rebuild = [] for v in items rebuild[v] = v - + for itemID in IDs if itemID in rebuild @@ -199,5 +199,10 @@ $(document).ready -> # Ping if asked if datas['pingInterval'] and datas['pingInterval'] > 0 window.setTimeout ping, datas['pingInterval'] + + # Set local dates (used to display history) + $(".localeDate").each -> + s = new Date($(this).attr("val")*1000) + $(this).text s.toLocaleString() translatePage(lang) diff --git a/lemonldap-ng-portal/site/htdocs/static/common/js/confirm.js b/lemonldap-ng-portal/site/htdocs/static/common/js/confirm.js index 1c27e6678..08ef12ddd 100644 --- a/lemonldap-ng-portal/site/htdocs/static/common/js/confirm.js +++ b/lemonldap-ng-portal/site/htdocs/static/common/js/confirm.js @@ -1,22 +1,33 @@ -/* Timer for confirmation page */ +// Generated by CoffeeScript 1.10.0 +(function() { + var go, i, timer; -var i = 5; + i = 5; -function go() { - $("#form").submit(); -} + go = function() { + return $("#form").submit(); + }; -function timer() { - var h = $('#timer').html(); - if (i > 0) { - i--; - } - h = h.replace(/\d+/, i); - $('#timer').html(h); - window.setTimeout(timer, 1000); -} + timer = function() { + var h; + h = $('#timer').html(); + if (i > 0) { + i--; + } + h = h.replace(/\d+/, i); + $('#timer').html(h); + return setTimeout(timer, 1000); + }; -$(document).ready(function() { - window.setTimeout(go, 5000); - window.setTimeout(timer, 1000); -}); + $(document).ready(function() { + setTimeout(go, 5000); + setTimeout(timer, 1000); + $(".idploop").on('click', function() { + return $("#idp").val($(this).attr("val")); + }); + return $("#refuse").on('click', function() { + return $("#confirm").attr("value", $(this).attr("val")); + }); + }); + +}).call(this); diff --git a/lemonldap-ng-portal/site/htdocs/static/common/js/confirm.min.js b/lemonldap-ng-portal/site/htdocs/static/common/js/confirm.min.js index 143f99f1c..0b3b50cd6 100644 --- a/lemonldap-ng-portal/site/htdocs/static/common/js/confirm.min.js +++ b/lemonldap-ng-portal/site/htdocs/static/common/js/confirm.min.js @@ -1 +1 @@ -var i=5;function go(){$("#form").submit()}function timer(){var a=$("#timer").html();if(i>0){i--}a=a.replace(/\d+/,i);$("#timer").html(a);window.setTimeout(timer,1000)}$(document).ready(function(){window.setTimeout(go,5000);window.setTimeout(timer,1000)}); \ No newline at end of file +(function(){var b,a,c;a=5;b=function(){return $("#form").submit()};c=function(){var d;d=$("#timer").html();if(a>0){a--}d=d.replace(/\d+/,a);$("#timer").html(d);return setTimeout(c,1000)};$(document).ready(function(){setTimeout(b,5000);setTimeout(c,1000);$(".idploop").on("click",function(){return $("#idp").val($(this).attr("val"))});return $("#refuse").on("click",function(){return $("#confirm").attr("value",$(this).attr("val"))})})}).call(this); \ No newline at end of file diff --git a/lemonldap-ng-portal/site/htdocs/static/common/js/info.js b/lemonldap-ng-portal/site/htdocs/static/common/js/info.js index d77348d85..7d9989951 100644 --- a/lemonldap-ng-portal/site/htdocs/static/common/js/info.js +++ b/lemonldap-ng-portal/site/htdocs/static/common/js/info.js @@ -31,10 +31,13 @@ $(document).ready(function() { if (window.datas['activeTimer']) { window.setTimeout(go, 10000); - return window.setTimeout(timer, 1000); + window.setTimeout(timer, 1000); } else { - return stop; + stop; } + return $("#wait").on('click', function() { + return stop(); + }); }); }).call(this); diff --git a/lemonldap-ng-portal/site/htdocs/static/common/js/info.min.js b/lemonldap-ng-portal/site/htdocs/static/common/js/info.min.js index 7034269f6..b3b845026 100644 --- a/lemonldap-ng-portal/site/htdocs/static/common/js/info.min.js +++ b/lemonldap-ng-portal/site/htdocs/static/common/js/info.min.js @@ -1 +1 @@ -(function(){var a,d,c,b,e;c=30;a=1;b=function(){a=0;return $("#timer").html("...")};d=function(){if(a){return $("#form").submit()}};e=function(){var f;f=$("#timer").html();if(c>0){c--}f=f.replace(/\d+/,c);$("#timer").html(f);return window.setTimeout(e,1000)};$(document).ready(function(){if(window.datas.activeTimer){window.setTimeout(d,10000);return window.setTimeout(e,1000)}else{return b}})}).call(this); \ No newline at end of file +(function(){var a,d,c,b,e;c=30;a=1;b=function(){a=0;return $("#timer").html("...")};d=function(){if(a){return $("#form").submit()}};e=function(){var f;f=$("#timer").html();if(c>0){c--}f=f.replace(/\d+/,c);$("#timer").html(f);return window.setTimeout(e,1000)};$(document).ready(function(){if(window.datas.activeTimer){window.setTimeout(d,10000);window.setTimeout(e,1000)}else{b}return $("#wait").on("click",function(){return b()})})}).call(this); \ No newline at end of file diff --git a/lemonldap-ng-portal/site/htdocs/static/common/js/portal.js b/lemonldap-ng-portal/site/htdocs/static/common/js/portal.js index 319c0b01d..e0cfd7f67 100644 --- a/lemonldap-ng-portal/site/htdocs/static/common/js/portal.js +++ b/lemonldap-ng-portal/site/htdocs/static/common/js/portal.js @@ -106,8 +106,7 @@ LemonLDAP::NG Portal jQuery scripts if (data.auth) { return setTimeout(ping, datas['pingInterval']); } else { - console.log(data); - //return location.reload(true); + return location.reload(true); } } }); @@ -200,6 +199,11 @@ LemonLDAP::NG Portal jQuery scripts if (datas['pingInterval'] && datas['pingInterval'] > 0) { window.setTimeout(ping, datas['pingInterval']); } + $(".localeDate").each(function() { + var s; + s = new Date($(this).attr("val") * 1000); + return $(this).text(s.toLocaleString()); + }); return translatePage(lang); }); diff --git a/lemonldap-ng-portal/site/htdocs/static/common/js/portal.min.js b/lemonldap-ng-portal/site/htdocs/static/common/js/portal.min.js index d4328c9b7..f0ede81ca 100644 --- a/lemonldap-ng-portal/site/htdocs/static/common/js/portal.min.js +++ b/lemonldap-ng-portal/site/htdocs/static/common/js/portal.min.js @@ -1 +1 @@ -(function(){var e,i,d,a,j,h,f,b,k,c,g=[].indexOf||function(o){for(var n=0,m=this.length;n=0){y=w[l];m=$(f+".ui-sortable").children("#"+y);s=$(f+".ui-sortable").children("#"+l);m.remove();$(f+".ui-sortable").filter(":first").append(s)}}return 1};a=function(l){return $("#lmhidden_"+l).length};j=function(){return $.ajax({type:"POST",url:e.scriptname,data:{ping:1},dataType:"json",success:function(l){if(l.auth){return setTimeout(j,e.pingInterval)}else{console.log(l)}}})};window.ping=j;e={};$(document).ready(function(){var x,w,z,v,A,y,C,t,s,B,r,q,u,o,m,n,l,p;e=d();window.datas=e;if(e.antiframe&&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));o=$("#menu").tabs({active:0});u=$('#menu a[href="#'+e.displaytab+'"]').parent().index();if(u<0){u=0}o.tabs("option","active",u);z=$("#authMenu").tabs({active:0});if(e.choicetab){z.tabs("option","active",$('#authMenu a[href="#'+e.choicetab+'"]').parent().index())}if(e.login){$("input[type=password]:first").focus()}else{$("input[type!=hidden]:first").focus()}if(e.newwindow){$("#appslist a").attr("target","_blank")}if($("p.removeOther").length){x=$("form.login").attr("action");m=$("form.login").attr("method");v="";if(x.indexOf("?")!==-1){x.substring(0,x.indexOf("?"))+"?"}else{v=x+"?"}$("form.login input[type=hidden]").each(function(D){return v+="&"+$(this).attr("name")+"="+$(this).val()});q=$("p.removeOther a").attr("href")+"&method="+m+"&url="+btoa(v);$("p.removeOther a").attr("href",q)}if(navigator){t=[];s=[];l=[navigator.language];if(navigator.languages){l=navigator.languages}for(A=0,B=l.length;A0){window.setTimeout(j,e.pingInterval)}return k(C)})}).call(this); \ No newline at end of file +(function(){var e,i,d,a,j,h,f,b,k,c,g=[].indexOf||function(o){for(var n=0,m=this.length;n=0){y=w[l];m=$(f+".ui-sortable").children("#"+y);s=$(f+".ui-sortable").children("#"+l);m.remove();$(f+".ui-sortable").filter(":first").append(s)}}return 1};a=function(l){return $("#lmhidden_"+l).length};j=function(){return $.ajax({type:"POST",url:e.scriptname,data:{ping:1},dataType:"json",success:function(l){if(l.auth){return setTimeout(j,e.pingInterval)}else{return location.reload(true)}}})};window.ping=j;e={};$(document).ready(function(){var x,w,z,v,A,y,C,t,s,B,r,q,u,o,m,n,l,p;e=d();window.datas=e;if(e.antiframe&&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));o=$("#menu").tabs({active:0});u=$('#menu a[href="#'+e.displaytab+'"]').parent().index();if(u<0){u=0}o.tabs("option","active",u);z=$("#authMenu").tabs({active:0});if(e.choicetab){z.tabs("option","active",$('#authMenu a[href="#'+e.choicetab+'"]').parent().index())}if(e.login){$("input[type=password]:first").focus()}else{$("input[type!=hidden]:first").focus()}if(e.newwindow){$("#appslist a").attr("target","_blank")}if($("p.removeOther").length){x=$("form.login").attr("action");m=$("form.login").attr("method");v="";if(x.indexOf("?")!==-1){x.substring(0,x.indexOf("?"))+"?"}else{v=x+"?"}$("form.login input[type=hidden]").each(function(D){return v+="&"+$(this).attr("name")+"="+$(this).val()});q=$("p.removeOther a").attr("href")+"&method="+m+"&url="+btoa(v);$("p.removeOther a").attr("href",q)}if(navigator){t=[];s=[];l=[navigator.language];if(navigator.languages){l=navigator.languages}for(A=0,B=l.length;A0){window.setTimeout(j,e.pingInterval)}$(".localeDate").each(function(){var D;D=new Date($(this).attr("val")*1000);return $(this).text(D.toLocaleString())});return k(C)})}).call(this); \ No newline at end of file diff --git a/lemonldap-ng-portal/site/templates/bootstrap/confirm.tpl b/lemonldap-ng-portal/site/templates/bootstrap/confirm.tpl index 35f4112bd..3c79e829d 100644 --- a/lemonldap-ng-portal/site/templates/bootstrap/confirm.tpl +++ b/lemonldap-ng-portal/site/templates/bootstrap/confirm.tpl @@ -36,7 +36,7 @@
"> - - diff --git a/lemonldap-ng-portal/site/templates/bootstrap/info.tpl b/lemonldap-ng-portal/site/templates/bootstrap/info.tpl index 32dac0312..58fa283b3 100644 --- a/lemonldap-ng-portal/site/templates/bootstrap/info.tpl +++ b/lemonldap-ng-portal/site/templates/bootstrap/info.tpl @@ -23,7 +23,7 @@ Continue - diff --git a/lemonldap-ng-portal/site/templates/impact/confirm.tpl b/lemonldap-ng-portal/site/templates/impact/confirm.tpl index 68459d0e8..d80187fa7 100644 --- a/lemonldap-ng-portal/site/templates/impact/confirm.tpl +++ b/lemonldap-ng-portal/site/templates/impact/confirm.tpl @@ -42,7 +42,7 @@ @@ -58,7 +58,7 @@
-
-
- - +
+ +
+
+ +
diff --git a/lemonldap-ng-portal/site/templates/impact/info.tpl b/lemonldap-ng-portal/site/templates/impact/info.tpl index 6c18c0ff3..84aaa9e71 100644 --- a/lemonldap-ng-portal/site/templates/impact/info.tpl +++ b/lemonldap-ng-portal/site/templates/impact/info.tpl @@ -17,7 +17,7 @@
- +
+ +
diff --git a/lemonldap-ng-portal/site/templates/impact/menu.tpl b/lemonldap-ng-portal/site/templates/impact/menu.tpl index 671a4a5be..2296ca26d 100644 --- a/lemonldap-ng-portal/site/templates/impact/menu.tpl +++ b/lemonldap-ng-portal/site/templates/impact/menu.tpl @@ -177,9 +177,11 @@

Are you sure?

- +
+ +
diff --git a/lemonldap-ng-portal/site/templates/impact/register.tpl b/lemonldap-ng-portal/site/templates/impact/register.tpl index 37db20d9a..560d9fcd6 100644 --- a/lemonldap-ng-portal/site/templates/impact/register.tpl +++ b/lemonldap-ng-portal/site/templates/impact/register.tpl @@ -109,9 +109,11 @@
- +
+ +
diff --git a/lemonldap-ng-portal/site/templates/pastel/confirm.tpl b/lemonldap-ng-portal/site/templates/pastel/confirm.tpl index b3a819a97..36bd32432 100644 --- a/lemonldap-ng-portal/site/templates/pastel/confirm.tpl +++ b/lemonldap-ng-portal/site/templates/pastel/confirm.tpl @@ -28,7 +28,7 @@ @@ -54,7 +54,7 @@ common/accept.png" alt="" /> Accept - diff --git a/lemonldap-ng-portal/site/templates/pastel/info.tpl b/lemonldap-ng-portal/site/templates/pastel/info.tpl index 9404cdeec..4e79d8315 100644 --- a/lemonldap-ng-portal/site/templates/pastel/info.tpl +++ b/lemonldap-ng-portal/site/templates/pastel/info.tpl @@ -19,7 +19,7 @@ common/accept.png" alt="" /> Continue -
-