AnsweredAssumed Answered

tiny_mce over alfresco lab 3e

Question asked by nicola.raglia on Mar 26, 2009
Hello,
i tried to create and install my tiny_mce plug-in over alfresco lab 3. But my plugin, that is a custom select list  isn't visible
I report the step and the code i created:

javascript code of my plugin, its file name is : editor_plugin_src.js

/**

* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $

*

* @author Moxiecode

* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.

*/



(function() {

   // Load plugin specific language pack

tinyMCE.importPluginLanguagePack('table', 'en,tr,ar,cs,da,de,el,es,fi,fr_ca,hu,it,ja,ko,nl,nb,pl,pt,pt_br,sv,tw,zh_cn,fr,de,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,is,zh_tw,zh_tw_utf8,sk');

   // Creates a new plugin class and a custom listbox
tinymce.create('tinymce.plugins.ExamplePlugin', {
    createControl: function(n, cm) {
        switch (n) {
            case 'mylistbox':
                var mlb = cm.createListBox('mylistbox', {
                     title : 'My list box',
                     onselect : function(v) {
                         tinyMCE.activeEditor.windowManager.alert('Value selected:' + v);
                     }
                });

                // Add some values to the list box
                mlb.add('Some item 1', 'val1');
                mlb.add('some item 2', 'val2');
                mlb.add('some item 3', 'val3');

                // Return the new listbox instance
                return mlb;
        }

        return null;
    }
});

// Register plugin with a short name
tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);

// Initialize TinyMCE with the new plugin and button
tinyMCE.init({
   plugins : 'example', // - means TinyMCE will not try to load it
   theme_advanced_buttons1 : 'mylistbox' // Add the new example listbox to the toolbar
});

web-client-config-wcm.xml

<widget xforms-type="xf:textarea"

                   appearance="full"

                   javascript-class-name="alfresco.xforms.RichTextEditor">

             <param name="theme_advanced_buttons1">bold,italic,underline,strikethrough,separator,fontselect,fontsizeselect,mylistbox</param>

             <param name="theme_advanced_buttons2">link,unlink,image,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,undo,redo,separator,forecolor,backcolor</param>
            
              <param name="theme_advanced_buttons3">tablecontrols,print</param>
             <param name="height">400</param>
             <param name="plugins">print,example,table</param>

           </widget>

I had create a folder example, under $/alfresco/scrpts/tiny_mce/plugins/ , then under example folder i inserted the  editor_plugin_src.js.
In the code above, i tried to insert , also, "print" plug-in that is in tiny_mce distribution downloaded from a site, but also it isn't visible
Anyone can help me in this taks ?
Thanks, tjanks at all.

Outcomes