mirror of
https://github.com/processing/processing4.git
synced 2026-02-11 09:39:19 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user