loadOnController)) {
return false;
}
$html = ''.PHP_EOL;
$html .= ''.PHP_EOL;
$html .= ''.PHP_EOL;
return $html;
}
public function adminBodyEnd()
{
// Load Quill only on the selected controllers to keep perfomance
// For example, in the dashboard is not going to be included the Quill CSS and JS scripts.
if (!in_array($GLOBALS['ADMIN_CONTROLLER'], $this->loadOnController)) {
return false;
}
$script = <<
var quill;
// Function required for Media Manager to insert a file on the editor
function editorInsertMedia(filename) {
var Delta = Quill.import("delta");
quill.focus();
quill.updateContents(new Delta()
.retain(quill.getSelection().index)
.insert('')
);
}
// Function required for Autosave function
// Returns the content of the editor
function editorGetContent() {
return quill.container.firstChild.innerHTML;
}
$(document).ready(function() {
var content = $("#jscontent").val();
$("#jseditor").replaceWith("
"+content+"
");
quill = new Quill("#jseditor", {
modules: {
toolbar: [
[{ header: [1, 2, false] }],
['bold', 'italic', 'underline'],
['image', 'code-block']
]
},
placeholder: "Content, support Markdown and HTML.",
theme: "snow"
});
// Change button images event handler to open the Media Manager
quill.getModule("toolbar").addHandler("image", openMediaManager);
});
EOF;
return $script;
}
}