can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r19520: LJSUP-9176: fix loading plusone button w...

Committer: dpetrov
LJSUP-9176: fix loading plusone button with ajax call
U   trunk/htdocs/js/livejournal.js
Modified: trunk/htdocs/js/livejournal.js
===================================================================
--- trunk/htdocs/js/livejournal.js	2011-07-25 07:01:44 UTC (rev 19519)
+++ trunk/htdocs/js/livejournal.js	2011-07-25 08:18:56 UTC (rev 19520)
@@ -32,15 +32,13 @@
 	//register system hooks
 	LiveJournal.register_hook( 'update_wallet_balance', LiveJournal.updateWalletBalance );
 
-    // set up various handlers for every page
-    LiveJournal.initInboxUpdate();
+	// set up various handlers for every page
+	LiveJournal.initInboxUpdate();
 
-	//check ljuniq cookie and create if needed
-// Now called from PageStats/Omniture.pm
-//	LiveJournal.checkLjUniq();
+	//ljunq cookie is checked in PageStats/Omniture.pm now
 
-    // run other hooks
-    LiveJournal.run_hook("page_load");
+	// run other hooks
+	LiveJournal.run_hook("page_load");
 };
 
 jQuery(LiveJournal.initPage);
@@ -274,6 +272,24 @@
 	} catch(e) {};
 
 	try {
+		if( jQuery.browser.msie ) {
+			var replaceNode, attrs, j, node;
+			var nodes = document.body.getElementsByTagName( 'plusone' );
+
+			for( var i = 0, l = nodes.length; i < l; ++i ) {
+				replaceNode = document.createElement( 'g:plusone' );
+				node = nodes[i];
+				attrs = node.attributes;
+
+				for( j = 0; j < attrs.length; ++j ) {
+					if( attrs[j].specified ) {
+						replaceNode.setAttribute( attrs[j].nodeName, attrs[j].nodeValue );
+					}
+				}
+
+				node.parentNode.replaceChild( replaceNode, node );
+			}
+		}
 		gapi.plusone.go();
 	} catch(e) {};
 

Tags: can3p, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments