4 * @author Laurel A. Williams
\r
5 * @copyright Copyright © 2008, ATutor, All rights reserved.
\r
10 // Load plugin specific language pack
\r
11 tinymce.PluginManager.requireLangPack('insert_tag');
\r
13 tinymce.create('tinymce.plugins.Insert_tagPlugin', {
\r
15 * Creates control instances based in the incoming name. This method is
\r
16 * normally not needed since the addButton method of the tinymce.Editor
\r
17 * class is a more easy way of adding buttons but you sometimes need to
\r
18 * create more complex controls like listboxes, split buttons etc then
\r
19 * this method can be used to create those.
\r
22 * n Name of the control to create.
\r
23 * @param {tinymce.ControlManager}
\r
24 * cm Control manager to use to create new control.
\r
25 * @return {tinymce.ui.Control} New control instance or null if no
\r
26 * control was created.
\r
28 createControl: function(n, cm) {
\r
29 var editor = tinyMCE.activeEditor;
\r
32 var pluginImgURL = tinymce.baseURL + '/plugins/insert_tag/img/';
\r
33 var c = cm.createMenuButton('insert_tag', {
\r
34 title : 'insert_tag.desc',
\r
35 image : pluginImgURL + 'insert_tag.png',
\r
36 cmd : 'mceInsert_tag'
\r
39 c.onRenderMenu.add(function(c, m) {
\r
41 //image: pluginImgURL + 'insert_tag.png',
\r
42 title : 'insert_tag.term',
\r
43 onclick : function() {
\r
44 editor.execCommand('mceInsertContent', false, '[?][/?]');
\r
49 title : 'insert_tag.code',
\r
50 onclick : function() {
\r
51 editor.execCommand('mceInsertContent', false, '[code][/code]');
\r
56 title : 'insert_tag.media',
\r
57 onclick : function() {
\r
58 editor.execCommand('mceInsertContent', false, '[media|640|480]http://[/media]');
\r
63 // Return the new menu button instance
\r
72 * Returns information about the plugin as a name/value array. The
\r
73 * current keys are longname, author, authorurl, infourl and version.
\r
75 * @return {Object} Name/value array containing information about the
\r
78 getInfo : function() {
\r
80 longname : 'Insert tag plugin',
\r
82 authorurl : 'http://www.atutor.ca',
\r
83 infourl : 'http://www.atutor.ca',
\r
84 version : "0.1alpha"
\r
90 tinymce.PluginManager.add('insert_tag', tinymce.plugins.Insert_tagPlugin);
\r