mikuli.cz

:)
git clone https://git.sr.ht/~ashymad/mikuli.cz
Log | Files | Refs

commit 096c7c6a3e16a6a959736ceaf12599cb2baa9880
parent 119a91b4f5ce863a554c90c33e9ea29f47569c53
Author: markseu <mark2011@mayberg.se>
Date:   Fri, 22 May 2015 11:05:42 +0200

Core update (navigation remix)

Thanks a lot @nibreh

Diffstat:
MREADME.md | 2+-
Msystem/core/core-webinterface.css | 6+++---
Msystem/core/core-webinterface.js | 2+-
Msystem/core/core-webinterface.php | 2+-
Msystem/core/core.php | 2+-
Msystem/themes/flatsite.css | 16++++++++++++++--
Msystem/themes/snippets/header.php | 2+-
Asystem/themes/snippets/navigationtree.php | 16++++++++++++++++
8 files changed, 38 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md @@ -1,4 +1,4 @@ -Yellow 0.5.12 +Yellow 0.5.13 ============= [![Yellow](https://raw.githubusercontent.com/wiki/datenstrom/yellow/images/yellow.jpg)](http://datenstrom.se/yellow) diff --git a/system/core/core-webinterface.css b/system/core/core-webinterface.css @@ -1,4 +1,4 @@ -/* Yellow web interface 0.5.11 */ +/* Yellow web interface 0.5.12 */ .yellow-bar { position:relative; overflow:hidden; line-height:2em; margin-bottom:10px; } .yellow-bar-left { display:block; float:left; } @@ -84,4 +84,4 @@ #yellow-pane-edit-page { margin:0; padding:5px; border:1px solid #bbb; outline:none; resize:none; font-size:0.9em; } #yellow-pane-edit-buttons { margin:8px 0; } #yellow-pane-edit-buttons input { margin-right:5px; } -#yellow-pane-user { } -\ No newline at end of file +#yellow-pane-user { cursor:pointer; } +\ No newline at end of file diff --git a/system/core/core-webinterface.js b/system/core/core-webinterface.js @@ -4,7 +4,7 @@ // Yellow main API var yellow = { - version: "0.5.11", + version: "0.5.12", action: function(text) { yellow.webinterface.action(text); }, onClick: function(e) { yellow.webinterface.hidePanesOnClick(yellow.toolbox.getEventElement(e)); }, onKeydown: function(e) { yellow.webinterface.hidePanesOnKeydown(yellow.toolbox.getEventKeycode(e)); }, diff --git a/system/core/core-webinterface.php b/system/core/core-webinterface.php @@ -5,7 +5,7 @@ // Web interface core plugin class YellowWebinterface { - const Version = "0.5.11"; + const Version = "0.5.12"; var $yellow; //access to API var $active; //web interface is active? (boolean) var $userLoginFailed; //web interface login failed? (boolean) diff --git a/system/core/core.php b/system/core/core.php @@ -5,7 +5,7 @@ // Yellow main class class Yellow { - const Version = "0.5.12"; + const Version = "0.5.13"; var $page; //current page var $pages; //pages from file system var $files; //files from file system diff --git a/system/themes/flatsite.css b/system/themes/flatsite.css @@ -1,4 +1,4 @@ -/* Flatsite theme 0.2.2 */ +/* Flatsite theme 0.5.3 */ /* Designer: Mark Mayberg */ @import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400,700); @@ -49,12 +49,24 @@ a, img { border:none; text-decoration:none; } /* Navigation */ +.navigation-banner { clear:both; } .navigation { display:block; float:right; } .navigation { margin-top:0.9em; margin-bottom:0.9em; line-height:2em; } .navigation a { padding:0 0.3em; display:inline-block; } .navigation ul { margin:0 -0.3em; padding:0; list-style:none; } .navigation li { display:inline; } -.navigation-banner { clear:both; } + +.navigationtree { display:block; float:right; } +.navigationtree { margin-top:0.9em; margin-bottom:0.9em; line-height:2em; } +.navigationtree a { padding:0 0.3em; display:inline-block; } +.navigationtree ul { margin:0 -0.3em; padding:0; list-style:none; } +.navigationtree li { display:inline; } +.navigationtree ul li { display:inline-block; position:relative; cursor:pointer; margin:0; } +.navigationtree ul li:hover {} +.navigationtree ul li ul { padding:0.3em; position:absolute; width:13em; background:#fff; z-index:100; display:none; } +.navigationtree ul li ul { border:1px solid #bbb; border-radius:4px; box-shadow:2px 4px 10px rgba(0, 0, 0, 0.2); } +.navigationtree ul li ul li { display:block; } +.navigationtree ul li:hover ul { display:block; } /* Forms and buttons */ diff --git a/system/themes/snippets/header.php b/system/themes/snippets/header.php @@ -21,5 +21,5 @@ <div class="header"> <div class="sitename"><h1><a href="<?php echo $yellow->page->base."/" ?>"><i class="sitename-logo"></i><?php echo $yellow->page->getHtml("sitename") ?></a></h1></div> <div class="sitename-banner"></div> -<?php $yellow->snippet("navigation") ?> +<?php $yellow->snippet($yellow->page->isExisting("navigation") ? $yellow->page->get("navigation") : "navigation") ?> </div> diff --git a/system/themes/snippets/navigationtree.php b/system/themes/snippets/navigationtree.php @@ -0,0 +1,16 @@ +<?php list($name, $pages, $level) = $yellow->getSnippetArgs() ?> +<?php if(!$pages) $pages = $yellow->pages->top() ?> +<?php $yellow->page->setLastModified($pages->getModified()) ?> +<?php if(!$level): ?> +<div class="navigationtree"> +<?php endif ?> +<ul> +<?php foreach($pages as $page): ?> +<?php $children = $page->getChildren() ?> +<li><a<?php echo $page->isActive() ? " class=\"active\"" : "" ?> href="<?php echo $page->getLocation() ?>"><?php echo $page->getHtml("titleNavigation") ?></a><?php if($children->count()) { echo "\n"; $yellow->snippet($name, $children, $level+1); } ?></li> +<?php endforeach ?> +</ul> +<?php if(!$level): ?> +</div> +<div class="navigation-banner"></div> +<?php endif ?>