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 8733349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:37:49+00:00 2026-06-13T09:37:49+00:00

I have a custom youtube plugin that adds an image to my tinyMCE editor

  • 0

I have a custom youtube plugin that adds an image to my tinyMCE editor and gets replaced with embedded or other code on the server side.

The only thing thats left is when I select the image in the editor, both the advImage icon and my plugin icon get set to active.
I want to set the advimage to non-active. I tried stuff like this:

 cm.setActive('image', false);

Thanks to Thariama (see answer below) I know the correct name should be 'image'. This is called from my youtube plugin editor_plugin.js file, and in the console I can see that on selecting an image that code is executed and image is the correct target.

How do I set the image plugin to non-active?

See comments below Thariama’s answer for more information.

  • 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-13T09:37:51+00:00Added an answer on June 13, 2026 at 9:37 am

    After this I let it be for a while because it was not on top of my priority list. Now it was the last thing on my list and because of working more with tinyMCE and it codes I pretty quickly found a solution.

    I figured that I needed to go to the root: editor_template.js. This is were image was set to active so I needed to change that.

    My images for youtube (and now vimeo as well) have an alt attribbute to tell me if it’s a youtube or vimeo video. Now I need to disable either one of those plugins as well.

    I have put it on line 1117 after this code (which sets the active state for all img tags.

    p = getParent('IMG');
    if (c = cm.get('image'))
        c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1);
    

    And my code:

    if(ed.selection.getNode())
                if(ed.selection.getNode().getAttribute('alt') === 'videoYoutube' || ed.selection.getNode().getAttribute('alt') === 'videoVimeo') // Get the current selection in the editor and compare
                {
                    cm.setDisabled('image', true); // Change disable state
                    cm.setActive('image', false); // Change active state state
                }
                else
                {
                    cm.setDisabled('image', false);
                }
                if(ed.selection.getNode().getAttribute('alt') === 'videoYoutube')
                {
                    cm.setDisabled('addvimeo', true);
                }
                else if(ed.selection.getNode().getAttribute('alt') === 'videoVimeo')
                {
                    cm.setDisabled('addyoutube', true);
                }
                else
                {
                    cm.setDisabled('addvimeo', false);
                    cm.setDisabled('addyoutube', false);
                }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a custom YouTube player. with that player I have implemented a
Ok I have a page that uses 3 plugins and custom code. Fullscreenr ScrollTo
I currently have a tableview with youtube videos embedded inside of the custom cells.
I have custom AJAX code on a blog page that I set up to
I have custom classes that I currently instantiate within App.xaml as resources. I want
I have custom event that has several different subscribers who will all use the
I have custom gallery. Gallery represents items that are frame layout. There are one
I have custom component that I can place in my layout file (XML) for
I have custom map image with specific height and width. i need to map
I have custom js/jquery code which is running fine on all browsers including IE9

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.