Diferencia entre revisiones de «MediaWiki:Common.js»
De FSF
Sin resumen de edición |
Sin resumen de edición |
||
| Línea 3: | Línea 3: | ||
/* 20260224 - Anexo para agregar encabezado arriba del SUMARIO del toc. Plantilla:FSF Panel Diario */ | /* 20260224 - Anexo para agregar encabezado arriba del SUMARIO del toc. Plantilla:FSF Panel Diario */ | ||
mw.loader.using(['mediawiki.api']).then(function() { | |||
$(function() { | |||
if ($('#toc').length) { | |||
var api = new mw.Api(); | |||
api.post({ | |||
action: 'parse', | |||
text: '{{FSF_Panel_Diario}}', | |||
contentmodel: 'wikitext', | |||
prop: 'text', | |||
format: 'json' | |||
}).done(function(data) { | |||
if (data.parse && data.parse.text) { | |||
$('#toc').prepend( | |||
$('<div class="fsf-panel-container">') | |||
.html(data.parse.text['*']) | |||
); | |||
} | |||
}); | |||
} | |||
}); | }); | ||
}); | }); | ||
Revisión del 09:30 24 feb 2026
/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios en cada carga de página */
/* 20260224 - Anexo para agregar encabezado arriba del SUMARIO del toc. Plantilla:FSF Panel Diario */
mw.loader.using(['mediawiki.api']).then(function() {
$(function() {
if ($('#toc').length) {
var api = new mw.Api();
api.post({
action: 'parse',
text: '{{FSF_Panel_Diario}}',
contentmodel: 'wikitext',
prop: 'text',
format: 'json'
}).done(function(data) {
if (data.parse && data.parse.text) {
$('#toc').prepend(
$('<div class="fsf-panel-container">')
.html(data.parse.text['*'])
);
}
});
}
});
});