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; \
|
install -v -d $(RMANAGERSKINSDIR)/$$skin; \
|
||||||
done
|
done
|
||||||
@cp -pR --remove-destination ${SRCMANAGERDIR}/example/index.pl ${RMANAGERDIR}
|
@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)
|
@cp -pR --remove-destination ${SRCMANAGERDIR}/example/skins/* $(RMANAGERSKINSDIR)
|
||||||
@if [ "$(MANAGERDIR)/skins/" != "$(MANAGERSKINSDIR)/" ]; then \
|
@if [ "$(MANAGERDIR)/skins/" != "$(MANAGERSKINSDIR)/" ]; then \
|
||||||
for skin in $$(ls lemonldap-ng-manager/example/skins/); do \
|
for skin in $$(ls lemonldap-ng-manager/example/skins/); do \
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
<Directory __DOCDIR__>
|
<Directory __DOCDIR__>
|
||||||
Order deny,allow
|
Order deny,allow
|
||||||
Allow from all
|
Allow from all
|
||||||
|
ErrorDocument 404 /notfound.html
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
# Perl script
|
# Perl script
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
<Directory __DOCDIR__>
|
<Directory __DOCDIR__>
|
||||||
Order deny,allow
|
Order deny,allow
|
||||||
Allow from all
|
Allow from all
|
||||||
|
ErrorDocument 404 /notfound.html
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
# Perl script
|
# Perl script
|
||||||
|
|
|
@ -2,6 +2,7 @@ Changes
|
||||||
example/index.pl
|
example/index.pl
|
||||||
example/mrtg/lmng-mrtg
|
example/mrtg/lmng-mrtg
|
||||||
example/mrtg/mrtg.cfg.example
|
example/mrtg/mrtg.cfg.example
|
||||||
|
example/notfound.html
|
||||||
example/scripts/lmConfigEditor
|
example/scripts/lmConfigEditor
|
||||||
example/sessions.pl
|
example/sessions.pl
|
||||||
example/skins/default/css/accordion.css
|
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
|
#help_content
|
||||||
{
|
{
|
||||||
text-align:left;
|
padding:5px;
|
||||||
max-height:200px;
|
overflow:hidden;
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#help_content iframe
|
||||||
|
{
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#query-switch
|
#query-switch
|
||||||
|
@ -241,10 +248,3 @@ input#skinText {
|
||||||
text-align: center;
|
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 */
|
/* Help chapters */
|
||||||
var helpCh={
|
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',
|
'cookies':'/pages/documentation/1.0/ssocookie.html',
|
||||||
'headers':'/pages/documentation/1.0/writingrulesand_headers.html#headers',
|
'headers':'/pages/documentation/1.0/writingrulesand_headers.html#headers',
|
||||||
'menu':'/pages/documentation/1.0/portalmenu.html',
|
'menu':'/pages/documentation/1.0/portalmenu.html',
|
||||||
|
@ -29,6 +29,7 @@ if (treejquerycss.match('true')){ treejquerycss = true; } else { treejquerycss =
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
/* Menu height */
|
/* Menu height */
|
||||||
|
resizeMenu();
|
||||||
jQuery.event.add(window, "load", resizeMenu);
|
jQuery.event.add(window, "load", resizeMenu);
|
||||||
jQuery.event.add(window, "resize", resizeMenu);
|
jQuery.event.add(window, "resize", resizeMenu);
|
||||||
|
|
||||||
|
@ -414,13 +415,12 @@ function display(div,title) {
|
||||||
$('#newapplicationr,#delapplication').hide();
|
$('#newapplicationr,#delapplication').hide();
|
||||||
$('#newpostr,#delpost').hide();
|
$('#newpostr,#delpost').hide();
|
||||||
$('#newpostdatar,#delpostdata').hide();
|
$('#newpostdatar,#delpostdata').hide();
|
||||||
/* TODO: conflict with loadAndScroll */
|
// Resize (or hide) Help window
|
||||||
/*var height_cur=$('#buttons').height()+$('#edition').height()+$('#help').height();
|
var height_menu=$('#menu').height();
|
||||||
var height_max=$('#menu').height();
|
var height_buttons_edition=$('#buttons').height()+$('#edition').height();
|
||||||
if(height_cur > height_max || $('#help_content').is(':visible')==false){
|
var help_height=height_menu-height_buttons_edition-50;
|
||||||
$('#help h1 img').toggle();
|
if(help_height<1){$('#help h1 img').toggle();$('#help_content').toggle();}
|
||||||
$('#help_content').toggle();
|
else{$('#help_content').height(help_height);}
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
function none(id) {
|
function none(id) {
|
||||||
currentId=id;
|
currentId=id;
|
||||||
|
@ -1392,55 +1392,14 @@ function networkPb(){
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Help management */
|
/* 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='';
|
var lasthelp='';
|
||||||
function loadHelp(ch){
|
function loadHelp(ch){
|
||||||
var url;
|
var url;
|
||||||
if(typeof(helpCh[ch])!='string'){ch='default';}
|
if(typeof(helpCh[ch])!='string'){ch='default';}
|
||||||
if(ch!=lasthelp){
|
if(ch!=lasthelp){
|
||||||
url=helpCh[ch];
|
url='/doc'+helpCh[ch];
|
||||||
loadAndScroll('/doc'+url,'/doc');
|
var html = '<iframe src="'+url+'" frameborder="0" />';
|
||||||
|
$('#help_content').html(html);
|
||||||
lasthelp=ch;
|
lasthelp=ch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user