Web interface cleanup

This commit is contained in:
markseu 2014-02-17 15:36:05 +01:00
parent ec64a255d4
commit 7eb65e91d3
6 changed files with 10 additions and 60 deletions

View file

@ -6,9 +6,9 @@ RewriteEngine on
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^(content|system)/ error404 [L]
RewriteCond %{REQUEST_URI} \.(css|js|png|woff)$
RewriteCond %{REQUEST_URI} \.(css|js|png)$
RewriteRule ^media/plugins/(core-.+) system/core/$1 [L]
RewriteCond %{REQUEST_URI} \.(css|js|png|woff)$
RewriteCond %{REQUEST_URI} \.(css|js|png)$
RewriteRule ^media/plugins/(.+) system/plugins/$1 [L]
RewriteRule ^$ yellow.php [L]

View file

@ -22,5 +22,4 @@ That's it. For more information see [Yellow documentation](https://github.com/ma
License and a big thanks
------------------------
* Yellow and extensions by Mark Seuffert are licensed under [GPLv2](http://opensource.org/licenses/GPL-2.0)
* [PHP Markdown Extra](https://github.com/michelf/php-markdown) by Michel Fortin is licensed under [BSD license](http://opensource.org/licenses/BSD-3-Clause)
* [Font Awesome](https://github.com/FortAwesome/Font-Awesome) by Dave Gandy is licensed under [OFLv1.1](http://opensource.org/licenses/OFL-1.1)
* [PHP Markdown Extra](https://github.com/michelf/php-markdown) by Michel Fortin is licensed under [BSD license](http://opensource.org/licenses/BSD-3-Clause)

Binary file not shown.

View file

@ -1,4 +1,4 @@
/* Yellow web interface 0.2.1 */
/* Yellow web interface 0.2.2 */
.yellow-bar { position:relative; overflow:hidden; line-height:2.0em; }
.yellow-bar-left { display:block; float:left; }
@ -47,19 +47,6 @@
#yellow-pane-edit #yellow-edit-text { margin:0; padding:5px; border:1px solid #bbb; resize:none; font-size:0.9em }
#yellow-pane-edit #yellow-edit-info { margin:0; padding:5px; border:1px solid #bbb; display:none; }
#yellow-pane-edit #yellow-edit-buttons { margin:5px 0; }
#yellow-pane-show { min-width:20em; overflow:auto; }
#yellow-pane-user { }
.yellow-icon { width:16px; height:16px; display:inline-block; background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAA4UlEQVQoFZWQPQrCQBBGv80qwfyIIoKFhYWl1/EGFl5A7EyhIFgIgnZewpt4A5uAgoWIS0SMiRlJlqzZJtPMtzPvMbAsPqNUGaXoBC4tVJQL9gIsROQj2Kdzc4hqH2Ipsb8LTTge6lvwzo+w4O7AJExBFYI5ohtgwp7Q0hzBeEFsKGelCvEFYk2r2hi8B2cK4SEOMpg6K3yri/YJvIWPD9xxHeTpJKsXaPmAWFHnXYgZBbWKAvA8pMz7qML00glxWOTkRCfwRrpmXHIy6ATDyoTMlLjul3JLXdRd0HFyVlr4AhXBLDxuCuBRAAAAAElFTkSuQmCC); }
@font-face { font-family:'FontAwesome'; font-style:normal; font-weight:normal; src:url('core-fontawesome.woff'); }
[class*="yellow-icon-"] {
font-family:FontAwesome;
font-style:normal;
font-weight:normal;
-webkit-font-smoothing:antialiased;
}
.yellow-icon-search:before { content:"\f002"; }
.yellow-icon-trash-o:before { content:"\f014"; }
.yellow-icon-caret-down:before { content:"\f0d7"; }
.yellow-icon-caret-up:before { content:"\f0d8"; }

View file

@ -1,16 +1,16 @@
// Copyright (c) 2013 Datenstrom, http://datenstrom.se
// Copyright (c) 2013-2014 Datenstrom, http://datenstrom.se
// This file may be used and distributed under the terms of the public license.
// Yellow main API
var yellow =
{
version: "0.2.2",
version: "0.2.3",
onClick: function(e) { yellow.webinterface.hidePanesOnClick(yellow.toolbox.getEventElement(e)); },
onKeydown: function(e) { yellow.webinterface.hidePanesOnKeydown(yellow.toolbox.getEventKeycode(e)); },
onResize: function() { yellow.webinterface.resizePanes(); },
onShow: function(id) { yellow.webinterface.showPane(id); },
onLogout: function() { yellow.toolbox.submitForm({"action":"logout"}); },
webinterface:{}, page:{}, pages:{}, toolbox:{}, config:{}, text:{}
webinterface:{}, page:{}, toolbox:{}, config:{}, text:{}
}
// Yellow web interface
@ -40,7 +40,6 @@ yellow.webinterface =
{
yellow.toolbox.insertBefore(this.createBar("yellow-bar"), body.firstChild);
yellow.toolbox.insertAfter(this.createPane("yellow-pane-edit"), body.firstChild);
yellow.toolbox.insertAfter(this.createPane("yellow-pane-show"), body.firstChild);
yellow.toolbox.insertAfter(this.createPane("yellow-pane-user"), body.firstChild);
yellow.toolbox.setText(document.getElementById("yellow-edit-text"), yellow.page.rawData);
} else {
@ -64,12 +63,11 @@ yellow.webinterface =
var location = yellow.config.serverBase+yellow.config.pluginLocation;
elementBar.innerHTML =
"<div class=\"yellow-bar-left\">"+
"<a href=\"http://datenstrom.se/yellow/\" target=\"_blank\"><i class=\"yellow-icon\"></i> Yellow</a>"+
"<a href=\"https://github.com/markseu/yellowcms-extensions/blob/master/documentation/README.md\" target=\"_blank\"><i class=\"yellow-icon\"></i> Yellow</a>"+
"<a href=\"#\" onclick=\"yellow.onShow('yellow-pane-edit'); return false;\">"+this.getText("Edit")+"</a>"+
"<a href=\"#\" onclick=\"yellow.onShow('yellow-pane-show'); return false;\">"+this.getText("Show")+"</a>"+
"</div>"+
"<div class=\"yellow-bar-right\">"+
"<a href=\"#\" onclick=\"yellow.onShow('yellow-pane-user'); return false;\" id=\"yellow-username\">"+yellow.config.userName+" <i class=\"yellow-icon-caret-down\"></i></a>"+
"<a href=\"#\" onclick=\"yellow.onShow('yellow-pane-user'); return false;\" id=\"yellow-username\">"+yellow.config.userName+" &#9662;</a>"+
"</div>";
}
return elementBar;
@ -97,7 +95,6 @@ yellow.webinterface =
"</form>";
} else if(id == "yellow-pane-edit") {
elementDiv.innerHTML =
"<p>Editing page...</p>"+
"<form method=\"post\">"+
"<input type=\"hidden\" name=\"action\" value=\"edit\" />"+
"<textarea id=\"yellow-edit-text\" name=\"rawdata\"></textarea>"+
@ -106,19 +103,6 @@ yellow.webinterface =
"<input class=\"yellow-btn\" type=\"submit\" value=\""+this.getText("SaveButton")+"\" />"+
"</div>"+
"</form>";
} else if(id == "yellow-pane-show") {
elementDiv.innerHTML = "<p>Showing files...</p>";
var elementUl = document.createElement("ul");
for(var n in yellow.pages)
{
var elementLi = document.createElement("li");
var elementA = document.createElement("a");
elementA.setAttribute("href", yellow.pages[n]["location"]);
yellow.toolbox.setText(elementA, yellow.pages[n]["title"]);
elementLi.appendChild(elementA);
elementUl.appendChild(elementLi);
}
elementDiv.appendChild(elementUl);
} else if(id == "yellow-pane-user") {
elementDiv.innerHTML =
"<p>"+yellow.config.userEmail+"</p>"+
@ -208,11 +192,6 @@ yellow.webinterface =
var height3 = yellow.toolbox.getOuterHeight(document.getElementById("yellow-edit-text"));
yellow.toolbox.setOuterHeight(document.getElementById("yellow-edit-text"), height1 - height2 + height3);
}
if(yellow.toolbox.isVisible(document.getElementById("yellow-pane-show")))
{
yellow.toolbox.setOuterTop(document.getElementById("yellow-pane-show"), paneTop);
yellow.toolbox.setOuterHeight(document.getElementById("yellow-pane-show"), paneHeight, true);
}
if(yellow.toolbox.isVisible(document.getElementById("yellow-pane-user")))
{
yellow.toolbox.setOuterTop(document.getElementById("yellow-pane-user"), paneTop);

View file

@ -5,7 +5,7 @@
// Web interface core plugin
class YellowWebinterface
{
const Version = "0.2.5";
const Version = "0.2.6";
var $yellow; //access to API
var $users; //web interface users
var $activeLocation; //web interface location? (boolean)
@ -104,7 +104,6 @@ class YellowWebinterface
if($this->isUser())
{
$header .= "yellow.page.rawData = ".json_encode($this->yellow->page->rawData).";\n";
$header .= "yellow.pages = ".json_encode($this->getPagesData()).";\n";
$header .= "yellow.config = ".json_encode($this->getConfigData($this->activeUserEmail)).";\n";
}
$header .= "yellow.text = ".json_encode($this->yellow->text->getData("webinterface", $language)).";\n";
@ -251,20 +250,6 @@ class YellowWebinterface
{
return !empty($this->activeUserEmail);
}
// Return page tree with content information, two levels
function getPagesData()
{
$data = array();
foreach($this->yellow->pages->index(true, 2) as $page)
{
$data[$page->fileName] = array();
$data[$page->fileName]["location"] = $page->getLocation();
$data[$page->fileName]["modified"] = $page->getModified();
$data[$page->fileName]["title"] = $page->getHtml("title");
}
return $data;
}
// Return configuration data including user information
function getConfigData($email)