markluffel / Corkbird (http://corkbird.org/)
Corkbird is a library for Processing that saves snapshots of a Processing sketch in JSON format and can reload these JSON snapshots in a running sketch. The library integrates with the corkbird.org website so that users can share and continue to interact with the snapshots.
Clone this repository (size: 491.7 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/markluffel/corkbird/
| commit 34: | 55f540b1a88d |
| parent 33: | 10b3470c861c |
| branch: | default |
fixing bug with domain
11 months ago
Changed (Δ128 bytes):
raw changeset »
Makefile (1 lines added, 1 lines removed)
src/corkbird/Corkbird.java (3 lines added, 4 lines removed)
src/corkbird/RemoteStorage.java (2 lines added, 2 lines removed)
| … | … | @@ -21,7 +21,7 @@ TEST_CLASSES=$(patsubst $(TEST_DIR)/%.ja |
21 |
21 |
library/corkbird.jar: build library $(CLASSES) |
22 |
22 |
cp resources/* build/corkbird |
23 |
23 |
jar cvf library/corkbird.jar -C build corkbird |
24 |
cp library/corkbird.jar ~/code/corkbird/ |
|
24 |
cp library/corkbird.jar ~/code/corkbird/static/ |
|
25 |
25 |
|
26 |
26 |
build/corkbird/%.class: src/corkbird/%.java |
27 |
27 |
javac -cp $(CLASSPATH) $(JAVAC_ARGS) src/corkbird/$*.java -d build |
Up to file-list src/corkbird/Corkbird.java:
| … | … | @@ -6,6 +6,7 @@ import java.io.IOException; |
6 |
6 |
import java.io.UnsupportedEncodingException; |
7 |
7 |
import java.lang.reflect.InvocationTargetException; |
8 |
8 |
import java.lang.reflect.Method; |
9 |
import java.net.URL; |
|
9 |
10 |
|
10 |
11 |
import javax.imageio.ImageIO; |
11 |
12 |
|
| … | … | @@ -38,10 +39,8 @@ public class Corkbird { |
38 |
39 |
|
39 |
40 |
this.parent = sketch; |
40 |
41 |
this.metadata = new DoodleMetadata(); // TODO: load from the page, or locally from... directory path? |
41 |
if(sketch.online || true) { |
|
42 |
//storage = new RemoteStorage("localhost:8080"); |
|
43 |
// TODO: pull this from params or something instead |
|
44 |
storage = new RemoteStorage("corkbird.org"); |
|
42 |
if(sketch.online) { |
|
43 |
storage = new RemoteStorage(sketch.getCodeBase()); |
|
45 |
44 |
} else { |
46 |
45 |
storage = new LocalStorage(sketch); |
47 |
46 |
} |
Up to file-list src/corkbird/RemoteStorage.java:
| … | … | @@ -21,8 +21,8 @@ class RemoteStorage implements CorkStora |
21 |
21 |
|
22 |
22 |
public String domain; |
23 |
23 |
|
24 |
RemoteStorage(String domain) { |
|
25 |
this.domain = domain; |
|
24 |
RemoteStorage(URL codebase) { |
|
25 |
this.domain = codebase.getHost()+":"+codebase.getPort(); |
|
26 |
26 |
} |
27 |
27 |
|
28 |
28 |
public void save(DoodleMetadata metadata, byte[] state, byte[] screenshot) { |
