forked from leftypol/leftypol
Add tinymce WYSIWIG post editor (experimental)
This commit is contained in:
parent
8346795054
commit
2fecc4a6a8
86 changed files with 2315 additions and 0 deletions
36
js/loadtinymce.js
Normal file
36
js/loadtinymce.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
if (active_page === "thread" || active_page === "index" || active_page === "ukko") {
|
||||
|
||||
$(document).on("ready", function() {
|
||||
if (window.Options && Options.get_tab('general')) {
|
||||
Options.extend_tab("general",
|
||||
"<fieldset><legend>Editor Dialog </legend>"
|
||||
+ ("<label class='tinymcec' id='tinymce'><input type='checkbox' /> Enable TinyMCE WYSIWYG Editor</label>")
|
||||
+ "</fieldset>");
|
||||
}
|
||||
|
||||
$('.tinymcec').on('change', function(){
|
||||
var setting = $(this).attr('id');
|
||||
|
||||
localStorage[setting] = $(this).children('input').is(':checked');
|
||||
location.reload();
|
||||
});
|
||||
|
||||
if (!localStorage.tinymce) {
|
||||
localStorage.tinymce = 'false';
|
||||
}
|
||||
|
||||
function getSetting(key) {
|
||||
return (localStorage[key] == 'true');
|
||||
}
|
||||
|
||||
if (getSetting('tinymce')) $('#tinymce>input').prop('checked', 'checked');
|
||||
|
||||
function inittinymce() {
|
||||
if (!getSetting("tinymce")) {return;}
|
||||
tinymce.init({
|
||||
selector: 'body'
|
||||
});
|
||||
}
|
||||
inittinymce();
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue