SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard Wolf_22's Avatar
    Join Date
    Jul 2005
    Posts
    1,700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question TinyMCE 3.4 Plugin and onClick...

    I have the following code:

    Code:
    (function() {
        tinymce.create('tinymce.plugins.usabilityPlugin', {
            init : function(ed, url) {
                var t = this;
                t.editor = ed;
            },
    
            click : function(ed) {
                ed.onClick.add(function(ed, e) {
                    alert('test');
                });
            },
    
        });
    
    
        tinymce.PluginManager.add('usability', tinymce.plugins.usabilityPlugin);
    })();
    I'm basically trying to understand why the alert() isn't working for the intended onClick I'm trying to implement here... There's no errors in Firefox from what I can tell (using Firebug, too, so I've tried the console.log approach and it doesn't tell me anything either). I think I'm probably misunderstanding how these classes are created in TinyMCE nomenclature (i.e. - are "init" and "click", in essence, methods?), so any insight is appreciated.

  2. #2
    SitePoint Wizard Wolf_22's Avatar
    Join Date
    Jul 2005
    Posts
    1,700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry everyone... Think I posted too soon.
    Code:
    (function() {     tinymce.create('tinymce.plugins.usabilityPlugin', {         init : function(ed, url) {             var t = this;             t.editor = ed;
                ed.onClick.add(function(ed, e) {                 alert('test');             });         },     });       tinymce.PluginManager.add('usability', tinymce.plugins.usabilityPlugin); })();
    EDIT:
    ...okay, I'm not sure what happened to the above. I went back to try and fix it... Oh well.
    (Mods, feel free to brush-up if you need to.)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •