Core update (navigation remix)

This commit is contained in:
markseu 2015-05-22 19:37:37 +02:00
parent 096c7c6a3e
commit f339d03606
8 changed files with 42 additions and 27 deletions

View file

@ -1,4 +1,4 @@
Yellow 0.5.13
Yellow 0.5.14
=============
[![Yellow](https://raw.githubusercontent.com/wiki/datenstrom/yellow/images/yellow.jpg)](http://datenstrom.se/yellow)

View file

@ -36,6 +36,7 @@ textFile = language-(.*).ini
errorFile = page-error-(.*).txt
robotsTextFile = robots.txt
template = default
navigation = navigation
parser = markdown
parserSafeMode = 0
multiLanguageMode = 0

View file

@ -5,7 +5,7 @@
// Yellow main class
class Yellow
{
const Version = "0.5.13";
const Version = "0.5.14";
var $page; //current page
var $pages; //pages from file system
var $files; //files from file system
@ -60,6 +60,7 @@ class Yellow
$this->config->setDefault("errorFile", "page-error-(.*).txt");
$this->config->setDefault("robotsTextFile", "robots.txt");
$this->config->setDefault("template", "default");
$this->config->setDefault("navigation", "navigation");
$this->config->setDefault("parser", "markdown");
$this->config->setDefault("parserSafeMode", "0");
$this->config->setDefault("multiLanguageMode", "0");
@ -437,6 +438,7 @@ class YellowPage
$this->set("template", $this->yellow->lookup->findNameFromFile($this->fileName,
$this->yellow->config->get("templateDir"), $this->yellow->config->get("template"), ".html"));
$this->set("modified", date("Y-m-d H:i:s", $this->yellow->toolbox->getFileModified($this->fileName)));
$this->set("navigation", $this->yellow->config->get("navigation"));
$this->set("parser", $this->yellow->config->get("parser"));
if(preg_match("/^(\xEF\xBB\xBF)?\-\-\-[\r\n]+(.+?)[\r\n]+\-\-\-[\r\n]+/s", $this->rawData, $parts))

View file

@ -1,4 +1,4 @@
/* Flatsite theme 0.5.3 */
/* Flatsite theme 0.5.4 */
/* Designer: Mark Mayberg */
@import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400,700);
@ -24,7 +24,6 @@ a, img { border:none; text-decoration:none; }
.sitename h1 a { color:#111; text-decoration:none; }
.with-sidebar .main { margin-right:13em; }
.with-sidebar .sidebar { float:right; width:12em; margin-top:4.3em; overflow:hidden; }
.with-sidebar .sidebar .navigationside ul { margin:0; padding:0; list-style:none; }
.content h1:first-child, .content>*:first-child { margin-top:0; }
.content h1 a:hover { text-decoration:none; }
.content img { max-width:100%; height:auto; }
@ -56,17 +55,28 @@ a, img { border:none; text-decoration:none; }
.navigation ul { margin:0 -0.3em; padding:0; list-style:none; }
.navigation li { display:inline; }
.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; }
.navigation-search { padding-bottom:1em; }
.navigation-search .search-form { position:relative; }
.navigation-search .search-text { font-family:inherit; font-size:inherit; font-weight:inherit; }
.navigation-search .search-text { padding:0.5em; border:1px solid #bbb; border-radius:4px; width:100%; box-sizing:border-box; }
.navigation-search .search-text { background-color:#fff; background-image:linear-gradient(to bottom, #fff, #fff); }
.navigation-search .search-button { position:absolute; top:0; right:0; }
.navigation-search .search-button { font-family:inherit; font-size:inherit; font-weight:inherit; }
.navigation-search .search-button { margin:5px; padding:0.3em; border:none; background-color:transparent; }
.navigation-sidebar ul { margin:0; }
.navigation-tree { display:block; float:right; }
.navigation-tree { margin-top:0.9em; margin-bottom:0.9em; line-height:2em; }
.navigation-tree a { padding:0 0.3em; display:inline-block; }
.navigation-tree ul { margin:0 -0.3em; padding:0; list-style:none; }
.navigation-tree li { display:inline; }
.navigation-tree ul li { display:inline-block; position:relative; cursor:pointer; margin:0; }
.navigation-tree ul li:hover {}
.navigation-tree ul li ul { padding:0.3em; position:absolute; width:13em; background:#fff; z-index:100; display:none; }
.navigation-tree ul li ul { border:1px solid #bbb; border-radius:4px; box-shadow:2px 4px 10px rgba(0, 0, 0, 0.2); }
.navigation-tree ul li ul li { display:block; }
.navigation-tree ul li:hover ul { display:block; }
/* Forms and buttons */
@ -111,6 +121,7 @@ a, img { border:none; text-decoration:none; }
.sitename h1, h1, h2 { font-size:1.2em; }
.sitename h1, .header, .navigation, .footer, .page { margin:0; padding:0; }
.sitename, .navigation { float:none; }
.navigation-search { padding-top: 0.5em; }
.with-sidebar .main { margin-right:0em; }
.with-sidebar .sidebar { display:none; }
}

View file

@ -5,16 +5,7 @@
<?php $yellow->page->setLastModified($page->getModified()) ?>
<?php echo $page->getContent() ?>
<?php else: ?>
<?php $page = $yellow->page->getParentTop(false) ?>
<?php $pages = $page ? $page->getChildren(): $yellow->pages->clean() ?>
<?php $yellow->page->setLastModified($pages->getModified()) ?>
<div class="navigationside">
<ul>
<?php foreach($pages as $page): ?>
<li><a<?php echo $page->isActive() ? " class=\"active\"" : "" ?> href="<?php echo $page->getLocation() ?>"><?php echo $page->getHtml("titleNavigation") ?></a></li>
<?php endforeach ?>
</ul>
</div>
<?php $yellow->snippet("navigation-sidebar") ?>
<?php endif ?>
</div>
<?php endif ?>

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($yellow->page->isExisting("navigation") ? $yellow->page->get("navigation") : "navigation") ?>
<?php $yellow->snippet($yellow->page->get("navigation")) ?>
</div>

View file

@ -0,0 +1,10 @@
<?php $page = $yellow->page->getParentTop(false) ?>
<?php $pages = $page ? $page->getChildren(): $yellow->pages->clean() ?>
<?php $yellow->page->setLastModified($pages->getModified()) ?>
<div class="navigation-sidebar">
<ul>
<?php foreach($pages as $page): ?>
<li><a<?php echo $page->isActive() ? " class=\"active\"" : "" ?> href="<?php echo $page->getLocation() ?>"><?php echo $page->getHtml("titleNavigation") ?></a></li>
<?php endforeach ?>
</ul>
</div>

View file

@ -2,7 +2,7 @@
<?php if(!$pages) $pages = $yellow->pages->top() ?>
<?php $yellow->page->setLastModified($pages->getModified()) ?>
<?php if(!$level): ?>
<div class="navigationtree">
<div class="navigation-tree">
<?php endif ?>
<ul>
<?php foreach($pages as $page): ?>