PluginProbe
codoc / 0.6
codoc v0.6
0.9.8.8 0.9.8.9 0.9.9 0.9.9.1 trunk 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.8.1 0.8.2 0.8.3 0.8.4 0.8.6 0.8.7 0.8.8 0.8.9 0.9 0.9.1 0.9.10 0.9.11 All 114 releases
codoc / src_mce / codoc-editor.js

codoc-editor.js in codoc 0.6, at src_mce/codoc-editor.js

45 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function () {
2 tinymce.create('tinymce.plugins.Codoc', {
3 init: function (ed, url) {
4 ed.addButton('codoc', {
5 title: 'codocの記事一覧',
6 onclick: function () {
7 tb_show('codocの記事一覧:', 'admin-ajax.php?action=codoc_shortcodes&height=600&width=600' + '&_wpnonce=' + CODOCEDITOR.nonce);
8 jQuery('#TB_window').width(600);
9 jQuery('#TB_window').addClass('codocTB');
10
11 }
12 });
13 },
14 createControl: function (n, cm) {
15 return null;
16 },
17 getInfo: function () {
18 return {
19 longname: 'codoc Shortcodes',
20 author: 'codoc.jp',
21 authorurl: 'codoc.jp',
22 infourl: '',
23 version: '1.0'
24 };
25 }
26 });
27
28 tinymce.PluginManager.add('codoc', tinymce.plugins.Codoc);
29
30 jQuery(document).on('click', '.return_codoc_shortcode', function () {
31 var id = jQuery(this).data('id');
32 tinyMCE.activeEditor.execCommand('mceInsertContent', 0, '[codoc id="' + id + '"]');
33 tb_remove();
34 });
35
36 jQuery(document).on('click', '.submit-codoc-form', function () {
37 // todo
38 //alert(CODOCEDITOR.nonce)
39 var url = 'admin-ajax.php?action=codoc_shortcodes&height=600&width=600&usercode=' + jQuery('#codoc-usercode')[0].value + '&entrycode=' + jQuery('#codoc-entrycode')[0].value + '&_wpnonce=' + CODOCEDITOR.nonce;
40 tb_show('codocの記事一覧:',url);
41 jQuery('#TB_window').addClass('codocTB');
42 });
43
44 })();
45