server start/stop now generates status messages; updated template to remove use of focus ring from canvas element; added a first example

This commit is contained in:
fjenett
2011-06-04 07:51:35 +00:00
parent 82335af6cd
commit dbddec591a
4 changed files with 106 additions and 8 deletions

View File

@@ -295,16 +295,16 @@ public class JavaScriptEditor extends Editor
{
jsServer = new JavaScriptServer( serverRoot );
jsServer.start();
System.out.println( "Server started." );
while ( !jsServer.isRunning() ) {}
String location = localDomain + ":" + jsServer.getPort() + "/";
System.out.println( location );
statusNotice( "Server started: " + location );
if ( !System.getProperty("os.name").startsWith("Mac OS") )
//if ( !System.getProperty("os.name").startsWith("Mac OS") )
Base.openURL( location );
else
/*else
{
try {
String scpt = "osascript -e "+
@@ -314,12 +314,11 @@ public class JavaScriptEditor extends Editor
} catch ( Exception e ) {
Base.openURL( location );
}
}
}*/
}
else if ( jsServer.isRunning() )
{
System.out.println( "Server running, reload your browser window." );
System.out.println( localDomain + ":" + jsServer.getPort() + "/" );
statusNotice( "Server running ("+localDomain + ":" + jsServer.getPort() +"), reload your browser window." );
}
toolbar.activate(JavaScriptToolbar.RUN);
}
@@ -332,7 +331,7 @@ public class JavaScriptEditor extends Editor
if ( jsServer != null && jsServer.isRunning() )
jsServer.shutDown();
System.out.println("Server stopped.");
statusNotice("Server stopped.");
toolbar.deactivate(JavaScriptToolbar.RUN);
}

View File

@@ -105,6 +105,7 @@ public class JavaScriptMode extends Mode
File jExamples = jMode.getContentFile("examples");
return new File[] {
new File(examplesFolder, "Environment"),
new File(jExamples, "Basics"),
new File(jExamples, "Topics"),
new File(jExamples, "3D"),