Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8221059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:46:00+00:00 2026-06-07T13:46:00+00:00

I want to catch the event of some button was pressed. In TinyMCE capture

  • 0

I want to catch the event of some button was pressed.
In TinyMCE capture click button event was suggested simple solution of how to do it, but for me it does not work. Could you please help. Here is my code in tinymce/plugins/test folder in editor_plugin_src.js and editor_plugin.js files:

(function(){
tinymce.create("tinymce.plugins.testPlugin",{
    init:function(ed,url){
        ed.addCommand('my_bold', this.my_bold, this); //calls the function my_bold
        ed.onInit.add(function(editor) {
            if (editor.controlManager.get('bold')){
                editor.controlManager.get('bold').settings.cmd='my_bold_action'; 
            };

        });
    },
    my_bold: function() {           
        // exectution of regular command
        this.editor.execCommand('Bold');

        // now do whatever you like here
        alert('pressed');
    },
    createControl:function(b,a){
        return null
    },
    getInfo:function(){
        return{
            longname:"test plugin",
            author:"test author",
            authorurl:"http://tinymce.moxiecode.com",
            infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",
            version:"1.0"
        }
    }
});
tinymce.PluginManager.add("test",tinymce.plugins.TestPlugin)     })();

Here I activate plugin test:

    $(this).tinymce({
        ...
        autoresize_bottom_margin : 15,
        mode : 'exact',
        elements : clickedId,           
        theme : 'advanced',
        plugins : 'autoresize,test',
        force_br_newlines : true,

UPDATE:

(function(){
tinymce.PluginManager.requireLangPack("test");
tinymce.create("tinymce.plugins.test",{
    init:function(ed,url){
        ed.addCommand('my_bold', this.my_bold, this);//calls the function my_bold
        ed.onInit.add(function(editor) {
            if (editor.controlManager.get('bold')){
                editor.controlManager.get('bold').settings.cmd='my_bold'; 
            }
        });
    },
    my_bold: function() {           
        // exectution of regular command
        this.editor.execCommand('Bold');

        // now do whatever you like here
        alert('pressed');
    },
    createControl:function(ed,url){
        return null
    },
    getInfo:function(){
        return{
           longname:"test plugin",
           author:"test author",
           authorurl:"http://tinymce.moxiecode.com",
           infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",
           version:"1.0"
        }
    }
});
tinymce.PluginManager.add("test",tinymce.plugins.test)    })();

Now I have this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T13:46:01+00:00Added an answer on June 7, 2026 at 1:46 pm

    Have you added the bold button to your button config?
    Something like:

    theme_advanced_buttons1: "bold,italic,underline";
    

    Update:

    editor.controlManager.get('bold').settings.cmd='my_bold_action';
    

    is erroneous, you need:

    editor.controlManager.get('bold').settings.cmd='my_bold';
    

    here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want bind to an event but I am not sure if its possible.
-I want to raise an event whenever method showmessage is called.I want to catch
I have a JFrame , which have some options. When OK button is pressed
I want to raise the some event in Java after finishing the reading of
I've got a FlowDocument which has some elements like so: <InlineUIContainer> <Button Click=Button_Click Tag=123456789890>
I want to catch a fancybox error (The requested content cannot be loaded. Please
i want to catch the data from server as an answer and alert it.
I want to catch exceptions thrown by classes implementing Processor interface. In aspect I
This is my below code and I want to catch the exception if any
I am using codeplex NVelocity library on .net and i want to catch an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.