에디터 변경

This commit is contained in:
2018-08-30 22:02:51 +09:00
parent b7a570cba2
commit c785027c5c
86 changed files with 8228 additions and 7419 deletions
+21 -44
View File
@@ -4,9 +4,7 @@
jQuery(function($){
jQuery.trumbowyg.langs.ko.fontFamily = '글꼴';
function guiEditorInit($obj, editable){
function guiEditorInit($obj, editable){
var $submitBtn = $obj.find('.submit');
var $noticeInput = $obj.find('.input_form');
var $editForm = $obj.find('.edit_form');
@@ -17,51 +15,30 @@ function guiEditorInit($obj, editable){
function enableEditor(){
editMode = true;
$cancelEdit.show();
$editForm.removeClass('viewer').trumbowyg({
autogrow: true,
autogrowOnEnter: true,
lang: 'ko',
removeformatPasted: true,
imageWidthModalEdit: true,
minimalLinks: true,
btns: [
['viewHTML'],
['undo', 'redo'], // Only supported in Blink browsers
['formatting'],
['fontfamily', 'fontsize'],
['foreColor', 'backColor'],
['emoji'],
['strong', 'em', 'del'],
['link'],
['insertImage'],
['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],
['unorderedList', 'orderedList'],
['horizontalRule'],
['removeformat'],
['fullscreen']
$editForm.removeClass('viewer').summernote({
minHeight:200,
maxHeight:null,
focus:true,
lang:'ko-KR',
toolbar: [
// [groupName, [list of button]]
['do', ['undo', 'redo']],
['style', ['bold', 'italic', 'underline', 'clear']],
['font2', ['fontname', 'fontsize']],
['font', ['strikethrough', 'superscript', 'subscript']],
['color', ['color']],
['in', ['picture', 'link', 'video', 'table', 'hr']],
['para', ['ul', 'ol', 'paragraph']],
['height', ['height', 'codeview']]
],
plugins: {
fontfamily : {
fontList:[
{name:'맑은 고딕', family:"'맑은 고딕'"},
{name:'나눔 고딕', family:"'Nanum Gothic', sans-serif"},
{name:'나눔 명조', family:"'Nanum Myeongjo', serif"},
{name:'나눔손글씨 펜체', family:"'Nanum Pen Script', cursive"},
{name:'굴림', family:"'굴림'"},
{name:'굴림체', family:"'굴림체'"},
{name:'바탕', family:"'바탕'"},
{name:'바탕체', family:"'바탕체'"},
{name:'궁서', family:"'궁서'"},
{name:'궁서체', family:"'궁서체'"},
]
}
},
}).trumbowyg('html', $noticeInput.val());
fontNames: ['맑은 고딕', 'Nanum Gothic', 'Nanum Myeongjo', 'Nanum Pen Script', '굴림', '굴림체', '바탕', '바탕체', '궁서', '궁서체']
}).summernote('code', $noticeInput.val());
}
function disableEditor(){
editMode = false;
$editForm.trumbowyg('destroy');
$editForm.summernote('destroy');
$cancelEdit.hide();
$editForm.html($noticeInput.val()).addClass('viewer');
}
@@ -81,7 +58,7 @@ function guiEditorInit($obj, editable){
enableEditor();
return false;
}
$noticeInput.val($editForm.trumbowyg('html'));
$noticeInput.val($editForm.summernote('code'));
});
$cancelEdit.click(function(e){