MediaWiki:AFC-submit-wizard.js: Difference between revisions

Content deleted Content added
remove note - shortdescs added by temlates don't override ones set by {{short description}}
if rare bug, add some todo comments
Line 413:
function warningsFromPageData(page) {
var pagetext = page.revisions[0].slots.main.content;
 
var warnings = [];
 
// Show no refs warning
if (!/<ref/i.test(pagetext) && !/\{\{([Ss]fn|[Hh]arv)/.test(pagetext)) {
warnings.push('warning-norefs');
return [
new OO.ui.HtmlSnippet(linkify(msg('warning-norefs')))
];
}
 
return [];
// TODO: Show warning for use of deprecated/unreliable sources
// TODO: Show tip for avoiding peacock words or promotional language?
 
return warnings.map(function (warning) {
return new OO.ui.HtmlSnippet(linkify(msg('warning-norefs')));
});
}
 
Line 672 ⟶ 678:
} else if (shortDescExists && existingShortDesc !== ui.shortdescInput.getValue()) {
header += '{{Short description|' + ui.shortdescInput.getValue() + '}}\n';
 
// 4. Shortdesc exists, but not generated by {{short description}}, and user hasn't changed the value
} else {
Line 691 ⟶ 697:
afc.oresTopics = ui.oresTopicInput.getValue();
}
if (afc.oresTopics && afc.oresTopics.length) {
text = text.replace(/\{\{[Dd]raft topics\|.*?\}\}\n*/g, '');
header += '{{Draft topics|' + afc.oresTopics.join('|') + '}}\n';