We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
popups (Read 1148 times)
popups
Dec 3rd, 2009, 6:58pm
 
I made this digg visualization with processing

http://neolab.stat.ucla.edu/diggvisual/

the nodes are supposed to link and they do work but if popups are blocked they do not work becuse the links are coming from the .jar file and not the html file so the browser thinks they are popups.

Also is there a way to scale the processing image without changing the source code? i.e. make the whole thing smaller without using void setup?
Re: popups
Reply #1 - Dec 4th, 2009, 12:31am
 
wow, I clicked once and got a hundred new tabs in firefox... I think this is not the behaviour you expect.

however, scale() might help to resize everything. call it once() at the top of the draw() function, that should do the trick.
Re: popups
Reply #2 - Dec 4th, 2009, 12:27pm
 
Works fine on Chrome, Safari, IE, firefox it seems to be messed up for some reason, it may be the version of Java it is using.

scale() wont work since the coordinates of links are read in through the data and they will still be the same after we scale the draw so the links will no longer be in the right place.
Re: popups
Reply #3 - Dec 4th, 2009, 1:09pm
 
antiplastik wrote on Dec 4th, 2009, 12:31am:
wow, I clicked once and got a hundred new tabs in firefox...

No wonder when you look at the code:
if mouse pressed, for(int i=1; i < 101; i++) link("http://digg.com/stuff", "_new")
(I simplify...)

Nice applet, anyway, but I didn't dare to try it...
Re: popups
Reply #4 - Dec 5th, 2009, 12:25pm
 
Oh, thanks for pointing that out, I fixed the loop, no more 100 popups for any browser!

still have a few problems:
1. Safari thinks the links are popups since they are coming from the .jar file and not index.html
2. data is not being updated (The WebServer admin is currently getting me permissions)
3. If the data does get updated, the browser has the .jar cached so it is not updating it

any insight on 1 and 3?
Re: popups
Reply #5 - Dec 6th, 2009, 2:48am
 
1) Not sure what is the "_new" target shown in the reference, but according to showDocument which is the Java base for link(), and according to HTML spec itself, the valid predefined targets are _blank (probably what you want), _parent, _top, _self.
Note that anti-popup feature of browsers can be hard to circumvent, precisely because they try to avoid popup invasion like the one you involuntarily made... Smiley

3) Cached jar: nothing to do automatically, you have to display the Java console and clear the cache.
You can also type javaws -viewer on the command line to visualize this cache.
When testing applet, this cache must be purged (at least from your own jars) after any update.
Page Index Toggle Pages: 1