From 9ee4b78e7e790e6cf577e37a696924866733a923 Mon Sep 17 00:00:00 2001 From: fjenett Date: Sat, 3 Nov 2012 17:35:06 +0000 Subject: [PATCH] Updated JS mode examples, changed convenience function to have same camel case as Processing.getInstanceById() --- .../DocumentObjectModel/colorFinder/jsinterface.js | 2 +- .../DocumentObjectModel/colorFinder/sketch.properties | 0 .../Environment/DocumentObjectModel/nodeTree/forrest.js | 2 +- .../DocumentObjectModel/nodeTree/sketch.properties | 0 .../DocumentObjectModel/selectionFlower/selectionmonitor.js | 2 +- .../DocumentObjectModel/selectionFlower/sketch.properties | 0 javascript/examples/Environment/Input/fileReader/reader.js | 2 +- .../examples/Environment/Input/fileReader/sketch.properties | 0 javascript/examples/Environment/Input/lockedIn/promt.js | 2 +- .../examples/Environment/Input/lockedIn/sketch.properties | 0 javascript/examples/HTML5/Audio/blobb/sketch.properties | 0 javascript/examples/HTML5/Audio/blobb/snd.js | 2 +- .../examples/HTML5/DragDrop/wordDroppings/drag_drop.js | 2 +- .../examples/HTML5/DragDrop/wordDroppings/sketch.properties | 0 .../examples/HTML5/GeoLocation/hiToYouToo/sketch.properties | 0 javascript/examples/HTML5/Input/colorRange/inteface.js | 2 +- javascript/examples/HTML5/Input/colorRange/sketch.properties | 0 javascript/examples/HTML5/Input/variableInputs/interface.js | 2 +- .../examples/HTML5/Input/variableInputs/sketch.properties | 0 javascript/examples/HTML5/Video/atTheStation/mov.js | 2 +- .../examples/HTML5/Video/atTheStation/sketch.properties | 0 javascript/examples/HTML5/Video/charmyDance/mov.js | 2 +- .../examples/HTML5/Video/charmyDance/sketch.properties | 0 javascript/examples/Libraries/Box2D/simpleBox2D/magic.js | 2 +- .../examples/Libraries/Box2D/simpleBox2D/sketch.properties | 0 javascript/examples/Services/Flickr/flickrSearch/flix.js | 2 +- .../examples/Services/Flickr/flickrSearch/sketch.properties | 0 .../Services/Twitter/twitterGewitter/sketch.properties | 0 .../examples/Services/Twitter/twitterGewitter/twitt.js | 2 +- javascript/todo.txt | 5 +++++ 30 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 javascript/examples/Environment/DocumentObjectModel/colorFinder/sketch.properties create mode 100644 javascript/examples/Environment/DocumentObjectModel/nodeTree/sketch.properties create mode 100644 javascript/examples/Environment/DocumentObjectModel/selectionFlower/sketch.properties create mode 100644 javascript/examples/Environment/Input/fileReader/sketch.properties create mode 100644 javascript/examples/Environment/Input/lockedIn/sketch.properties create mode 100644 javascript/examples/HTML5/Audio/blobb/sketch.properties create mode 100644 javascript/examples/HTML5/DragDrop/wordDroppings/sketch.properties create mode 100644 javascript/examples/HTML5/GeoLocation/hiToYouToo/sketch.properties create mode 100644 javascript/examples/HTML5/Input/colorRange/sketch.properties create mode 100644 javascript/examples/HTML5/Input/variableInputs/sketch.properties create mode 100644 javascript/examples/HTML5/Video/atTheStation/sketch.properties create mode 100644 javascript/examples/HTML5/Video/charmyDance/sketch.properties create mode 100644 javascript/examples/Libraries/Box2D/simpleBox2D/sketch.properties create mode 100644 javascript/examples/Services/Flickr/flickrSearch/sketch.properties create mode 100644 javascript/examples/Services/Twitter/twitterGewitter/sketch.properties diff --git a/javascript/examples/Environment/DocumentObjectModel/colorFinder/jsinterface.js b/javascript/examples/Environment/DocumentObjectModel/colorFinder/jsinterface.js index 8d4265b8e..d4ce770ad 100644 --- a/javascript/examples/Environment/DocumentObjectModel/colorFinder/jsinterface.js +++ b/javascript/examples/Environment/DocumentObjectModel/colorFinder/jsinterface.js @@ -14,7 +14,7 @@ // Get the instance. We just use the first one. Another way would be to use // the automaticaly generated ID "colorFinder", see in index.html - var mySketchInstance = Processing.getInstanceById( getProcessingSketchID() ); + var mySketchInstance = Processing.getInstanceById( getProcessingSketchId() ); if ( mySketchInstance == undefined ) { // means it has not started setTimeout( makeTheLink, 200 ); // try again later diff --git a/javascript/examples/Environment/DocumentObjectModel/colorFinder/sketch.properties b/javascript/examples/Environment/DocumentObjectModel/colorFinder/sketch.properties new file mode 100644 index 000000000..e69de29bb diff --git a/javascript/examples/Environment/DocumentObjectModel/nodeTree/forrest.js b/javascript/examples/Environment/DocumentObjectModel/nodeTree/forrest.js index 0d141b6e6..6611483e6 100644 --- a/javascript/examples/Environment/DocumentObjectModel/nodeTree/forrest.js +++ b/javascript/examples/Environment/DocumentObjectModel/nodeTree/forrest.js @@ -5,7 +5,7 @@ window.onload = function () { } function tryFindSketch () { - var sketch = Processing.getInstanceById( getProcessingSketchID() ); + var sketch = Processing.getInstanceById( getProcessingSketchId() ); if ( sketch == undefined ) setTimeout(tryFindSketch, 200); // retry after 0.2 secs else diff --git a/javascript/examples/Environment/DocumentObjectModel/nodeTree/sketch.properties b/javascript/examples/Environment/DocumentObjectModel/nodeTree/sketch.properties new file mode 100644 index 000000000..e69de29bb diff --git a/javascript/examples/Environment/DocumentObjectModel/selectionFlower/selectionmonitor.js b/javascript/examples/Environment/DocumentObjectModel/selectionFlower/selectionmonitor.js index e654ccfb9..604305b8d 100644 --- a/javascript/examples/Environment/DocumentObjectModel/selectionFlower/selectionmonitor.js +++ b/javascript/examples/Environment/DocumentObjectModel/selectionFlower/selectionmonitor.js @@ -12,7 +12,7 @@ window.onload = function () { // this is called (repeatedly) to find the sketch function getSketchInstance() { - var s = Processing.getInstanceById(getProcessingSketchID()); + var s = Processing.getInstanceById(getProcessingSketchId()); if ( s == undefined ) { setTimeout(getSketchInstance, 200); // try again a bit later diff --git a/javascript/examples/Environment/DocumentObjectModel/selectionFlower/sketch.properties b/javascript/examples/Environment/DocumentObjectModel/selectionFlower/sketch.properties new file mode 100644 index 000000000..e69de29bb diff --git a/javascript/examples/Environment/Input/fileReader/reader.js b/javascript/examples/Environment/Input/fileReader/reader.js index 77d212b27..31d260af3 100644 --- a/javascript/examples/Environment/Input/fileReader/reader.js +++ b/javascript/examples/Environment/Input/fileReader/reader.js @@ -4,7 +4,7 @@ window.onload = function () { } function tryFindSketch() { - var sketch = Processing.getInstanceById(getProcessingSketchID()); + var sketch = Processing.getInstanceById(getProcessingSketchId()); if ( sketch == undefined ) return setTimeout(tryFindSketch, 200); // retry soon diff --git a/javascript/examples/Environment/Input/fileReader/sketch.properties b/javascript/examples/Environment/Input/fileReader/sketch.properties new file mode 100644 index 000000000..e69de29bb diff --git a/javascript/examples/Environment/Input/lockedIn/promt.js b/javascript/examples/Environment/Input/lockedIn/promt.js index 99019191b..27ad08272 100644 --- a/javascript/examples/Environment/Input/lockedIn/promt.js +++ b/javascript/examples/Environment/Input/lockedIn/promt.js @@ -6,7 +6,7 @@ window.onload = function () { // find sketch instance function tryFindSketch () { - var sketch = Processing.getInstanceById(getProcessingSketchID()); + var sketch = Processing.getInstanceById(getProcessingSketchId()); if ( sketch == undefined ) setTimeout( tryFindSketch, 200 ); // try again in 0.2 secs else diff --git a/javascript/examples/Environment/Input/lockedIn/sketch.properties b/javascript/examples/Environment/Input/lockedIn/sketch.properties new file mode 100644 index 000000000..e69de29bb diff --git a/javascript/examples/HTML5/Audio/blobb/sketch.properties b/javascript/examples/HTML5/Audio/blobb/sketch.properties new file mode 100644 index 000000000..e69de29bb diff --git a/javascript/examples/HTML5/Audio/blobb/snd.js b/javascript/examples/HTML5/Audio/blobb/snd.js index 6f47a66e0..47321007c 100644 --- a/javascript/examples/HTML5/Audio/blobb/snd.js +++ b/javascript/examples/HTML5/Audio/blobb/snd.js @@ -4,7 +4,7 @@ window.onload = function () { var audioNode = document.getElementsByTagName("audio")[0]; function tryFindSketch () { - var sketch = Processing.getInstanceById(getProcessingSketchID()); + var sketch = Processing.getInstanceById(getProcessingSketchId()); if ( sketch == undefined ) setTimeout(tryFindSketch,200); // retry else diff --git a/javascript/examples/HTML5/DragDrop/wordDroppings/drag_drop.js b/javascript/examples/HTML5/DragDrop/wordDroppings/drag_drop.js index 821101410..4e4f60262 100644 --- a/javascript/examples/HTML5/DragDrop/wordDroppings/drag_drop.js +++ b/javascript/examples/HTML5/DragDrop/wordDroppings/drag_drop.js @@ -6,7 +6,7 @@ window.onload = function () { // try and find the sketch function tryLinkSketch() { - var sketch = Processing.getInstanceById( getProcessingSketchID() ); + var sketch = Processing.getInstanceById( getProcessingSketchId() ); if ( sketch == undefined ) setTimeout(tryLinkSketch, 200); /*try again later*/ else { diff --git a/javascript/examples/HTML5/DragDrop/wordDroppings/sketch.properties b/javascript/examples/HTML5/DragDrop/wordDroppings/sketch.properties new file mode 100644 index 000000000..e69de29bb diff --git a/javascript/examples/HTML5/GeoLocation/hiToYouToo/sketch.properties b/javascript/examples/HTML5/GeoLocation/hiToYouToo/sketch.properties new file mode 100644 index 000000000..e69de29bb diff --git a/javascript/examples/HTML5/Input/colorRange/inteface.js b/javascript/examples/HTML5/Input/colorRange/inteface.js index a49dc650d..f7cb876b4 100644 --- a/javascript/examples/HTML5/Input/colorRange/inteface.js +++ b/javascript/examples/HTML5/Input/colorRange/inteface.js @@ -6,7 +6,7 @@ window.onload = function () { } function tryFindSketch () { - var sketch = Processing.getInstanceById(getProcessingSketchID()); + var sketch = Processing.getInstanceById(getProcessingSketchId()); if ( sketch == undefined ) return setTimeout(tryFindSketch, 200); // try again .. diff --git a/javascript/examples/HTML5/Input/colorRange/sketch.properties b/javascript/examples/HTML5/Input/colorRange/sketch.properties new file mode 100644 index 000000000..e69de29bb diff --git a/javascript/examples/HTML5/Input/variableInputs/interface.js b/javascript/examples/HTML5/Input/variableInputs/interface.js index 1c62f6a80..922c76bcf 100644 --- a/javascript/examples/HTML5/Input/variableInputs/interface.js +++ b/javascript/examples/HTML5/Input/variableInputs/interface.js @@ -3,7 +3,7 @@ window.onload = function () { } function tryFindSketch () { - var sketch = Processing.getInstanceById(getProcessingSketchID()); + var sketch = Processing.getInstanceById(getProcessingSketchId()); if ( sketch == undefined ) return setTimeout(tryFindSketch, 200); var controller = new Controller(sketch,"form-form"); diff --git a/javascript/examples/HTML5/Input/variableInputs/sketch.properties b/javascript/examples/HTML5/Input/variableInputs/sketch.properties new file mode 100644 index 000000000..e69de29bb diff --git a/javascript/examples/HTML5/Video/atTheStation/mov.js b/javascript/examples/HTML5/Video/atTheStation/mov.js index ccacbe183..0930ad376 100644 --- a/javascript/examples/HTML5/Video/atTheStation/mov.js +++ b/javascript/examples/HTML5/Video/atTheStation/mov.js @@ -3,7 +3,7 @@ window.onload = function () { video['loop'] = true; function tryFindSketch () { - var sketch = Processing.getInstanceById(getProcessingSketchID()); + var sketch = Processing.getInstanceById(getProcessingSketchId()); if ( sketch == undefined ) return setTimeout(tryFindSketch, 200); // retry in 0.2 secs diff --git a/javascript/examples/HTML5/Video/atTheStation/sketch.properties b/javascript/examples/HTML5/Video/atTheStation/sketch.properties new file mode 100644 index 000000000..e69de29bb diff --git a/javascript/examples/HTML5/Video/charmyDance/mov.js b/javascript/examples/HTML5/Video/charmyDance/mov.js index 95cb4895d..96046e218 100644 --- a/javascript/examples/HTML5/Video/charmyDance/mov.js +++ b/javascript/examples/HTML5/Video/charmyDance/mov.js @@ -4,7 +4,7 @@ window.onload = function () { // try to find the Processing sketch instance, or retry function tryFindSketch () { - var sketch = Processing.getInstanceById(getProcessingSketchID()); + var sketch = Processing.getInstanceById(getProcessingSketchId()); if ( sketch == undefined ) setTimeout(tryFindSketch, 200); // retry in 0.2 secs else diff --git a/javascript/examples/HTML5/Video/charmyDance/sketch.properties b/javascript/examples/HTML5/Video/charmyDance/sketch.properties new file mode 100644 index 000000000..e69de29bb diff --git a/javascript/examples/Libraries/Box2D/simpleBox2D/magic.js b/javascript/examples/Libraries/Box2D/simpleBox2D/magic.js index 46e251647..8078fa624 100644 --- a/javascript/examples/Libraries/Box2D/simpleBox2D/magic.js +++ b/javascript/examples/Libraries/Box2D/simpleBox2D/magic.js @@ -11,7 +11,7 @@ window.onload = function () { // try to get the sketch instance from Processing.js function tryFindSketch () { - var sketch = Processing.getInstanceById(getProcessingSketchID()); + var sketch = Processing.getInstanceById(getProcessingSketchId()); if ( sketch == undefined ) return setTimeout( tryFindSketch, 200 ); // retry diff --git a/javascript/examples/Libraries/Box2D/simpleBox2D/sketch.properties b/javascript/examples/Libraries/Box2D/simpleBox2D/sketch.properties new file mode 100644 index 000000000..e69de29bb diff --git a/javascript/examples/Services/Flickr/flickrSearch/flix.js b/javascript/examples/Services/Flickr/flickrSearch/flix.js index b9a738813..4c7ea9db8 100644 --- a/javascript/examples/Services/Flickr/flickrSearch/flix.js +++ b/javascript/examples/Services/Flickr/flickrSearch/flix.js @@ -18,7 +18,7 @@ window.onload = function () { var sendImage = null; function tryFindSketch () { - var sketch = Processing.getInstanceById(getProcessingSketchID()); + var sketch = Processing.getInstanceById(getProcessingSketchId()); if ( sketch == undefined ) return setTimeout(tryFindSketch, 200); //retry later diff --git a/javascript/examples/Services/Flickr/flickrSearch/sketch.properties b/javascript/examples/Services/Flickr/flickrSearch/sketch.properties new file mode 100644 index 000000000..e69de29bb diff --git a/javascript/examples/Services/Twitter/twitterGewitter/sketch.properties b/javascript/examples/Services/Twitter/twitterGewitter/sketch.properties new file mode 100644 index 000000000..e69de29bb diff --git a/javascript/examples/Services/Twitter/twitterGewitter/twitt.js b/javascript/examples/Services/Twitter/twitterGewitter/twitt.js index 39b096ff8..1562b9bf7 100644 --- a/javascript/examples/Services/Twitter/twitterGewitter/twitt.js +++ b/javascript/examples/Services/Twitter/twitterGewitter/twitt.js @@ -6,7 +6,7 @@ window.onload = function () { var sendTweet = null; function tryFindSketch () { - var sketch = Processing.getInstanceById(getProcessingSketchID()); + var sketch = Processing.getInstanceById(getProcessingSketchId()); if ( sketch == undefined ) return setTimeout(tryFindSketch, 200); //retry later diff --git a/javascript/todo.txt b/javascript/todo.txt index 8a6ca02a2..d55317972 100644 --- a/javascript/todo.txt +++ b/javascript/todo.txt @@ -11,6 +11,11 @@ LibraryManager, updating, .. Update reference / wiki to mirror changes. Make tutorial / template for Library authors. +Check "Duplicate import!" message + +Sketch > Import Library > ... +Does not work, complains about libs not supported + ---------------------------------------------------------------------------- Reference