Add summernote WYSIWIG post editor (experimental)
This commit is contained in:
parent
f78db77a81
commit
a58c213a4e
34
js/loadsummernote.js
Normal file
34
js/loadsummernote.js
Normal file
@ -0,0 +1,34 @@
|
||||
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='summer-note' id='summernote'><input type='checkbox' /> Enable Summernote WYSIWYG Editor</label>")
|
||||
+ "</fieldset>");
|
||||
}
|
||||
|
||||
$('.summer-note').on('change', function(){
|
||||
var setting = $(this).attr('id');
|
||||
|
||||
localStorage[setting] = $(this).children('input').is(':checked');
|
||||
location.reload();
|
||||
});
|
||||
|
||||
if (!localStorage.summernote) {
|
||||
localStorage.summernote = 'false';
|
||||
}
|
||||
|
||||
function getSetting(key) {
|
||||
return (localStorage[key] == 'true');
|
||||
}
|
||||
|
||||
if (getSetting('summernote')) $('#summernote>input').prop('checked', 'checked');
|
||||
|
||||
function initsummernote() {
|
||||
if (!getSetting("summernote")) {return;}
|
||||
$('#body').summernote();
|
||||
}
|
||||
initsummernote();
|
||||
});
|
||||
}
|
7120
js/summernote.js
Normal file
7120
js/summernote.js
Normal file
File diff suppressed because it is too large
Load Diff
1
stylesheets/summernote.css
Normal file
1
stylesheets/summernote.css
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user