User:NguoiDungKhongDinhDanh/scriptManager.js

// For attribution: User:MusikAnimal/scriptManager.js

var scriptsToManage; (function {	var $html;	if (mw.config.get('skin') === 'vector' || mw.config.get('skin') === 'vector-2022') {		$html = $(' ');		$html.append( '' + ' Enable scripts ' + ' '		);		$html.append( ' ' +				'' + ' '		);	} else {		$html = $(' ');		$html.append('Enable scripts ');		$html.append('  ');	}	var loadScript = function(e) {		mw.loader.load(e.data.src);	}; 	if(scriptsToManage) {		$.each(scriptsToManage, function(script, src) { var scriptName = script.replace(/ /g, '_'); $html.find('ul').append('' + script + ''); $(mw.config.get('skin') === 'vector' || mw.config.get('skin') === 'vector-2022' ? '#mw-panel' : '#column-one').append($html); $('#t-enablescript-' + scriptName).click({		 	script: script,		  	src: src		  }, loadScript); }); 	} else { 		$html.find('ul').append('No scripts registered!'); 		$(mw.config.get('skin') === 'vector' || mw.config.get('skin') === 'vector-2022' ? '#mw-panel' : '#column-one').append($html); 	} });