מדיה ויקי:Gadget-TemplateParamWizard.js: הבדלים בין גרסאות בדף
תודה למשתמש:בורה בורה על מציאת הבג. |
למקרה של "אפשרויות": אם הערך הקיים אינו אחת מהאפשרויות המוצעות, הוסף אותו לרשימה. |
||
| שורה 65: | שורה 65: | ||
var name = $.trim(paramPair.shift()); | var name = $.trim(paramPair.shift()); | ||
if (name && paramPair.length) { | if (name && paramPair.length) { | ||
templateParams[name] = templateParams[name] || {options: {notInParamPage: 1}}; | var tp = templateParams[name] = templateParams[name] || {options: {notInParamPage: 1}}, | ||
val = paramPair.join( '=' ); | |||
addParam(name); | addParam(name); | ||
$.extend( | $.extend( tp.options, { 'defval': val } ); | ||
// 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 ( tp.options.choices && $.inArray( val, tp.options.choices ) < 0 ) | |||
tp.options.choices += ( ', ' + val ); | |||
} | } | ||
} | } | ||