User:NguoiDungKhongDinhDanh/Edit notice.js

// Install with: // // or with //  // // Globalized by NhacNy2412 // // If forking this script, please note Danny&NhacNy2412's contributions / give Danny&NhacNy2412 credit

mw.loader.using ('mediawiki.util').done (function {	if (mw.config.get('wgNamespaceNumber') != -1) {		var page = mw.config.get('wgPageName') + '/Editnotice';		mw.util.addPortletLink ('p-cactions', 'https://' + mw.config.get('wgServer') +'/w/index.php?title=' + page + '&redirect=no', 'EdNo', 'ca-pageEditNotice', 'View edit notice');		var get_EN = {			action: 'query',			prop: 'revisions',			rvprop: 'ids',			titles: page,			format: 'json'		};		$.get( mw.config.get( 'wgScriptPath' ) + '/api.php', get_EN, function (data) { console.log( data ); if (data && data.query && data.query.pages && data.query.pages["-1"]){ $('#ca-pageEditNotice').addClass('new'); }		} );	} });