Added initial class example
parent
ff477e75cc
commit
3d879183c1
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* Basic class declaration example
|
||||
*/
|
||||
|
||||
var Dog = Class( 'Dog',
|
||||
{
|
||||
'public bark': function()
|
||||
{
|
||||
console.log( 'Woof!' );
|
||||
}
|
||||
} );
|
||||
|
||||
Dog().bark();
|
||||
|
|
@ -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>' )
|
||||
|
|
Loading…
Reference in New Issue