Loading ...
Sorry, an error occurred while loading the content.

Disable Buttons in Rich Text Editor (RTE)

Expand Messages
  • Jamie
    I want to be able to use the Advanced RTE, but the only button that I would like disabled is the image button. I was wondering if there was an easy way to do
    Message 1 of 8 , Jul 2, 2008
    • 0 Attachment
      I want to be able to use the Advanced RTE, but the only button that I
      would like disabled is the image button. I was wondering if there was
      an easy way to do that, or do I have to build my own bar without that
      button?

      Thanks, Jamie
    • Dav Glass
      Jamie -- Try this (provided that you didn t add any buttons): myEditor = new YAHOO.widget.Editor( editor ); delete
      Message 2 of 8 , Jul 2, 2008
      • 0 Attachment
        Jamie --

        Try this (provided that you didn't add any buttons):

        myEditor = new YAHOO.widget.Editor('editor');
        delete myEditor._defaultToolbar.buttons[10].buttons[1];
        myEditor.render();


        That should remove the 'insertimage' button from the Editor before it's rendered..

        Does that help?

        Dav Glass
        dav.glass@...
        blog.davglass.com




        + Windows: n. - The most successful computer virus, ever. +
        + A computer without a Microsoft operating system is like a dog
        without bricks tied to its head +
        + A Microsoft Certified Systems Engineer is to computing what a
        McDonalds Certified Food Specialist is to fine cuisine +



        ----- Original Message ----
        From: Jamie <jamierytlewski@...>
        To: ydn-javascript@yahoogroups.com
        Sent: Wednesday, July 2, 2008 7:22:07 AM
        Subject: [ydn-javascript] Disable Buttons in Rich Text Editor (RTE)

        I want to be able to use the Advanced RTE, but the only button that I
        would like disabled is the image button. I was wondering if there was
        an easy way to do that, or do I have to build my own bar without that
        button?

        Thanks, Jamie


        ------------------------------------

        Yahoo! Groups Links
      • Jamie
        No, it did not work. Firefox gives me an error that says, Error: J.buttons[H] is undefined Source File:
        Message 3 of 8 , Jul 2, 2008
        • 0 Attachment
          No, it did not work. Firefox gives me an error that says,

          "Error: J.buttons[H] is undefined
          Source File:
          http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js
          Line: 8"

          What I am curious about is the destroyButton method or disableButton
          method. Is that only good for user created buttons? I tried to the
          destroyButton and I got this error:

          Error: I is null
          Source File:
          http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js
          Line: 11

          Even if I could just disable the button that would be fine.

          Thanks,

          Jamie

          --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
          >
          > Jamie --
          >
          > Try this (provided that you didn't add any buttons):
          >
          > myEditor = new YAHOO.widget.Editor('editor');
          > delete myEditor._defaultToolbar.buttons[10].buttons[1];
          > myEditor.render();
          >
          >
          > That should remove the 'insertimage' button from the Editor before
          it's rendered..
          >
          > Does that help?
          >
          > Dav Glass
          > dav.glass@...
          > blog.davglass.com
          >
          >
          >
          >
          > + Windows: n. - The most successful computer virus, ever. +
          > + A computer without a Microsoft operating system is like a dog
          > without bricks tied to its head +
          > + A Microsoft Certified Systems Engineer is to computing what a
          > McDonalds Certified Food Specialist is to fine cuisine +
          >
          >
          >
          > ----- Original Message ----
          > From: Jamie <jamierytlewski@...>
          > To: ydn-javascript@yahoogroups.com
          > Sent: Wednesday, July 2, 2008 7:22:07 AM
          > Subject: [ydn-javascript] Disable Buttons in Rich Text Editor (RTE)
          >
          > I want to be able to use the Advanced RTE, but the only button that I
          > would like disabled is the image button. I was wondering if there was
          > an easy way to do that, or do I have to build my own bar without that
          > button?
          >
          > Thanks, Jamie
          >
          >
          > ------------------------------------
          >
          > Yahoo! Groups Links
          >
        • Dav Glass
          Jamie -- Sorry about that, here is an example: http://blog.davglass.com/files/yui/editor57/ It should be this:
          Message 4 of 8 , Jul 2, 2008
          • 0 Attachment
            Jamie --

            Sorry about that, here is an example:
            http://blog.davglass.com/files/yui/editor57/


            It should be this:
            myEditor._defaultToolbar.buttons[10].buttons.pop();

            That should remove that last item from the array which is the Insert Image button..

            Does that help?
            Dav

            Dav Glass
            dav.glass@...
            blog.davglass.com




            + Windows: n. - The most successful computer virus, ever. +
            + A computer without a Microsoft operating system is like a dog
            without bricks tied to its head +
            + A Microsoft Certified Systems Engineer is to computing what a
            McDonalds Certified Food Specialist is to fine cuisine +



            ----- Original Message ----
            From: Jamie <jamierytlewski@...>
            To: ydn-javascript@yahoogroups.com
            Sent: Wednesday, July 2, 2008 8:15:03 AM
            Subject: [ydn-javascript] Re: Disable Buttons in Rich Text Editor (RTE)

            No, it did not work. Firefox gives me an error that says,

            "Error: J.buttons[H] is undefined
            Source File:
            http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js
            Line: 8"

            What I am curious about is the destroyButton method or disableButton
            method. Is that only good for user created buttons? I tried to the
            destroyButton and I got this error:

            Error: I is null
            Source File:
            http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js
            Line: 11

            Even if I could just disable the button that would be fine.

            Thanks,

            Jamie

            --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
            >
            > Jamie --
            >
            > Try this (provided that you didn't add any buttons):
            >
            > myEditor = new YAHOO.widget.Editor('editor');
            > delete myEditor._defaultToolbar.buttons[10].buttons[1];
            > myEditor.render();
            >
            >
            > That should remove the 'insertimage' button from the Editor before
            it's rendered..
            >
            > Does that help?
            >
            > Dav Glass
            > dav.glass@...
            > blog.davglass.com
            >
            >
            >
            >
            > + Windows: n. - The most successful computer virus, ever. +
            > + A computer without a Microsoft operating system is like a dog
            > without bricks tied to its head +
            > + A Microsoft Certified Systems Engineer is to computing what a
            > McDonalds Certified Food Specialist is to fine cuisine +
            >
            >
            >
            > ----- Original Message ----
            > From: Jamie <jamierytlewski@...>
            > To: ydn-javascript@yahoogroups.com
            > Sent: Wednesday, July 2, 2008 7:22:07 AM
            > Subject: [ydn-javascript] Disable Buttons in Rich Text Editor (RTE)
            >
            > I want to be able to use the Advanced RTE, but the only button that I
            > would like disabled is the image button. I was wondering if there was
            > an easy way to do that, or do I have to build my own bar without that
            > button?
            >
            > Thanks, Jamie
            >
            >
            > ------------------------------------
            >
            > Yahoo! Groups Links
            >



            ------------------------------------

            Yahoo! Groups Links
          • Jamie
            Dav, Works perfect. Can I ask a few questions, that you may or may not be able to answer. 1) Why is it that the destroyButton gives an error? The error was
            Message 5 of 8 , Jul 2, 2008
            • 0 Attachment
              Dav,

              Works perfect. Can I ask a few questions, that you may or may not be
              able to answer. 1) Why is it that the destroyButton gives an error?
              The error was in the previous message. 2) This seems to be a hack,
              what if I wanted to remove say the underline, how would I go about
              removing that?

              Thanks again,

              Jamie

              --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
              >
              > Jamie --
              >
              > Sorry about that, here is an example:
              > http://blog.davglass.com/files/yui/editor57/
              >
              >
              > It should be this:
              > myEditor._defaultToolbar.buttons[10].buttons.pop();
              >
              > That should remove that last item from the array which is the Insert
              Image button..
              >
              > Does that help?
              > Dav
              >
              > Dav Glass
              > dav.glass@...
              > blog.davglass.com
              >
              >
              >
              >
              > + Windows: n. - The most successful computer virus, ever. +
              > + A computer without a Microsoft operating system is like a dog
              > without bricks tied to its head +
              > + A Microsoft Certified Systems Engineer is to computing what a
              > McDonalds Certified Food Specialist is to fine cuisine +
              >
              >
              >
              > ----- Original Message ----
              > From: Jamie <jamierytlewski@...>
              > To: ydn-javascript@yahoogroups.com
              > Sent: Wednesday, July 2, 2008 8:15:03 AM
              > Subject: [ydn-javascript] Re: Disable Buttons in Rich Text Editor (RTE)
              >
              > No, it did not work. Firefox gives me an error that says,
              >
              > "Error: J.buttons[H] is undefined
              > Source File:
              > http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js
              > Line: 8"
              >
              > What I am curious about is the destroyButton method or disableButton
              > method. Is that only good for user created buttons? I tried to the
              > destroyButton and I got this error:
              >
              > Error: I is null
              > Source File:
              > http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js
              > Line: 11
              >
              > Even if I could just disable the button that would be fine.
              >
              > Thanks,
              >
              > Jamie
              >
              > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
              > >
              > > Jamie --
              > >
              > > Try this (provided that you didn't add any buttons):
              > >
              > > myEditor = new YAHOO.widget.Editor('editor');
              > > delete myEditor._defaultToolbar.buttons[10].buttons[1];
              > > myEditor.render();
              > >
              > >
              > > That should remove the 'insertimage' button from the Editor before
              > it's rendered..
              > >
              > > Does that help?
              > >
              > > Dav Glass
              > > dav.glass@
              > > blog.davglass.com
              > >
              > >
              > >
              > >
              > > + Windows: n. - The most successful computer virus, ever. +
              > > + A computer without a Microsoft operating system is like a dog
              > > without bricks tied to its head +
              > > + A Microsoft Certified Systems Engineer is to computing what a
              > > McDonalds Certified Food Specialist is to fine cuisine +
              > >
              > >
              > >
              > > ----- Original Message ----
              > > From: Jamie <jamierytlewski@>
              > > To: ydn-javascript@yahoogroups.com
              > > Sent: Wednesday, July 2, 2008 7:22:07 AM
              > > Subject: [ydn-javascript] Disable Buttons in Rich Text Editor (RTE)
              > >
              > > I want to be able to use the Advanced RTE, but the only button that I
              > > would like disabled is the image button. I was wondering if there was
              > > an easy way to do that, or do I have to build my own bar without that
              > > button?
              > >
              > > Thanks, Jamie
              > >
              > >
              > > ------------------------------------
              > >
              > > Yahoo! Groups Links
              > >
              >
              >
              >
              > ------------------------------------
              >
              > Yahoo! Groups Links
              >
            • Dav Glass
              Jamie -- 1. I would need to see the error in Destroy button, you also need to make sure that when you destroy a button it s called from the toolbarLoaded
              Message 6 of 8 , Jul 2, 2008
              • 0 Attachment
                Jamie --


                1. I would need to see the error in Destroy button, you also need to make sure that when you destroy a button it's called from the toolbarLoaded event, so that you know the toolbar is available..

                2. It's not really a hack, it's by design.. You can remove a button, the following ways..
                a. Declare an entire toolbar config (without the button that you don't want). //Sometime to much code here..
                b. Remove it from the _defaultConfig var before it's rendered. //Usually one line to remove a button.
                c. Wait for the toolbarLoaded event to fire, then call destroyButton on the button you want to remove.

                All 3 of those options are available to use, just depends on the one you want to and the one that fits your needs..

                Dav

                Dav Glass
                dav.glass@...
                blog.davglass.com




                + Windows: n. - The most successful computer virus, ever. +
                + A computer without a Microsoft operating system is like a dog
                without bricks tied to its head +
                + A Microsoft Certified Systems Engineer is to computing what a
                McDonalds Certified Food Specialist is to fine cuisine +



                ----- Original Message ----
                From: Jamie <jamierytlewski@...>
                To: ydn-javascript@yahoogroups.com
                Sent: Wednesday, July 2, 2008 10:13:46 AM
                Subject: [ydn-javascript] Re: Disable Buttons in Rich Text Editor (RTE)

                Dav,

                Works perfect. Can I ask a few questions, that you may or may not be
                able to answer. 1) Why is it that the destroyButton gives an error?
                The error was in the previous message. 2) This seems to be a hack,
                what if I wanted to remove say the underline, how would I go about
                removing that?

                Thanks again,

                Jamie

                --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
                >
                > Jamie --
                >
                > Sorry about that, here is an example:
                > http://blog.davglass.com/files/yui/editor57/
                >
                >
                > It should be this:
                > myEditor._defaultToolbar.buttons[10].buttons.pop();
                >
                > That should remove that last item from the array which is the Insert
                Image button..
                >
                > Does that help?
                > Dav
                >
                > Dav Glass
                > dav.glass@...
                > blog.davglass.com
                >
                >
                >
                >
                > + Windows: n. - The most successful computer virus, ever. +
                > + A computer without a Microsoft operating system is like a dog
                > without bricks tied to its head +
                > + A Microsoft Certified Systems Engineer is to computing what a
                > McDonalds Certified Food Specialist is to fine cuisine +
                >
                >
                >
                > ----- Original Message ----
                > From: Jamie <jamierytlewski@...>
                > To: ydn-javascript@yahoogroups.com
                > Sent: Wednesday, July 2, 2008 8:15:03 AM
                > Subject: [ydn-javascript] Re: Disable Buttons in Rich Text Editor (RTE)
                >
                > No, it did not work. Firefox gives me an error that says,
                >
                > "Error: J.buttons[H] is undefined
                > Source File:
                > http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js
                > Line: 8"
                >
                > What I am curious about is the destroyButton method or disableButton
                > method. Is that only good for user created buttons? I tried to the
                > destroyButton and I got this error:
                >
                > Error: I is null
                > Source File:
                > http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js
                > Line: 11
                >
                > Even if I could just disable the button that would be fine.
                >
                > Thanks,
                >
                > Jamie
                >
                > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                > >
                > > Jamie --
                > >
                > > Try this (provided that you didn't add any buttons):
                > >
                > > myEditor = new YAHOO.widget.Editor('editor');
                > > delete myEditor._defaultToolbar.buttons[10].buttons[1];
                > > myEditor.render();
                > >
                > >
                > > That should remove the 'insertimage' button from the Editor before
                > it's rendered..
                > >
                > > Does that help?
                > >
                > > Dav Glass
                > > dav.glass@
                > > blog.davglass.com
                > >
                > >
                > >
                > >
                > > + Windows: n. - The most successful computer virus, ever. +
                > > + A computer without a Microsoft operating system is like a dog
                > > without bricks tied to its head +
                > > + A Microsoft Certified Systems Engineer is to computing what a
                > > McDonalds Certified Food Specialist is to fine cuisine +
                > >
                > >
                > >
                > > ----- Original Message ----
                > > From: Jamie <jamierytlewski@>
                > > To: ydn-javascript@yahoogroups.com
                > > Sent: Wednesday, July 2, 2008 7:22:07 AM
                > > Subject: [ydn-javascript] Disable Buttons in Rich Text Editor (RTE)
                > >
                > > I want to be able to use the Advanced RTE, but the only button that I
                > > would like disabled is the image button. I was wondering if there was
                > > an easy way to do that, or do I have to build my own bar without that
                > > button?
                > >
                > > Thanks, Jamie
                > >
                > >
                > > ------------------------------------
                > >
                > > Yahoo! Groups Links
                > >
                >
                >
                >
                > ------------------------------------
                >
                > Yahoo! Groups Links
                >



                ------------------------------------

                Yahoo! Groups Links
              • Jamie
                Dav, Thanks for your help and here is what I had tried and the error. Code: myEditor.on( toolbarLoaded , function(){ this.toolbar.destroyButton(21); } Error: I
                Message 7 of 8 , Jul 2, 2008
                • 0 Attachment
                  Dav,

                  Thanks for your help and here is what I had tried and the error.

                  Code:

                  myEditor.on('toolbarLoaded', function(){
                  this.toolbar.destroyButton(21);
                  }

                  Error: I is null
                  Source File:
                  http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js
                  Line: 11

                  I even tried this Code:

                  myEditor.on('toolbarLoaded', function(){
                  myEditor.toolbar.destroyButton(21);
                  }

                  And it had the same error. I would get the error no matter which
                  button I tried to destroy. I could not find a way to do number 2 that
                  would work, besides the code you gave me. I called it a hack as is
                  there really is no documentation of being able to do that.

                  Thanks,

                  Jamie


                  --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
                  >
                  > Jamie --
                  >
                  >
                  > 1. I would need to see the error in Destroy button, you also need to
                  make sure that when you destroy a button it's called from the
                  toolbarLoaded event, so that you know the toolbar is available..
                  >
                  > 2. It's not really a hack, it's by design.. You can remove a button,
                  the following ways..
                  > a. Declare an entire toolbar config (without the button that you
                  don't want). //Sometime to much code here..
                  > b. Remove it from the _defaultConfig var before it's rendered.
                  //Usually one line to remove a button.
                  > c. Wait for the toolbarLoaded event to fire, then call
                  destroyButton on the button you want to remove.
                  >
                  > All 3 of those options are available to use, just depends on the one
                  you want to and the one that fits your needs..
                  >
                  > Dav
                  >
                  > Dav Glass
                  > dav.glass@...
                  > blog.davglass.com
                  >
                  >
                  >
                  >
                  > + Windows: n. - The most successful computer virus, ever. +
                  > + A computer without a Microsoft operating system is like a dog
                  > without bricks tied to its head +
                  > + A Microsoft Certified Systems Engineer is to computing what a
                  > McDonalds Certified Food Specialist is to fine cuisine +
                  >
                  >
                  >
                  > ----- Original Message ----
                  > From: Jamie <jamierytlewski@...>
                  > To: ydn-javascript@yahoogroups.com
                  > Sent: Wednesday, July 2, 2008 10:13:46 AM
                  > Subject: [ydn-javascript] Re: Disable Buttons in Rich Text Editor (RTE)
                  >
                  > Dav,
                  >
                  > Works perfect. Can I ask a few questions, that you may or may not be
                  > able to answer. 1) Why is it that the destroyButton gives an error?
                  > The error was in the previous message. 2) This seems to be a hack,
                  > what if I wanted to remove say the underline, how would I go about
                  > removing that?
                  >
                  > Thanks again,
                  >
                  > Jamie
                  >
                  > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                  > >
                  > > Jamie --
                  > >
                  > > Sorry about that, here is an example:
                  > > http://blog.davglass.com/files/yui/editor57/
                  > >
                  > >
                  > > It should be this:
                  > > myEditor._defaultToolbar.buttons[10].buttons.pop();
                  > >
                  > > That should remove that last item from the array which is the Insert
                  > Image button..
                  > >
                  > > Does that help?
                  > > Dav
                  > >
                  > > Dav Glass
                  > > dav.glass@
                  > > blog.davglass.com
                  > >
                  > >
                  > >
                  > >
                  > > + Windows: n. - The most successful computer virus, ever. +
                  > > + A computer without a Microsoft operating system is like a dog
                  > > without bricks tied to its head +
                  > > + A Microsoft Certified Systems Engineer is to computing what a
                  > > McDonalds Certified Food Specialist is to fine cuisine +
                  > >
                  > >
                  > >
                  > > ----- Original Message ----
                  > > From: Jamie <jamierytlewski@>
                  > > To: ydn-javascript@yahoogroups.com
                  > > Sent: Wednesday, July 2, 2008 8:15:03 AM
                  > > Subject: [ydn-javascript] Re: Disable Buttons in Rich Text Editor
                  (RTE)
                  > >
                  > > No, it did not work. Firefox gives me an error that says,
                  > >
                  > > "Error: J.buttons[H] is undefined
                  > > Source File:
                  > > http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js
                  > > Line: 8"
                  > >
                  > > What I am curious about is the destroyButton method or disableButton
                  > > method. Is that only good for user created buttons? I tried to the
                  > > destroyButton and I got this error:
                  > >
                  > > Error: I is null
                  > > Source File:
                  > > http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js
                  > > Line: 11
                  > >
                  > > Even if I could just disable the button that would be fine.
                  > >
                  > > Thanks,
                  > >
                  > > Jamie
                  > >
                  > > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                  > > >
                  > > > Jamie --
                  > > >
                  > > > Try this (provided that you didn't add any buttons):
                  > > >
                  > > > myEditor = new YAHOO.widget.Editor('editor');
                  > > > delete myEditor._defaultToolbar.buttons[10].buttons[1];
                  > > > myEditor.render();
                  > > >
                  > > >
                  > > > That should remove the 'insertimage' button from the Editor before
                  > > it's rendered..
                  > > >
                  > > > Does that help?
                  > > >
                  > > > Dav Glass
                  > > > dav.glass@
                  > > > blog.davglass.com
                  > > >
                  > > >
                  > > >
                  > > >
                  > > > + Windows: n. - The most successful computer virus, ever. +
                  > > > + A computer without a Microsoft operating system is like a dog
                  > > > without bricks tied to its head +
                  > > > + A Microsoft Certified Systems Engineer is to computing what a
                  > > > McDonalds Certified Food Specialist is to fine cuisine +
                  > > >
                  > > >
                  > > >
                  > > > ----- Original Message ----
                  > > > From: Jamie <jamierytlewski@>
                  > > > To: ydn-javascript@yahoogroups.com
                  > > > Sent: Wednesday, July 2, 2008 7:22:07 AM
                  > > > Subject: [ydn-javascript] Disable Buttons in Rich Text Editor (RTE)
                  > > >
                  > > > I want to be able to use the Advanced RTE, but the only button
                  that I
                  > > > would like disabled is the image button. I was wondering if
                  there was
                  > > > an easy way to do that, or do I have to build my own bar without
                  that
                  > > > button?
                  > > >
                  > > > Thanks, Jamie
                  > > >
                  > > >
                  > > > ------------------------------------
                  > > >
                  > > > Yahoo! Groups Links
                  > > >
                  > >
                  > >
                  > >
                  > > ------------------------------------
                  > >
                  > > Yahoo! Groups Links
                  > >
                  >
                  >
                  >
                  > ------------------------------------
                  >
                  > Yahoo! Groups Links
                  >
                • Dav Glass
                  Jamie -- It should have been this: myEditor.on( toolbarLoaded , function(){ this.toolbar.destroyButton( insertimage ); } Dav Dav Glass dav.glass@yahoo.com
                  Message 8 of 8 , Jul 2, 2008
                  • 0 Attachment
                    Jamie --

                    It should have been this:
                    myEditor.on('toolbarLoaded', function(){
                    this.toolbar.destroyButton('insertimage');
                    }

                    Dav

                    Dav Glass
                    dav.glass@...
                    blog.davglass.com




                    + Windows: n. - The most successful computer virus, ever. +
                    + A computer without a Microsoft operating system is like a dog
                    without bricks tied to its head +
                    + A Microsoft Certified Systems Engineer is to computing what a
                    McDonalds Certified Food Specialist is to fine cuisine +



                    ----- Original Message ----
                    From: Jamie <jamierytlewski@...>
                    To: ydn-javascript@yahoogroups.com
                    Sent: Wednesday, July 2, 2008 12:22:01 PM
                    Subject: [ydn-javascript] Re: Disable Buttons in Rich Text Editor (RTE)

                    Dav,

                    Thanks for your help and here is what I had tried and the error.

                    Code:

                    myEditor.on('toolbarLoaded', function(){
                    this.toolbar.destroyButton(21);
                    }

                    Error: I is null
                    Source File:
                    http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js
                    Line: 11

                    I even tried this Code:

                    myEditor.on('toolbarLoaded', function(){
                    myEditor.toolbar.destroyButton(21);
                    }

                    And it had the same error. I would get the error no matter which
                    button I tried to destroy. I could not find a way to do number 2 that
                    would work, besides the code you gave me. I called it a hack as is
                    there really is no documentation of being able to do that.

                    Thanks,

                    Jamie


                    --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
                    >
                    > Jamie --
                    >
                    >
                    > 1. I would need to see the error in Destroy button, you also need to
                    make sure that when you destroy a button it's called from the
                    toolbarLoaded event, so that you know the toolbar is available..
                    >
                    > 2. It's not really a hack, it's by design.. You can remove a button,
                    the following ways..
                    > a. Declare an entire toolbar config (without the button that you
                    don't want). //Sometime to much code here..
                    > b. Remove it from the _defaultConfig var before it's rendered.
                    //Usually one line to remove a button.
                    > c. Wait for the toolbarLoaded event to fire, then call
                    destroyButton on the button you want to remove.
                    >
                    > All 3 of those options are available to use, just depends on the one
                    you want to and the one that fits your needs..
                    >
                    > Dav
                    >
                    > Dav Glass
                    > dav.glass@...
                    > blog.davglass.com
                    >
                    >
                    >
                    >
                    > + Windows: n. - The most successful computer virus, ever. +
                    > + A computer without a Microsoft operating system is like a dog
                    > without bricks tied to its head +
                    > + A Microsoft Certified Systems Engineer is to computing what a
                    > McDonalds Certified Food Specialist is to fine cuisine +
                    >
                    >
                    >
                    > ----- Original Message ----
                    > From: Jamie <jamierytlewski@...>
                    > To: ydn-javascript@yahoogroups.com
                    > Sent: Wednesday, July 2, 2008 10:13:46 AM
                    > Subject: [ydn-javascript] Re: Disable Buttons in Rich Text Editor (RTE)
                    >
                    > Dav,
                    >
                    > Works perfect. Can I ask a few questions, that you may or may not be
                    > able to answer. 1) Why is it that the destroyButton gives an error?
                    > The error was in the previous message. 2) This seems to be a hack,
                    > what if I wanted to remove say the underline, how would I go about
                    > removing that?
                    >
                    > Thanks again,
                    >
                    > Jamie
                    >
                    > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                    > >
                    > > Jamie --
                    > >
                    > > Sorry about that, here is an example:
                    > > http://blog.davglass.com/files/yui/editor57/
                    > >
                    > >
                    > > It should be this:
                    > > myEditor._defaultToolbar.buttons[10].buttons.pop();
                    > >
                    > > That should remove that last item from the array which is the Insert
                    > Image button..
                    > >
                    > > Does that help?
                    > > Dav
                    > >
                    > > Dav Glass
                    > > dav.glass@
                    > > blog.davglass.com
                    > >
                    > >
                    > >
                    > >
                    > > + Windows: n. - The most successful computer virus, ever. +
                    > > + A computer without a Microsoft operating system is like a dog
                    > > without bricks tied to its head +
                    > > + A Microsoft Certified Systems Engineer is to computing what a
                    > > McDonalds Certified Food Specialist is to fine cuisine +
                    > >
                    > >
                    > >
                    > > ----- Original Message ----
                    > > From: Jamie <jamierytlewski@>
                    > > To: ydn-javascript@yahoogroups.com
                    > > Sent: Wednesday, July 2, 2008 8:15:03 AM
                    > > Subject: [ydn-javascript] Re: Disable Buttons in Rich Text Editor
                    (RTE)
                    > >
                    > > No, it did not work. Firefox gives me an error that says,
                    > >
                    > > "Error: J.buttons[H] is undefined
                    > > Source File:
                    > > http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js
                    > > Line: 8"
                    > >
                    > > What I am curious about is the destroyButton method or disableButton
                    > > method. Is that only good for user created buttons? I tried to the
                    > > destroyButton and I got this error:
                    > >
                    > > Error: I is null
                    > > Source File:
                    > > http://yui.yahooapis.com/2.5.2/build/editor/editor-beta-min.js
                    > > Line: 11
                    > >
                    > > Even if I could just disable the button that would be fine.
                    > >
                    > > Thanks,
                    > >
                    > > Jamie
                    > >
                    > > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                    > > >
                    > > > Jamie --
                    > > >
                    > > > Try this (provided that you didn't add any buttons):
                    > > >
                    > > > myEditor = new YAHOO.widget.Editor('editor');
                    > > > delete myEditor._defaultToolbar.buttons[10].buttons[1];
                    > > > myEditor.render();
                    > > >
                    > > >
                    > > > That should remove the 'insertimage' button from the Editor before
                    > > it's rendered..
                    > > >
                    > > > Does that help?
                    > > >
                    > > > Dav Glass
                    > > > dav.glass@
                    > > > blog.davglass.com
                    > > >
                    > > >
                    > > >
                    > > >
                    > > > + Windows: n. - The most successful computer virus, ever. +
                    > > > + A computer without a Microsoft operating system is like a dog
                    > > > without bricks tied to its head +
                    > > > + A Microsoft Certified Systems Engineer is to computing what a
                    > > > McDonalds Certified Food Specialist is to fine cuisine +
                    > > >
                    > > >
                    > > >
                    > > > ----- Original Message ----
                    > > > From: Jamie <jamierytlewski@>
                    > > > To: ydn-javascript@yahoogroups.com
                    > > > Sent: Wednesday, July 2, 2008 7:22:07 AM
                    > > > Subject: [ydn-javascript] Disable Buttons in Rich Text Editor (RTE)
                    > > >
                    > > > I want to be able to use the Advanced RTE, but the only button
                    that I
                    > > > would like disabled is the image button. I was wondering if
                    there was
                    > > > an easy way to do that, or do I have to build my own bar without
                    that
                    > > > button?
                    > > >
                    > > > Thanks, Jamie
                    > > >
                    > > >
                    > > > ------------------------------------
                    > > >
                    > > > Yahoo! Groups Links
                    > > >
                    > >
                    > >
                    > >
                    > > ------------------------------------
                    > >
                    > > Yahoo! Groups Links
                    > >
                    >
                    >
                    >
                    > ------------------------------------
                    >
                    > Yahoo! Groups Links
                    >



                    ------------------------------------

                    Yahoo! Groups Links
                  Your message has been successfully submitted and would be delivered to recipients shortly.