Releases: SpringRoll/Bellhop
Releases · SpringRoll/Bellhop
1.2.0
Changes
- Reorganized the code into an event dispatcher (BellhopEventDispatcher) and the main class (Bellhop)
- Added some basic functionality tests for Travis
- Added support for NPM using require
- In the parent Bellhop instance, no longer saving a reference to
contentWindow
, instead using a reference to the iframe, in case the iframe changes src, doesn't break in iOS9 - Fixed a bug when adding multiple events to a single handler, e.g.
bellhop.on('start end progress', function(){})
1.1.8
Changed the target of the child Bellhop instance to be window.parent
instead of window.top
in situations where the child depth is greater than 1 iframe deep.
1.1.7
1.1.6
1.1.5
- Child Bellhop instance can now call
connect()
after the DOM has loaded
1.1.4
1.1.3
1.1.2
1.1.1
- Bellhop now supports a format for transporting typed instances of custom JavaScript classes (See the examples/object.html file as an example). There are a few prerequisites for getting this to work:
- The class instance must contain methods
toJSON():object
andfromJSON(object)
in order to properly serialize to and from a generic JSON object. - The
toJSON
function must add a key to the output JSON object called__classname
which is a string reference to constructing class. - Both the parent the child window must have a reference to the same class being used.
- The class instance must contain methods
- Here's an example of a typed serializing class that would work with Bellhop:
(function(){
var Bicycle = function(color, name)
{
this.color = color;
this.name = name;
};
Bicycle.prototype.toJSON = function()
{
return {
color : this.color,
name : this.name,
__classname : 'vehicles.Bicycle'
};
};
Bicycle.prototype.fromJSON = function(data)
{
this.color = data.color;
this.name = data.name;
};
window.vehicles = window.vehicles || {};
window.vehicles.Bicycle = Bicycle;
}());
1.1.0
- Removed the need for a handshake identifier
- Works with multiple Bellhop instances on the same parent page
- Fixed issues with catching JSON errors
- Removed
Function.prototype.bind
polyfill from the source (now a Bower dependency) - Re-implemented
failed
event for when connection fails