1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-06 14:16:46 +02:00

Version 1.2.19: Modularized Visual Editor

This commit is contained in:
trendschau
2019-11-24 07:25:04 +01:00
parent e1c16529e5
commit 126106bccb
54 changed files with 801 additions and 1465 deletions

View File

@@ -8,11 +8,14 @@ class Assets
public function __construct($baseUrl)
{
$this->baseUrl = $baseUrl;
$this->JS = array();
$this->CSS = array();
$this->inlineJS = array();
$this->inlineCSS = array();
$this->baseUrl = $baseUrl;
$this->JS = array();
$this->CSS = array();
$this->inlineJS = array();
$this->inlineCSS = array();
$this->editorJS = array();
$this->editorInlineJS = array();
$this->svgSymbols = array();
}
public function addCSS($CSS)
@@ -75,6 +78,11 @@ class Assets
}
}
public function addSvgSymbol($symbol)
{
$this->svgSymbols[] = $symbol;
}
public function renderCSS()
{
return implode('', $this->CSS) . implode('', $this->inlineCSS);
@@ -85,6 +93,32 @@ class Assets
return implode('', $this->JS) . implode('', $this->inlineJS);
}
public function renderSvg()
{
return implode('', $this->svgSymbols);
}
# add JS to enhance the blox-editor in author area
public function addEditorJS($JS)
{
$JSfile = $this->getFileUrl($JS);
if($JSfile)
{
$this->editorJS[] = '<script src="' . $JSfile . '"></script>';
}
}
public function addEditorInlineJS($JS)
{
$this->editorInlineJS[] = '<script>' . $JS . '</script>';
}
public function renderEditorJS()
{
return implode('', $this->editorJS) . implode('', $this->editorInlineJS);
}
/**
* Checks, if a string is a valid internal or external ressource like js-file or css-file
* @params $path string