MediaWiki:Thongbao.js

/** Bản cũ cần lưu tâm: http://sonako.wikia.com/wiki/MediaWiki:Thongbao.js?oldid=99216 **/ if ((mw.config.get('wgAction') === 'view') && (mediaWiki.config.get('wgPageName') !== 'Sonako_Light_Novel') && (mediaWiki.config.get('wgCanonicalSpecialPageName') !== 'WikiActivity') && (mediaWiki.config.get('wgNamespaceNumber') === 0 || mediaWiki.config.get('wgNamespaceNumber') === 4 || mediaWiki.config.get('wgNamespaceNumber') === 6 || mediaWiki.config.get('wgNamespaceNumber') === 14 || mediaWiki.config.get('wgNamespaceNumber') === 112 || mediaWiki.config.get('wgNamespaceNumber') === 114 || mediaWiki.config.get('wgNamespaceNumber') === 500 || mediaWiki.config.get('wgNamespaceNumber') === 1201)) { $('#WikiaRail').bind('DOMNodeInserted', function(event) { //fires after lazy-loading takes place.		if ($('#WikiaRail section').length && !$("#ThongBaoModule").length { // Only add it once

var newSection = '' + 'Thông báo' + ' ' + ' '; $('#WikiaRail section:first-child:not(.recirculation-rail)').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 = ' ';            $('#ThongBaoModule a').attr('target', '_blank').attr('title', 'Mở link sang Tab mới.');            tabberAutomatic; });		           }        }); //end of DOMNodeInserted block } }

if (mediaWiki.config.get('wgCanonicalSpecialPageName') === 'WikiActivity') { if ($('#WikiaRail').length) { //only on pages where the rail is present $('#WikiaRail').bind('DOMNodeInserted', function(event) { //fires after lazy-loading takes place.           if (!$("section#ThongBaoModule").length) { // Only add it once                var newSection = '' +                    'Thông báo' + ' ' + ' ';                $('#WikiaRail section:last-child').after(newSection);            }        }); //end of DOMNodeInserted block $.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 = ' ';            $('#ThongBaoModule a').attr('target', '_blank').attr('title', 'Mở link sang Tab mới.');            impart('u:dev:MediaWiki:TopEditors/code.js'); tabberAutomatic; });   } }

$('#WikiaRail').trigger('DOMNodeInserted'); //Bypass race condition by firing the event.