Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
sidebar [2019/11/04 23:45]
muaddib
sidebar [2019/11/14 22:29] (current)
muaddib
Line 1: Line 1:
 +~~NOCACHE~~
 +
 <​html>​ <​html>​
  
Line 4: Line 6:
 // Workaround to prevent auto-expand / auto-collapse menus in the flat template. // Workaround to prevent auto-expand / auto-collapse menus in the flat template.
 jQuery(document).ready(function() { jQuery(document).ready(function() {
- if ("​ontouchstart"​ in window) { + jQuery("#​site-navigation .menu-item-has-children .fa, #​site-navigation .page_item_has_children .fa"​).off("​click"​);​
- jQuery("#​site-navigation .menu-item-has-children .fa, #​site-navigation .page_item_has_children .fa"​).off("​click"​);​ +
- }+
  jQuery("#​site-navigation .menu-item-has-children .fa, #​site-navigation .page_item_has_children .fa"​).click(function() {  jQuery("#​site-navigation .menu-item-has-children .fa, #​site-navigation .page_item_has_children .fa"​).click(function() {
  jQuery(this).toggleClass("​open"​).next("​ul"​).slideToggle(300);​  jQuery(this).toggleClass("​open"​).next("​ul"​).slideToggle(300);​
Line 14: Line 14:
 </​script>​ </​script>​
  
-<li class="​fa fa-home menu-item menu-item-type-custom menu-item-home">​ +</​html>​
-  ​</html>​[[:​|Home]]<​html>​ +
-</li>+
  
-<li class="​fa fa-keyboard-o menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children current-menu-ancestor">​ +<php>
-  </​html>​[[vampire:​|Vampire Boards]]<​html>​ +
-  <ul class="​sub-menu">​ +
-    <li class="​menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children">​ +
-      </​html>​[[vampire:​vsa-v4:​|Vampire Standalone (V4)]]<​html>​ +
-      <ul class="​sub-menu">​ +
-        <li class="​menu-item menu-item-type-custom">​ +
-          </​html>​[[vampire:​vsa-v4:​peripherals|Peripherals]]<​html>​ +
-        </​li>​ +
-        <li class="​menu-item menu-item-type-custom">​ +
-          </​html>​[[vampire:​vsa-v4:​troubleshooting|Troubleshooting]]<​html>​ +
-        </​li>​ +
-        <li class="​menu-item menu-item-type-custom">​ +
-          </​html>​[[vampire:​vsa-v4:​updates|Updates]]<​html>​ +
-        </​li>​ +
-      </​ul>​ +
-    </​li>​ +
-    <li class="​menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children">​ +
-      </​html>​[[vampire:​v500-v2plus:​|Vampire 500 (V2+)]]<​html>​ +
-      <ul class="​sub-menu">​ +
-        <li class="​menu-item menu-item-type-custom">​ +
-          </​html>​[[vampire:​v500-v2plus:​peripherals|Peripherals]]<​html>​ +
-        </​li>​ +
-        <li class="​menu-item menu-item-type-custom">​ +
-          </​html>​[[vampire:​v500-v2plus:​troubleshooting|Troubleshooting]]<​html>​ +
-        </​li>​ +
-        <li class="​menu-item menu-item-type-custom">​ +
-          </​html>​[[vampire:​v500-v2plus:​updates|Updates]]<​html>​ +
-        </​li>​ +
-      </​ul>​ +
-    </​li>​ +
-    <li class="​menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children">​ +
-      </​html>​[[vampire:​v600-v2:​|Vampire 600 (V2)]]<​html>​ +
-      <ul class="​sub-menu">​ +
-        <li class="​menu-item menu-item-type-custom">​ +
-          </​html>​[[vampire:​v600-v2:​peripherals|Peripherals]]<​html>​ +
-        </​li>​ +
-        <li class="​menu-item menu-item-type-custom">​ +
-          </​html>​[[vampire:​v600-v2:​troubleshooting|Troubleshooting]]<​html>​ +
-        </​li>​ +
-        <li class="​menu-item menu-item-type-custom">​ +
-          </​html>​[[vampire:​v600-v2:​updates|Updates]]<​html>​ +
-        </​li>​ +
-      </​ul>​ +
-    </​li>​ +
-    <li class="​menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children">​ +
-      </​html>​[[vampire:​v1200:​|Vampire 1200]]<​html>​ +
-      <ul class="​sub-menu">​ +
-      </​ul>​ +
-    </​li>​ +
-    <li class="​menu-item menu-item-type-custom">​ +
-      </​html>​[[http://​www.apollo-core.com/​index.htm?​page=reseller|Where To Buy]]<​html>​ +
-    </​li>​ +
-  </​ul>​ +
-</li>+
  
-<li class="​fa fa-calculator menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children">​ +global $ID; 
-  </​html>​[[apollo_core:​start|68080 CPU]]<​html>​ +global $INFO;
-  <ul class="​sub-menu">​ +
-    <li class="​menu-item menu-item-type-custom">​ +
-      </​html>​[[apollo_core:​fpu|FPU]]<​html>​ +
-    </​li>​ +
-  </​ul>​ +
-</li>+
  
-<li class="​fa fa-gamepad menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children">​ +// Edit the following page to modify the menu. 
-  </html>​[[saga:​|SAGA]]<​html>​ +$controlPage ​= "navigationmenu";
-  <ul class="​sub-menu">​ +
-    <li class="​menu-item menu-item-type-custom">​ +
-      </html>​[[saga:​video|Video]]<​html>​ +
-    </​li>​ +
-    <li class="​menu-item menu-item-type-custom">​ +
-      </​html>​[[saga:​sdcard|SDCard]]<​html>​ +
-    </​li>​ +
-    <li class="menu-item menu-item-type-custom"+
-      </​html>​[[saga:​flash|SPI Flash]]<​html>​ +
-    </​li>​ +
-    <li class="​menu-item menu-item-type-custom">​ +
-      </​html>​[[saga_clock_counter|Clock-Cycle Counter]]<​html>​ +
-    </​li>​ +
-    <li class="​menu-item menu-item-type-custom">​ +
-      </​html>​[[saga:​registers|All Registers]]<​html>​ +
-    </​li>​ +
-    <li class="​menu-item menu-item-type-custom">​ +
-      </​html>​[[saga:​updates|Updates]]<​html>​ +
-    </​li>​ +
-  </​ul>​ +
-</li>+
  
-<!--li class="fa fa-floppy-o menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children">​ +$instructions = p_cached_instructions(wikiFN($controlPage),​ false, $controlPage);​ 
-  </​html>[[os:|Operating Systems]]<html+$max = count($instructions);​ 
-</li-->+$pre = true; 
 +$lvl = 0; 
 +$parents = array(); 
 +$page = '';​ 
 +// build a lookup table 
 +for ($i = 0; $i $max; $i++) { 
 + if ($instructions[$i][0] == '​listu_open'​) { 
 + $pre = false; 
 + $lvl++; 
 + if ($page) { 
 + array_push($parents,​ $page); 
 +
 + } elseif ($instructions[$i][0] == '​listu_close'​) { 
 + $lvl--
 + array_pop($parents);​ 
 + } elseif ($pre || $lvl == 0) { 
 + unset($instructions[$i]);​ 
 + } elseif ($instructions[$i][0] == '​internallink'​) { 
 + $foo = true; 
 + $page = $instructions[$i][1][0];​ 
 + $isExternal = TRUE; 
 + if ($page[0] != '?'​) { 
 + resolve_pageid(getNS($ID),​ $page, $foo); // resolve relative to sidebar ID 
 + $isExternal = FALSE; 
 +
 + $details = explode("|", $instructions[$i][1][1]);​ 
 + $title = $details[0];​ 
 + $options = array(); 
 + if (count($details) ​1) { 
 + parse_str($details[1],​ $options);​ 
 +
 + $list[$page] = array( 
 + '​parents'​ =$parents, 
 + '​page'​ => $page, 
 + '​title'​ => $title, 
 + '​options'​ => $options, 
 + '​lvl'​ => $lvl, 
 + '​isExternal'​ => $isExternal,​ 
 + '​hasChildren'​ => FALSE 
 + ); 
 + } elseif ($instructions[$i][0] == '​externallink'​) { 
 + $page = $instructions[$i][1][0];​ 
 + $details = explode("​|", $instructions[$i][1][1]); 
 + $title = $details[0];​ 
 + $options = array(); 
 + if (count($details) ​1) { 
 + parse_str($details[1],​ $options);​ 
 +
 + $list[$page] = array( 
 + '​parents'​ =$parents, 
 + '​page'​ => $page, 
 + '​title'​ => $title, 
 + '​options'​ => $options, 
 + '​lvl'​ => $lvl, 
 + '​isExternal'​ => TRUE, 
 + '​hasChildren'​ => FALSE 
 + ); 
 +
 +
 +foreach ((array) $list as $pid => $info) { 
 + $parents = $info['​parents'​];​ 
 + $parentCount = count($parents);​ 
 + for ($i = 0; $i < $parentCount;​ $i++) { 
 + $list[$parents[$i]]['​hasChildren'​] = TRUE; 
 +
 +}
  
-<li class="fa fa-rocket menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children"> +$openPath ​array(); 
-  </​html>​[[system_tools:|System Tools]]<​html>​ +if (isset($list[$INFO['​id'​]])) { 
-</li>+ $openPath = (array) $list[$INFO['​id'​]]['​parents'​];​ // get the "path" ​of the page we're on currently 
 + array_push($openPath,​ $INFO['​id'​]);​ 
 +} else { 
 + $ns = $INFO['​id'​];​ 
 + // traverse up for matching namespaces 
 + if ($list) do { 
 + $ns = getNS($ns);​ 
 + $try = "$ns:"; 
 + resolve_pageid('',​ $try, $foo); 
 + if (isset($list[$try])) { 
 + // got a start page 
 + $openPath = (array) $list[$try]['​parents'​];​ 
 + array_push($openPath,​ $try); 
 + break; 
 + } else { 
 + // search for the first page matching the namespace 
 + foreach ($list as $key =$junk) { 
 + if (getNS($key) == $ns) { 
 + $openPath = (array) $list[$key]['​parents'​];​ 
 + array_push($openPath,​ $key); 
 + break 2; 
 +
 +
 +
 + } while ($ns); 
 +}
  
-<li class="​fa ​fa-star menu-item menu-item-type-custom">​ +$listItemClasses = array(); 
-    <a href="?do=index">Sitemap</​a>​ +foreach ((array) $list as $pid => $info) { 
-</li>+ $faOption = $info['​options'​]['​fa'​];​ 
 + if ($faOption) { 
 + $listItemClass ​= "​fa ​" . $faOption . " "; 
 + } else { 
 + $listItemClass = "";​ 
 +
 + $listItemClass .= "menu-item menu-item-object-page ​menu-item-type-post_type"
 + if ($info['​hasChildren'​]) { 
 + $listItemClass .= " menu-item-has-children";​ 
 +
 + if ($info['​page'​] == "​start"​) { 
 + $listItemClass .= " menu-item-home";​ 
 +
 + $homepageexpandOption = $info['​options'​]['​homepageexpand'​];​ 
 + if ($homepageexpandOption && $homepageexpandOption == "​true"​ && $INFO['​id'​] == '​start'​) { 
 + if (!in_array($pid,​ $openPath)) { 
 + $listItemClass .= " current-menu-ancestor current-post_type-ancestor";​ 
 +
 +
 + $listItemClasses[$pid] = $listItemClass;​ 
 +
 + 
 +$openPathCount = count($openPath);​ 
 +for ($openPathIndex = 0; $openPathIndex < $openPathCount;​ $openPathIndex++) { 
 + if ($openPathIndex + 1 == $openPathCount) { 
 + $listItemClass = "​current-menu-item current-menu-parent current-post_type-parent";​ 
 + } elseif ($openPathIndex + 2 == $openPathCount) { 
 + $listItemClass = "​current-menu-parent current-post_type-parent";​ 
 + } else { 
 + $listItemClass = "​current-menu-ancestor current-post_type-ancestor";​ 
 +
 + $pid = $openPath[$openPathIndex];​ 
 + $listItemClasses[$pid] .= " " . $listItemClass;​ 
 +
 + 
 +$open = false; 
 +$lvl = 1; 
 +$R = new Doku_Renderer_xhtml();​ 
 +foreach ((array) $list as $pid =$info) { 
 + // skip every non readable page 
 + if (auth_quickaclcheck(cleanID($info['​page'​])) < AUTH_READ) { 
 + continue;​ 
 +
 + $listItemClass = $listItemClasses[$pid];​ 
 + if ($info['​lvl'​] == $lvl) { 
 + if ($open) { 
 + $R->​doc .= "</​li>​\n";​ 
 +
 + $R->​doc .= "<​li class=\""​ . $listItemClass . "​\">​\n";​ 
 + $open = true; 
 + } elseif ($lvl > $info['​lvl'​]) { 
 + for ($lvl; $lvl > $info['​lvl'​];​ --$lvl) { 
 + $R->​doc .= "</​li>​\n";​ 
 + $R->​doc .= "</​ul>​\n";​ 
 +
 + $R->​doc .= "</​li>​\n";​ 
 + $R->​doc .= "<​li class=\""​ . $listItemClass . "​\">​\n";​ 
 + } elseif ($lvl < $info['​lvl'​]) { 
 + // more than one run is bad nesting! 
 + for ($lvl; $lvl < $info['​lvl'​];​ ++$lvl) { 
 + $R->​doc .= "<​ul class=\"​sub-menu\">​\n";​ 
 + $R->​doc .= "<​li class=\""​ . $listItemClass . "​\">​\n";​ 
 + $open = true; 
 +
 +
 + if ($info['​isExternal'​]) { 
 + $externalPage = $info['​page'​];​ 
 + if ($externalPage[0] == '?'​) { 
 + $R->​doc .= "<a href=\"" . $externalPage . "​\"​ class=\"​wikilink1\"​ title=\""​ . $externalPage . "\">" . $info['​title'​] . "</a>"; 
 + } else { 
 + $R->​externallink($externalPage,​ $info['​title'​]);​ 
 +
 + } else { 
 + $R->​internallink(':'​ . $info['​page'​],​ $info['​title'​]);​ 
 +
 +
 +while ($lvl > 0) { 
 + $R->doc .= "</li>​\n";​ 
 + if ($lvl > 1) { 
 + $R->​doc .= "</​ul>​\n";​ 
 +
 + --$lvl; 
 +
 + 
 +echo $R->​doc;​ 
 + 
 +</php>
  
-</​html>​ 
Last modified: le 2019/11/04 23:45