summernote icon indicating copy to clipboard operation
summernote copied to clipboard

插入图片时,选择图片好像很慢才能跳出来,怎么解决

Open onlyou opened this issue 10 years ago • 9 comments

steps to reproduce

1. 2. 3.

browser version and os version

What is your browser and OS?

screenshot of issue

add screenshots which shows your issue(if needed). You can make gif from Recordit.

onlyou avatar Nov 18 '16 14:11 onlyou

Plz write a title in English

leon0707 avatar Nov 18 '16 17:11 leon0707

大神,英文不好,有没有具体点的解法方法,或者代码也行,多谢!!!

onlyou avatar Nov 19 '16 02:11 onlyou

I have a google. I have a translator. Ugh. Google Translator. I have an issue. I have Chinese. Ugh. Issue in Chinese. Chinese issue translated by Google!

Title: Insert pictures, select the picture seems to be very slow to jump out, how to solve

Commend: Great God, English is not good, there is no specific point of the solution method, or the code line, thank you

lqez avatar Nov 21 '16 08:11 lqez

@onlyou As @alex1007 said, I (and we) might misunderstand your exact problem if you keep describing in Chinese. And I cannot speak in Chinese and you'll have to use some translators vice versa. And this is also applied for other languages. I and other contributors are mostly Korean, but we're trying not to use Korean and translate it in English for other developers.

BTW, following the translated text, it looks like you embedded a large picture. Need more information for investigation. Thanks.

lqez avatar Nov 21 '16 09:11 lqez

@alex1007 @lqez steps to reproduce: 1.When I want to insert a picture, point to select the file, the page pops up too slowly

browser version and os version Chrome Ubuntu 14.04LTS

diandianJJYY avatar Nov 28 '16 11:11 diandianJJYY

meet the same problem :) it seems like a problem of Chorme on the lateset version. when we use attribute accept="image/*" in <input> tag,the page will pops up slowly. so,just replace <input type="file" accept="image/*"> with <input type="file" accept="image/jpg,image/jpeg,image/png"> or something else MIME type you need. it will be resolved. first write issue,sorry for my poor english :) reference:input['file'] accept=“image/*” open dialog so slow with Chrome

以下是中文: 貌似是Chrome的问题,想办法把 <input type="file" accept="image/*"> 换成<input type="file" accept="image/jpg,image/jpeg,image/png">就行了。

fry95116 avatar Nov 29 '16 10:11 fry95116

Try Another Version!!

@onlyou

「Talk is cheap. Show you the code」

Html tag as bellow: <textarea id="summernote" class="summernote" name="description" placeholder="this is a demo" > </textarea>

All my javascript code as bellow: $(document).ready(function () { $(".summernote").summernote({ popover: { image: [ ['imagesize', ['imageSize100', 'imageSize50', 'imageSize25']], ['float', ['floatLeft', 'floatRight', 'floatNone']], ['custom', ['imageAttributes', 'imageShape']], ['remove', ['removeMedia']] ], }, lang: 'zh-CN', minHeight: 300, dialogsFade: true,// Add fade effect on dialogs dialogsInBody: true,// Dialogs can be placed in body, not in disableDragAndDrop: false,// default false You can disable drag and drop callbacks: { onImageUpload: function (files) { var $files = $(files); var $this = $(this); $files.each(function () { var file = this; var data = new FormData(); data.append("file", file); $.ajax({ data: data, type: "POST", url: "/publish-upload-file", cache: false, contentType: false, processData: false, success: function (response) { $this.summernote('insertImage','http://myfileserver/'+response, function ($image) {}); }, error: function (xhr, ajaxOptions, thrownError) { if (xhr.responseText) { toastr.error(xhr.responseText, 'Inconceivable!') } else { console.error("

Http status: " + xhr.status + " " + xhr.statusText + "
" + "
ajaxOptions: " + ajaxOptions + "
" + "
thrownError: " + thrownError + "
"); } } }); }); } } }); }); `

devpage avatar Dec 09 '16 15:12 devpage

This is a bug of Chrome which could be reproduced in China Great Network

https://stackoverflow.com/questions/39187857/inputfile-accept-image-open-dialog-so-slow-with-chrome

sunzhongwei avatar Sep 30 '17 02:09 sunzhongwei

$(document).ready(function() {
    $('#summernote').summernote();
    $('.note-image-input').prop('accept', 'image/jpeg, image/jpg, image/png, image/gif');
});

ghost avatar Nov 02 '17 23:11 ghost