430N/A <!-- reset the default browser styles --> 430N/A /* Fix this - Shouldn't require body specificity */
430N/A body .yui3-button-selected {
430N/A background-color:#426FD9;
430N/A }).use('button', 'cssfonts', 'console', function(Y){
430N/A Y.log('A ninja button called ' + new
Y.Button({label:'Bruce Lee'}).getNode().getContent());
430N/A Just a basic test with a listener
430N/A A 'toggle' button listening for the selectedChange event
430N/A selectedChange:function(){
430N/A Preferably, the user would just apply a yui3-button style to an <
a> element and not use JS
430N/A A group of radio-like buttons
430N/A A group of checkbox-like buttons
430N/A Y.Buttons adds nothing useful for the gernator buttons, so just add the class and a listener.
430N/A Y.all('.generator').addClass('yui3-button').on('click', function(e){
430N/A var button, type, config;
430N/A if (type === 'disabled') {
430N/A <
body class='yui3-skin-sam'>
430N/A <
div id='yconsole'></
div>
430N/A <
h1>Button prototype</
h1>
430N/A <
button id='event' tabindex='3'>Log a message</
button>
430N/A <
h2>Toggle w/ event</
h2>
430N/A <
input type='button' id='toggle' value='Toggle'></
input>
430N/A <
button id='disabled'>Should be disabled</
button>
430N/A <
button class='group' id='btn1'>Button 13</
button>
430N/A <
button class='group' id='btn2'>Button 27</
button>
430N/A <
button class='group' id='btn3'>Button 40</
button>
430N/A <
h2>Multi-Group (checkbox)</
h2>
430N/A <
button class='multigroup' id='btn4'>Button 4</
button>
430N/A <
button class='multigroup' id='btn5'>Button 5</
button>
430N/A <
button type='button' class='multigroup' id='btn6'>Button 6</
button>
430N/A <
button class='generator' data-
type='push'>Generate Push Button</
button>
430N/A <
button class='generator' data-
type='toggle'>Generate Toggle Button</
button>
430N/A <
button class='generator' data-
type='disabled'>Generate Disabled Button</
button>
430N/A <
div id='generated' style='border:solid black 1px;'></
div>