You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by li...@apache.org on 2009/07/10 00:44:50 UTC
svn commit: r792735 - in
/incubator/shindig/trunk/features/src/main/javascript/features/rpc: rpc.js
wpm.transport.js
Author: lindner
Date: Thu Jul 9 22:44:50 2009
New Revision: 792735
URL: http://svn.apache.org/viewvc?rev=792735&view=rev
Log:
SHINDIG-1108 | IE8 issues with wpm RPC mechanism
Modified:
incubator/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js
incubator/shindig/trunk/features/src/main/javascript/features/rpc/wpm.transport.js
Modified: incubator/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js?rev=792735&r1=792734&r2=792735&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js Thu Jul 9 22:44:50 2009
@@ -119,6 +119,7 @@
*/
function getTransport() {
return typeof window.postMessage === 'function' ? gadgets.rpctx.wpm :
+ typeof window.postMessage === 'object' ? gadgets.rpctx.wpm :
window.ActiveXObject ? gadgets.rpctx.nix :
navigator.userAgent.indexOf('WebKit') > 0 ? gadgets.rpctx.rmr :
navigator.product === 'Gecko' ? gadgets.rpctx.frameElement :
Modified: incubator/shindig/trunk/features/src/main/javascript/features/rpc/wpm.transport.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/rpc/wpm.transport.js?rev=792735&r1=792734&r2=792735&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/rpc/wpm.transport.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/rpc/wpm.transport.js Thu Jul 9 22:44:50 2009
@@ -56,11 +56,17 @@
init: function(processFn, readyFn) {
ready = readyFn;
- // Set up native postMessage handler.
- window.addEventListener('message', function(packet) {
+ var onmessage = function(packet) {
// TODO validate packet.domain for security reasons
processFn(gadgets.json.parse(packet.data));
- }, false);
+ };
+
+ // Set up native postMessage handler.
+ if (typeof window.addEventListener != 'undefined') {
+ window.addEventListener('message', onmessage, false);
+ } else if (typeof window.attachEvent != 'undefined') {
+ window.attachEvent('onmessage', onmessage);
+ }
ready('..', true); // Immediately ready to send to parent.
return true;
},