-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathplugin.js
54 lines (49 loc) · 1.29 KB
/
plugin.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
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
* QR code - a TinyMCE 4 QR code wizzard
* qrcode/plugin.js
*
*
* Plugin info: http://www.cfconsultancy.nl/
* Author: Ceasar Feijen
*
* Version: 1.0 released 15/09/2013
*/
tinymce.PluginManager.add('qrcode', function(editor) {
function openmanager() {
var title="Create QRcode";
if (typeof tinymce.settings.qrcode_title !== "undefined" && tinymce.settings.qrcode_title) {
title=tinymce.settingsqrcode_title;
}
win = editor.windowManager.open({
title: title,
file: tinyMCE.baseURL + '/plugins/qrcode/qrcode.html',
filetype: 'image',
width: 650,
height: 510,
inline: 1,
buttons: [{
text: 'cancel',
onclick: function() {
this.parent()
.parent()
.close();
}
}]
});
}
editor.addButton('qrcode', {
icon: true,
image: tinyMCE.baseURL + '/plugins/qrcode/icon.png',
tooltip: 'Create QRcode',
shortcut: 'Ctrl+QR',
onclick: openmanager
});
editor.addShortcut('Ctrl+QR', '', openmanager);
editor.addMenuItem('qrcode', {
icon:'media',
text: 'Create QRcode',
shortcut: 'Ctrl+QR',
onclick: openmanager,
context: 'insert'
});
});