1
0
Fork 0

Added initial class example

website
Mike Gerwitz 2011-03-25 00:08:23 -04:00
parent ff477e75cc
commit 3d879183c1
2 changed files with 22 additions and 3 deletions

View File

@ -0,0 +1,14 @@
/**
* Basic class declaration example
*/
var Dog = Class( 'Dog',
{
'public bark': function()
{
console.log( 'Woof!' );
}
} );
Dog().bark();

View File

@ -61,6 +61,13 @@
return $trybox || ( function createTryBox()
{
$txt = $( '<textarea>' );
$.get( 'scripts/ex/class.js', function( data )
{
$txt.text( data );
} );
return $trybox = $( '<div>' )
.attr( 'id', 'trybox' )
.hide()
@ -71,9 +78,7 @@
"already imported for you. When you are ready, click " +
"<strong>Run</strong> to run the script."
) )
.append( $txt = $( '<textarea>' ).text (
"console.log( Class( 'Foo', {} ) );"
) )
.append( $txt )
.append( $( '<div>' )
.attr( 'id', 'trybtns' )
.append( $( '<div>' )