4 * @author Laurel A. Williams
\r
5 * @copyright Copyright © 2008, ATutor, All rights reserved.
\r
13 // Load plugin specific language pack
\r
14 tinymce.PluginManager.requireLangPack('swap_toolbar');
\r
16 tinymce.create('tinymce.plugins.Swap_toolbarPlugin', {
\r
19 * Initializes the plugin, this will be executed after the plugin has been created.
\r
20 * This call is done before the editor instance has finished it's initialization so use the onInit event
\r
21 * of the editor instance to intercept that event.
\r
23 * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
\r
24 * @param {string} url Absolute URL to where the plugin is located.
\r
26 init : function (ed, url) {
\r
28 ed.addCommand('mceSwapToComplex', function () {
\r
29 tinyMCE.execCommand('mceRemoveControl', false, ed.id);
\r
30 ATutor.tinymce.initComplex();
\r
31 tinyMCE.execCommand('mceAddControl', false, ed.id);
\r
32 jQuery("#complexeditor").val('1');
\r
35 ed.addButton('swap_toolbar_complex', {
\r
36 title : 'swap_toolbar_complex.desc',
\r
37 cmd : 'mceSwapToComplex',
\r
38 image : url + '/img/bullet_arrow_down.png'
\r
41 ed.addCommand('mceSwapToSimple', function () {
\r
42 tinyMCE.execCommand('mceRemoveControl', false, ed.id);
\r
43 ATutor.tinymce.initSimple();
\r
44 tinyMCE.execCommand('mceAddControl', false, ed.id);
\r
45 jQuery("#complexeditor").val('0');
\r
48 ed.addButton('swap_toolbar_simple', {
\r
49 title : 'swap_toolbar_simple.desc',
\r
50 cmd : 'mceSwapToSimple',
\r
51 image : url + '/img/bullet_arrow_up.png'
\r
57 * Returns information about the plugin as a name/value array. The
\r
58 * current keys are longname, author, authorurl, infourl and version.
\r
60 * @return {Object} Name/value array containing information about the
\r
63 getInfo : function () {
\r
65 longname : 'Swap toolbar plugin',
\r
67 authorurl : 'http://www.atutor.ca',
\r
68 infourl : 'http://www.atutor.ca',
\r
75 tinymce.PluginManager.add('swap_toolbar', tinymce.plugins.Swap_toolbarPlugin);
\r