fix for editor and height 100%

This commit is contained in:
Diego Najar 2018-10-18 22:40:35 +02:00
parent 68bea24530
commit 13605eb315
7 changed files with 96 additions and 84 deletions

View File

@ -6,7 +6,7 @@ AddDefaultCharset UTF-8
RewriteEngine on
# Base directory
# RewriteBase /
RewriteBase /
# Deny direct access to the next directories
RewriteRule ^bl-content/(databases|workspaces|pages|tmp)/.*$ - [R=404,L]

View File

@ -254,4 +254,5 @@ td.child {
padding: 10px 5% !important;
font-size: 16px;
line-height: 1.5em;
border: 1px solid #ccc;
}

View File

@ -67,7 +67,7 @@
</div>
<!-- RIGHT MAIN -->
<div class="col-lg-10 pt-3 h-100">
<div class="col-lg-10 pt-3 pb-1 h-100">
<?php
if (Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php')) {
include(PATH_ADMIN_VIEWS.$layout['view'].'.php');

View File

@ -69,7 +69,7 @@ echo Bootstrap::formOpen(array(
</div>
<!-- Editor -->
<div id="jseditor" class="editable h-100" style=""></div>
<div id="jseditor" class="editable h-100 mb-1"></div>
<!-- Modal for Cover Image -->
<div id="jscoverImageModal" class="modal" tabindex="-1" role="dialog">

View File

@ -1,37 +1,12 @@
body {
padding: 10px 5% !important;
font-size: 16px;
.mce-tinymce,
.mce-stack-layout,
.mce-edit-area{
display: flex!important;
flex-direction: column;
flex: 1;
align-items:stretch;
}
.mce-content-body img {
max-width: 100%;
height: auto;
.mce-tinymce iframe{
flex: 1;
}
.mce-content-body .mce-pagebreak {
height: 5px !important;
}
.mce-content-body a {
color: #4a90e2;
text-decoration: none;
}
.mce-content-body p,
.mce-content-body div,
.mce-content-body h1,
.mce-content-body h2,
.mce-content-body h3,
.mce-content-body h4,
.mce-content-body h5,
.mce-content-body h6,
.mce-content-body ul {
line-height: 1.5em;
}
.mce-content-body blockquote p {
padding: 10px 20px;
margin: 0 0 20px;
border-left: 5px solid #eee;
font-style: italic;
}

View File

@ -0,0 +1,37 @@
body.mce-content-body {
padding: 10px 5% !important;
font-size: 16px;
}
.mce-content-body img {
max-width: 100%;
height: auto;
}
.mce-content-body .mce-pagebreak {
height: 5px !important;
}
.mce-content-body a {
color: #4a90e2;
text-decoration: none;
}
.mce-content-body p,
.mce-content-body div,
.mce-content-body h1,
.mce-content-body h2,
.mce-content-body h3,
.mce-content-body h4,
.mce-content-body h5,
.mce-content-body h6,
.mce-content-body ul {
line-height: 1.5em;
}
.mce-content-body blockquote p {
padding: 10px 20px;
margin: 0 0 20px;
border-left: 5px solid #eee;
font-style: italic;
}

View File

@ -40,25 +40,29 @@ class pluginTinymce extends Plugin {
public function adminHead()
{
// Load the plugin only in the controllers setted in $this->loadOnController
if (!in_array($GLOBALS['ADMIN_CONTROLLER'], $this->loadOnController)) {
return false;
}
return '<script src="'.$this->htmlPath().'tinymce/tinymce.min.js"></script>';
$html = '<link rel="stylesheet" href="'.$this->htmlPath().'css/bludit.css">'.PHP_EOL;
$html .= '<script src="'.$this->htmlPath().'tinymce/tinymce.min.js"></script>';
return $html;
}
public function adminBodyEnd()
{
global $L;
// Load the plugin only in the controllers setted in $this->loadOnController
if (!in_array($GLOBALS['ADMIN_CONTROLLER'], $this->loadOnController)) {
return false;
}
// Load object $language
global $L;
$toolbar1 = $this->getValue('toolbar1');
$toolbar2 = $this->getValue('toolbar2');
$min_height = '760';
$content_css = $this->htmlPath().'css/bludit.css';
$content_css = $this->htmlPath().'css/tinymce.css';
$plugins = $this->getValue('plugins');
$lang = 'en';
@ -74,55 +78,50 @@ class pluginTinymce extends Plugin {
$document_base_url = '';
}
$script = <<<EOF
$html = <<<EOF
<script>
// Function required for Media Manager
// Insert an image on the editor in the cursor position
function editorInsertMedia(filename) {
tinymce.activeEditor.insertContent("<img src=\""+filename+"\" alt=\"\">");
}
// Insert an image in the editor in the cursor position
// Function required for Bludit
function editorInsertMedia(filename) {
tinymce.activeEditor.insertContent("<img src=\""+filename+"\" alt=\"\">");
}
// Function required for Autosave function
// Returns the content of the editor
function editorGetContent() {
return tinymce.get('jseditor').getContent();
}
// Returns the content of the editor
// Function required for Bludit
function editorGetContent() {
return tinymce.get('jseditor').getContent();
}
function resizeEditor() {
var editor = tinymce.activeEditor;
editor.theme.resizeTo("100%", "500px");
}
tinymce.init({
selector: "#jseditor",
auto_focus: "jseditor",
theme: "modern",
skin: "bludit",
element_format : "html",
entity_encoding : "raw",
schema: "html5",
statusbar: false,
menubar:false,
branding: false,
browser_spellcheck: true,
pagebreak_separator: PAGE_BREAK,
paste_as_text: true,
remove_script_host: false,
convert_urls: true,
relative_urls: false,
$document_base_url
plugins: ["$plugins"],
toolbar1: "$toolbar1",
toolbar2: "$toolbar2",
language: "$lang",
content_css : "$content_css",
height: 200
});
tinymce.init({
selector: "#jseditor",
auto_focus: "jseditor",
theme: "modern",
skin: "bludit",
element_format : "html",
entity_encoding : "raw",
schema: "html5",
statusbar: false,
menubar:false,
branding: false,
browser_spellcheck: true,
pagebreak_separator: PAGE_BREAK,
paste_as_text: true,
remove_script_host: false,
convert_urls: true,
relative_urls: false,
$document_base_url
plugins: ["$plugins"],
toolbar1: "$toolbar1",
toolbar2: "$toolbar2",
language: "$lang",
content_css : "$content_css",
height: "200px"
});
</script>
EOF;
return $script;
return $html;
}
}