SSOwat/portal/panel.ms

128 lines
5 KiB
Text
Raw Normal View History

2013-10-23 11:21:05 +02:00
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, width=device-width, height=device-height" />
<title>Yunohost Apps</title>
<link media="all" type="text/css" href="assets/css/panel.css" rel="stylesheet">
<script src="assets/js/jquery-1.10.2.min.js"></script>
</head>
<body class="gradient" style="overflow: hidden">
2013-10-29 10:16:30 +01:00
<iframe name="glu" id="glu" width="100%" src="https://megusta7.com/webmaaail/" style=""></iframe>
2013-10-23 11:21:05 +02:00
<script>
var ynh = {};
ynh.jquery = jQuery.noConflict();
(function( $ ) {
2013-10-23 13:01:14 +02:00
preventFire = false;
preventRefire = false;
2013-10-23 11:21:05 +02:00
function datScroll(to) {
preventRefire = true;
$("body,html").animate({scrollTop:to}, '100', 'swing', function() {
setTimeout(function() {
if (to == 0) {
$("#ynhtoggle").addClass("ynhopen");
} else {
$("#ynhtoggle").removeClass("ynhopen");
}
preventRefire = false;
2013-10-23 13:01:14 +02:00
}, 200);
2013-10-23 11:21:05 +02:00
});
}
function checkScroll (direction) {
if(preventRefire) return;
if((direction == "top") && ($("body").scrollTop() == 107 || $("html").scrollTop() == 107) && $("#ynhtoggle.ynhopen").length == 0) {
2013-10-23 13:01:14 +02:00
if(preventFire) return;
2013-10-23 11:21:05 +02:00
datScroll(0);
} else if((direction == "bottom") && $("#ynhtoggle.ynhopen").length > 0 ) {
2013-10-23 11:21:05 +02:00
datScroll(h);
}
}
2013-10-29 10:16:30 +01:00
function changeTitle() {
if (top.glu.document.title)
top.document.title = top.glu.document.title;
else
top.document.title = 'Yunohost Apps';
}
var tid = setInterval(changeTitle, 10000);
2013-10-23 11:21:05 +02:00
$( document ).ready(function($) {
h = 107;
$("#glu").load(function() {
2013-10-23 13:01:14 +02:00
setTimeout(function() {
2013-10-29 10:16:30 +01:00
changeTitle();
2013-10-24 12:19:44 +02:00
if ($("#ynhtopbar").length == 0) {
$('body').children().filter(function() {
return $(this).css("position") === 'absolute' || $(this).css("position") === 'fixed';
}).css({top: function(index, value) {
2013-10-23 13:01:14 +02:00
return parseFloat(value) + h + 3;
2013-10-24 12:19:44 +02:00
}});
$("body").append('<div id="ynhtopbar"><div id="ynhtoggle" class="ynhopen">YunoHost</div></div>');
2013-10-29 10:16:30 +01:00
{{#app}}
$("#ynhtopbar").append('<div class="ynhapp" data-href="https://{{url}}"><div class="ynhappsquare">R</div><div class="ynhappcaption">{{name}}</div></div>');
{{/app}}
2013-10-24 12:19:44 +02:00
}
2013-10-23 13:01:14 +02:00
$("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");
});
2013-10-29 10:16:30 +01:00
$(".ynhapp").on("click", function(event) {
event.preventDefault();
parent.glu.location.href = $(this).attr('data-href');
$('.ynhapp.active').removeClass('active');
$(this).addClass('active');
});
2013-10-23 13:01:14 +02:00
}, 10);
$(window).resize(function() {
if ($("#ynhtoggle.ynhopen").length == 0) {
$("body,html").scrollTop(h);
}
});
2013-10-23 11:21:05 +02:00
$( $(this)[0].contentWindow ).bind("DOMMouseScroll mousewheel scroll", function(event) {
2013-10-23 13:01:14 +02:00
if ((event.type == "DOMMouseScroll" && event.originalEvent.detail > 0)
|| (event.type == "mousewheel" && event.originalEvent.wheelDeltaY < 0)
|| event.currentTarget.scrollY > 0 ) {
2013-10-23 11:21:05 +02:00
checkScroll("bottom");
2013-10-23 13:01:14 +02:00
preventFire = true;
2013-10-23 11:21:05 +02:00
} else {
2013-10-24 12:19:44 +02:00
setTimeout(function() { preventFire = false; }, 500);
2013-10-23 11:21:05 +02:00
checkScroll("top");
}
});
$(document).bind("keyup keydown",function(event){
if($('input:focus,textarea:focus').length > 0) return; //If an input field is focused
if(event.which == 38 || event.which == 33) {
checkScroll("top");
} else if(event.which == 40 || event.which == 34) {
checkScroll("bottom");
}
});
});
});
})(ynh.jquery);
</script>
</body>
</html>