-
TinyMCE 사진 넣기/업로드Django 2021. 1. 21. 19:16
TinyMCE photo upload
recipecontent_form.html
< script > tinymce.init({ selector: "textarea", theme: "modern", height: 500, paste_data_images: true, plugins: [ "advlist autolink lists link image charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code fullscreen", "insertdatetime media nonbreaking save table contextmenu directionality", "emoticons template paste textcolor colorpicker textpattern" ], toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", toolbar2: "print preview media | forecolor backcolor emoticons", image_advtab: true, file_picker_callback: function (callback, value, meta) { if (meta.filetype == 'image') { $('#upload').trigger('click'); $('#upload').on('change', function () { var file = this.files[0]; var reader = new FileReader(); reader.onload = function (e) { callback(e.target.result, { alt: '' }); }; reader.readAsDataURL(file); }); } }, templates: [{ title: 'Test template 1', content: 'Test 1' }, { title: 'Test template 2', content: 'Test 2' }] });
'Django' 카테고리의 다른 글
Django ajax 좋아요 구현 (0) 2021.01.22 youtube API를 통해 동영상 검색하고, 검색 결과 TinyMCE 삽입하기 (0) 2021.01.22 한 뷰 안에 여러개의 페이지네이션 구현 (0) 2021.01.22 [error] 첨부파일 에러 (0) 2021.01.22