mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
JS mode, regression bug because of fix for #936 (server hangs) fixed
This commit is contained in:
@@ -381,11 +381,13 @@ public class JavaScriptEditor extends ServingEditor
|
||||
{
|
||||
statusEmpty();
|
||||
|
||||
startServer( getExportFolder() );
|
||||
if ( !startServer( getExportFolder() ) )
|
||||
{
|
||||
if ( !handleExport( false ) ) return;
|
||||
toolbar.activate(JavaScriptToolbar.RUN);
|
||||
}
|
||||
|
||||
if ( !handleExport( false ) ) return;
|
||||
|
||||
toolbar.activate(JavaScriptToolbar.RUN);
|
||||
// waiting for server to call "serverStarted() below ..."
|
||||
}
|
||||
|
||||
private void handleOpenInBrowser ()
|
||||
@@ -515,6 +517,16 @@ public class JavaScriptEditor extends ServingEditor
|
||||
null);
|
||||
}
|
||||
|
||||
// ------- server callbacks ----
|
||||
|
||||
public void serverStarted ()
|
||||
{
|
||||
super.serverStarted();
|
||||
|
||||
if ( !handleExport( false ) ) return;
|
||||
toolbar.activate(JavaScriptToolbar.RUN);
|
||||
}
|
||||
|
||||
// ------- utilities ---------
|
||||
|
||||
private File getExportFolder ()
|
||||
|
||||
@@ -130,7 +130,7 @@ public abstract class ServingEditor extends Editor implements BasicServerListene
|
||||
return server;
|
||||
}
|
||||
|
||||
protected void startServer ( File root )
|
||||
protected boolean startServer ( File root )
|
||||
{
|
||||
if ( server != null &&
|
||||
( !server.isRunning() || !server.getRoot().equals(root) ) )
|
||||
@@ -156,7 +156,11 @@ public abstract class ServingEditor extends Editor implements BasicServerListene
|
||||
statusNotice( "Server running (" +
|
||||
server.getAddress() +
|
||||
"), reload your browser window." );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean serverRunning ()
|
||||
|
||||
Reference in New Issue
Block a user