1
0
Fork 0

Began adding console (currently jQuery popup)

website
Mike Gerwitz 2011-03-24 23:45:33 -04:00
parent 16b0ece58a
commit 32c010fd07
3 changed files with 57 additions and 3 deletions

View File

@ -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>

View File

@ -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 );
}
} )(); } )();

View File

@ -233,3 +233,11 @@ p.copyright a, p.copyright a:link {
text-align: right; text-align: right;
} }
#try-console {
width: 99%;
height: 10em;
font-size: 0.8em;
font-family: monospace;
}