Jump to content

MediaWiki:Gadget-friendlywelcome.js: Difference between revisions

v2.0-717-gb28bc42: tag: Switch to scrollbox; add link to each template's documentation; morebits, welcome, shared: Overhaul scrollbox functionality; morebits: Remove padding: 0 from footer buttons; morebits: Add DocumentFragment and CSS class support
imported>Amalthea
(v2.0-703-gfcc0f24: misc: Make slight lint fixes to deprod, general linting and code cleanup; welcome: Add Wikipedia Adventure invite)
imported>Amalthea
(v2.0-717-gb28bc42: tag: Switch to scrollbox; add link to each template's documentation; morebits, welcome, shared: Overhaul scrollbox functionality; morebits: Remove padding: 0 from footer buttons; morebits: Add DocumentFragment and CSS class support)
Line 136:
});
 
form.append( { type: 'div', id: 'welcomeWorkArea' } );
type: "'div"',
id: "'welcomeWorkArea"',
rendered. className: = "quickform'morebits-scrollbox";'
} );
 
form.append( {
Line 168 ⟶ 172:
Twinkle.welcome.populateWelcomeList = function(e) {
var type = e.target.value;
var $workarea = $(e.target.form).find("div#welcomeWorkArea");
 
var divcontainer = new Morebits.quickForm.element({ type: "fragment" });
type: "div",
id: "welcomeWorkArea"
});
 
if ((type === "standard" || type === "anonymous") && Twinkle.getFriendlyPref("customWelcomeList").length) {
divcontainer.append({ type: 'header', label: 'Custom welcome templates' });
divcontainer.append({
type: 'radio',
name: 'template',
Line 186:
 
var appendTemplates = function(list) {
divcontainer.append({
type: 'radio',
name: 'template',
Line 207:
switch (type) {
case "standard":
divcontainer.append({ type: 'header', label: 'General welcome templates' });
appendTemplates([
"welcome",
Line 220:
"welcome non-latin"
]);
divcontainer.append({ type: 'header', label: 'Problem user welcome templates' });
appendTemplates([
"welcomelaws",
Line 236:
break;
case "anonymous":
divcontainer.append({ type: 'header', label: 'Anonymous user welcome templates' });
appendTemplates([
"welcome-anon",
Line 247:
break;
case "wikiProject":
divcontainer.append({ type: 'header', label: 'WikiProject-specific welcome templates' });
appendTemplates([
"welcome-au",
Line 276:
break;
case "nonEnglish":
divcontainer.append({ type: 'header', label: 'Non-English welcome templates' });
appendTemplates([
"welcomeen-sq",
Line 298:
break;
default:
divcontainer.append({ type: 'div', label: 'Twinkle.welcome.populateWelcomeList: something went wrong' });
break;
}
 
var rendered = divcontainer.render();
var $workarea = $(e.target.form).find("div#welcomeWorkArea").empty().append(rendered);
rendered.className = "quickform-scrollbox";
$workarea.replaceWith(rendered);
 
var firstRadio = e.target.form.template[0];
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.