mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
fixed #971 - js mode - warn about size on export only once per session
This commit is contained in:
@@ -104,7 +104,7 @@ public class JavaScriptBuild
|
||||
* you have more than one sketch each will need a separate builder.
|
||||
*/
|
||||
protected Sketch sketch;
|
||||
|
||||
|
||||
protected Mode mode;
|
||||
|
||||
protected File binFolder;
|
||||
@@ -208,14 +208,18 @@ public class JavaScriptBuild
|
||||
// renderer
|
||||
|
||||
} catch (NumberFormatException e) {
|
||||
// found a reference to size, but it didn't seem to contain numbers
|
||||
final String message =
|
||||
"The size of this applet could not automatically be\n" +
|
||||
"determined from your code. You'll have to edit the\n" +
|
||||
"HTML file to set the size of the applet.\n" +
|
||||
"Use only numeric values (not variables) for the size()\n" +
|
||||
"command. See the size() reference for an explanation.";
|
||||
Base.showWarning("Could not find applet size", message, null);
|
||||
if ( ((JavaScriptMode)mode).showSizeWarning ) {
|
||||
// found a reference to size, but it didn't seem to contain numbers
|
||||
final String message =
|
||||
"The size of this applet could not automatically be\n" +
|
||||
"determined from your code. You'll have to edit the\n" +
|
||||
"HTML file to set the size of the applet.\n" +
|
||||
"Use only numeric values (not variables) for the size()\n" +
|
||||
"command. See the size() reference for an explanation.";
|
||||
Base.showWarning("Could not find applet size", message, null);
|
||||
// warn only once ..
|
||||
((JavaScriptMode)mode).showSizeWarning = false;
|
||||
}
|
||||
}
|
||||
} // else no size() command found, defaults will be used
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ import processing.mode.java.JavaMode;
|
||||
*/
|
||||
public class JavaScriptMode extends Mode
|
||||
{
|
||||
public boolean showSizeWarning = true;
|
||||
|
||||
private JavaScriptEditor jsEditor;
|
||||
|
||||
// create a new editor with the mode
|
||||
|
||||
Reference in New Issue
Block a user