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

  • Home
  • SEARCH
  • 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 5981681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:58:41+00:00 2026-05-22T21:58:41+00:00

I am adding a button to tinyMCE and I want to know how to

  • 0

I am adding a button to tinyMCE and I want to know how to wrap text inside tags with javascript, for instance (this highlighted text gets wrapped inside [highlight][/highlight] tags).
and now the entire tinymce

(function() {
tinymce.create('tinymce.plugins.shoutButton', {
    init : function(ed, url) {
        ed.addButton('shout.button', {
            title : 'shout.button',
            image : 'viral.gif',
            onclick : function() {
                window.alert("booh");
        });
    },
    createControl : function(n, cm) {
        return null;
    },
    getInfo : function() {
        return {
            longname : "Shout button",
            author : 'SAFAD',
            authorurl : 'http://safadsoft.com/',
            infourl : 'http://safadsoft.com/',
            version : "1.0"
        };
    }
});
tinymce.PluginManager.add('shout.button', tinymce.plugins.ShoutButton);

})();

  • 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-05-22T21:58:41+00:00Added an answer on May 22, 2026 at 9:58 pm

    The issue was syntax errors, not properly closed brackets and some missing semi-colons, using the help of the awesome Jsfiddle‘s JSHint and JSLint I fixed it :

    (function () {
        tinymce.create('tinymce.plugins.shoutButton', {
            init: function (ed, url) {
                ed.addButton('shout.button', {
                    title: 'shout.button',
                    image: 'viral.gif',
                    onclick: function () {
                        window.alert("booh");
                    }
                });
                createControl: function (n, cm) {
                    return null;
                }
                getInfo: function () {
                    return {
                        longname: "Shout button",
                        author: 'You !',
                        authorurl: 'http://example.com/',
                        infourl: 'http://example.com/',
                        version: "1.0"
                    };
                }
            }
        });
        tinymce.PluginManager.add('shout.button', tinymce.plugins.ShoutButton);
    })();
    

    Best Regards

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

Sidebar

Related Questions

I'm adding a row like this, when a button is pressed. It must be
I have been banging my head on adding a button to a cell. This
In question 663830 , Isaac asks about adding a button to a text field.
I am adding a button to a winform programmatically and wish this to be
I'm adding a button column to my databound datagridview. The column gets created, and
For Wordpress TinyMCE when adding or editing posts. I have this issue where I
In IE for button elements, when you click the button the text gets pushed
I'm having trouble adding a button to this JFrame, it's having a conflict with
I have code that works great for adding a button to the toolbar: NSArray*
I'm trying to modify the fridge magnets example by adding a button that will

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.