define function if the editor is not enabled
This commit is contained in:
parent
d847b58907
commit
8b0ff80efb
|
@ -271,7 +271,7 @@ td.child {
|
||||||
padding: 10px 5% !important;
|
padding: 10px 5% !important;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 1.5em;
|
line-height: 1.5em;
|
||||||
|
border: 1px solid #ced4da;
|
||||||
}
|
}
|
||||||
|
|
||||||
#jseditorSidebar {
|
#jseditorSidebar {
|
||||||
|
|
|
@ -382,6 +382,19 @@ echo Bootstrap::formOpen(array(
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
// Define function if they doesn't exist
|
||||||
|
// This helps if the user doesn't activate any plugin as editor
|
||||||
|
if (typeof editorGetContent != "function") {
|
||||||
|
window.editorGetContent = function(){
|
||||||
|
return $("#jseditor").val();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (typeof editorInsertMedia != "function") {
|
||||||
|
window.editorInsertMedia = function(filename){
|
||||||
|
$("#jseditor").val($('#jseditor').val()+'<img src="'+filename+'" alt="">');
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Button Save
|
// Button Save
|
||||||
$("#jsbuttonSave").on("click", function() {
|
$("#jsbuttonSave").on("click", function() {
|
||||||
// If the switch is setted to "published", get the value from the selector
|
// If the switch is setted to "published", get the value from the selector
|
||||||
|
|
|
@ -328,6 +328,19 @@ echo Bootstrap::formOpen(array(
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
// Define function if they doesn't exist
|
||||||
|
// This helps if the user doesn't activate any plugin as editor
|
||||||
|
if (typeof editorGetContent != "function") {
|
||||||
|
window.editorGetContent = function(){
|
||||||
|
return $("#jseditor").val();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (typeof editorInsertMedia != "function") {
|
||||||
|
window.editorInsertMedia = function(filename){
|
||||||
|
$("#jseditor").val($('#jseditor').val()+'<img src="'+filename+'" alt="">');
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Button Save
|
// Button Save
|
||||||
$("#jsbuttonSave").on("click", function() {
|
$("#jsbuttonSave").on("click", function() {
|
||||||
// If the switch is setted to "published", get the value from the selector
|
// If the switch is setted to "published", get the value from the selector
|
||||||
|
|
Loading…
Reference in New Issue