Core update (navigation remix)

Thanks a lot @nibreh
This commit is contained in:
markseu 2015-05-22 11:05:42 +02:00
parent 119a91b4f5
commit 096c7c6a3e
8 changed files with 37 additions and 9 deletions

View file

@ -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)

View file

@ -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 { }
#yellow-pane-user { cursor:pointer; }

View file

@ -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)); },

View file

@ -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)

View file

@ -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

View file

@ -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 */

View file

@ -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>

View file

@ -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 ?>