본문 바로가기

Story/Javascript

위지윅 에디터 KindEditor 에서 옵션값 변경 샘플

반응형

var editor = null;
    setTimeout(function () {
        editor = KindEditor.create('#' + editorId, {
            resizeType: 1,
            uploadJson: 'kindeditor/upload_json.ashx',
            fileManagerJson: 'kindeditor/file_manager_json.ashx',
            allowPreviewEmoticons: false,
            allowImageUpload: true,
            items: [
      'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
      'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
      'insertunorderedlist', '|', 'emoticons', 'image', 'link']
        });
    }, 1);

 

 

 

 

<html>
<head>
<meta charset="utf-8" />
<title>FileManager Examples</title>
<link rel="stylesheet" href="../themes/default/default.css" />
<script src="../kindeditor.js"></script>
<script>
KindEditor.ready(function(K) {
    var editor = K.editor({
        fileManagerJson : '../php/file_manager_json.php'
    });
 
    K('#filemanager').click(function() {
        editor.loadPlugin('filemanager', function() {
            editor.plugin.filemanagerDialog({
                viewType : 'VIEW',
                dirName : 'image',
                clickFn : function(url, title) {
                    K('#url').val(url);
                    editor.hideDialog();
                }
            });
        });
    });
});
</script>
</head>
 
<body>
<input type="text" id="url" value="" /> <input type="button" id="filemanager" value="서버파일" />
</body>
 
</html>
 

반응형