0

我像这里使用的那样使用 WMD 编辑器。

我有一个通过弹出窗口完成的自定义上传功能,并自动处理降价的插入,例如 wmd 编辑器根本不需要处理。

我已经使用了文档中示例中描述的编辑器钩子,但我仍然无法弄清楚如何禁用/删除默认显示的提示背景...(单击时在此处使用的相同背景/覆盖图像按钮等)

这是我的代码:

    // initialize the editor
    var editor1 = new Markdown.Editor(converter1, "", options);

    //customize upload button on button bar... remove default functionality, activate popup on click
    editor1.hooks.set("insertImageDialog", function (callback) {

        var a = $('#wmd-button-bar').data('stgt');
        popup('/inc_upload.asp?t=' + a, 'Upload a File', 350, 500);

        return true; // tell the editor that we'll take care of getting the image url
    });

editor1.run();
4

1 回答 1

1

想通了,我只需要一个空回调。

// initialize the editor
var editor1 = new Markdown.Editor(converter1, "", options);

//customize upload button on button bar... remove default functionality, activate popup on click
editor1.hooks.set("insertImageDialog", function (callback) {

    var a = $('#wmd-button-bar').data('stgt');
    popup('/inc_upload.asp?t=' + a, 'Upload a File', 350, 500);
    callback(null);
    return true; // tell the editor that we'll take care of getting the image url
});

 editor1.run();
于 2016-05-26T00:17:20.723 回答