Panel bugfixes

This commit is contained in:
Kload 2013-10-23 11:01:14 +00:00
parent 418ae04571
commit f9547b6dc8
3 changed files with 36 additions and 53 deletions

View file

@ -130,7 +130,10 @@ end
function set_headers (user)
user = user or ngx.var.cookie_SSOwAuthUser
if not cache[user] or not cache[user]["mail"] then
if not cache[user] then
cache[user] = {}
end
if not cache[user]["mail"] then
ldap = lualdap.open_simple("localhost")
for dn, attribs in ldap:search {
base = "uid=".. user ..",ou=users,dc=yunohost,dc=org",

View file

@ -1,20 +1 @@
{
"portal_scheme": "https",
"portal_domain": "mydomain.com",
"portal_path": "/ssowat/",
"domains": [
"mydomain.com",
"myotherdomain.com"
],
"skipped_urls": [
"mydomain.com/megusta",
"myotherdomain.com/somuchwin"
],
"unprotected_urls": ["mydomain.com/yunoprotect"],
"additional_headers": {
"Auth-User": "uid",
"Remote-User": "uid",
"Email": "mail",
"Name": "cn"
}
}
{}

View file

@ -20,6 +20,8 @@ var ynh = {};
ynh.jquery = jQuery.noConflict();
(function( $ ) {
preventFire = false;
preventRefire = false;
function datScroll(to) {
preventRefire = true;
$("body,html").animate({scrollTop:to}, '100', 'swing', function() {
@ -30,15 +32,15 @@ ynh.jquery = jQuery.noConflict();
$("#ynhtoggle").removeClass("ynhopen");
}
preventRefire = false;
}, 300);
}, 200);
});
}
preventRefire = false;
function checkScroll (direction) {
if(preventRefire) return;
if((direction == "top") && ($("body").scrollTop() == 107 || $("html").scrollTop() == 107) && $("#ynhtoggle.ynhopen").length == 0) {
if(preventFire) return;
datScroll(0);
} else if((direction == "bottom") && $("#ynhtoggle.ynhopen").length > 0) {
datScroll(h);
@ -46,42 +48,39 @@ ynh.jquery = jQuery.noConflict();
}
$( document ).ready(function($) {
scroll = $("body").scrollTop();
h = 107;
$('body').children().filter(function() {
return $(this).css("position") === 'absolute' || $(this).css("position") === 'fixed';
}).css({top: function(index, value) {
return parseFloat(value) + h + 3;
}});
if ($(window).height() > $("html").height()) {
alert('moualé');
$("html").css('min-height', $(window).height() + h );
}
$("body").append('<div id="ynhtopbar"><div id="ynhtoggle" class="ynhopen">YunoHost</div></div>');
$("body").css({marginTop: function(index, value) {
return parseFloat(value) + h + 3;
}});
if (scroll == 0) {
$("body,html").animate({scrollTop:h}, '100', 'swing', function() {
setTimeout(function() {
$("#ynhtoggle").removeClass("ynhopen");
}, 300);
//window.scrollTo(0, h);
});
}
$("#ynhtoggle").on("click", function() {
if ($("body").scrollTop() == 0 && $("html").scrollTop() == 0) {
datScroll(h);
} else {
datScroll(0);
}
});
$("#glu").load(function() {
setTimeout(function() {
$('body').children().filter(function() {
return $(this).css("position") === 'absolute' || $(this).css("position") === 'fixed';
}).css({top: function(index, value) {
return parseFloat(value) + h + 3;
}});
$("body").append('<div id="ynhtopbar"><div id="ynhtoggle" class="ynhopen">YunoHost</div></div>');
$("body").css({marginTop: function(index, value) {
return parseFloat(value) + h + 3;
}});
if ($("body").scrollTop() == 0) {
$("body,html").scrollTop(h);
$("#ynhtoggle").removeClass("ynhopen");
}
$("#ynhtoggle").on("click", function() {
preventFire = false;
checkScroll("bottom");
checkScroll("top");
});
}, 10);
$( $(this)[0].contentWindow ).bind("DOMMouseScroll mousewheel scroll", function(event) {
if (event.currentTarget.scrollY > 0) {
if ((event.type == "DOMMouseScroll" && event.originalEvent.detail > 0)
|| (event.type == "mousewheel" && event.originalEvent.wheelDeltaY < 0)
|| event.currentTarget.scrollY > 0 ) {
checkScroll("bottom");
preventFire = true;
} else {
setTimeout(function() { preventFire = false; }, 200);
checkScroll("top");
}
});