MediaWiki:Vector.js: Difference between revisions
Jump to navigation
Jump to search
Admin (talk | contribs) (Created page with "→All JavaScript here will be loaded for users of the Vector skin: function addGalleryRow() { const container = document.getElementById('gallery-builder'); const row = container.firstElementChild.cloneNode(true); row.querySelectorAll('input').forEach(i => i.value = ''); container.appendChild(row); } mw.hook('pf.formSubmit').add(function () { let gallery = '<gallery>\n'; document.querySelectorAll('.gallery-row').forEach(row => { cons...") |
|||
| Line 1: | Line 1: | ||
/* All JavaScript here will be loaded for users of the Vector skin */ | /* All JavaScript here will be loaded for users of the Vector skin */ | ||
mw.loader.using('jquery', function () { | |||
$('#addGalleryRowBtn').on('click', function () { | |||
addGalleryRow(); | |||
}); | |||
}); | |||
function addGalleryRow() { | function addGalleryRow() { | ||
alert('Button works!'); | |||
} | } | ||
Revision as of 20:11, 21 January 2026
/* All JavaScript here will be loaded for users of the Vector skin */
mw.loader.using('jquery', function () {
$('#addGalleryRowBtn').on('click', function () {
addGalleryRow();
});
});
function addGalleryRow() {
alert('Button works!');
}