1. 程式人生 > >百度Ueditor富文字編輯器上傳圖片

百度Ueditor富文字編輯器上傳圖片

      <script type="text/javascript">
            window.UEDITOR_HOME_URL = '/resource/ueditor';
                    UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
                    editor = UE.getEditor('container',{
                        toolbars:[['Source', 'Undo', 'Redo', 'Bold', 'pasteplain',
                            'selectall','preview','time','date', 'simpleupload'
                        ]],  
           //關閉elementPath
           elementPathEnabled:false,
           //純文字貼上
           pasteplain: true,
           initialFrameHeight: 100,
           initialFrameWidth: 470,
           minFrameHeight: 100,
           initialContent: '',
           wordCount: true
       });
                   UE.Editor.prototype.getActionUrl = function(action) {
                        if (action == 'uploadimage') {
                            return '/file/upload_image';
                        } else {
                            return this._bkGetActionUrl.call(this, action);
                        }
                    }
</script>