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

YUI Rich Text editor menu click

Expand Messages
  • teejay_hh
    Hi everybody, i have a small issue with a newly created menu button in the editor toolbar. below is my code. I would like to know on which menu entry i have
    Message 1 of 3 , Mar 4, 2008
    • 0 Attachment
      Hi everybody,

      i have a small issue with a newly created menu button in the editor
      toolbar. below is my code. I would like to know on which menu entry i
      have clicked. I have tried several thing but with no success i hope
      anybody of you could help me.

      Best regards Thomas

      var tb = this.toolbar;
      var config = {
      group: 'layouts',
      label: 'Layouts',

      buttons: [
      { type: 'select',
      id: 'selectknopf',
      label: 'Layouts ',
      value: 'layouts',
      menu: [
      { text: 'Arial', checked: true },
      { text: 'Arial Black'},
      { text: 'Comic Sans MS' },
      { text: 'Courier New' },
      { text: 'Lucida Console' },
      { text: 'Tahoma' },
      { text: 'Times New Roman' },
      { text: 'Trebuchet MS' },
      { text: 'Verdana' }
      ]
      }

      ]
      };
      this.toolbar.addSeparator();
      this.toolbar.addButtonGroup(config);

      this.toolbar.ref = this;
      this.toolbar.on('layoutsClick', function(ev){

      //var sel = this._getSelectedElement();
      //alert(sel.text);
      alert(this);
      for (var i in ev){alert(ev[i] + ' ' + i)};
      alert(ev.target.innerHTML);
      var _sel = this.ref._getSelectedElement();
      alert(_sel.innerHTML);
      this.ref.execCommand('insertHTML','<b>na doll</b>');
      });
    • Dav Glass
      Thomas -- This example should get you going: http://blog.davglass.com/files/yui/editor49/ Hope that helps :) Dav Dav Glass dav.glass@yahoo.com
      Message 2 of 3 , Mar 4, 2008
      • 0 Attachment
        Thomas --

        This example should get you going:
        http://blog.davglass.com/files/yui/editor49/

        Hope that helps :)
        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: teejay_hh <teejay_hh@...>
        To: ydn-javascript@yahoogroups.com
        Sent: Tuesday, March 4, 2008 6:18:41 AM
        Subject: [ydn-javascript] YUI Rich Text editor menu click

        Hi everybody,

        i have a small issue with a newly created menu button in the editor
        toolbar. below is my code. I would like to know on which menu entry i
        have clicked. I have tried several thing but with no success i hope
        anybody of you could help me.

        Best regards Thomas

        var tb = this.toolbar;
        var config = {
        group: 'layouts',
        label: 'Layouts',

        buttons: [
        { type: 'select',
        id: 'selectknopf',
        label: 'Layouts ',
        value: 'layouts',
        menu: [
        { text: 'Arial', checked: true },
        { text: 'Arial Black'},
        { text: 'Comic Sans MS' },
        { text: 'Courier New' },
        { text: 'Lucida Console' },
        { text: 'Tahoma' },
        { text: 'Times New Roman' },
        { text: 'Trebuchet MS' },
        { text: 'Verdana' }
        ]
        }

        ]
        };
        this.toolbar.addSeparator();
        this.toolbar.addButtonGroup(config);

        this.toolbar.ref = this;
        this.toolbar.on('layoutsClick', function(ev){

        //var sel = this._getSelectedElement();
        //alert(sel.text);
        alert(this);
        for (var i in ev){alert(ev[i] + ' ' + i)};
        alert(ev.target.innerHTML);
        var _sel = this.ref._getSelectedElement();
        alert(_sel.innerHTML);
        this.ref.execCommand('insertHTML','<b>na doll</b>');
        });




        Yahoo! Groups Links
      • teejay_hh
        thats it Dav, thx alot. Do you have created this example especialy for my issue ?? wish u a nice day Thomas
        Message 3 of 3 , Mar 4, 2008
        • 0 Attachment
          thats it Dav, thx alot. Do you have created this example especialy for
          my issue ??

          wish u a nice day

          Thomas
        Your message has been successfully submitted and would be delivered to recipients shortly.