absecrist / sb2-js

Automatically exported from code.google.com/p/sb2-js
0 stars 0 forks source link

Rewrite sb2.js to be contained within its own object #18

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Before now sb2.js has been polluting the global scopes of every page it is 
implemented on and is breaking pretty much every standard ever implemented in 
javascript. Embedding the player was pretty nonstandard too, forcing the player 
to init onload and not when the site designer wants to.

With the rewrite, an sb2.js player should be created as follows:

var player = new sb2js("project.sb2", canvas);

Where canvas is a DOM element and "project.sb2" is the url. There should be an 
optional third parameter "properties" which should be passed an object with a 
number of properties eg if the player has a frame or not.

Multiple players should be possible on the same page without them interfering 
with each other. There should be a variety of public functions and variables 
allowing for external access and control of the player while it is running.

BlockHandler also deserves a rewrite, it should be lookup table object of 
functions that should be extendable using external js files and sb2js.prototype.

Original issue reported on code.google.com by rhy3alte...@gmail.com on 11 Apr 2013 at 6:10