1
我使用的是最新版本的TinyMCE,并且我希望在用户单击插入图像时集成Google Drive Picker。如何将Google Picker与TinyMCE集成?
从TinyMCE文档中我看到我应该使用file_browser_callback参数,但我遇到了一些问题。首先,我设法附加了Google Picker,但插入图像弹出窗口保留在顶部,我无法选择文件。即使我解决了这个问题,我该如何设置Google Picker回调函数中的文本框值?下面你可以看到我的代码,Google Picker code is pretty standard,所以我不会粘贴它。
var picker;
tinymce.init({
//other init parameters...
file_browser_callback: function(field_name, url, type, win) {
picker.setVisible(true);
win.document.getElementById(field_name).value = 'my browser value';
}
});
function createPicker() {
// Here I build the Picker...
// var picker = ...
}
function pickerCallback(data) {
//TODO: Find a way to set textbox value with the URL of the Image selected from Drive
}
干得不错,不敢相信我没想到:) – raz3r 2014-10-10 08:56:11
很高兴帮助... :) – Surya 2014-10-10 09:10:42