MediaWiki:Thongbao.js

if ($('#WikiaRail').length) { $('#WikiaRail').bind('DOMNodeInserted.modules', function(event) { //fires after lazy-loading takes place.         //It is important not to unbind this event, because #WikiaRecentActivity is replaced twice when logged out.	if ($('#WikiaRail section').length && !$('#ThongBaoModule').length) { // Only add it 	              var newSection = '' +                  'Thông báo' + ' ' + ' ';              $('#WikiaRail section:first-of-type').after(newSection);        $.getJSON('/api.php?action=parse&text=&format=json', function(data) { var code = data.parse.text['*']; $('section#ThongBaoModule').append(code); // Embed The Facebook Widget to sidebar. Because ?action=render only pull some text and therefore the default embed code for FB by Wikia doesn't work document.getElementById("fbbox").innerHTML = "<iframe width='292px' height='600px' frameborder='0' src='http://www.facebook.com/v2.1/plugins/page.php?app_id=112328095453510&amp;channel=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter%2F1ldYU13brY_.js%3Fversion%3D41%23cb%3Df31a363961de4c%26domain%3Dsonako.wikia.com%26origin%3Dhttp%253A%252F%252Fsonako.wikia.com%252Ff1f51d054ac62d8%26relation%3Dparent.parent&amp;container_width=292&amp;hide_cover=false&amp;href=https%3A%2F%2Fwww.facebook.com%2FSonakoWiki&amp;locale=vi_VN&amp;sdk=joey&amp;show_facepile=true&amp;show_posts=true&amp;width=292' style='border: medium none; visibility: visible; width: 292px; height: 500px;' title='fb:page Facebook Social Plugin' scrolling='no' allowfullscreen='true' allowtransparency='true' name='fcf1590b737636' class=''> "; });         } /* End of custom "ThongBaoModule" */      }); //end of DOMNodeInserted block $('#WikiaRail').trigger('DOMNodeInserted'); //Bypass race condition by firing the event. } //end Rail check