MediaWiki:DYK-nomination-wizard.js: Difference between revisions
Content deleted Content added
update date check behaviour per feedback at WT:DYK |
change dyk-helper to dyk-wizard in edit summary, api user agent and other places |
||
Line 1:
/**
* DYK-nomination-wizard
*
* Wizard to easily create DYK nominations▼
*
* Loaded on [[Wikipedia:Did you know/Create new nomination]]
* using [[mw:Snippets/Load JS and CSS by URL]]
*
* Author: [[User:SD0001]]
*
▲ * Wizard to easily create DYK nominations
*/
Line 20 ⟶ 21:
$.ready
).then(function() {
if (mw.config.get('wgPageName') !== 'Wikipedia:Did_you_know/Create_new_nomination' ||
mw.config.get('wgAction') !== 'view') return;
Line 34 ⟶ 29:
var NOMINATIONS_PAGE = 'Template talk:Did you know';
dyk.advert = ' ([[
// Calculating prose character count, code based on [[User:Shubinator/DYKcheck.js]] and [[User:Dr pda/prosesize.js]]
Line 345 ⟶ 340:
.addClass('hlist')
.append(
$('<li>').append(Morebits.createHtml('[[
$('<li>').append(Morebits.createHtml('[[
).get()
});
Line 352 ⟶ 347:
var result = form.render();
// Attach to the page, #dyk-
$('#dyk-
dyk.updateProseSize(result, mw.util.getParamValue('article'));
Line 641 ⟶ 636:
Morebits.wiki.actionCompleted.redirect = NOMINATIONS_PAGE + '#' + dyk.articles.join(', ');
Morebits.wiki.actionCompleted.notice = 'Completed';
Morebits.wiki.api.setApiUserAgent('[[w:
var nompage = new Morebits.wiki.page(NOMPAGE_PREFIX + article, 'Creating nomination page');
Line 658 ⟶ 653:
if (pageText === newPageText) {
var linknode = document.createElement('a');
linknode.setAttribute("href", mw.util.getUrl("
linknode.appendChild(document.createTextNode('Repair nomination'));
dykpage.getStatusElement().error(['Could not find the target spot for the nomination. Please see: ', linknode, '.']);
|