User:.jun/wikia.js

$(function {	$('#WikiaRail').on('DOMNodeInserted', function { var module = { popular: '' + ' Popular pages ' + '' + ' ',			viewed: '' + ' Most viewed pages ' + '' + ' '		};		$('#videosModule').replaceWith(module.popular + module.viewed); mw.util.addCSS(			'#list-module ul {' +			   'list-style: square;' +			    'margin: 0 5px 0 10px;' +			'}' +			'#list-module ul > li {' +			    'margin: 2px 0;' +			    'font-size: 13px;' +			'}'		); $.when(			$.get('/api/v1/Articles/Popular?limit=10'),			$.get('/api/v1/Articles/Top?limit=10')		).done(function(popular, top) {			var list = {				popular: '',				top: ''			};			for (var i in popular[0].items) {				list.popular +=					'' +						'' + popular[0].items[i].title + '' +					'';			}			for (var i in top[0].items) {				list.top +=					'' +						'' + top[0].items[i].title + '' +					'';			}			$('#popular-pages').html(list.popular);			$('#top-pages').html(list.top);		}); }); });