====== Auto Include Index plugin ====== ---- plugin ---- description: Automatically includes an index menu on each page, hidden by default, can be toggled by clicking the sitemap bar on the right of the screen author : James GuanFeng Lin email : guanfenglin@gmail.com type : action lastupdate : 2009-07-20 compatible : depends : box, indexmenu, addnewpage conflicts : similar : tags : navigation, menu, listing, index downloadurl: https://trello.com/1/cards/5b07062ee890e2cf25802b7a/attachments/5b0706c0d1e843b7fc825428/download/autoincludeindex.zip bugtracker : sourcerepo : donationurl: screenshot_img: ---- ====Donation==== {{http://widget.chipin.com/widget/id/d1f89456c806f24a?.swf?250x250 }} ===== Download and Installation ===== Your wiki should allow include: * html * php code It's in the settings of your wiki, there are 2 ways to do it: - if you log in as admin, go to admin section, then configuration settings, in the editting section, tick the checkboxes for allow embeded html and php. - the other way is to go to your config file[conf/local.php] and change your setting to look like this ''%%$conf['htmlok'] = 1; $conf['phpok'] = 1;%%'' Refer to [[:Plugins]] on how to install plugins manually. * [[https://trello.com/1/cards/5b07062ee890e2cf25802b7a/attachments/5b0706c0d1e843b7fc825428/download/autoincludeindex.zip|download]] See it in action [[http://www.dev.entityzero.co.nz/wiki/doku.php?id=start]] FIXME ===== Screen shots ===== {{https://trello.com/1/cards/5b07062ee890e2cf25802b7a/attachments/658453efcf3d07af1a2660af/download/autoincludeindex-screenshot-o.jpg?recache}} {{https://trello.com/1/cards/5b07062ee890e2cf25802b7a/attachments/658453ee8dbcdcb0de196150/download/autoincludeindex-screenshot-c.jpg?recache}} ===== Bugs ===== User reported that this plugin has problem with the latest dokuwiki snapshot dokuwiki-latest.tgz 20. oct 2010 ===== Bug fix for missing edit bar ===== Replace your script.js with the code below and all works fine. -- Gary Greyling var autoincludeindexhidden = true; var autoincludeindexiconid = 'autoincludeindexicon'; var autoincludeindexid = 'autoincludeindex'; var autoincludeindexicontop = 0; var autoincludeindextop = 0; var autoincludeindexscroll = 0; function toggleautoindexmenu() { if (autoincludeindexhidden) { showautoincludeindex(autoincludeindexid,autoincludeindexiconid); } else { hideautoincludeindex(autoincludeindexid,autoincludeindexiconid); } } function showautoincludeindex(id,iconid) { $(id).style.visibility="visible"; $(id).style.display="inline"; $(id).style.top = $(iconid).offsetTop - 25 + 'px'; $(iconid).style.right = '254px'; autoincludeindexhidden = false; } function hideautoincludeindex(id,iconid) { $(id).style.visibility="hidden"; //$(id).style.display="none"; $(iconid).style.right = '0px'; autoincludeindexhidden = true; } function floatautoincludeindex() { if (autoincludeindexhidden) { ScrollTop = document.body.scrollTop; if (ScrollTop == 0) { if (window.pageYOffset) { ScrollTop = window.pageYOffset; } else { ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0; } } if ($(autoincludeindexiconid)) { $(autoincludeindexiconid).style.top = ScrollTop + autoincludeindexicontop+'px'; } //document.getElementById('autoincludeindex').style.top = ScrollTop + autoincludeindexicontop+'px'; } } function initautoincludeindex() { if ($(autoincludeindexiconid)) { autoincludeindexicontop = $(autoincludeindexiconid).offsetTop; } //autoincludeindexicontop = document.getElementById('autoincludeindex').offsetTop; addEvent(window, 'scroll', floatautoincludeindex); } addInitEvent(function(){ initautoincludeindex(); });