LEMONLDAP-162:
* Use an iframe for offline doc * Dynamic resize of help div * Custom error page if documentation not found
This commit is contained in:
parent
0d5144bce8
commit
58703dcf95
|
@ -300,6 +300,7 @@ install_manager_site: install_conf_dir
|
|||
install -v -d $(RMANAGERSKINSDIR)/$$skin; \
|
||||
done
|
||||
@cp -pR --remove-destination ${SRCMANAGERDIR}/example/index.pl ${RMANAGERDIR}
|
||||
@cp -pR --remove-destination ${SRCMANAGERDIR}/example/notfound.html ${RMANAGERDIR}
|
||||
@cp -pR --remove-destination ${SRCMANAGERDIR}/example/skins/* $(RMANAGERSKINSDIR)
|
||||
@if [ "$(MANAGERDIR)/skins/" != "$(MANAGERSKINSDIR)/" ]; then \
|
||||
for skin in $$(ls lemonldap-ng-manager/example/skins/); do \
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
<Directory __DOCDIR__>
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
ErrorDocument 404 /notfound.html
|
||||
</Directory>
|
||||
|
||||
# Perl script
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
<Directory __DOCDIR__>
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
ErrorDocument 404 /notfound.html
|
||||
</Directory>
|
||||
|
||||
# Perl script
|
||||
|
|
|
@ -2,6 +2,7 @@ Changes
|
|||
example/index.pl
|
||||
example/mrtg/lmng-mrtg
|
||||
example/mrtg/mrtg.cfg.example
|
||||
example/notfound.html
|
||||
example/scripts/lmConfigEditor
|
||||
example/sessions.pl
|
||||
example/skins/default/css/accordion.css
|
||||
|
|
9
modules/lemonldap-ng-manager/example/notfound.html
Normal file
9
modules/lemonldap-ng-manager/example/notfound.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Page not found</title>
|
||||
</head>
|
||||
<body style="background:#FFF;text-align:center;">
|
||||
<h1>Page not found</h1>
|
||||
<h2>Please install documentation package to get offline doc</h2>
|
||||
</body>
|
||||
</html>
|
|
@ -145,8 +145,15 @@ option
|
|||
|
||||
#help_content
|
||||
{
|
||||
text-align:left;
|
||||
max-height:200px;
|
||||
padding:5px;
|
||||
overflow:hidden;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
#help_content iframe
|
||||
{
|
||||
width:100%;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
#query-switch
|
||||
|
@ -241,10 +248,3 @@ input#skinText {
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
/* Force font color for help pages */
|
||||
#help_content .note, #help_content .noteimportant, #help_content .notewarning, #help_content .notetip, #help_content table {
|
||||
color: #000;
|
||||
}
|
||||
div.dokuwiki h1,div.dokuwiki h2, div.dokuwiki h3, div.dokuwiki h4, div.dokuwiki h5 {
|
||||
color: inherit;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
/* Help chapters */
|
||||
var helpCh={
|
||||
'authParams':'/pages/documentation/1.0/start.html#authentication_and_users_database',
|
||||
'authParams':'/pages/documentation/1.0/start.html#authentication_users_and_password_databases',
|
||||
'cookies':'/pages/documentation/1.0/ssocookie.html',
|
||||
'headers':'/pages/documentation/1.0/writingrulesand_headers.html#headers',
|
||||
'menu':'/pages/documentation/1.0/portalmenu.html',
|
||||
|
@ -29,6 +29,7 @@ if (treejquerycss.match('true')){ treejquerycss = true; } else { treejquerycss =
|
|||
$(document).ready(function(){
|
||||
|
||||
/* Menu height */
|
||||
resizeMenu();
|
||||
jQuery.event.add(window, "load", resizeMenu);
|
||||
jQuery.event.add(window, "resize", resizeMenu);
|
||||
|
||||
|
@ -414,13 +415,12 @@ function display(div,title) {
|
|||
$('#newapplicationr,#delapplication').hide();
|
||||
$('#newpostr,#delpost').hide();
|
||||
$('#newpostdatar,#delpostdata').hide();
|
||||
/* TODO: conflict with loadAndScroll */
|
||||
/*var height_cur=$('#buttons').height()+$('#edition').height()+$('#help').height();
|
||||
var height_max=$('#menu').height();
|
||||
if(height_cur > height_max || $('#help_content').is(':visible')==false){
|
||||
$('#help h1 img').toggle();
|
||||
$('#help_content').toggle();
|
||||
}*/
|
||||
// Resize (or hide) Help window
|
||||
var height_menu=$('#menu').height();
|
||||
var height_buttons_edition=$('#buttons').height()+$('#edition').height();
|
||||
var help_height=height_menu-height_buttons_edition-50;
|
||||
if(help_height<1){$('#help h1 img').toggle();$('#help_content').toggle();}
|
||||
else{$('#help_content').height(help_height);}
|
||||
}
|
||||
function none(id) {
|
||||
currentId=id;
|
||||
|
@ -1392,55 +1392,14 @@ function networkPb(){
|
|||
}
|
||||
|
||||
/* Help management */
|
||||
function loadAndScroll(url,prefix){
|
||||
var t=url.match(/^(.*?)(?:#(.*))?$/);
|
||||
var dir=t[1].match(/(.*\/)/);
|
||||
$.ajax({url:t[1],
|
||||
type:'GET',
|
||||
dataType:'html',
|
||||
complete:function(res,status){
|
||||
if(status=="success"||status=="notmodified"){
|
||||
var tmp=$(res.responseText.replace(/\n/g,''));
|
||||
/* keep just html content element */
|
||||
res='<div class="dokuwiki">';
|
||||
var i;
|
||||
for(i=0;i<tmp.length;i++){
|
||||
if(typeof(tmp[i].innerHTML)=='string')res+=tmp[i].innerHTML;
|
||||
}
|
||||
$('#help_content').html(res);
|
||||
$('#help_content').attr('scrollTop',0);
|
||||
/* Scroll to anchor if defined */
|
||||
if(typeof(t[2])=='string')
|
||||
$('#help_content').attr('scrollTop',$("a[name='"+t[2]+"']").position().top-$('#help_content').position().top);
|
||||
/* Replace help_content links */
|
||||
$('#help_content a,#help_content img').each(function(i){
|
||||
var hn;
|
||||
if(this.tagName=='IMG'){hn='src'}else{hn='href'}
|
||||
if(typeof($(this).attr(hn))=='string'){
|
||||
/* Links must be opened in another window */
|
||||
$(this).attr('target','_blank');
|
||||
var href=$(this).attr(hn);
|
||||
/* absolute links are prefixed if needed */
|
||||
if(typeof(prefix)=='string' && typeof(dir[0])=='string' && href.match(/^\//)){
|
||||
$(this).attr(hn,prefix+href);
|
||||
}
|
||||
/* relative links are replaced by absolute ones */
|
||||
else if(!href.match(/^https?:\/\//)){
|
||||
$(this).attr(hn,dir[0]+href);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
var lasthelp='';
|
||||
function loadHelp(ch){
|
||||
var url;
|
||||
if(typeof(helpCh[ch])!='string'){ch='default';}
|
||||
if(ch!=lasthelp){
|
||||
url=helpCh[ch];
|
||||
loadAndScroll('/doc'+url,'/doc');
|
||||
url='/doc'+helpCh[ch];
|
||||
var html = '<iframe src="'+url+'" frameborder="0" />';
|
||||
$('#help_content').html(html);
|
||||
lasthelp=ch;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user