forked from enoyhs/TinyMCE-Simple-Image-Upload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
editor_plugin_src.js
41 lines (39 loc) · 1005 Bytes
/
editor_plugin_src.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* editor_plugin_src.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function() {
tinymce.create('tinymce.plugins.ImageUploadPlugin', {
init : function(ed, url) {
// Register commands
ed.addCommand('mceImageUpload', function() {
ed.windowManager.open({
file : url + '/upload.php',
inline : 0
}, {
plugin_url : url
});
});
// Register buttons
ed.addButton('imageupload', {
title : 'Upload Image',
image : url + '/img/upload-image.png',
cmd : 'mceImageUpload'
});
},
getInfo : function() {
return {
longname : 'Simple Image Upload',
author : 'enoyhs',
version : '0.0.1'
};
}
});
// Register plugin
tinymce.PluginManager.add('imageupload', tinymce.plugins.ImageUploadPlugin);
})();