User:ThunderDragon2/oasis-revived.js

/** * Brings back the user's first edit date to their profile masthead * @docs FirstEditDate * @author Kofirs2634 */ $(function {	if (window.FirstEditDate) return;	window.FirstEditDate = true;	const c = mw.config.get(['wgScriptPath', 'profileUserId']);	var i18n;	if (!c.profileUserId) return;

function init { $.ajax({			method: 'get',			url: c.wgScriptPath + '/wikia.php',			data: {				controller: 'UserProfile',				method: 'getUserData',				format: 'json',				userId: c.profileUserId			}		}).done(function(r) {			$('.user-identity-stats')			.append($('', { id: 'wr', text: i18n.msg('label').plain + ' ' }) .append($(' ', { text: r.userData.registration ? r.userData.registration : i18n.msg('noedit').plain }))			);		}).fail(function(e) {			console.error('FED says an exception:', e)		}) }	importArticle({ type: 'script', article: 'u:dev:MediaWiki:i18n-js/code.js' }) mw.hook('dev.i18n').add(function(i18np) {		i18np.loadMessages('FirstEditDate').done(function(i18np) { i18n = i18np; i18n.useUserLang; var timer = setInterval(function {				if ($('#userProfileApp').length) {					clearInterval(timer);					init				}			}, 1000); })	}) })

//importing Status for compatibility testing importArticles({   type: 'script',    articles: [        //'u:dev:MediaWiki:Status/code.js',        'u:thundr2testing:User:ThunderDragon2/oasis-revived.js',    ] });