Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Pete Naylor 21 posts 39 karma points
    Feb 08, 2013 @ 15:43
    Pete Naylor
    0

    TinyMCE stopping me from adding a custom button.

    I'm using the test code below to add an extra button to the menu of each tab. Unfortunately this only works on the properties tab. I've had a look with Firebug at the source and it appears the button is there on the other tabs, but since it was added after the TinyMCE editor, it is not displaying in the bar.

    Is there a way I can place the button before the TinyMCE editor?  

     

          private void umbracoPage_Load(object sender, EventArgs e)

            {

                umbracoPage up = (umbracoPage)sender;

                string path = up.Page.Request.Path.ToLower().Replace((umbraco.GlobalSettings.Path + "/").ToLower(), "");

     

                ContentPlaceHolder cph = (ContentPlaceHolder)up.FindControl("body");

                Control c2 = cph.FindControl("TabView1");

     

                //register a script block to add an action for the button to call

                string script = "function mediaCopy(){alert('you clicked the new button!!!');return false;}";

                umbracoPage page = (umbracoPage)sender;

                page.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "epiphanyCopy", script, true);

     

                if (c2 != null)

                {

                    TabView panel = (TabView)c2;

     

                    //add this to all of the tabs for the page

                    foreach (TabPage tp in panel.GetPanels())

                    {

                        ImageButton dependencies = tp.Menu.NewImageButton();

                        dependencies.ImageUrl = umbraco.GlobalSettings.Path + "/images/editor/copy.gif";

                        dependencies.OnClientClick = "mediaCopy()";

                    }

                }

            }

Please Sign in or register to post replies

Write your reply to:

Draft