[ 10 posts ]

paulm

  • Username: paulm
  • Joined: Sat Dec 12, 2009 5:22 am
  • Posts: 114
  • Location: Maine
  • Offline
  • Profile
Tags:

Dav questions on previous suggestions please

Post Posted: Fri Jan 01, 2010 8:09 pm
+0-
Dav regarding your suggestions for editor buttons:
where to put this in simle editor widget code and do I have it right?
myEditor._getWindow().print('print', {buttons: [{ type: 'push', label: 'Print', value: 'print' }, ]);

and how/where to use myEditor.render(); to clear window? (print/clear buttons in editor toolbar is goal)

Regarding your sam radio buttons: I've got code in head in <style type = "text/css"></style> tags and radio buttons
<input type="radio" name="theme" value="grey" /> etc. in body. buttons are not showing style. tried body class sam skin tag around radio buttons that doesn't help either. also tried
<input class="yui-radio-button" name="theme" value="grey" />

help please--thank you.

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: Dav questions on previous suggestions please

Post Posted: Fri Jan 01, 2010 9:16 pm
+0-
Here is a working example of both:

http://blog.davglass.com/files/yui/editor77/

paulm

  • Username: paulm
  • Joined: Sat Dec 12, 2009 5:22 am
  • Posts: 114
  • Location: Maine
  • Offline
  • Profile
Tags:

Re: Dav questions on previous suggestions please

Post Posted: Sat Jan 02, 2010 7:45 am
+0-
thanks Dav for writing that example. I have simple editor set up minimally with just a few buttons, but toolbarLoaded loads all buttons, and putting var newGroup in various places within my existing code is not working. for example if I replace toolbarLoaded with just toolbar: and paste your code after or in button section of code, the editor doesn't render. so please advise how/where to put your code in existing javascript. thanks!

also source for png button icons?

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: Dav questions on previous suggestions please

Post Posted: Sat Jan 02, 2010 4:09 pm
+0-
I can't tell you how to put it in your code because I can't see your code ;)

The icons are from:
http://iconlet.com/search?n=print
http://iconlet.com/search?n=clear

paulm

  • Username: paulm
  • Joined: Sat Dec 12, 2009 5:22 am
  • Posts: 114
  • Location: Maine
  • Offline
  • Profile

Re: Dav questions on previous suggestions please

Post Posted: Sat Jan 02, 2010 5:54 pm
+0-
Dav thanks for the link to icons. Here is my code with your latest kind of mashed in I was experimenting. Thanks in advance
Code:
var editor = new YAHOO.widget.SimpleEditor('msgpost', {
    height: '250px',
    width: '465px',
    dompath: true,
   animate: true,
   handleSubmit: true
});

//editor.on('toolbarLoaded', function() {
   
   toolbar: {
        titlebar: 'Write something.',
        buttons: [
            { group: 'textstyle', label: 'Font Style',
                buttons: [
                    { type: 'push', label: 'Bold', value: 'bold' },
                    { type: 'push', label: 'Italic', value: 'italic' },
                    { type: 'separator' },
                    { type: 'select', label: 'Arial', value: 'fontname', disabled: true,
                        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' }
                        ]
                    },
                    { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true },
                    { type: 'separator' },
                    { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true },
                    { type: 'color', label: 'Background Color', value: 'backcolor', disabled: false },
               
                ]
            }
      ]
},
   //Create a new Group of buttons
   var newGroup = {
        group: 'clearprint', label: 'Clear/Print',
        buttons: [
            //Add the Clear Button
            { type: 'push', label: 'Clear', value: 'clear' },
            //Add the Print Button
            { type: 'push', label: 'Print', value: 'print' }
        ]
    };
    //Add the group to the Toolbar
    editor.toolbar.addButtonGroup(newGroup);
 
    //Listen for the clear button click
    editor.toolbar.on('clearClick', function(ev) {
        //Clear the Editor
        editor.setEditorHTML('');
        //Focus the Editor
        editor.focus();
    });
    //Listen for the Print button click
    editor.toolbar.on('printClick', function(ev) {
        //Tell the window to print.
        editor._getWindow().print();
    });
});
editor.render();

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile
Tags:

Re: Dav questions on previous suggestions please

Post Posted: Sat Jan 02, 2010 9:39 pm
+0-
Paul --

I don't want to sound "mean", but you may want to check out some of the videos in the YUI Theater:
http://developer.yahoo.com/yui/theater/

That JS is nowhere near valid, you may need to learn a little more JS ;)

Anyway, here is a cleaned up version:
http://gist.github.com/267843

paulm

  • Username: paulm
  • Joined: Sat Dec 12, 2009 5:22 am
  • Posts: 114
  • Location: Maine
  • Offline
  • Profile

Re: Dav questions on previous suggestions please

Post Posted: Sun Jan 03, 2010 6:46 am
+0-
Dav I've copied/pasted your new version and editor is not rendering--why I don't know but maybe you could shed some light.

I'm off to watch your Editor vid. YUI theater is great. Even what I have on my site now is beyond where I was with CSS. So thanks!

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: Dav questions on previous suggestions please

Post Posted: Sun Jan 03, 2010 4:54 pm
+0-
I need to see the page, so give me a link and I will take a look.

paulm

  • Username: paulm
  • Joined: Sat Dec 12, 2009 5:22 am
  • Posts: 114
  • Location: Maine
  • Offline
  • Profile

Re: Dav questions on previous suggestions please

Post Posted: Mon Jan 04, 2010 6:47 am
+0-
almost there, but clear.png not showing: http://www.releasecenter.org

app is not running yet but at least the editor is cool!

watched your editor vid. what's cool to think about is that as far as text and writer behavior is concerned this interface seems to have unlimited possibilities.

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile
Tags:

Re: Dav questions on previous suggestions please

Post Posted: Mon Jan 04, 2010 7:36 am
+0-
It's not picking up the CSS for that rule, because you have an invalid comment above the rule:

Code:
<!--print/clear buttons-->


Should be:

Code:
/* print/clear buttons */
  [ 10 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum