mikuli.cz

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

commit fbe8a9cfa1df9e3dd34ef54359a54f1e9678e0ee
parent 914a1fc28584dd32f3baccf066bdcabbfba923b3
Author: markseu <mark2011@mayberg.se>
Date:   Tue, 26 May 2015 11:50:38 +0200

Core update (Smultron remix)

Diffstat:
Msystem/core/core-webinterface.js | 25++++++++++++++-----------
Msystem/core/core-webinterface.php | 41++++++++++++++++++++++-------------------
2 files changed, 36 insertions(+), 30 deletions(-)

diff --git a/system/core/core-webinterface.js b/system/core/core-webinterface.js @@ -37,18 +37,21 @@ yellow.webinterface = if(body && body.firstChild && !this.loaded) { this.loaded = true; - if(yellow.debug) console.log("yellow.webinterface.load email:"+yellow.config.userEmail+" "+yellow.config.userName); - if(yellow.config.userEmail) + if(yellow.config.webinterfaceLocation) { - this.createBar("yellow-bar", true, body.firstChild); - this.createPane("yellow-pane-edit", true, body.firstChild); - this.createPane("yellow-pane-user", true, body.firstChild); - yellow.toolbox.addEvent(document.getElementById("yellow-pane-edit-page"), "keyup", yellow.onUpdate); - yellow.toolbox.addEvent(document.getElementById("yellow-pane-edit-page"), "change", yellow.onUpdate); - } else { - this.createBar("yellow-bar", false, body.firstChild); - this.createPane("yellow-pane-login", false, body.firstChild); - if(yellow.config.login) this.showPane("yellow-pane-login"); + if(yellow.debug) console.log("yellow.webinterface.load email:"+yellow.config.userEmail+" "+yellow.config.userName); + if(yellow.config.userEmail) + { + this.createBar("yellow-bar", true, body.firstChild); + this.createPane("yellow-pane-edit", true, body.firstChild); + this.createPane("yellow-pane-user", true, body.firstChild); + yellow.toolbox.addEvent(document.getElementById("yellow-pane-edit-page"), "keyup", yellow.onUpdate); + yellow.toolbox.addEvent(document.getElementById("yellow-pane-edit-page"), "change", yellow.onUpdate); + } else { + this.createBar("yellow-bar", false, body.firstChild); + this.createPane("yellow-pane-login", false, body.firstChild); + if(yellow.config.login) this.showPane("yellow-pane-login"); + } } clearInterval(this.intervalId); } diff --git a/system/core/core-webinterface.php b/system/core/core-webinterface.php @@ -93,27 +93,30 @@ class YellowWebinterface { $location = $this->yellow->config->getHtml("serverBase").$this->yellow->config->getHtml("pluginLocation"); $output = "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"{$location}core-webinterface.css\" />\n"; - $output .= "<script type=\"text/javascript\" src=\"{$location}core-webinterface.js\"></script>\n"; - $output .= "<script type=\"text/javascript\">\n"; - $output .= "// <![CDATA[\n"; - if($this->isUser()) + if($this->users->getNumber()) { - $output .= "yellow.page.title = ".json_encode($this->getDataTitle($this->rawDataEdit)).";\n"; - $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"; + $output .= "<script type=\"text/javascript\" src=\"{$location}core-webinterface.js\"></script>\n"; + $output .= "<script type=\"text/javascript\">\n"; + $output .= "// <![CDATA[\n"; + if($this->isUser()) + { + $output .= "yellow.page.title = ".json_encode($this->getDataTitle($this->rawDataEdit)).";\n"; + $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"; + } + $output .= "yellow.config = ".json_encode($this->getDataConfig()).";\n"; + $language = $this->isUser() ? $this->users->getLanguage() : $this->yellow->page->get("language"); + if(!$this->yellow->text->isLanguage($language)) $language = $this->yellow->config->get("language"); + $output .= "yellow.text = ".json_encode($this->yellow->text->getData("webinterface", $language)).";\n"; + if(defined("DEBUG")) $output .= "yellow.debug = ".json_encode(DEBUG).";\n"; + $output .= "// ]]>\n"; + $output .= "</script>\n"; } - $output .= "yellow.config = ".json_encode($this->getDataConfig()).";\n"; - $language = $this->isUser() ? $this->users->getLanguage() : $this->yellow->page->get("language"); - if(!$this->yellow->text->isLanguage($language)) $language = $this->yellow->config->get("language"); - $output .= "yellow.text = ".json_encode($this->yellow->text->getData("webinterface", $language)).";\n"; - if(defined("DEBUG")) $output .= "yellow.debug = ".json_encode(DEBUG).";\n"; - $output .= "// ]]>\n"; - $output .= "</script>\n"; } return $output; }