Froala编辑器 - 插入多张图片

3

我正在使用Froala编辑器,在尝试插入多张图片时遇到了问题。问题是只有第一张图片被插入,而不是其他的图片。我在网上搜索了答案,但是找不到任何有用的信息。是否可能同时插入多张图片?

以下是我的代码:

function show() {
    $current_image = editor.image.get();

    var image = {
        id: 0
    }

    angular
        .element($('html'))
        .scope()
        .showImageManager(image)
        .then(function (imageList) {                    
            for (var i = 0; i < imageList.length; i++) {              
                    insert(imageList[i].url);                         
            }
        });
}

function insert(url) {
    if (!$current_image) {
        // Make sure we have focus.
        editor.events.focus(true);
        editor.selection.restore();
    }
    else {
        $current_image.trigger('click');
    }

    editor.undo.saveStep();
    editor.image.insert(url, false, {}, $current_image, { });
}
2个回答

0

我已经手动解决了多图上传问题。

请找到附加的image.min.js文件,并将其替换为floara编辑器的image.min.js。

对我来说,它很好用。如果您有任何问题,请告诉我,我会根据您的要求进行更新。 请将image.min.txt更改为image.min.js。

image.min.txt

谢谢。
Sanjay Parmar


0
为了解决这个问题,我创建了适用于Froala Editor的插件 - Images Multi Upload
该插件使用来自image.js插件的选项,并允许将多张图片发送到服务器。
祝使用愉快!

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接