shindig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lind...@apache.org
Subject svn commit: r792735 - in /incubator/shindig/trunk/features/src/main/javascript/features/rpc: rpc.js wpm.transport.js
Date Thu, 09 Jul 2009 22:44:50 GMT
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;
     },



Mime
View raw message