Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed to have methods available in ender
  • Loading branch information
thomassturm committed May 24, 2011
1 parent 849d7a8 commit 8b65eaf
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions ender-postmessage.js
Expand Up @@ -21,7 +21,6 @@
// 0.4 - (8/25/2009) Initial release

!function ($) {
$.ender({
// A few vars used in non-awesome browsers.
var interval_id,
last_hash,
Expand All @@ -41,6 +40,8 @@
p_receiveMessage,

has_postMessage = window[postMessage];
$.ender({


// Method: ender.postMessage
//
Expand Down Expand Up @@ -70,7 +71,7 @@
//
// Nothing.

postMessage = function( message, target_url, target ) {
postMessage: function( message, target_url, target ) {
if ( !target_url ) { return; }

// Default to parent if unspecified.
Expand All @@ -88,7 +89,7 @@
// callback.
target.location = target_url.replace( /#.*$/, '' ) + '#' + (+new Date) + (cache_bust++) + '&' + message;
}
};
},

// Method: ender.receiveMessage
//
Expand Down Expand Up @@ -137,14 +138,14 @@
//
// Nothing!

receiveMessage = p_receiveMessage = function( callback, source_origin, delay ) {
receiveMessage: function( callback, source_origin, delay ) {
if ( has_postMessage ) {
// Since the browser supports window.postMessage, the callback will be
// bound to the actual event associated with window.postMessage.

if ( callback ) {
// Unbind an existing callback if it exists.
rm_callback && p_receiveMessage();
rm_callback && receiveMessage();

// Bind the callback. A reference to the callback is stored for ease of
// unbinding.
Expand Down Expand Up @@ -187,6 +188,6 @@
}, delay );
}
}
};
});
}
});
}(ender);

0 comments on commit 8b65eaf

Please sign in to comment.