Skip to content

Releases: SpringRoll/Bellhop

1.2.0

04 Nov 21:24
Compare
Choose a tag to compare

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

07 Oct 20:04
Compare
Choose a tag to compare

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

28 May 14:24
Compare
Choose a tag to compare

Further protection for just-in-case use after destroy()

1.1.6

27 May 16:16
Compare
Choose a tag to compare

The same bellhop instance may now be re-used after destroy()

1.1.5

12 Mar 21:26
Compare
Choose a tag to compare
  • Child Bellhop instance can now call connect() after the DOM has loaded

1.1.4

10 Mar 16:05
Compare
Choose a tag to compare

Add ability to remove all listeners


1.1.3

10 Feb 19:45
Compare
Choose a tag to compare

Added priority parameter to .on() for setting order of callbacks.

1.1.2

03 Feb 02:53
Compare
Choose a tag to compare
  • When using the fetch() and respond() pair, we add the ability to have the data returned by respond() be generated by a function. This function is called when respond() is invoked, and its return value is returned as data.

1.1.1

24 Jan 15:50
Compare
Choose a tag to compare
  • 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:
    1. The class instance must contain methods toJSON():object and fromJSON(object) in order to properly serialize to and from a generic JSON object.
    2. The toJSON function must add a key to the output JSON object called __classname which is a string reference to constructing class.
    3. Both the parent the child window must have a reference to the same class being used.
  • 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

21 Jan 18:45
Compare
Choose a tag to compare
  • 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