Began adding console (currently jQuery popup)
parent
16b0ece58a
commit
32c010fd07
|
@ -4,6 +4,8 @@
|
||||||
<head>
|
<head>
|
||||||
<title>ease.js</title>
|
<title>ease.js</title>
|
||||||
<link type="text/css" rel="stylesheet" href="style.css" />
|
<link type="text/css" rel="stylesheet" href="style.css" />
|
||||||
|
<link type="text/css" rel="stylesheet"
|
||||||
|
href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/base/jquery-ui.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="header">
|
<div id="header">
|
||||||
|
@ -45,6 +47,9 @@
|
||||||
<script type="text/javascript"
|
<script type="text/javascript"
|
||||||
src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js">
|
src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js">
|
||||||
</script>
|
</script>
|
||||||
|
<script type="text/javascript"
|
||||||
|
src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js">
|
||||||
|
</script>
|
||||||
<script type="text/javascript" src="scripts/ease-full.js"></script>
|
<script type="text/javascript" src="scripts/ease-full.js"></script>
|
||||||
<script type="text/javascript" src="scripts/ui.js"></script>
|
<script type="text/javascript" src="scripts/ui.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
.hide()
|
.hide()
|
||||||
.append( $( '<h2>' ).text( 'Try ease.js' ) )
|
.append( $( '<h2>' ).text( 'Try ease.js' ) )
|
||||||
.append( $txt = $( '<textarea>' ).text (
|
.append( $txt = $( '<textarea>' ).text (
|
||||||
"Test"
|
"console.log( Class( 'Foo', {} ) );"
|
||||||
) )
|
) )
|
||||||
.append( $( '<div>' )
|
.append( $( '<div>' )
|
||||||
.attr( 'id', 'trybtns' )
|
.attr( 'id', 'trybtns' )
|
||||||
|
@ -76,13 +76,54 @@
|
||||||
.addClass( 'btn med green' )
|
.addClass( 'btn med green' )
|
||||||
.click( function()
|
.click( function()
|
||||||
{
|
{
|
||||||
var Class = easejs.Class;
|
runScript( $txt.val() );
|
||||||
eval( $txt.val() );
|
|
||||||
} )
|
} )
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.prependTo( '#content' );
|
.prependTo( '#content' );
|
||||||
} )();
|
} )();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function runScript( script )
|
||||||
|
{
|
||||||
|
var Class = easejs.Class,
|
||||||
|
|
||||||
|
$console = $( '<textarea>' )
|
||||||
|
.attr( {
|
||||||
|
id: 'try-console',
|
||||||
|
readonly: 'readonly'
|
||||||
|
} ),
|
||||||
|
|
||||||
|
$dialog = $( '<div>' )
|
||||||
|
.append( $console )
|
||||||
|
.dialog( {
|
||||||
|
title: 'Console',
|
||||||
|
modal: true,
|
||||||
|
width: '800px',
|
||||||
|
height: 'auto'
|
||||||
|
} ),
|
||||||
|
|
||||||
|
console = {
|
||||||
|
log: function( text )
|
||||||
|
{
|
||||||
|
$console.text(
|
||||||
|
$console.text() + "\n" + text
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
( function( console )
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
eval( script );
|
||||||
|
}
|
||||||
|
catch ( e )
|
||||||
|
{
|
||||||
|
console.log( e );
|
||||||
|
}
|
||||||
|
} )( console );
|
||||||
|
}
|
||||||
} )();
|
} )();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue