commit 914a1fc28584dd32f3baccf066bdcabbfba923b3
parent 9eeede1d5807e824abb67b1ecb0e4932ee45c667
Author: markseu <mark2011@mayberg.se>
Date: Tue, 26 May 2015 10:27:28 +0200
Core update (Smultron remix)
Diffstat:
8 files changed, 86 insertions(+), 61 deletions(-)
diff --git a/README.md b/README.md
@@ -1,4 +1,4 @@
-Yellow 0.5.16
+Yellow 0.5.17
=============
[](http://datenstrom.se/yellow)
diff --git a/content/1-home/page.txt b/content/1-home/page.txt
@@ -3,5 +3,5 @@ Title: Home
---
Your website works!
-You can now [edit this page](@pageedit) or use your text editor.
+You can now [edit this page] or use your text editor.
For more information see [Yellow documentation](https://github.com/datenstrom/yellow/wiki).
\ No newline at end of file
diff --git a/system/core/core-webinterface.css b/system/core/core-webinterface.css
@@ -1,16 +1,16 @@
-/* Yellow web interface 0.5.16 */
+/* Yellow web interface 0.5.17 */
-.yellow-bar { position:relative; overflow:hidden; line-height:2em; margin-bottom:10px; }
+.yellow-bar { position:relative; overflow:hidden; height:2em; margin-bottom:10px; }
.yellow-bar-left { display:block; float:left; }
.yellow-bar-right { display:block; float:right; }
.yellow-bar-right a { margin-left:1em; }
.yellow-bar-right #yellow-pane-create-link { padding:0 0.5em; }
.yellow-bar-right #yellow-pane-delete-link { padding:0 0.5em; }
-.yellow-body-modal-open { overflow:hidden; }
+.yellow-body-modal-open { overflow:hidden; background-color:rgba(128, 128, 128, 0.1); transition:background-color 100ms; }
.yellow-pane {
position:absolute; display:none; z-index:100;
- margin:10px 0px; padding:5px;
+ margin:10px 0px; padding:10px;
background-color:#fff; color:#000;
border:1px solid #bbb;
border-radius:4px; box-shadow:2px 4px 10px rgba(0, 0, 0, 0.2);
@@ -18,6 +18,8 @@
.yellow-pane p { margin:0.5em; }
.yellow-pane ul { list-style:none; margin:0 0.5em; padding:0; }
.yellow-pane div { overflow:hidden; }
+.yellow-cancel { display:block; float:right; padding:0 0.5em; color:#bbb; }
+.yellow-cancel:hover { text-decoration:none; color:#000; }
.yellow-arrow { position:absolute; top:0; left:0; }
.yellow-arrow:after, .yellow-arrow:before {
position:absolute;
@@ -39,51 +41,62 @@
margin-left:-11px;
}
-.yellow-btn {
- margin:0; padding:4px 22px; min-width:7em;
+.yellow-form-control {
+ margin:0; padding:2px 4px;
display:inline-block;
+ background-color:#fff; color:#000;
+ background-image:linear-gradient(to bottom, #fff, #fff);
+ border:1px solid #bbb;
+ border-radius:4px;
+ font-size:0.9em; font-family:inherit; font-weight:normal; line-height:normal;
+}
+.yellow-btn {
+ margin:0; padding:4px 22px;
+ display:inline-block; min-width:7em;
background-color:#eaeaea; color:#333333;
background-image:linear-gradient(to bottom, #f8f8f8, #e1e1e1);
border:1px solid #bbb;
border-color:#c1c1c1 #c1c1c1 #aaaaaa;
- border-radius:4px;
- outline-offset:-2px;
+ border-radius:4px;
+ outline-offset:-2px;
font-size:0.9em; font-family:inherit; font-weight:normal; line-height:1;
text-align:center; text-decoration:none;
}
-.yellow-btn:hover, .yellow-btn:focus, .yellow-btn:active {
+.yellow-btn:hover, .yellow-btn:focus, .yellow-btn:active {
color:#333333;
- background-image:none;
+ background-image:none;
text-decoration:none;
}
.yellow-btn:active { box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.1); }
-.yellow-btn-red {
- background-color:#c33c35; color:#ffffff;
- background-image:linear-gradient(to bottom, #ee5f5b, #bd362f);
- border-color:#b13121 #b13121 #802020;
-}
-.yellow-btn-red:hover, .yellow-btn-red:focus, .yellow-btn-red:active { color:#ffffff; }
-.yellow-btn-green {
+.yellow-btn-create {
background-color:#3cc335; color:#ffffff;
background-image:linear-gradient(to bottom, #5fee5b, #36bd2f);
border-color:#31b121 #31b121 #20b020;
}
-.yellow-btn-green:hover, .yellow-btn-green:focus, .yellow-btn-green:active { color:#ffffff; }
-.yellow-btn-yellow {
- background-color:#f0d000; color:#333333;
- background-image:linear-gradient(to bottom, #ffe100, #efc100);
- border-color:#d1c121 #d1c121 #ccaa00;
+.yellow-btn-create:hover, .yellow-btn-create:focus, .yellow-btn-create:active { color:#ffffff; }
+.yellow-btn-edit {
+ background-color:#3cc335; color:#ffffff;
+ background-image:linear-gradient(to bottom, #5fee5b, #36bd2f);
+ border-color:#31b121 #31b121 #20b020;
+}
+.yellow-btn-edit:hover, .yellow-btn-edit:focus, .yellow-btn-edit:active { color:#ffffff; }
+.yellow-btn-delete {
+ background-color:#c33c35; color:#ffffff;
+ background-image:linear-gradient(to bottom, #ee5f5b, #bd362f);
+ border-color:#b13121 #b13121 #802020;
}
-.yellow-btn-yellow:hover, .yellow-btn-yellow:focus, .yellow-btn-yellow:active { color:#333333; }
+.yellow-btn-delete:hover, .yellow-btn-delete:focus, .yellow-btn-delete:active { color:#ffffff; }
-#yellow-pane-login { }
-#yellow-pane-login h1 { margin:0.5em 0.5em; }
-#yellow-pane-login p { margin:0.5em; text-align:right; }
+#yellow-pane-login { text-align:center; }
+#yellow-pane-login h1 { margin:0 0.5em; color:#000; font-size:2em; }
+#yellow-pane-login p { margin:1em 0.5em; }
+#yellow-pane-login-fields { width:12em; text-align:left; margin:0 auto; }
+#yellow-pane-login input { width:12em; box-sizing:border-box; }
#yellow-pane-edit { }
-#yellow-pane-edit h1 { margin:4px 0; color:#000; font-size:1.3em; text-align:center; }
-#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:4px 0; }
-#yellow-pane-edit-buttons input { margin-right:5px; }
+#yellow-pane-edit h1 { margin:0 0 10px 0; color:#000; font-size:1.5em; }
+#yellow-pane-edit-page { padding:5px; outline:none; resize:none; }
+#yellow-pane-edit-buttons { margin-top:5px; }
+#yellow-pane-edit-buttons input { margin-right:10px; }
#yellow-pane-user { cursor:pointer; }
#yellow-pane-user a { text-decoration:none; }
#yellow-pane-user a:hover { text-decoration:underline; }
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.16",
+ version: "0.5.17",
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)); },
@@ -59,9 +59,9 @@ yellow.webinterface =
{
switch(text)
{
- case "create": this.togglePane("yellow-pane-edit", "create"); break;
- case "edit": this.togglePane("yellow-pane-edit", "edit"); break;
- case "delete": this.togglePane("yellow-pane-edit", "delete"); break;
+ case "create": this.togglePane("yellow-pane-edit", "create", true); break;
+ case "edit": this.togglePane("yellow-pane-edit", "edit", true); break;
+ case "delete": this.togglePane("yellow-pane-edit", "delete", true); break;
case "user": this.togglePane("yellow-pane-user"); break;
case "send": this.sendPane(this.paneId, this.paneType); break;
case "cancel": this.hidePane(this.paneId); break;
@@ -113,18 +113,21 @@ yellow.webinterface =
if(paneId == "yellow-pane-login")
{
elementDiv.innerHTML =
- "<h1>"+this.getText("LoginText")+"</h1>"+
"<form method=\"post\">"+
+ "<a href=\"#\" onclick=\"yellow.action('cancel'); return false;\" class=\"yellow-cancel\">x</a>"+
+ "<h1>"+this.getText("LoginText")+"</h1>"+
+ "<div id=\"yellow-pane-login-fields\">"+
"<input type=\"hidden\" name=\"action\" value=\"login\" />"+
- "<p><label for=\"email\">"+this.getText("LoginEmail")+"</label> <input name=\"email\" id=\"email\" maxlength=\"64\" value=\""+yellow.config.loginEmail+"\" /></p>"+
- "<p><label for=\"password\">"+this.getText("LoginPassword")+"</label> <input type=\"password\" name=\"password\" id=\"password\" maxlength=\"64\" value=\""+yellow.config.loginPassword+"\" /></p>"+
+ "<p><label for=\"email\">"+this.getText("LoginEmail")+"</label><br /><input class=\"yellow-form-control\" name=\"email\" id=\"email\" maxlength=\"64\" value=\""+yellow.config.loginEmail+"\" /></p>"+
+ "<p><label for=\"password\">"+this.getText("LoginPassword")+"</label><br /><input class=\"yellow-form-control\" type=\"password\" name=\"password\" id=\"password\" maxlength=\"64\" value=\""+yellow.config.loginPassword+"\" /></p>"+
"<p><input class=\"yellow-btn\" type=\"submit\" value=\""+this.getText("LoginButton")+"\" /></p>"+
+ "</div>"+
"</form>";
} else if(paneId == "yellow-pane-edit") {
elementDiv.innerHTML =
"<form method=\"post\">"+
"<h1 id=\"yellow-pane-edit-title\">"+this.getText("Edit")+"</h1>"+
- "<textarea id=\"yellow-pane-edit-page\" name=\"rawdataedit\"></textarea>"+
+ "<textarea id=\"yellow-pane-edit-page\" class=\"yellow-form-control\" name=\"rawdataedit\"></textarea>"+
"<div id=\"yellow-pane-edit-buttons\">"+
"<input id=\"yellow-pane-edit-send\" class=\"yellow-btn\" type=\"button\" onclick=\"yellow.action('send'); return false;\" value=\""+this.getText("EditButton")+"\" />"+
"<input id=\"yellow-pane-edit-cancel\" class=\"yellow-btn\" type=\"button\" onclick=\"yellow.action('cancel'); return false;\" value=\""+this.getText("CancelButton")+"\" />"+
@@ -164,9 +167,9 @@ yellow.webinterface =
var key, className;
switch(action)
{
- case "create": key = "CreateButton"; className = "yellow-btn yellow-btn-green"; break;
- case "edit": key = "EditButton"; className = "yellow-btn yellow-btn-yellow"; break;
- case "delete": key = "DeleteButton"; className = "yellow-btn yellow-btn-red"; break;
+ case "create": key = "CreateButton"; className = "yellow-btn yellow-btn-create"; break;
+ case "edit": key = "EditButton"; className = "yellow-btn yellow-btn-edit"; break;
+ case "delete": key = "DeleteButton"; className = "yellow-btn yellow-btn-delete"; break;
}
document.getElementById("yellow-pane-edit-send").value = this.getText(key);
document.getElementById("yellow-pane-edit-send").className = className;
@@ -197,26 +200,26 @@ yellow.webinterface =
},
// Show or hide pane
- togglePane: function(paneId, paneType)
+ togglePane: function(paneId, paneType, modal)
{
if(this.paneId!=paneId || this.paneType!=paneType)
{
this.hidePane(this.paneId);
- this.showPane(paneId, paneType);
+ this.showPane(paneId, paneType, modal);
} else {
this.hidePane(paneId);
}
},
// Show pane
- showPane: function(paneId, paneType)
+ showPane: function(paneId, paneType, modal)
{
var element = document.getElementById(paneId);
if(!yellow.toolbox.isVisible(element))
{
if(yellow.debug) console.log("yellow.webinterface.showPane id:"+paneId);
element.style.display = "block";
- yellow.toolbox.addClass(document.body, "yellow-body-modal-open");
+ if(modal) yellow.toolbox.addClass(document.body, "yellow-body-modal-open");
this.paneId = paneId;
this.paneType = paneType;
this.resizePanes();
@@ -280,6 +283,7 @@ yellow.webinterface =
var paneHeight = yellow.toolbox.getWindowHeight() - paneTop - yellow.toolbox.getOuterHeight(elementBar);
if(yellow.toolbox.isVisible(document.getElementById("yellow-pane-login")))
{
+ yellow.toolbox.setOuterTop(document.getElementById("yellow-pane-login"), paneTop);
yellow.toolbox.setOuterWidth(document.getElementById("yellow-pane-login"), paneWidth);
}
if(yellow.toolbox.isVisible(document.getElementById("yellow-pane-edit")))
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.16";
+ const Version = "0.5.17";
var $yellow; //access to API
var $active; //web interface is active? (boolean)
var $userLoginFailed; //web interface login failed? (boolean)
@@ -72,6 +72,19 @@ class YellowWebinterface
}
}
+ // Handle page content parsing of custom block
+ function onParseContentBlock($page, $name, $text, $typeShortcut)
+ {
+ $output = NULL;
+ if($name=="edit" && $typeShortcut)
+ {
+ $editText = "$name $text";
+ if(substru($text, 0, 2)=="- ") $editText = trim(substru($text, 2));
+ $output = "<a href=\"".$page->get("pageEdit")."\">".htmlspecialchars($editText)."</a>";
+ }
+ return $output;
+ }
+
// Handle page extra HTML data
function onExtra($name)
{
@@ -89,6 +102,7 @@ class YellowWebinterface
$output .= "yellow.page.rawDataSource = ".json_encode($this->rawDataSource).";\n";
$output .= "yellow.page.rawDataEdit = ".json_encode($this->rawDataEdit).";\n";
$output .= "yellow.page.rawDataNew = ".json_encode($this->getDataNew()).";\n";
+ $output .= "yellow.page.pageFile = ".json_encode($this->yellow->page->get("pageFile")).";\n";
$output .= "yellow.page.userPermission = ".json_encode($this->userPermission).";\n";
$output .= "yellow.page.parserSafeMode = ".json_encode($this->yellow->page->parserSafeMode).";\n";
$output .= "yellow.page.statusCode = ".json_encode($this->yellow->page->statusCode).";\n";
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.16";
+ const Version = "0.5.17";
var $page; //current page
var $pages; //pages from file system
var $files; //files from file system
@@ -532,13 +532,6 @@ class YellowPage
if(!is_null($output)) break;
}
}
- if(is_null($output) && $name=="snippet" && $typeShortcut && !$this->parserSafeMode)
- {
- ob_start();
- $this->parseSnippet($this->yellow->toolbox->getTextArgs($text));
- $output = ob_get_contents();
- ob_end_clean();
- }
if(defined("DEBUG") && DEBUG>=3 && !empty($name)) echo "YellowPage::parseContentBlock name:$name shortcut:$typeShortcut<br/>\n";
return $output;
}
diff --git a/system/plugins/markdown.php b/system/plugins/markdown.php
@@ -5,7 +5,7 @@
// Markdown plugin
class YellowMarkdown
{
- const Version = "0.5.3";
+ const Version = "0.5.4";
var $yellow; //access to API
// Handle initialisation
@@ -51,6 +51,7 @@ class YellowMarkdownParser extends MarkdownExtraParser
$text = preg_replace("/@pageRead/i", $this->page->get("pageRead"), $text);
$text = preg_replace("/@pageEdit/i", $this->page->get("pageEdit"), $text);
$text = preg_replace("/@pageError/i", $this->page->get("pageError"), $text);
+ $text = preg_replace("/@pageFile/i", $this->page->get("pageFile"), $text);
return parent::transform($text);
}
diff --git a/system/themes/flatsite.css b/system/themes/flatsite.css
@@ -1,4 +1,4 @@
-/* Flatsite theme 0.5.4 */
+/* Flatsite theme 0.5.5 */
/* Designer: Mark Mayberg */
@import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400,700);
@@ -87,18 +87,18 @@ a, img { border:none; text-decoration:none; }
background-image:linear-gradient(to bottom, #fff, #fff);
border:1px solid #bbb;
border-radius:4px;
- font-size:0.9em; font-family:inherit; font-weight:normal; line-height:1;
+ font-size:0.9em; font-family:inherit; font-weight:normal; line-height:normal;
}
.btn {
margin:0; padding:4px 22px;
- display:inline-block; min-width:8em;
+ display:inline-block; min-width:7em;
background-color:#eaeaea; color:#333333;
background-image:linear-gradient(to bottom, #f8f8f8, #e1e1e1);
border:1px solid #bbb;
border-color:#c1c1c1 #c1c1c1 #aaaaaa;
border-radius:4px;
outline-offset:-2px;
- font-size:0.9em; font-family:inherit; font-weight:normal; line-height:1;
+ font-size:0.9em; font-family:inherit; font-weight:normal; line-height:1;
text-align:center; text-decoration:none;
}
.btn:hover, .btn:focus, .btn:active {