מדיה ויקי:Gadget-TemplateParamWizard.js: הבדלים בין גרסאות בדף
מ שחזור לגרסה 31630591 מ־10:31, 21 ביוני 2021 מאת עלי בדיקה |
מ שחזור לגרסה 30511848 מ־01:48, 30 בינואר 2021 מאת קיפודנחש המשך יבוא |
||
| שורה 88: | שורה 88: | ||
if ( /\n/.test( val ) ) $.extend( tp.options, { multiline : 5 } ); | if ( /\n/.test( val ) ) $.extend( tp.options, { multiline : 5 } ); | ||
// next line is for the case where there are "choices"' but current value is not one of them: add it as a new choice. | // next line is for the case where there are "choices"' but current value is not one of them: add it as a new choice. | ||
if ( | if ( typeof tp.options.choices === 'string' && tp.options.choices.indexOf( val ) < 0 ) | ||
tp.options.choices | tp.options.choices += ( ', ' + val ); | ||
} | } | ||
} | } | ||
| שורה 114: | שורה 114: | ||
templateParams[name] = { | templateParams[name] = { | ||
desc: param.description || '', | desc: param.description || '', | ||
options: { required: param.required | options: { required: param.required }, | ||
label: param.label || name, | label: param.label || name, | ||
param: param | param: param | ||
| שורה 506: | שורה 506: | ||
checkbox = false; | checkbox = false; | ||
if ( | if (options.choices) { | ||
var choices = options.choices; | var choices = options.choices.split(/\s*,\s*/); | ||
if (choices.length > 1) { | if (choices.length > 1) { | ||
f = $('<select>').append($('<option>', {text: i18n('options select'), value: ''})); | f = $('<select>').append($('<option>', {text: i18n('options select'), value: ''})); | ||