Committer: vvasin
LJSUP-14136: Optimize like buttons parsing. Fix facebook buttons overhead loading.U trunk/htdocs/js/livejournal.js
Modified: trunk/htdocs/js/livejournal.js =================================================================== --- trunk/htdocs/js/livejournal.js 2012-10-31 09:09:02 UTC (rev 23223) +++ trunk/htdocs/js/livejournal.js 2012-10-31 09:19:44 UTC (rev 23224) @@ -354,7 +354,7 @@ base = base.replace(/(\&|\?)+$/g, ''); var queryStr = base, queryArr = []; - + if (args) { queryStr += ( base.indexOf('?') === -1 ? '?' : '&' ); @@ -409,8 +409,10 @@ LiveJournal.parseLikeButtons = function(ctx) { try { - FB.XFBML.parse(); - } catch(e) {} + window.FB.XFBML.parse( jQuery(ctx).find('[action=recommend]').parent().get(0) ); + } catch (e) { + console.warn(e.message); + } try { if (jQuery.browser.msie) { @@ -766,7 +768,7 @@ }; LiveJournal.showWidgets = function() { - + function random() { return 'rgb(' + (Math.floor((256-199)*Math.random()) + 200) + ',' + (Math.floor((256-199)*Math.random()) + 200) + ','