I used the last version of ueditor1.3.6, since the 1.4.2 version, "Front-end upload Module Unified use Webuploader", ueditor in the multi-image upload has been considering the problem of missing the picture order.
My website in the user uploads the picture article when, uses the multi-image uploads, the point confirmation, the edit box picture order is disorderly.
See Webuploader problem is multi-threaded upload, ueditor to "uploadsuccess" processing is a successful upload, added to the array, so if the picture upload complete order is chaotic, the final addition of the text box in the Order of chaos.
I have modified the JS here for your reference, I hope ueditor can improve the problem:
Vim Dialogs/image/image.js
716 Uploader.on (' uploadsuccess ', function (file, ret) {
717 var $file = $ (' # ' + file.id);
718 try {
719 var responsetext = (Ret._raw | | ret),
720 JSON = Utils.str2json (responsetext);
721 if (json.state = = ' SUCCESS ') {
722 _this.imagelist[$file. Index ()] = JSON; Modified here: stored in the order of the selected file list.
723 $file. Append (");
724} else {
725 $file. Find ('. Error '). Text (Json.state). Show ();
726}
727} catch (e) {
728 $file. Find ('. Error '). Text (Lang.errorserverupload). Show ();
729}
730});
for Dialogs/image/image.js, if the ln:722 line is modified as described above, then Ln : 769 rows or so of the getinsertlist function should also be modified synchronously. Avoid this type of situation: arr = [];arr[0]=obj0;arr[2]=obj2; then try to read Arr[1] properties.
Getinsertlist:function () {
var i, data, List = [],
align = Getalign (),
prefix = editor.getopt (' Imageurlprefix ');
for (i = 0; i < this.imageList.length; i++) {
data = This.imagelist[i];
if (data = = undefined) {//is derived from the modification of line: (722 or 721), to avoid partial image upload failure, or to select a picture that does not conform to the specification cannot participate in the upload resulting in the ImageList array undefined items appear
Continue
}
List.push ({
Src:prefix + Data.url,
_src:prefix + Data.url,
Title:data.title,
Alt:data.original,
Floatstyle:align
});
}
return list;
}
Baidu Editor multi-image batch Upload order confusion problem Ueditor