מדיה ויקי:Gadget-TemplateParamWizard.js: הבדלים בין גרסאות בדף
←using [[mw:CodeEditor|CodeEditor]]: צודק - פירצה |
←using [[mw:CodeEditor|CodeEditor]]: לבקשת הבודקים - הסבר למה לא עובד. |
||
| שורה 301: | שורה 301: | ||
rowsBypName = {}; | rowsBypName = {}; | ||
fieldsBypName = {}; | fieldsBypName = {}; | ||
} | |||
function reportError(a,b,error) { | |||
if (error == "Not Found") | |||
error = 'לתבנית "' + template + '" אין דף דף פרמטרים - האשף לא יכול לפעול ללא דף כזה'; | |||
if (console) { | |||
for (key in a) | |||
if (typeof a[key] != 'function') | |||
console.log(key + '=>' + a[key]); | |||
console.log(b); | |||
console.log(error); | |||
} | |||
alert('טעות בהפעלת האשף.' + '\n' + error); | |||
} | } | ||
| שורה 307: | שורה 320: | ||
var match = $("#wpTextbox1").textSelection('getSelection').match(/^\{\{([^|}]*)/); | var match = $("#wpTextbox1").textSelection('getSelection').match(/^\{\{([^|}]*)/); | ||
template = match ? $.trim(match[1]) : null; | template = match ? $.trim(match[1]) : null; | ||
if (! template) | if (! template) { | ||
reportError(null, null, 'כדי להשתמש באשף התבניות יש לסמן בתיבת העריכה את התבנית.'); | |||
return; | return; | ||
} | |||
$.ajax({ | $.ajax({ | ||
url: mw.util.wikiScript('index'), | url: mw.util.wikiScript('index'), | ||
data: {title: paramPage(), action: 'raw', ctype: 'text/x-wiki'}, | data: {title: paramPage(), action: 'raw', ctype: 'text/x-wiki'}, | ||
success: buildDialog | success: buildDialog, | ||
error: reportError | |||
}); | }); | ||
} | } | ||