(function (Popcorn) {
- var processingLoader = {
- readyState: 0
- },
- gmlPlayer = function( $p ) {
+ var gmlPlayer = function( $p ) {
var _stroke = 0,
onPt = 0,
document.getElementById( options.target ) && document.getElementById( options.target ).appendChild( options.container );
- if ( processingLoader.readyState === 0 ) {
+ if ( !window.Processing ) {
- processingLoader.readyState = 1;
-
- if ( !window.Processing ) {
-
- Popcorn.getScript( "http://processingjs.org/content/download/processing-js-1.2.1/processing-1.2.1.min.js", function() {
-
- processingLoader.readyState = 2;
- });
- } else {
-
- processingLoader.readyState = 2;
- }
+ Popcorn.getScript( "http://processingjs.org/content/download/processing-js-1.2.1/processing-1.2.1.min.js" );
}
// makes sure both processing.js and the gml data are loaded
var readyCheck = function() {
- if ( processingLoader.readyState === 2 ) {
+ if ( window.Processing ) {
Popcorn.getJSONP( "http://000000book.com/data/" + options.gmltag + ".json?callback=", function( data ) {
(function ( Popcorn ) {
- var processingLoader = {
- readyState: 0
- },
- toggle = function( on, options ) {
+ var toggle = function( on, options ) {
var instance = options.pjsInstance,
canvas = options.canvas;
var initProcessing,
canvas;
- if ( processingLoader.readyState === 0 ) {
-
- processingLoader.readyState = 1;
-
- if ( !window.Processing ) {
-
- Popcorn.getScript( "http://processingjs.org/content/download/processing-js-1.2.1/processing-1.2.1.min.js", function() {
+ if ( !window.Processing ) {
- processingLoader.readyState = 2;
- });
- } else {
-
- processingLoader.readyState = 2;
- }
+ Popcorn.getScript( "http://processingjs.org/content/download/processing-js-1.2.1/processing-1.2.1.min.js" );
}
options.parentTarget = document.getElementById( options.target );
});
};
- if ( options.codeReady && processingLoader.readyState === 2 ) {
+ if ( options.codeReady && window.Processing ) {
options.pjsInstance = new Processing( options.canvas, options.processingCode );
options.pjsInstance.noLoop();
context.listen( "seeking", function() {