MediaWiki:Gadget-morebits.js: Difference between revisions
Content deleted Content added
MusikAnimal (talk | contribs) Repo at dff0416: stop relying on .toccolours (not available in vector-2022) (#1720); support deletetalk/undeletetalk API options; disallow nested ternaries (#1695) |
Repo at 6d69a4b: fix dark mode (#1982); change default label from "Submit Query" to "Submit" (#1865) |
||
Line 460:
// fragments can't have any attributes, so just return it straight away
return [ node, node ];
// Sometimes Twinkle uses fancy searchable "select" elements. This is powered by the third party library "select2". Activate it by creating a Morebits "select" element, then call `$('select[name=sub_group]').select2({});` or similar towards the end of your main code.
case 'select':
node = document.createElement('div');
Line 471 ⟶ 472:
}
var select = node.appendChild(document.createElement('select'));
// opt out of dark mode for now
select.classList.add('notheme');
if (data.event) {
select.addEventListener('change', data.event, false);
Line 673 ⟶ 676:
subnode = node.appendChild(document.createElement('input'));
// opt out of dark mode for now
subnode.classList.add('notheme');
subnode.setAttribute('name', data.name);
Line 862 ⟶ 868:
}
subnode = node.appendChild(document.createElement('textarea'));
// opt out of dark mode for now
subnode.classList.add('notheme');
subnode.setAttribute('name', data.name);
if (data.cols) {
Line 6,012 ⟶ 6,020:
button.textContent = value.textContent;
} else {
button.textContent = msg('submit', 'Submit
}
|