Files
leanote/public/tinymce/plugins/leanote_image/plugin.js

33 lines
753 B
JavaScript
Raw Normal View History

2014-05-07 13:06:24 +08:00
/**
* 图片上传插件
* 结合了原tinymce image插件
* 添加了input上传和拖拽上传
* http://leanote.com
*/
tinymce.PluginManager.add('leanote_image', function(editor, url) {
// 弹框
function showDialog() {
/*
win = editor.windowManager.open({
title: 'Insert/edit image',
file : url + '/dialog.html',
width : 550,
height: 345
});
*/
showDialog2("#imageDialog", {postShow:function() {
$("#imageDialog iframe").attr("src", url + '/dialog.html');
}});
}
// 添加按钮
editor.addButton('leanote_image', {
icon: 'image',
tooltip: 'ctrl+shift+i 插入/修改图片',
onclick: showDialog,
stateSelector: 'img:not([data-mce-object])'
});
editor.addShortcut('ctrl+shift+i', '', showDialog);
});