I figured it was about time to put something on my domain instead of a blank HTML file, so installed WonderCMS and absolutely love how easy it is.
(after cpanel install i realised checking this project out LOOOONG time ago lol!)
I was wondering though, is there any right/wrong approach of doing a plugin?
I looked at a the ones out on github, and came up with this example:
Code: Select all
$('#content').one('click', function() {
(a = $(this)), (title = a.attr('id'));
setTimeout(() => {
let UpDaTe = a.children(':first').attr('onblur');
console.log(UpDaTe);
a.children(':first').removeAttr('onblur');
let simplemde = new SimpleMDE({
element: $('textarea')[0],
toolbar: [
{
name: 'save', // saving simplemde back to wondercms
action: function(editor) {
fieldSave(a.attr('id'), editor.value(), a.data('target'), a.data('menu'), a.data('visibility'));
},
className: 'fa fa-save',
title: 'Save!',
},
],
});
}, 100);
});
It works in any case:
![Image](https://mjxl.net/simplemde.png)