Mohan Ram
Mohan Ram

Reputation: 8463

How to add icon in tinymce?

Once user click toggle full screen mode. i need to add insertimage icon into tinymce.

Once user clicks insert image icon i need to call thickbox. How can i do that. I am using jquery tinymce. (If ques is not clear refer wordpress advanced texteditor)

Upvotes: 2

Views: 2370

Answers (1)

Thariama
Thariama

Reputation: 50832

If it would be ok to have that image visible when tinymce UI is visible you can implement an icon/button using an own plugin + this code

init : function(ed, url) {

  // To create a tinymce command use
  var t = this;
  ed.addCommand('mycommand', t.my_function, t);  // my function need to be a function inside your plugin

  createControl: function(n, cm) {

    // Register button
    c = cm.createButton(n, {
      title : 'Title',
      cmd : 'registered_tinymce_command',
      image : 'http://myserver.com/images/buttonimage.png',
      scope: t
    });
    return c;
  }
}

Upvotes: 1

Related Questions