GithubHelp home page GithubHelp logo

fjenett / javascript-mode-processing Goto Github PK

View Code? Open in Web Editor NEW
57.0 57.0 13.0 10.63 MB

Former ProcessingJS mode (Processing 1.5) that became JavaScript mode (Processing 2.0 beta) that has now been moved out of the Processing IDE.

Processing 3.74% JavaScript 85.65% HTML 0.29% Java 10.33%

javascript-mode-processing's People

Contributors

fjenett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

javascript-mode-processing's Issues

Should be able to determine sketch size when it is computed only from constants

Example code:

static final int WID=400;
static final int HEI=400;


void setup() {
  size(WID,HEI);
}

let alone this:

static final int WID=400;
static final int FACTOR=2;
static final int HEI=400;


void setup() {
  size(WID*FACTOR,HEI);
}

Expected: both should export just fine, since the provided values are constants.

Observed: it issues an error, which I have to remember because it only shows up once (i'll report that as a separate bug), which says more or less:

The size of the sketch cannot be determined from your code. You'll have to edit the html...

size(width,height) causes thread error

Hi,

When I use the IDE in javascript mode to compile a Processing-js project and change the size value with this:

void setup() {
  int dim = 100;
  size(dim, dim);
}

I receive this error:

Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: processing.app.Base.showWarning(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Exception;)V
    at de.bezier.mode.javascript.JavaScriptBuild.build(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptBuild.export(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptMode.handleExport(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptEditor.handleExport(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptEditor.handleStartServer(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptEditor$15.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

This both on 2.2.1 and 3.0a2

Can't install Javascript Mode in Processing 2.1.1 (Mac OSX 10.9.2)

This is the console output:

javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1675)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1673)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1671)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1244)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at processing.app.contrib.ContributionManager.download(ContributionManager.java:69)
at processing.app.contrib.ContributionManager$1.run(ContributionManager.java:123)
at java.lang.Thread.run(Thread.java:744)
Caused by: javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name
at sun.security.ssl.ClientHandshaker.handshakeAlert(ClientHandshaker.java:1292)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1952)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1077)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:2398)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1557)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2678)
at java.net.URLConnection.getHeaderFieldLong(URLConnection.java:639)
at java.net.URLConnection.getContentLengthLong(URLConnection.java:511)
at java.net.URLConnection.getContentLength(URLConnection.java:495)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentLength(HttpsURLConnectionImpl.java:398)
at processing.app.contrib.ContributionManager.download(ContributionManager.java:65)
... 2 more

The date could not be parsed.

Hi guys, this is what I got yesterday:

The date β€œFri Jun 05 16:01:26 CEST 2043” could not be parsed.
Please report this as a bug so we can fix it.

I got it when starting server in JavaScript mode. Actually I wasn't doing anything special, when I tried to start server again after few seconds, it worked OK. My system time is synchronized with 'time.fi.muni.cz'; UTC +01:00.

Add javascript code to index.html template so that the canvas is focused as the page is loaded

keyPressed() and keyReleased() are not triggered unless the canvas is focused, which usually means that they won't work until you click on it. That's because processing.js attaches the listeners to the canvas object.

From a "standard sketch page" such as that generated by JavaScript mode, one expects the sketch to behave as similarly as possible to a sketch in Processing. So, when you load the page, one expects the keystrokes to trigger the keyPressed() and keyReleased() events from the beginning as it would happen when you run a sketch from Processing's IDE.

That can be accomplished easily by adding few lines of javascript to the html template, so that the canvas containing the sketch is focused on page load.

Processing.js's author gives a couple of pretty good reasons for not doing this from PJS itself: (1) there may be more than one sketch in a page, and (2) a sketch may not be the main thing on the page. However, neither of these apply to the page generated by JavaScript Mode, which is intended to be as similar an experience as possible to a sketch run from the Processing IDE.

print and println should html-encode the output

Test code:

println("<test>aaa</test>");

Expected visible output in the console:

<test>aaa</test>

Observed output in the console:

aaa

The same issue can (obviously) be observed by println'ing an XML object.

If you inspect element you'll see that the output is actually there, but since it is interpreted as html by the browser, the tags are not visible.
Print and println should encode the necessary characters into html entities or, perhaps simpler, wrap the output into CDATA blocks (in this case, don't forget to escape any CDATA block that may be present in the string passed to print[ln]), before adding it to the html document.

TTF fonts don't load properly

Passing on this ticket entered on Lighthouse (http://processing-js.lighthouseapp.com/projects/41284/tickets/2067-ttf-fonts-dont-load-properly#ticket-2067-1):

Env: ProcessingJS 1.4.1 / OSX 10.8.4 / Firefox 22.0

Test case:

/* @pjs font="automat.ttf"; */

void setup()
{
size(200,200);
noLoop();
textFont(createFont("automat",32));
}

void draw()
{
background(255);
String t = "P.js";
float tw = textWidth(t);
fill(0);
text(t, (width-tw)/2, (height+32)/2);
}

screen-shot-2014-02-26-at-8-39-26-pm

Sketch: https://drive.google.com/file/d/0BwrY_kn-ktHEN3hOcXNwZDJkSkE/edit?usp=sharing

Cannot change to "JavaScript Mode" when there's a ".java" file present.

I've got a cross-mode sketch which needs a ".java" tab when in "Java Mode".
But when trying to change to "JS Mode", it refuses to when non-".pde" files are present!
That is going on even in Processing 2. And it's now present for Processing 3 too.
Of course I don't want for both "JS & CS Modes" to recognize & display tabs which aren't ".pde", ".js" or ".coffee".

http://forum.Processing.org/two/discussion/12532/windowjs-cross-mode-alert-confirm-prompt-other-js-api-for-java

touch support throwing an error in chrome

I'm attempting to run a processing.js sketch on a mobile device, but every time the user initiates a mouse event the following exception is thrown:

Uncaught ReferenceError: eventHandlers is not defined

The error occurs at the following location in processing.js:
https://github.com/fjenett/javascript-mode-processing/blob/master/resources/template/processing.js#L7575

I would have thought that 'eventHandlers' would be included in the scope where the callback to attachEventHandlers() is being defined, but apparently not. I've been able to replicate this issue using the mobile device emulator in Chrome for Windows v43.0.2357.124 m.

For completeness, I've included a basic sketch that demonstrates the problem:

void setup() {
  size(300, 300); 
}

PVector m = new PVector(), displace = new PVector();
boolean pressing = false;
void mousePressed() {
  m.set(mouseX, mouseY);
  pressing = true;
}

void mouseReleased() {
  pressing = false;
}

void draw() {
  background(0);

  if (pressing) {
    displace = PVector.sub(m, new PVector(mouseX, mouseY));
    float rad = displace.mag()*2.0;
    fill(255);
    ellipse(m.x, m.y, rad, rad);
  }
}

size(int, int) not working in javascript export when passed stored int variables Edit

In processing 2.1 on OSX 10.7.5, I am experiencing and issue in Javascript mode when exporting a sketch for web.

In the javascript mode, when entering numbers directly into "size()", like:

size(960, 640);

The javascript correctly exports to a canvas tag correctly as:

<canvas id="sizeissue" data-processing-sources="sizeissue.pde" 
                        width="960" height="640">

However, when stored local or global int variables are passed into the function, like:

  int width = 960;
  int height = 640;
  size(int(width), int(height));

The canvas tag renders incorrectly, as:

<canvas id="sizeissue" data-processing-sources="sizeissue.pde" 
                        width="100" height="100">

When passed the variables directly, the server will not run:

  int width = 960;
  int height = 640;
  size(width, height);

And gives the error:

Exception in thread "Processing.BasicServer" java.lang.NoSuchMethodError: processing.app.Base.showWarning(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Exception;)V
    at de.bezier.mode.javascript.JavaScriptBuild.build(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptBuild.export(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptMode.handleExport(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptEditor.handleExport(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptEditor.serverStarted(Unknown Source)
    at de.bezier.mode.javascript.BasicServer.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:744)

A sketch that can replicate the issue:

void setup() 
{
  int width = 960;
  int height = 640;
 // size(960, 640);
 // size(width, height);

  size(int(width), int(height));

  background(63, 63, 63);

}

void draw() {

}

Little mistake in variableInputs example

The variable "menuItems" is declared as:
String[] menuItems;
and should be
String[][] menuItems;

as it is initialized latter like this:

menuItems = new String[] {
new String[] {"Rectangle"}, new String[] {"Ellipse"},
new String[] {"Star"}, new String[] {"Spirograph"}
};

And the js function is waiting for an array of arrays.

"console" output is unreadable

The default style for the pseudo-console, where the output of print and println's is written, shuld by default be readable, e.g. white text over black background, as it actually used to be some versions ago.
At some point it got broken. Now the text is light grey and the background is slightly-less-light grey, almost the same color. The text is unreadable.

Not sure at this point whether this is more a bug in JS Mode or in PJS itself.
PJS does apply (since 1.4.13) a 'console' class to the console div. So perhaps JS Mode should have a default CSS that results in a decent layout for the console.

Support retina display

Have no retina device atm. to test this but it was supported to be "blurry" on them.

Not sure if this is our template or rather a Processing.js issue.

JavaScript mode doesn't work with more than one .pde file

It seems you didn't take into account that Processing supports sketches made of more than one .pde file, e.g. with one main sketch file plus one file per class definition. You can add files from the IDE.
In Java mode they are compiled together.

processing.js also supports that by simply inserting the list of files in the data-processing-sources attribute of the canvas node.

However, JavaScript mode ignores that, only copies the one main .pde file into the web-export folder, and only includes that one in the data-processing-sources attribute.

This renders JavaScript mode useless for sketches including more than one file.

Additionally, since the web-export folder is wiped out every time the sketch is exported, there doesn't even seem to be an easy workaround.

JavaScript mode should copy all .pde files, not only the one with the same name as the folder, into web-export, and include all of them in the data-processing-sources attribute (I don't remember if they need to be separated by commas or spaces or what)

Can't install Javascript Mode in Processing 2.1.1 (Mac OSX 10.9.2)

This is the console output:

javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1675)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1673)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1671)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1244)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at processing.app.contrib.ContributionManager.download(ContributionManager.java:69)
at processing.app.contrib.ContributionManager$1.run(ContributionManager.java:123)
at java.lang.Thread.run(Thread.java:744)
Caused by: javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name
at sun.security.ssl.ClientHandshaker.handshakeAlert(ClientHandshaker.java:1292)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1952)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1077)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:2398)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1557)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2678)
at java.net.URLConnection.getHeaderFieldLong(URLConnection.java:639)
at java.net.URLConnection.getContentLengthLong(URLConnection.java:511)
at java.net.URLConnection.getContentLength(URLConnection.java:495)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentLength(HttpsURLConnectionImpl.java:398)
at processing.app.contrib.ContributionManager.download(ContributionManager.java:65)
... 2 more

JavaScript mode in Processing 2.0.1 does not install on MacOSX (10.8.4)

As the title states.
"JavaScript mode in Processing 2.0.1 does not install on MacOSX (10.8.4)"
Android mode installed with no problems.

Repro:

  1. Create to New sketch
  2. Choose Add Mode from the top-right box (drop-down already includes Java, Experimental and Android). Choose JavaScript.
  3. Watch the bar whirl away with no progress.

I can not see any error messages generated anywhere, nor any pertinent output from the console.

Text in warning popups should ALWAYS be copy-pastable

It fills me with rage when a popup appears with a warning or error or a message of any kind, and I can't copy and paste its text. Be it in order to report a bug or google it.

An example is the warning that says that the size cannot be determined from the sketch code, when you pass size() variables as parameters. The text of the message is not copy-pastable.

Cannot-determine-size warning is never displayed after the first time

Steps to reproduce:

  1. Try to run this sketch:
int wid=random(300,400);
int hei=random(300,400);

void setup() {
  size(wid,hei);
}

AS EXPECTED, it will show a warning: "The size of this applet could not be determined from your code, etc etc".

Now
2) Stop the server and run again
3) Stop the server, delete the web-export folder, try to run again
4) Stop the server, create a new sketch with similar code and run it

Expected behavior:
at step 2, or at the very least 3 and 4, the warning should be displayed again.

If the warning had a "don't show this message again" checkbox, then if checked, the warning may not be displayed again for the same sketch, perhaps even in case (3), or even until restart. But only if there was a "don't show again" option.

Make this mode working with 2.0b9

In the console it says after switching to the JS-mode:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at processing.app.EditorToolbar.loadImages(EditorToolbar.java:145)
    at de.bezier.mode.javascript.JavaScriptToolbar.init(Unknown Source)
    at processing.app.EditorToolbar.paintComponent(EditorToolbar.java:170)
    at javax.swing.JComponent.paint(JComponent.java:1037)
    at javax.swing.JComponent.paintChildren(JComponent.java:870)
    at javax.swing.JComponent.paint(JComponent.java:1046)
    at javax.swing.JComponent.paintChildren(JComponent.java:870)
    at javax.swing.JSplitPane.paintChildren(JSplitPane.java:1030)
    at javax.swing.JComponent.paint(JComponent.java:1046)
    at javax.swing.JComponent.paintToOffscreen(JComponent.java:5132)
    at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1491)
    at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1422)
    at javax.swing.RepaintManager.paint(RepaintManager.java:1225)
    at javax.swing.JComponent._paintImmediately(JComponent.java:5080)
    at javax.swing.JComponent.paintImmediately(JComponent.java:4890)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:786)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714)
    at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:694)
    at javax.swing.RepaintManager.access$700(RepaintManager.java:41)
    at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1636)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:666)
    at java.awt.EventQueue.access$400(EventQueue.java:81)
    at java.awt.EventQueue$2.run(EventQueue.java:627)
    at java.awt.EventQueue$2.run(EventQueue.java:625)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:636)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

limitations of functions when writing pure javascript

Now I'm over here!

I might not be understanding the limits and goals of JS Mode, but I've noticed the following:

//this works fine, speak() prints "hello" to console
function speak(){
     println("hello");
};

//unexpected token {
var speak = function(){
     println("hello");
};

//unexpected token: what
function speak(what){
     println(what);
};

Is there something I'm doing wrong or have these capabilities not been implemented yet?

Nonsense java error when trying to run a sketch. Doesn't start the server and doesn't point to any error in sketch code

I'm trying to run a sketch which works fine in Java mode.

At the first try I got this error in the IDE's console:

Exception in thread "Processing.BasicServer" java.lang.NoSuchMethodError: processing.app.Base.showWarning(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Exception;)V
    at de.bezier.mode.javascript.JavaScriptBuild.build(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptBuild.export(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptMode.handleExport(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptEditor.handleExport(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptEditor.serverStarted(Unknown Source)
    at de.bezier.mode.javascript.BasicServer.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

The browser tab opened but kept waiting forever.

At the second try I got this error:

Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: processing.app.Base.showWarning(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Exception;)V
    at de.bezier.mode.javascript.JavaScriptBuild.build(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptBuild.export(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptMode.handleExport(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptEditor.handleExport(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptEditor.handleStartServer(Unknown Source)
    at de.bezier.mode.javascript.JavaScriptToolbar.handlePressed(Unknown Source)
    at processing.app.EditorToolbar.mousePressed(EditorToolbar.java:474)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

and the status bar says "server started; reload your browser window". Even after hitting the Stop button (and seeing the "server stopped" message), at any further try I get the same second error, and it does not even attempt to open the browser window, and it keep saying "server started; reload your browser window" despite the fact that the server should have been stopped.

As you can see there's no reference whatsoever to any error in the sketch code, so even if this is being triggered by some issue with my code, the behavior is wrong and buggy.

I may send you the sketch privately if you need it to debug the issue.
I've tried an empty sketch and it "runs" as expected.

processing.js from custom template folder not used?

Steps:

  • create js sketch, save
  • create custom template from menu
  • alter processing.js code in template dir (add a comment)
  • run sketch, check processing.js that has loaded in browser and exists in web-export dir for existance of custom comment

@pjs preload doesn't export images

Using the JavaScript Mode with the Processing IDE 2.2.1

/* @pjs preload="stars.jpeg"; */

void setup(){
  size(450,450);
  background(244);

  PImage img = loadImage("stars.jpeg");
  image(img, 0, 0); 
}

After starting the server, the browser opens a new tab, but I only see a blank screen: Because the images aren't copied to the web-export directory. When I manually copy the images to the web-export directory and reloading the browser the image is shown. Seems to be a bug?

keep processing.js up to date

I expected that with a fresh download of JavaScript mode I would get the latest version of Processing.js, but it turn out it was foolish of me.

JavaScript mode currently bundles a very obsolete version of processing.js

Processing.js is available at https://raw.githubusercontent.com/processing-js/processing-js/master/processing.js and ttps://raw.githubusercontent.com/processing-js/processing-js/master/processing.min.js and is actively maintained.
It should be possible to add a feature to the javascript mode such that it would automatically download the latest release from there, at least when the user installs JavaScript Mode.

Plus, it should also be possible to have it check automatically for available updates of processing.js.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.