מדיה ויקי:Gadget-TemplateParamWizard.js: הבדלים בין גרסאות בדף
←using [[mw:CodeEditor|CodeEditor]]: פרמטרים מספריים לא צריכים לעקוף את השאר. |
בג |
||
| שורה 31: | שורה 31: | ||
wikiCodeFinder = /[\[\]\{\}\<\>]/, | wikiCodeFinder = /[\[\]\{\}\<\>]/, | ||
globalExplanation = ''; | globalExplanation = ''; | ||
function addParam(name) { | |||
if ($.inArray(name, paramsOrder) == -1) | |||
paramsOrder.push(name); | |||
} | |||
function paramsFromSelection() { | function paramsFromSelection() { | ||
var selection = $("#wpTextbox1").textSelection('getSelection').replace(/^\s*\{\{|\}\}\s*$/g, ''); //scrap the first {{ and last }} | var selection = $("#wpTextbox1").textSelection('getSelection').replace(/^\s*\{\{|\}\}\s*$/g, ''); //scrap the first {{ and last }} | ||
| שורה 55: | שורה 60: | ||
if (name && paramPair.length) { | if (name && paramPair.length) { | ||
templateParams[name] = templateParams[name] || {options: {notInParamPage: 1}}; | templateParams[name] = templateParams[name] || {options: {notInParamPage: 1}}; | ||
addParam(name); | |||
$.extend(templateParams[name].options, {'defval': paramPair.join('=')}); | $.extend(templateParams[name].options, {'defval': paramPair.join('=')}); | ||
} | } | ||
| שורה 68: | שורה 72: | ||
while (m = paramExtractor.exec(data)) { | while (m = paramExtractor.exec(data)) { | ||
templateParams[m[1]] = {desc: '', options: {multiline: 5}}; | templateParams[m[1]] = {desc: '', options: {multiline: 5}}; | ||
addParam(m[1]); | |||
} | } | ||
} | } | ||
| שורה 117: | שורה 121: | ||
templateParams[name] = pAttribs; | templateParams[name] = pAttribs; | ||
addParam(name); | |||
} | } | ||