', {
href: '#',
@@ -1315,7 +1315,7 @@ Twinkle.speedy.callbacks = {
text: 'To orphan backlinks',
css: { fontSize: '130%', fontWeight: 'bold' }
});
- Morebits.status.info($bigtext[0], $link[0]);
+ Morebits.Status.info($bigtext[0], $link[0]);
}
},
deleteRedirectsMain: function(apiobj) {
@@ -1346,7 +1346,7 @@ Twinkle.speedy.callbacks = {
snapshot.forEach((value) => {
const title = value.title;
- const page = new Morebits.wiki.page(title, 'Deleting redirect "' + title + '"');
+ const page = new Morebits.wiki.Page(title, 'Deleting redirect "' + title + '"');
page.setEditSummary('[[WP:CSD#G8|G8]]: Redirect to deleted page "' + Morebits.pageNameNorm + '"');
page.setChangeTags(Twinkle.changeTags);
page.deletePage(onsuccess);
@@ -1452,7 +1452,7 @@ Twinkle.speedy.callbacks = {
text = code;
} else {
// Insert tag after short description or any hatnotes
- const wikipage = new Morebits.wikitext.page(text);
+ const wikipage = new Morebits.wikitext.Page(text);
text = wikipage.insertAfterTemplates(code + '\n', Twinkle.hatnoteRegex).getText();
}
@@ -1469,7 +1469,7 @@ Twinkle.speedy.callbacks = {
pageobj.getStatusElement().warn('Unable to edit page, placing tag on talk page');
- const talk_page = new Morebits.wiki.page(talkName, 'Automatically placing tag on talk page');
+ const talk_page = new Morebits.wiki.Page(talkName, 'Automatically placing tag on talk page');
talk_page.setNewSectionTitle(pageobj.getPageName() + ' nominated for CSD, request deletion');
talk_page.setNewSectionText(code + '\n\nI was unable to tag ' + pageobj.getPageName() + ' so please delete it. ~~~~');
talk_page.setCreateOption('recreate');
@@ -1489,7 +1489,7 @@ Twinkle.speedy.callbacks = {
// Notification to first contributor, will also log nomination to the user's userspace log
if (params.usertalk) {
- const thispage = new Morebits.wiki.page(Morebits.pageNameNorm);
+ const thispage = new Morebits.wiki.Page(Morebits.pageNameNorm);
thispage.setCallbackParameters(params);
thispage.lookupCreation(Twinkle.speedy.callbacks.noteToCreator);
// or, if not notifying, add this nomination to the user's userspace log without the initial contributor's name
@@ -1499,7 +1499,7 @@ Twinkle.speedy.callbacks = {
},
addToLog: function(params, initialContrib) {
- const usl = new Morebits.userspaceLogger(Twinkle.getPref('speedyLogPageName'));
+ const usl = new Morebits.UserspaceLogger(Twinkle.getPref('speedyLogPageName'));
usl.initialText =
"This is a log of all [[WP:CSD|speedy deletion]] nominations made by this user using [[WP:TW|Twinkle]]'s CSD module.\n\n" +
'If you no longer wish to keep this log, you can turn it off using the [[Wikipedia:Twinkle/Preferences|preferences panel]], and ' +
@@ -1926,8 +1926,8 @@ Twinkle.speedy.callback.evaluateSysop = function twinklespeedyCallbackEvaluateSy
templateParams: templateParams
};
- Morebits.simpleWindow.setButtonsEnabled(false);
- Morebits.status.init(form);
+ Morebits.SimpleWindow.setButtonsEnabled(false);
+ Morebits.Status.init(form);
Twinkle.speedy.callbacks.sysop.main(params);
};
@@ -1972,13 +1972,13 @@ Twinkle.speedy.callback.evaluateUser = function twinklespeedyCallbackEvaluateUse
templateParams: templateParams
};
- Morebits.simpleWindow.setButtonsEnabled(false);
- Morebits.status.init(form);
+ Morebits.SimpleWindow.setButtonsEnabled(false);
+ Morebits.Status.init(form);
Morebits.wiki.actionCompleted.redirect = mw.config.get('wgPageName');
Morebits.wiki.actionCompleted.notice = 'Tagging complete';
- const wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), 'Tagging page');
+ const wikipedia_page = new Morebits.wiki.Page(mw.config.get('wgPageName'), 'Tagging page');
wikipedia_page.setChangeTags(Twinkle.changeTags); // Here to apply to triage
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.speedy.callbacks.user.main);
diff --git a/modules/twinkletag.js b/modules/twinkletag.js
index 058984bc3..6421d016f 100644
--- a/modules/twinkletag.js
+++ b/modules/twinkletag.js
@@ -35,14 +35,14 @@ Twinkle.tag = function twinkletag() {
Twinkle.tag.checkedTags = [];
Twinkle.tag.callback = function twinkletagCallback() {
- const Window = new Morebits.simpleWindow(630, Twinkle.tag.mode === 'article' ? 500 : 400);
+ const Window = new Morebits.SimpleWindow(630, Twinkle.tag.mode === 'article' ? 500 : 400);
Window.setScriptName('Twinkle');
// anyone got a good policy/guideline/info page/instructional page link??
Window.addFooterLink('Tag prefs', 'WP:TW/PREF#tag');
Window.addFooterLink('Twinkle help', 'WP:TW/DOC#tag');
Window.addFooterLink('Give feedback', 'WT:TW');
- const form = new Morebits.quickForm(Twinkle.tag.callback.evaluate);
+ const form = new Morebits.QuickForm(Twinkle.tag.callback.evaluate);
// if page is unreviewed, add a checkbox to the form so that user can pick whether or not to review it
const isPatroller = mw.config.get('wgUserGroups').some((r) => ['patroller', 'sysop'].includes(r));
@@ -62,7 +62,7 @@ Twinkle.tag.callback = function twinkletagCallback() {
// if article is not marked as reviewed, show the "mark as reviewed" check box
if (!isReviewed) {
// Quickform is probably already rendered. Instead of using form.append(), we need to make an element and then append it using JQuery.
- const checkbox = new Morebits.quickForm.element({
+ const checkbox = new Morebits.QuickForm.Element({
type: 'checkbox',
list: [
{
@@ -354,7 +354,7 @@ Twinkle.tag.callback = function twinkletagCallback() {
} else {
// Redirects and files: Add a link to each template's description page
- Morebits.quickForm.getElements(result, 'tags').forEach(generateLinks);
+ Morebits.QuickForm.getElements(result, 'tags').forEach(generateLinks);
}
};
@@ -367,7 +367,7 @@ Twinkle.tag.updateSortOrder = function(e) {
const sortorder = e.target.value;
Twinkle.tag.checkedTags = form.getChecked('tags');
- const container = new Morebits.quickForm.element({ type: 'fragment' });
+ const container = new Morebits.QuickForm.Element({ type: 'fragment' });
// function to generate a checkbox, with appropriate subgroup if needed
const makeCheckbox = function (item) {
@@ -483,8 +483,8 @@ Twinkle.tag.updateSortOrder = function(e) {
$workarea.find('h5:not(:first-child)').css({ 'margin-top': '1em' });
$workarea.find('div').filter(':has(span.quickformDescription)').css({ 'margin-top': '0.4em' });
- Morebits.quickForm.getElements(form, 'existingTags').forEach(generateLinks);
- Morebits.quickForm.getElements(form, 'tags').forEach(generateLinks);
+ Morebits.QuickForm.getElements(form, 'existingTags').forEach(generateLinks);
+ Morebits.QuickForm.getElements(form, 'tags').forEach(generateLinks);
// tally tags added/removed, update statusNode text
const statusNode = document.getElementById('tw-tag-status');
@@ -506,7 +506,7 @@ Twinkle.tag.updateSortOrder = function(e) {
/**
* Adds a link to each template's description page
*
- * @param {Morebits.quickForm.element} checkbox associated with the template
+ * @param {Morebits.QuickForm.Element} checkbox associated with the template
*/
var generateLinks = function(checkbox) {
const link = Morebits.htmlNode('a', '>');
@@ -1186,7 +1186,7 @@ Twinkle.tag.fileList = {
type: 'number',
name: 'DoNotMoveToCommons_expiry',
label: 'Expiration year:',
- min: new Morebits.date().getFullYear(),
+ min: new Morebits.Date().getFullYear(),
tooltip: 'If this file can be moved to Commons beginning in a certain year, you can enter it here (optional).'
}
]
@@ -1400,9 +1400,9 @@ Twinkle.tag.callbacks = {
pageobj.save(() => {
// COI: Start the discussion on the talk page (mainspace only)
if (params.coiReason) {
- const coiTalkPage = new Morebits.wiki.page('Talk:' + Morebits.pageNameNorm, 'Starting discussion on talk page');
+ const coiTalkPage = new Morebits.wiki.Page('Talk:' + Morebits.pageNameNorm, 'Starting discussion on talk page');
coiTalkPage.setNewSectionText(params.coiReason + ' ~~~~');
- coiTalkPage.setNewSectionTitle('COI tag (' + new Morebits.date(pageobj.getLoadTime()).format('MMMM Y', 'utc') + ')');
+ coiTalkPage.setNewSectionTitle('COI tag (' + new Morebits.Date(pageobj.getLoadTime()).format('MMMM Y', 'utc') + ')');
coiTalkPage.setChangeTags(Twinkle.changeTags);
coiTalkPage.setCreateOption('recreate');
coiTalkPage.newSection();
@@ -1411,7 +1411,7 @@ Twinkle.tag.callbacks = {
// Special functions for merge tags
// Post a rationale on the talk page (mainspace only)
if (params.mergeReason) {
- const mergeTalkPage = new Morebits.wiki.page('Talk:' + params.discussArticle, 'Posting rationale on talk page');
+ const mergeTalkPage = new Morebits.wiki.Page('Talk:' + params.discussArticle, 'Posting rationale on talk page');
mergeTalkPage.setNewSectionText(params.mergeReason.trim() + ' ~~~~');
mergeTalkPage.setNewSectionTitle(params.talkDiscussionTitleLinked);
mergeTalkPage.setChangeTags(Twinkle.changeTags);
@@ -1436,7 +1436,7 @@ Twinkle.tag.callbacks = {
talkDiscussionTitle: params.talkDiscussionTitle,
talkDiscussionTitleLinked: params.talkDiscussionTitleLinked
};
- const otherpage = new Morebits.wiki.page(params.mergeTarget, 'Tagging other page (' +
+ const otherpage = new Morebits.wiki.Page(params.mergeTarget, 'Tagging other page (' +
params.mergeTarget + ')');
otherpage.setChangeTags(Twinkle.changeTags);
otherpage.setCallbackParameters(newParams);
@@ -1446,7 +1446,7 @@ Twinkle.tag.callbacks = {
// Special functions for {{not English}} and {{rough translation}}
// Post at WP:PNT (mainspace only)
if (params.translationPostAtPNT) {
- const pntPage = new Morebits.wiki.page('Wikipedia:Pages needing translation into English',
+ const pntPage = new Morebits.wiki.Page('Wikipedia:Pages needing translation into English',
'Listing article at Wikipedia:Pages needing translation into English');
pntPage.setFollowRedirect(true);
pntPage.load((pageobj) => {
@@ -1486,7 +1486,7 @@ Twinkle.tag.callbacks = {
}
// Notify the user ({{Not English}} only)
if (params.translationNotify) {
- new Morebits.wiki.page(Morebits.pageNameNorm).lookupCreation((innerPageobj) => {
+ new Morebits.wiki.Page(Morebits.pageNameNorm).lookupCreation((innerPageobj) => {
const initialContrib = innerPageobj.getCreator();
// Disallow warning yourself
@@ -1495,7 +1495,7 @@ Twinkle.tag.callbacks = {
return;
}
- const userTalkPage = new Morebits.wiki.page('User talk:' + initialContrib,
+ const userTalkPage = new Morebits.wiki.Page('User talk:' + initialContrib,
'Notifying initial contributor (' + initialContrib + ')');
userTalkPage.setNewSectionTitle('Your article [[' + Morebits.pageNameNorm + ']]');
userTalkPage.setNewSectionText('{{subst:uw-notenglish|1=' + Morebits.pageNameNorm +
@@ -1525,7 +1525,7 @@ Twinkle.tag.callbacks = {
return;
}
- Morebits.status.info('Info', 'Removing deselected tags that were already present');
+ Morebits.Status.info('Info', 'Removing deselected tags that were already present');
const getRedirectsFor = [];
@@ -1548,7 +1548,7 @@ Twinkle.tag.callbacks = {
}
// Remove tags which appear in page text as redirects
- const api = new Morebits.wiki.api('Getting template redirects', {
+ const api = new Morebits.wiki.Api('Getting template redirects', {
action: 'query',
prop: 'linkshere',
titles: getRedirectsFor.join('|'),
@@ -1571,7 +1571,7 @@ Twinkle.tag.callbacks = {
}
});
if (!removed) {
- Morebits.status.warn('Info', 'Failed to find {{' +
+ Morebits.Status.warn('Info', 'Failed to find {{' +
page.title.slice(9) + '}} on the page... excluding');
}
@@ -1667,7 +1667,7 @@ Twinkle.tag.callbacks = {
// Insert tag after short description or any hatnotes,
// as well as deletion/protection-related templates
- const wikipage = new Morebits.wikitext.page(pageText);
+ const wikipage = new Morebits.wikitext.Page(pageText);
const templatesAfter = Twinkle.hatnoteRegex +
// Protection templates
'pp|pp-.*?|' +
@@ -1701,7 +1701,7 @@ Twinkle.tag.callbacks = {
if (tag === 'Merge from' || tag === 'History merge') {
tags.push(tag);
} else {
- Morebits.status.warn('Info', 'Found {{' + tag +
+ Morebits.Status.warn('Info', 'Found {{' + tag +
'}} on the article already...excluding');
// don't do anything else with merge tags
if (['Merge', 'Merge to'].indexOf(tag) !== -1) {
@@ -1722,7 +1722,7 @@ Twinkle.tag.callbacks = {
const miTest = /\{\{(multiple ?issues|article ?issues|mi)(?!\s*\|\s*section\s*=)[^}]+\{/im.exec(pageText);
if (miTest && groupableTags.length > 0) {
- Morebits.status.info('Info', 'Adding supported tags inside existing {{multiple issues}} tag');
+ Morebits.Status.info('Info', 'Adding supported tags inside existing {{multiple issues}} tag');
tagText = '';
$.each(groupableTags, addTag);
@@ -1734,7 +1734,7 @@ Twinkle.tag.callbacks = {
addUngroupedTags();
} else if (params.group && !miTest && (groupableExistingTags.length + groupableTags.length) >= 2) {
- Morebits.status.info('Info', 'Grouping supported tags inside {{multiple issues}}');
+ Morebits.Status.info('Info', 'Grouping supported tags inside {{multiple issues}}');
tagText += '{{Multiple issues|\n';
@@ -1767,7 +1767,7 @@ Twinkle.tag.callbacks = {
return;
}
- const api = new Morebits.wiki.api('Getting template redirects', {
+ const api = new Morebits.wiki.Api('Getting template redirects', {
action: 'query',
prop: 'linkshere',
titles: getRedirectsFor.join('|'),
@@ -1791,7 +1791,7 @@ Twinkle.tag.callbacks = {
}
});
if (!found) {
- Morebits.status.warn('Info', 'Failed to find the existing {{' +
+ Morebits.Status.warn('Info', 'Failed to find the existing {{' +
page.title.slice(9) + '}} on the page... skip repositioning');
}
});
@@ -1816,7 +1816,7 @@ Twinkle.tag.callbacks = {
if (!tagRe.exec(pageText)) {
tags.push(params.tags[i]);
} else {
- Morebits.status.warn('Info', 'Found {{' + params.tags[i] +
+ Morebits.Status.warn('Info', 'Found {{' + params.tags[i] +
'}} on the redirect already...excluding');
}
}
@@ -1847,7 +1847,7 @@ Twinkle.tag.callbacks = {
};
if (!tags.length) {
- Morebits.status.warn('Info', 'No tags remaining to apply');
+ Morebits.Status.warn('Info', 'No tags remaining to apply');
}
tags.sort();
@@ -2016,7 +2016,7 @@ Twinkle.tag.callbacks = {
Twinkle.tag.callback.evaluate = function twinkletagCallbackEvaluate(e) {
const form = e.target;
- const params = Morebits.quickForm.getInputData(form);
+ const params = Morebits.QuickForm.getInputData(form);
// Validation
@@ -2169,8 +2169,8 @@ Twinkle.tag.callback.evaluate = function twinkletagCallbackEvaluate(e) {
return;
}
- Morebits.simpleWindow.setButtonsEnabled(false);
- Morebits.status.init(form);
+ Morebits.SimpleWindow.setButtonsEnabled(false);
+ Morebits.Status.init(form);
Morebits.wiki.actionCompleted.redirect = Morebits.pageNameNorm;
Morebits.wiki.actionCompleted.notice = 'Tagging complete, reloading article in a few seconds';
@@ -2178,7 +2178,7 @@ Twinkle.tag.callback.evaluate = function twinkletagCallbackEvaluate(e) {
Morebits.wiki.actionCompleted.followRedirect = false;
}
- const wikipedia_page = new Morebits.wiki.page(Morebits.pageNameNorm, 'Tagging ' + Twinkle.tag.mode);
+ const wikipedia_page = new Morebits.wiki.Page(Morebits.pageNameNorm, 'Tagging ' + Twinkle.tag.mode);
wikipedia_page.setCallbackParameters(params);
wikipedia_page.setChangeTags(Twinkle.changeTags); // Here to apply to triage
wikipedia_page.load(Twinkle.tag.callbacks[Twinkle.tag.mode]);
diff --git a/modules/twinkletalkback.js b/modules/twinkletalkback.js
index c750d1a31..2fdfc02a3 100644
--- a/modules/twinkletalkback.js
+++ b/modules/twinkletalkback.js
@@ -22,14 +22,14 @@ Twinkle.talkback.callback = function() {
return;
}
- const Window = new Morebits.simpleWindow(600, 350);
+ const Window = new Morebits.SimpleWindow(600, 350);
Window.setTitle('Talkback');
Window.setScriptName('Twinkle');
Window.addFooterLink('Talkback prefs', 'WP:TW/PREF#talkback');
Window.addFooterLink('Twinkle help', 'WP:TW/DOC#talkback');
Window.addFooterLink('Give feedback', 'WT:TW');
- const form = new Morebits.quickForm(Twinkle.talkback.evaluate);
+ const form = new Morebits.QuickForm(Twinkle.talkback.evaluate);
form.append({ type: 'radio', name: 'tbtarget',
list: [
@@ -74,7 +74,7 @@ Twinkle.talkback.callback = function() {
var result = form.render();
Window.setContent(result);
Window.display();
- result.previewer = new Morebits.wiki.preview($(result).find('div#twinkletalkback-previewbox').last()[0]);
+ result.previewer = new Morebits.wiki.Preview($(result).find('div#twinkletalkback-previewbox').last()[0]);
// We must init the
const evt = document.createEvent('Event');
@@ -90,7 +90,7 @@ Twinkle.talkback.callback = function() {
ellimit: '1',
format: 'json'
};
- const wpapi = new Morebits.wiki.api('Fetching talkback opt-out status', query, Twinkle.talkback.callback.optoutStatus);
+ const wpapi = new Morebits.wiki.Api('Fetching talkback opt-out status', query, Twinkle.talkback.callback.optoutStatus);
wpapi.post();
};
@@ -115,7 +115,7 @@ Twinkle.talkback.changeTarget = function(e) {
const value = e.target.values;
const root = e.target.form;
- const old_area = Morebits.quickForm.getElements(root, 'work_area')[0];
+ const old_area = Morebits.QuickForm.getElements(root, 'work_area')[0];
if (root.section) {
prev_section = root.section.value;
@@ -127,7 +127,7 @@ Twinkle.talkback.changeTarget = function(e) {
prev_page = root.page.value;
}
- let work_area = new Morebits.quickForm.element({
+ let work_area = new Morebits.QuickForm.Element({
type: 'field',
label: 'Talkback information',
name: 'work_area'
@@ -168,11 +168,11 @@ Twinkle.talkback.changeTarget = function(e) {
label: 'Noticeboard:',
event: function(e) {
if (e.target.value === 'afchd') {
- Morebits.quickForm.overrideElementLabel(root.section, 'Title of draft (excluding the prefix): ');
- Morebits.quickForm.setElementTooltipVisibility(root.section, false);
+ Morebits.QuickForm.overrideElementLabel(root.section, 'Title of draft (excluding the prefix): ');
+ Morebits.QuickForm.setElementTooltipVisibility(root.section, false);
} else {
- Morebits.quickForm.resetElementLabel(root.section);
- Morebits.quickForm.setElementTooltipVisibility(root.section, true);
+ Morebits.QuickForm.resetElementLabel(root.section);
+ Morebits.QuickForm.setElementTooltipVisibility(root.section, true);
}
}
});
@@ -304,13 +304,13 @@ Twinkle.talkback.noticeboards = {
};
Twinkle.talkback.evaluate = function(e) {
- const input = Morebits.quickForm.getInputData(e.target);
+ const input = Morebits.QuickForm.getInputData(e.target);
const fullUserTalkPageName = new mw.Title(mw.config.get('wgRelevantUserName'), 3).toText();
- const talkpage = new Morebits.wiki.page(fullUserTalkPageName, 'Adding talkback');
+ const talkpage = new Morebits.wiki.Page(fullUserTalkPageName, 'Adding talkback');
- Morebits.simpleWindow.setButtonsEnabled(false);
- Morebits.status.init(e.target);
+ Morebits.SimpleWindow.setButtonsEnabled(false);
+ Morebits.Status.init(e.target);
Morebits.wiki.actionCompleted.redirect = fullUserTalkPageName;
Morebits.wiki.actionCompleted.notice = 'Talkback complete; reloading talk page in a few seconds';
@@ -365,7 +365,7 @@ Twinkle.talkback.callbacks = {
},
preview: function(form) {
- const input = Morebits.quickForm.getInputData(form);
+ const input = Morebits.QuickForm.getInputData(form);
if (input.tbtarget === 'talkback' || input.tbtarget === 'see') {
input.page = Twinkle.talkback.callbacks.normalizeTalkbackPage(input.page);
diff --git a/modules/twinkleunlink.js b/modules/twinkleunlink.js
index cfc1cb204..c27c316db 100644
--- a/modules/twinkleunlink.js
+++ b/modules/twinkleunlink.js
@@ -23,14 +23,14 @@ Twinkle.unlink = function twinkleunlink() {
Twinkle.unlink.callback = function(presetReason) {
const fileSpace = mw.config.get('wgNamespaceNumber') === 6;
- const Window = new Morebits.simpleWindow(600, 440);
+ const Window = new Morebits.SimpleWindow(600, 440);
Window.setTitle('Unlink backlinks' + (fileSpace ? ' and file usages' : ''));
Window.setScriptName('Twinkle');
Window.addFooterLink('Unlink prefs', 'WP:TW/PREF#unlink');
Window.addFooterLink('Twinkle help', 'WP:TW/DOC#unlink');
Window.addFooterLink('Give feedback', 'WT:TW');
- const form = new Morebits.quickForm(Twinkle.unlink.callback.evaluate);
+ const form = new Morebits.QuickForm(Twinkle.unlink.callback.evaluate);
// prepend some documentation: files are commented out, while any
// display text is preserved for links (otherwise the link itself is used)
@@ -81,13 +81,13 @@ Twinkle.unlink.callback = function(presetReason) {
} else {
query.blfilterredir = 'nonredirects';
}
- const wikipedia_api = new Morebits.wiki.api('Grabbing backlinks', query, Twinkle.unlink.callbacks.display.backlinks);
+ const wikipedia_api = new Morebits.wiki.Api('Grabbing backlinks', query, Twinkle.unlink.callbacks.display.backlinks);
wikipedia_api.params = { form: form, Window: Window, image: fileSpace };
wikipedia_api.post();
const root = document.createElement('div');
root.style.padding = '15px'; // just so it doesn't look broken
- Morebits.status.init(root);
+ Morebits.Status.init(root);
wikipedia_api.statelem.status('loading...');
Window.setContent(root);
Window.display();
@@ -95,7 +95,7 @@ Twinkle.unlink.callback = function(presetReason) {
Twinkle.unlink.callback.evaluate = function twinkleunlinkCallbackEvaluate(event) {
const form = event.target;
- const input = Morebits.quickForm.getInputData(form);
+ const input = Morebits.QuickForm.getInputData(form);
if (!input.reason) {
alert('You must specify a reason for unlinking.');
@@ -110,16 +110,16 @@ Twinkle.unlink.callback.evaluate = function twinkleunlinkCallbackEvaluate(event)
return;
}
- Morebits.simpleWindow.setButtonsEnabled(false);
- Morebits.status.init(form);
+ Morebits.SimpleWindow.setButtonsEnabled(false);
+ Morebits.Status.init(form);
- const unlinker = new Morebits.batchOperation('Unlinking ' + (input.backlinks.length ? 'backlinks' +
+ const unlinker = new Morebits.BatchOperation('Unlinking ' + (input.backlinks.length ? 'backlinks' +
(input.imageusage.length ? ' and instances of file usage' : '') : 'instances of file usage'));
unlinker.setOption('preserveIndividualStatusLines', true);
unlinker.setPageList(pages);
const params = { reason: input.reason, unlinker: unlinker };
unlinker.run((pageName) => {
- const wikipedia_page = new Morebits.wiki.page(pageName, 'Unlinking in page "' + pageName + '"');
+ const wikipedia_page = new Morebits.wiki.Page(pageName, 'Unlinking in page "' + pageName + '"');
wikipedia_page.setBotEdit(true); // unlink considered a floody operation
wikipedia_page.setCallbackParameters(Object.assign({
doBacklinks: input.backlinks.indexOf(pageName) !== -1,
@@ -166,14 +166,14 @@ Twinkle.unlink.callbacks = {
type: 'button',
label: 'Select All',
event: function(e) {
- $(Morebits.quickForm.getElements(e.target.form, 'imageusage')).prop('checked', true);
+ $(Morebits.QuickForm.getElements(e.target.form, 'imageusage')).prop('checked', true);
}
});
apiobj.params.form.append({
type: 'button',
label: 'Deselect All',
event: function(e) {
- $(Morebits.quickForm.getElements(e.target.form, 'imageusage')).prop('checked', false);
+ $(Morebits.QuickForm.getElements(e.target.form, 'imageusage')).prop('checked', false);
}
});
apiobj.params.form.append({
@@ -213,14 +213,14 @@ Twinkle.unlink.callbacks = {
type: 'button',
label: 'Select All',
event: function(e) {
- $(Morebits.quickForm.getElements(e.target.form, 'backlinks')).prop('checked', true);
+ $(Morebits.QuickForm.getElements(e.target.form, 'backlinks')).prop('checked', true);
}
});
apiobj.params.form.append({
type: 'button',
label: 'Deselect All',
event: function(e) {
- $(Morebits.quickForm.getElements(e.target.form, 'backlinks')).prop('checked', false);
+ $(Morebits.QuickForm.getElements(e.target.form, 'backlinks')).prop('checked', false);
}
});
apiobj.params.form.append({
@@ -241,15 +241,15 @@ Twinkle.unlink.callbacks = {
const result = apiobj.params.form.render();
apiobj.params.Window.setContent(result);
- Morebits.quickForm.getElements(result, 'backlinks').forEach(Twinkle.generateBatchPageLinks);
- Morebits.quickForm.getElements(result, 'imageusage').forEach(Twinkle.generateBatchPageLinks);
+ Morebits.QuickForm.getElements(result, 'backlinks').forEach(Twinkle.generateBatchPageLinks);
+ Morebits.QuickForm.getElements(result, 'imageusage').forEach(Twinkle.generateBatchPageLinks);
}
},
unlinkBacklinks: function twinkleunlinkCallbackUnlinkBacklinks(pageobj) {
let oldtext = pageobj.getPageText();
const params = pageobj.getCallbackParameters();
- const wikiPage = new Morebits.wikitext.page(oldtext);
+ const wikiPage = new Morebits.wikitext.Page(oldtext);
let summaryText = '', warningString = false;
let text;
diff --git a/modules/twinklewarn.js b/modules/twinklewarn.js
index 2795364b3..f1b490d60 100644
--- a/modules/twinklewarn.js
+++ b/modules/twinklewarn.js
@@ -55,7 +55,7 @@ Twinkle.warn.callback = function twinklewarnCallback() {
}
let dialog;
- Twinkle.warn.dialog = new Morebits.simpleWindow(600, 440);
+ Twinkle.warn.dialog = new Morebits.SimpleWindow(600, 440);
dialog = Twinkle.warn.dialog;
dialog.setTitle('Warn/notify user');
dialog.setScriptName('Twinkle');
@@ -64,7 +64,7 @@ Twinkle.warn.callback = function twinklewarnCallback() {
dialog.addFooterLink('Twinkle help', 'WP:TW/DOC#warn');
dialog.addFooterLink('Give feedback', 'WT:TW');
- const form = new Morebits.quickForm(Twinkle.warn.callback.evaluate);
+ const form = new Morebits.QuickForm(Twinkle.warn.callback.evaluate);
const main_select = form.append({
type: 'field',
label: 'Choose type of warning/notice to issue',
@@ -131,7 +131,7 @@ Twinkle.warn.callback = function twinklewarnCallback() {
dialog.setContent(result);
dialog.display();
result.main_group.root = result;
- result.previewer = new Morebits.wiki.preview($(result).find('div#twinklewarn-previewbox').last()[0]);
+ result.previewer = new Morebits.wiki.Preview($(result).find('div#twinklewarn-previewbox').last()[0]);
// Potential notices for staleness and missed reverts
const vanrevid = Twinkle.getPrefill('vanarticlerevid');
@@ -152,7 +152,7 @@ Twinkle.warn.callback = function twinklewarnCallback() {
format: 'json'
};
- new Morebits.wiki.api('Checking if you successfully reverted the page', query, ((apiobj) => {
+ new Morebits.wiki.Api('Checking if you successfully reverted the page', query, ((apiobj) => {
const rev = apiobj.getResponse().query.pages[0].revisions;
const revertUser = rev && rev[1].user;
if (revertUser && revertUser !== mw.config.get('wgUserName')) {
@@ -164,7 +164,7 @@ Twinkle.warn.callback = function twinklewarnCallback() {
// Confirm edit wasn't too old for a warning
const checkStale = function(vantimestamp) {
- const revDate = new Morebits.date(vantimestamp);
+ const revDate = new Morebits.Date(vantimestamp);
if (vantimestamp && revDate.isValid()) {
if (revDate.add(24, 'hours').isBefore(new Date())) {
message += ' This edit was made more than 24 hours ago so a warning may be stale.';
@@ -185,7 +185,7 @@ Twinkle.warn.callback = function twinklewarnCallback() {
revids: vanrevid,
format: 'json'
};
- new Morebits.wiki.api('Grabbing the revision timestamps', query, ((apiobj) => {
+ new Morebits.wiki.Api('Grabbing the revision timestamps', query, ((apiobj) => {
const rev = apiobj.getResponse().query.pages[0].revisions;
vantimestamp = rev && rev[0].timestamp;
checkStale(vantimestamp);
@@ -1421,7 +1421,7 @@ Twinkle.warn.callback.change_category = function twinklewarnCallbackChangeCatego
// due to an apparent iOS bug, we have to add an option-group to prevent truncation of text
// (search WT:TW archives for "Problem selecting warnings on an iPhone")
if (wrapInOptgroup && $.client.profile().platform === 'iphone') {
- let wrapperOptgroup = new Morebits.quickForm.element({
+ let wrapperOptgroup = new Morebits.QuickForm.Element({
type: 'optgroup',
label: 'Available templates'
});
@@ -1438,7 +1438,7 @@ Twinkle.warn.callback.change_category = function twinklewarnCallbackChangeCatego
const key = typeof itemKey === 'string' ? itemKey : itemProperties.value;
const template = key + level;
- const elem = new Morebits.quickForm.element({
+ const elem = new Morebits.QuickForm.Element({
type: 'option',
label: '{{' + template + '}}: ' + (level ? itemProperties[val].label : itemProperties.label),
value: template
@@ -1454,7 +1454,7 @@ Twinkle.warn.callback.change_category = function twinklewarnCallbackChangeCatego
};
const createGroup = function(warnGroup, label, wrapInOptgroup, val) {
wrapInOptgroup = typeof wrapInOptgroup !== 'undefined' ? wrapInOptgroup : true;
- let optgroup = new Morebits.quickForm.element({
+ let optgroup = new Morebits.QuickForm.Element({
type: 'optgroup',
label: label
});
@@ -1525,7 +1525,7 @@ Twinkle.warn.callback.change_category = function twinklewarnCallbackChangeCatego
if (Twinkle.warn.talkpageObj) {
autolevelProc();
} else {
- const usertalk_page = new Morebits.wiki.page('User_talk:' + mw.config.get('wgRelevantUserName'), 'Loading previous warnings');
+ const usertalk_page = new Morebits.wiki.Page('User_talk:' + mw.config.get('wgRelevantUserName'), 'Loading previous warnings');
usertalk_page.setFollowRedirect(true, false);
usertalk_page.load((pageobj) => {
Twinkle.warn.talkpageObj = pageobj; // Update talkpageObj
@@ -1563,8 +1563,8 @@ Twinkle.warn.callback.change_category = function twinklewarnCallbackChangeCatego
Twinkle.warn.callback.postCategoryCleanup = function twinklewarnCallbackPostCategoryCleanup(e) {
// clear overridden label on article textbox
- Morebits.quickForm.setElementTooltipVisibility(e.target.root.article, true);
- Morebits.quickForm.resetElementLabel(e.target.root.article);
+ Morebits.QuickForm.setElementTooltipVisibility(e.target.root.article, true);
+ Morebits.QuickForm.resetElementLabel(e.target.root.article);
// Trigger custom label/change on main category change
Twinkle.warn.callback.change_subcategory(e);
@@ -1607,18 +1607,18 @@ Twinkle.warn.callback.change_subcategory = function twinklewarnCallbackChangeSub
const hideLinkedPage = Twinkle.warn.getTemplateProperty(Twinkle.warn.messages, selected_template, 'hideLinkedPage');
if (hideLinkedPage) {
e.target.form.article.value = '';
- Morebits.quickForm.setElementVisibility(e.target.form.article.parentElement, false);
+ Morebits.QuickForm.setElementVisibility(e.target.form.article.parentElement, false);
} else {
- Morebits.quickForm.setElementVisibility(e.target.form.article.parentElement, true);
+ Morebits.QuickForm.setElementVisibility(e.target.form.article.parentElement, true);
}
// If template shouldn't have an optional message, hide the optional message label and text box
const hideReason = Twinkle.warn.getTemplateProperty(Twinkle.warn.messages, selected_template, 'hideReason');
if (hideReason) {
e.target.form.reason.value = '';
- Morebits.quickForm.setElementVisibility(e.target.form.reason.parentElement, false);
+ Morebits.QuickForm.setElementVisibility(e.target.form.reason.parentElement, false);
} else {
- Morebits.quickForm.setElementVisibility(e.target.form.reason.parentElement, true);
+ Morebits.QuickForm.setElementVisibility(e.target.form.reason.parentElement, true);
}
// Tags that don't take a linked article, but something else (often a username).
@@ -1641,16 +1641,16 @@ Twinkle.warn.callback.change_subcategory = function twinklewarnCallbackChangeSub
e.target.form.article.value = '';
// change form labels according to the warning selected
- Morebits.quickForm.setElementTooltipVisibility(e.target.form.article, false);
- Morebits.quickForm.overrideElementLabel(e.target.form.article, notLinkedArticle[selected_template]);
+ Morebits.QuickForm.setElementTooltipVisibility(e.target.form.article, false);
+ Morebits.QuickForm.overrideElementLabel(e.target.form.article, notLinkedArticle[selected_template]);
} else if (e.target.form.article.notArticle) {
if (Twinkle.warn.prev_article !== null) {
e.target.form.article.value = Twinkle.warn.prev_article;
Twinkle.warn.prev_article = null;
}
e.target.form.article.notArticle = false;
- Morebits.quickForm.setElementTooltipVisibility(e.target.form.article, true);
- Morebits.quickForm.resetElementLabel(e.target.form.article);
+ Morebits.QuickForm.setElementTooltipVisibility(e.target.form.article, true);
+ Morebits.QuickForm.resetElementLabel(e.target.form.article);
}
}
@@ -1661,12 +1661,12 @@ Twinkle.warn.callback.change_subcategory = function twinklewarnCallbackChangeSub
$redWarning = $("{{uw-username}} should not be used for blatant username policy violations. " +
"Blatant violations should be reported directly to UAA (via Twinkle's ARV tab). " +
'{{uw-username}} should only be used in edge cases in order to engage in discussion with the user.
');
- $redWarning.insertAfter(Morebits.quickForm.getElementLabelObject(e.target.form.reasonGroup));
+ $redWarning.insertAfter(Morebits.QuickForm.getElementLabelObject(e.target.form.reasonGroup));
} else if (selected_template === 'uw-coi-username') {
$redWarning = $("{{uw-coi-username}} should not be used for blatant username policy violations. " +
"Blatant violations should be reported directly to UAA (via Twinkle's ARV tab). " +
'{{uw-coi-username}} should only be used in edge cases in order to engage in discussion with the user.
');
- $redWarning.insertAfter(Morebits.quickForm.getElementLabelObject(e.target.form.reasonGroup));
+ $redWarning.insertAfter(Morebits.QuickForm.getElementLabelObject(e.target.form.reasonGroup));
}
};
@@ -1702,7 +1702,7 @@ Twinkle.warn.callbacks = {
return text + ' ~~~~';
},
showPreview: function(form, templatename) {
- const input = Morebits.quickForm.getInputData(form);
+ const input = Morebits.QuickForm.getInputData(form);
// Provided on autolevel, not otherwise
templatename = templatename || input.sub_group;
const linkedarticle = input.article;
@@ -1717,7 +1717,7 @@ Twinkle.warn.callbacks = {
preview: function(form) {
if (form.main_group.value === 'autolevel') {
// Always get a new, updated talkpage for autolevel processing
- const usertalk_page = new Morebits.wiki.page('User_talk:' + mw.config.get('wgRelevantUserName'), 'Loading previous warnings');
+ const usertalk_page = new Morebits.wiki.Page('User_talk:' + mw.config.get('wgRelevantUserName'), 'Loading previous warnings');
usertalk_page.setFollowRedirect(true, false);
// Will fail silently if the talk page is a cross-ns redirect,
// removal of the preview box handled when loading the menu
@@ -1758,11 +1758,11 @@ Twinkle.warn.callbacks = {
dateProcessing: function(wikitext) {
const history_re = /.*?(\d{1,2}:\d{1,2}, \d{1,2} \w+ \d{4} \(UTC\))/g;
const history = {};
- const latest = { date: new Morebits.date(0), type: '' };
+ const latest = { date: new Morebits.Date(0), type: '' };
let current;
while ((current = history_re.exec(wikitext)) !== null) {
- const template = current[1], current_date = new Morebits.date(current[2]);
+ const template = current[1], current_date = new Morebits.Date(current[2]);
if (!(template in history) || history[template].isBefore(current_date)) {
history[template] = current_date;
}
@@ -1786,8 +1786,8 @@ Twinkle.warn.callbacks = {
* @param {Object} latest First element of the array returned from
* dateProcessing. Provided here rather than processed within to avoid
* repeated call to dateProcessing
- * @param {(Date|Morebits.date)} date Date from which staleness is determined
- * @param {Morebits.status} statelem Status element, only used for handling error in final execution
+ * @param {(Date|Morebits.Date)} date Date from which staleness is determined
+ * @param {Morebits.Status} statelem Status element, only used for handling error in final execution
*
* @return {Array} - Array that contains the full template and just the warning level
*/
@@ -1822,7 +1822,7 @@ Twinkle.warn.callbacks = {
return;
} else {
date = date || new Date();
- const autoTimeout = new Morebits.date(latest.date.getTime()).add(parseInt(Twinkle.getPref('autolevelStaleDays'), 10), 'days');
+ const autoTimeout = new Morebits.Date(latest.date.getTime()).add(parseInt(Twinkle.getPref('autolevelStaleDays'), 10), 'days');
if (autoTimeout.isAfter(date)) {
if (level === 4) {
level = 4;
@@ -1880,7 +1880,7 @@ Twinkle.warn.callbacks = {
const [latest, history] = Twinkle.warn.callbacks.dateProcessing(text);
- const now = new Morebits.date(pageobj.getLoadTime());
+ const now = new Morebits.Date(pageobj.getLoadTime());
Twinkle.warn.talkpageObj = pageobj; // Update talkpageObj, just in case
if (params.main_group === 'autolevel') {
@@ -1896,7 +1896,7 @@ Twinkle.warn.callbacks = {
params.sub_group = templateAndLevel[0];
messageData = params.messageData['level' + templateAndLevel[1]];
} else if (params.sub_group in history) {
- if (new Morebits.date(history[params.sub_group]).add(1, 'day').isAfter(now)) {
+ if (new Morebits.Date(history[params.sub_group]).add(1, 'day').isAfter(now)) {
if (!confirm('An identical ' + params.sub_group + ' has been issued in the last 24 hours. \nWould you still like to add this warning/notice?')) {
statelem.error('aborted per user request');
return;
@@ -1984,7 +1984,7 @@ Twinkle.warn.callbacks = {
let warningText = Twinkle.warn.callbacks.getWarningWikitext(params.sub_group, params.article,
params.reason, params.main_group === 'custom');
if (Twinkle.getPref('showSharedIPNotice') && mw.util.isIPAddress(mw.config.get('wgTitle'))) {
- Morebits.status.info('Info', 'Adding a shared IP notice');
+ Morebits.Status.info('Info', 'Adding a shared IP notice');
warningText += '\n{{subst:Shared IP advice}}';
}
@@ -2010,7 +2010,7 @@ Twinkle.warn.callbacks = {
if (messageData.heading) { // create new section
pageobj.setNewSectionTitle(messageData.heading);
} else {
- Morebits.status.info('Info', 'Will create a new talk page section for this month, as none was found');
+ Morebits.Status.info('Info', 'Will create a new talk page section for this month, as none was found');
pageobj.setNewSectionTitle(now.monthHeader(0));
}
pageobj.setNewSectionText(warningText);
@@ -2023,7 +2023,7 @@ Twinkle.warn.callback.evaluate = function twinklewarnCallbackEvaluate(e) {
const userTalkPage = 'User_talk:' + mw.config.get('wgRelevantUserName');
// reason, main_group, sub_group, article
- const params = Morebits.quickForm.getInputData(e.target);
+ const params = Morebits.QuickForm.getInputData(e.target);
// Check that a reason was filled in if uw-username was selected
if (params.sub_group === 'uw-username' && !params.article) {
@@ -2042,13 +2042,13 @@ Twinkle.warn.callback.evaluate = function twinklewarnCallbackEvaluate(e) {
const $selectedEl = $(e.target.sub_group).find('option[value="' + $(e.target.sub_group).val() + '"]');
params.messageData = $selectedEl.data('messageData');
- Morebits.simpleWindow.setButtonsEnabled(false);
- Morebits.status.init(e.target);
+ Morebits.SimpleWindow.setButtonsEnabled(false);
+ Morebits.Status.init(e.target);
Morebits.wiki.actionCompleted.redirect = userTalkPage;
Morebits.wiki.actionCompleted.notice = 'Warning complete, reloading talk page in a few seconds';
- const wikipedia_page = new Morebits.wiki.page(userTalkPage, 'User talk page modification');
+ const wikipedia_page = new Morebits.wiki.Page(userTalkPage, 'User talk page modification');
wikipedia_page.setCallbackParameters(params);
wikipedia_page.setFollowRedirect(true, false);
wikipedia_page.load(Twinkle.warn.callbacks.main);
diff --git a/modules/twinklewelcome.js b/modules/twinklewelcome.js
index c1049bc29..c2d9233e4 100644
--- a/modules/twinklewelcome.js
+++ b/modules/twinklewelcome.js
@@ -95,7 +95,7 @@ Twinkle.welcome.normal = function() {
};
Twinkle.welcome.welcomeUser = function welcomeUser() {
- Morebits.status.init(document.getElementById('mw-content-text'));
+ Morebits.Status.init(document.getElementById('mw-content-text'));
$('#catlinks').remove();
const params = {
@@ -108,7 +108,7 @@ Twinkle.welcome.welcomeUser = function welcomeUser() {
Morebits.wiki.actionCompleted.redirect = userTalkPage;
Morebits.wiki.actionCompleted.notice = 'Welcoming complete, reloading talk page in a few seconds';
- const wikipedia_page = new Morebits.wiki.page(userTalkPage, 'User talk page modification');
+ const wikipedia_page = new Morebits.wiki.Page(userTalkPage, 'User talk page modification');
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.welcome.callbacks.main);
@@ -119,7 +119,7 @@ Twinkle.welcome.callback = function twinklewelcomeCallback(uid) {
return;
}
- const Window = new Morebits.simpleWindow(600, 420);
+ const Window = new Morebits.SimpleWindow(600, 420);
Window.setTitle('Welcome user');
Window.setScriptName('Twinkle');
Window.addFooterLink('Welcoming Committee', 'WP:WC');
@@ -127,7 +127,7 @@ Twinkle.welcome.callback = function twinklewelcomeCallback(uid) {
Window.addFooterLink('Twinkle help', 'WP:TW/DOC#welcome');
Window.addFooterLink('Give feedback', 'WT:TW');
- const form = new Morebits.quickForm(Twinkle.welcome.callback.evaluate);
+ const form = new Morebits.QuickForm(Twinkle.welcome.callback.evaluate);
form.append({
type: 'select',
@@ -179,7 +179,7 @@ Twinkle.welcome.callback = function twinklewelcomeCallback(uid) {
Twinkle.welcome.populateWelcomeList = function(e) {
const type = e.target.value;
- const container = new Morebits.quickForm.element({ type: 'fragment' });
+ const container = new Morebits.QuickForm.Element({ type: 'fragment' });
if ((type === 'standard' || type === 'unregistered') && Twinkle.getPref('customWelcomeList').length) {
container.append({ type: 'header', label: 'Custom welcome templates' });
@@ -667,7 +667,7 @@ Twinkle.welcome.getTemplateWikitext = function(type, template, article) {
Twinkle.welcome.callbacks = {
preview: function(form) {
- const previewDialog = new Morebits.simpleWindow(750, 400);
+ const previewDialog = new Morebits.SimpleWindow(750, 400);
previewDialog.setTitle('Welcome template preview');
previewDialog.setScriptName('Welcome user');
previewDialog.setModality(true);
@@ -677,8 +677,8 @@ Twinkle.welcome.callbacks = {
previewdiv.style.fontSize = 'small';
previewDialog.setContent(previewdiv);
- const previewer = new Morebits.wiki.preview(previewdiv);
- const input = Morebits.quickForm.getInputData(form);
+ const previewer = new Morebits.wiki.Preview(previewdiv);
+ const input = Morebits.QuickForm.getInputData(form);
previewer.beginRender(Twinkle.welcome.getTemplateWikitext(input.type, input.template, input.article), 'User talk:' + mw.config.get('wgRelevantUserName')); // Force wikitext/correct username
const submit = document.createElement('input');
@@ -698,7 +698,7 @@ Twinkle.welcome.callbacks = {
// abort if mode is auto and form is not empty
if (pageobj.exists() && params.mode === 'auto') {
- Morebits.status.info('Warning', 'User talk page not empty; aborting automatic welcome');
+ Morebits.Status.info('Warning', 'User talk page not empty; aborting automatic welcome');
Morebits.wiki.actionCompleted.event();
return;
}
@@ -731,17 +731,17 @@ Twinkle.welcome.callbacks = {
Twinkle.welcome.callback.evaluate = function twinklewelcomeCallbackEvaluate(e) {
const form = e.target;
- const params = Morebits.quickForm.getInputData(form); // : type, template, article
+ const params = Morebits.QuickForm.getInputData(form); // : type, template, article
params.mode = 'manual';
- Morebits.simpleWindow.setButtonsEnabled(false);
- Morebits.status.init(form);
+ Morebits.SimpleWindow.setButtonsEnabled(false);
+ Morebits.Status.init(form);
const userTalkPage = mw.config.get('wgFormattedNamespaces')[3] + ':' + mw.config.get('wgRelevantUserName');
Morebits.wiki.actionCompleted.redirect = userTalkPage;
Morebits.wiki.actionCompleted.notice = 'Welcoming complete, reloading talk page in a few seconds';
- const wikipedia_page = new Morebits.wiki.page(userTalkPage, 'User talk page modification');
+ const wikipedia_page = new Morebits.wiki.Page(userTalkPage, 'User talk page modification');
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.welcome.callbacks.main);
diff --git a/modules/twinklexfd.js b/modules/twinklexfd.js
index fa82cec90..903eb4d11 100644
--- a/modules/twinklexfd.js
+++ b/modules/twinklexfd.js
@@ -106,17 +106,17 @@ const utils = {
Twinkle.xfd.currentRationale = null;
-// error callback on Morebits.status.object
+// error callback on Morebits.Status.object
Twinkle.xfd.printRationale = function twinklexfdPrintRationale() {
if (Twinkle.xfd.currentRationale) {
- Morebits.status.printUserText(Twinkle.xfd.currentRationale, 'Your deletion rationale is provided below, which you can copy and paste into a new XFD dialog if you wish to try again:');
+ Morebits.Status.printUserText(Twinkle.xfd.currentRationale, 'Your deletion rationale is provided below, which you can copy and paste into a new XFD dialog if you wish to try again:');
// only need to print the rationale once
Twinkle.xfd.currentRationale = null;
}
};
Twinkle.xfd.callback = function twinklexfdCallback() {
- const Window = new Morebits.simpleWindow(700, 400);
+ const Window = new Morebits.SimpleWindow(700, 400);
Window.setTitle('Start a deletion discussion (XfD)');
Window.setScriptName('Twinkle');
Window.addFooterLink('About deletion discussions', 'WP:XFD');
@@ -124,7 +124,7 @@ Twinkle.xfd.callback = function twinklexfdCallback() {
Window.addFooterLink('Twinkle help', 'WP:TW/DOC#xfd');
Window.addFooterLink('Give feedback', 'WT:TW');
- const form = new Morebits.quickForm(Twinkle.xfd.callback.evaluate);
+ const form = new Morebits.QuickForm(Twinkle.xfd.callback.evaluate);
const categories = form.append({
type: 'select',
name: 'venue',
@@ -221,7 +221,7 @@ Twinkle.xfd.callback = function twinklexfdCallback() {
var result = form.render();
Window.setContent(result);
Window.display();
- result.previewer = new Morebits.wiki.preview($(result).find('div#twinklexfd-previewbox').last()[0]);
+ result.previewer = new Morebits.wiki.Preview($(result).find('div#twinklexfd-previewbox').last()[0]);
// We must init the controls
const evt = document.createEvent('Event');
@@ -282,7 +282,7 @@ Twinkle.xfd.callback.wrongVenueWarning = function twinklexfdWrongVenueWarning(ve
Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory(e) {
const value = e.target.value;
const form = e.target.form;
- const old_area = Morebits.quickForm.getElements(e.target.form, 'work_area')[0];
+ const old_area = Morebits.QuickForm.getElements(e.target.form, 'work_area')[0];
let work_area = null;
const oldreasontextbox = form.getElementsByTagName('textarea')[0];
@@ -304,7 +304,7 @@ Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory
switch (value) {
case 'afd':
- work_area = new Morebits.quickForm.element({
+ work_area = new Morebits.QuickForm.Element({
type: 'field',
label: 'Articles for deletion',
name: 'work_area'
@@ -412,7 +412,7 @@ Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory
break;
case 'tfd':
- work_area = new Morebits.quickForm.element({
+ work_area = new Morebits.QuickForm.Element({
type: 'field',
label: 'Templates for discussion',
name: 'work_area'
@@ -428,7 +428,7 @@ Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory
tfdtarget = target.form.tfdtarget;
// add/remove extra input box
if (target.value === 'tfm' && !tfdtarget) {
- tfdtarget = new Morebits.quickForm.element({
+ tfdtarget = new Morebits.QuickForm.Element({
name: 'tfdtarget',
type: 'input',
label: 'Other ' + templateOrModule + ' to be merged:',
@@ -437,7 +437,7 @@ Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory
});
target.parentNode.appendChild(tfdtarget.render());
} else {
- $(Morebits.quickForm.getElementContainer(tfdtarget)).remove();
+ $(Morebits.QuickForm.getElementContainer(tfdtarget)).remove();
tfdtarget = null;
}
},
@@ -495,7 +495,7 @@ Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory
break;
case 'mfd':
- work_area = new Morebits.quickForm.element({
+ work_area = new Morebits.QuickForm.Element({
type: 'field',
label: 'Miscellany for deletion',
name: 'work_area'
@@ -532,7 +532,7 @@ Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory
old_area.parentNode.replaceChild(work_area, old_area);
break;
case 'ffd':
- work_area = new Morebits.quickForm.element({
+ work_area = new Morebits.QuickForm.Element({
type: 'field',
label: 'Discussion venues for files',
name: 'work_area'
@@ -543,7 +543,7 @@ Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory
break;
case 'cfd':
- work_area = new Morebits.quickForm.element({
+ work_area = new Morebits.QuickForm.Element({
type: 'field',
label: 'Categories for discussion',
name: 'work_area'
@@ -564,11 +564,11 @@ Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory
if (isCategory) {
// update label
if (value === 'cfs') {
- Morebits.quickForm.setElementLabel(cfdtarget, 'Target categories: ');
+ Morebits.QuickForm.setElementLabel(cfdtarget, 'Target categories: ');
} else if (value === 'cfc') {
- Morebits.quickForm.setElementLabel(cfdtarget, 'Target article: ');
+ Morebits.QuickForm.setElementLabel(cfdtarget, 'Target article: ');
} else {
- Morebits.quickForm.setElementLabel(cfdtarget, 'Target category: ');
+ Morebits.QuickForm.setElementLabel(cfdtarget, 'Target category: ');
}
// add/remove extra input box
if (value === 'cfs') {
@@ -587,7 +587,7 @@ Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory
$(cfdtarget2).hide();
}
} else { // Update stub template label
- Morebits.quickForm.setElementLabel(cfdtarget, 'Target stub template: ');
+ Morebits.QuickForm.setElementLabel(cfdtarget, 'Target stub template: ');
}
},
list: isCategory ? [
@@ -616,7 +616,7 @@ Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory
break;
case 'cfds':
- work_area = new Morebits.quickForm.element({
+ work_area = new Morebits.QuickForm.Element({
type: 'field',
label: 'Categories for speedy renaming',
name: 'work_area'
@@ -650,7 +650,7 @@ Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory
break;
case 'rfd':
- work_area = new Morebits.quickForm.element({
+ work_area = new Morebits.QuickForm.Element({
type: 'field',
label: 'Redirects for discussion',
name: 'work_area'
@@ -674,7 +674,7 @@ Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory
break;
case 'rm': {
- work_area = new Morebits.quickForm.element({
+ work_area = new Morebits.QuickForm.Element({
type: 'field',
label: 'Requested moves',
name: 'work_area'
@@ -734,7 +734,7 @@ Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory
}
default:
- work_area = new Morebits.quickForm.element({
+ work_area = new Morebits.QuickForm.Element({
type: 'field',
label: 'Nothing for anything',
name: 'work_area'
@@ -762,7 +762,7 @@ Twinkle.xfd.callbacks = {
'|discussion=' + params.discussionpage + (params.venue === 'rfd' ? '|rfd=yes' : '') +
'|tag=' + params.tagText + '\u003C/nowiki>}}'; // U+003C: <
- const talk_page = new Morebits.wiki.page(talkName, 'Automatically posting edit request on talk page');
+ const talk_page = new Morebits.wiki.Page(talkName, 'Automatically posting edit request on talk page');
talk_page.setNewSectionTitle('Edit request to complete ' + utils.toTLACase(params.venue) + ' nomination');
talk_page.setNewSectionText(editRequest);
talk_page.setCreateOption('recreate');
@@ -851,7 +851,7 @@ Twinkle.xfd.callbacks = {
},
preview: function(form) {
// venue, reason, xfdcat, tfdtarget, cfdtarget, cfdtarget2, cfdstarget, delsortCats, newname
- const params = Morebits.quickForm.getInputData(form);
+ const params = Morebits.QuickForm.getInputData(form);
const venue = params.venue;
@@ -869,7 +869,7 @@ Twinkle.xfd.callbacks = {
if (venue === 'ffd') {
// Fetch the uploader
- const page = new Morebits.wiki.page(mw.config.get('wgPageName'));
+ const page = new Morebits.wiki.Page(mw.config.get('wgPageName'));
page.lookupCreation(() => {
params.uploader = page.getCreator();
Twinkle.xfd.callbacks.showPreview(form, venue, params);
@@ -907,7 +907,7 @@ Twinkle.xfd.callbacks = {
if (targetNS === 3) {
// Disallow warning yourself
if (usernameOrTarget === mw.config.get('wgUserName')) {
- Morebits.status.warn('You (' + usernameOrTarget + ') created this page; skipping user notification');
+ Morebits.Status.warn('You (' + usernameOrTarget + ') created this page; skipping user notification');
// if we thought we would notify someone but didn't,
// then jump to logging.
@@ -951,7 +951,7 @@ Twinkle.xfd.callbacks = {
const editSummary = 'Notification: [[' + params.discussionpage + '|listing]] of [[:' +
Morebits.pageNameNorm + ']] at [[WP:' + venueNames[params.venue] + ']].';
- const usertalkpage = new Morebits.wiki.page(notifyTarget, actionName);
+ const usertalkpage = new Morebits.wiki.Page(notifyTarget, actionName);
usertalkpage.setAppendText(notifytext);
usertalkpage.setEditSummary(editSummary);
usertalkpage.setChangeTags(Twinkle.changeTags);
@@ -985,7 +985,7 @@ Twinkle.xfd.callbacks = {
return;
}
- const usl = new Morebits.userspaceLogger(Twinkle.getPref('xfdLogPageName'));// , 'Adding entry to userspace log');
+ const usl = new Morebits.UserspaceLogger(Twinkle.getPref('xfdLogPageName'));// , 'Adding entry to userspace log');
usl.initialText =
"This is a log of all [[WP:XFD|deletion discussion]] nominations made by this user using [[WP:TW|Twinkle]]'s XfD module.\n\n" +
@@ -1111,14 +1111,14 @@ Twinkle.xfd.callbacks = {
}
apiobj.params.discussionpage = 'Wikipedia:Articles for deletion/' + Morebits.pageNameNorm + apiobj.params.numbering;
- Morebits.status.info('Next discussion page', '[[' + apiobj.params.discussionpage + ']]');
+ Morebits.Status.info('Next discussion page', '[[' + apiobj.params.discussionpage + ']]');
// Updating data for the action completed event
Morebits.wiki.actionCompleted.redirect = apiobj.params.discussionpage;
Morebits.wiki.actionCompleted.notice = 'Nomination completed, now redirecting to the discussion page';
// Tagging article
- const wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), 'Adding deletion tag to article');
+ const wikipedia_page = new Morebits.wiki.Page(mw.config.get('wgPageName'), 'Adding deletion tag to article');
wikipedia_page.setFollowRedirect(true); // should never be needed, but if the article is moved, we would want to follow the redirect
wikipedia_page.setChangeTags(Twinkle.changeTags); // Here to apply to triage
wikipedia_page.setCallbackParameters(apiobj.params);
@@ -1151,24 +1151,24 @@ Twinkle.xfd.callbacks = {
// Mark the page as curated/patrolled, if wanted
if (Twinkle.getPref('markXfdPagesAsPatrolled')) {
- new Morebits.wiki.page(Morebits.pageNameNorm).triage();
+ new Morebits.wiki.Page(Morebits.pageNameNorm).triage();
}
// Start discussion page, will also handle pagetriage and delsort listings
- let wikipedia_page = new Morebits.wiki.page(params.discussionpage, 'Creating article deletion discussion page');
+ let wikipedia_page = new Morebits.wiki.Page(params.discussionpage, 'Creating article deletion discussion page');
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.afd.discussionPage);
// Today's list
- const date = new Morebits.date(pageobj.getLoadTime());
- wikipedia_page = new Morebits.wiki.page('Wikipedia:Articles for deletion/Log/' +
+ const date = new Morebits.Date(pageobj.getLoadTime());
+ wikipedia_page = new Morebits.wiki.Page('Wikipedia:Articles for deletion/Log/' +
date.format('YYYY MMMM D', 'utc'), "Adding discussion to today's list");
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.afd.todaysList);
// Notification to first contributor
if (params.notifycreator) {
- const thispage = new Morebits.wiki.page(mw.config.get('wgPageName'));
+ const thispage = new Morebits.wiki.Page(mw.config.get('wgPageName'));
thispage.setCallbackParameters(params);
thispage.setLookupNonRedirectCreator(true); // Look for author of first non-redirect revision
thispage.lookupCreation((pageobj) => {
@@ -1192,7 +1192,7 @@ Twinkle.xfd.callbacks = {
}
// Insert tag after short description or any hatnotes
- const wikipage = new Morebits.wikitext.page(text);
+ const wikipage = new Morebits.wikitext.Page(text);
text = wikipage.insertAfterTemplates(params.tagText, Twinkle.hatnoteRegex).getText();
pageobj.setPageText(text);
@@ -1220,7 +1220,7 @@ Twinkle.xfd.callbacks = {
// List at deletion sorting pages
if (params.delsortCats) {
params.delsortCats.forEach((cat) => {
- const delsortPage = new Morebits.wiki.page('Wikipedia:WikiProject Deletion sorting/' + cat, 'Adding to list of ' + cat + '-related deletion discussions');
+ const delsortPage = new Morebits.wiki.Page('Wikipedia:WikiProject Deletion sorting/' + cat, 'Adding to list of ' + cat + '-related deletion discussions');
delsortPage.setFollowRedirect(true); // In case a category gets renamed
delsortPage.setCallbackParameters({discussionPage: params.discussionpage});
delsortPage.load(Twinkle.xfd.callbacks.afd.delsortListing);
@@ -1273,7 +1273,7 @@ Twinkle.xfd.callbacks = {
main: function(pageobj) {
const params = pageobj.getCallbackParameters();
- const date = new Morebits.date(pageobj.getLoadTime());
+ const date = new Morebits.Date(pageobj.getLoadTime());
params.logpage = 'Wikipedia:Templates for discussion/Log/' + date.format('YYYY MMMM D', 'utc');
params.discussionpage = params.logpage + '#' + Morebits.pageNameNorm;
// Add log/discussion page params to the already-loaded page object
@@ -1305,15 +1305,15 @@ Twinkle.xfd.callbacks = {
if (params.xfdcat === 'tfm') { // Merge
let wikipedia_otherpage;
if (params.scribunto) {
- wikipedia_otherpage = new Morebits.wiki.page(params.otherTemplateName + '/doc', 'Tagging other module documentation with merge tag');
+ wikipedia_otherpage = new Morebits.wiki.Page(params.otherTemplateName + '/doc', 'Tagging other module documentation with merge tag');
// Watch tagged module pages as well
if (watchModule) {
watch_query.titles.push(params.otherTemplateName);
- new Morebits.wiki.api('Adding Modules to watchlist', watch_query).post();
+ new Morebits.wiki.Api('Adding Modules to watchlist', watch_query).post();
}
} else {
- wikipedia_otherpage = new Morebits.wiki.page(params.otherTemplateName, 'Tagging other template with merge tag');
+ wikipedia_otherpage = new Morebits.wiki.Page(params.otherTemplateName, 'Tagging other template with merge tag');
}
// Tag this template/module
Twinkle.xfd.callbacks.tfd.taggingTemplateForMerge(pageobj);
@@ -1328,7 +1328,7 @@ Twinkle.xfd.callbacks = {
if (params.scribunto && Twinkle.getPref('xfdWatchPage') !== 'no') {
// Watch tagged module page as well
if (watchModule) {
- new Morebits.wiki.api('Adding Module to watchlist', watch_query).post();
+ new Morebits.wiki.Api('Adding Module to watchlist', watch_query).post();
}
}
Twinkle.xfd.callbacks.tfd.taggingTemplate(pageobj);
@@ -1339,7 +1339,7 @@ Twinkle.xfd.callbacks = {
Morebits.wiki.actionCompleted.notice = "Nomination completed, now redirecting to today's log";
// Adding discussion
- const wikipedia_page = new Morebits.wiki.page(params.logpage, "Adding discussion to today's log");
+ const wikipedia_page = new Morebits.wiki.Page(params.logpage, "Adding discussion to today's log");
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.tfd.todaysList);
@@ -1348,12 +1348,12 @@ Twinkle.xfd.callbacks = {
if (params.notifycreator) {
const involvedpages = [];
const seenusers = [];
- involvedpages.push(new Morebits.wiki.page(mw.config.get('wgPageName')));
+ involvedpages.push(new Morebits.wiki.Page(mw.config.get('wgPageName')));
if (params.xfdcat === 'tfm') {
if (params.scribunto) {
- involvedpages.push(new Morebits.wiki.page('Module:' + params.tfdtarget));
+ involvedpages.push(new Morebits.wiki.Page('Module:' + params.tfdtarget));
} else {
- involvedpages.push(new Morebits.wiki.page('Template:' + params.tfdtarget));
+ involvedpages.push(new Morebits.wiki.Page('Template:' + params.tfdtarget));
}
}
involvedpages.forEach((page) => {
@@ -1520,7 +1520,7 @@ Twinkle.xfd.callbacks = {
// Tagging page
if (mw.config.get('wgNamespaceNumber') !== 710) { // cannot tag TimedText pages
- wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), 'Tagging page with deletion tag');
+ wikipedia_page = new Morebits.wiki.Page(mw.config.get('wgPageName'), 'Tagging page with deletion tag');
wikipedia_page.setFollowRedirect(true); // should never be needed, but if the page is moved, we would want to follow the redirect
wikipedia_page.setCallbackParameters(apiobj.params);
wikipedia_page.load(Twinkle.xfd.callbacks.mfd.taggingPage);
@@ -1531,12 +1531,12 @@ Twinkle.xfd.callbacks = {
Morebits.wiki.actionCompleted.notice = 'Nomination completed, now redirecting to the discussion page';
// Discussion page
- wikipedia_page = new Morebits.wiki.page(apiobj.params.discussionpage, 'Creating deletion discussion page');
+ wikipedia_page = new Morebits.wiki.Page(apiobj.params.discussionpage, 'Creating deletion discussion page');
wikipedia_page.setCallbackParameters(apiobj.params);
wikipedia_page.load(Twinkle.xfd.callbacks.mfd.discussionPage);
// Today's list
- wikipedia_page = new Morebits.wiki.page('Wikipedia:Miscellany for deletion', "Adding discussion to today's list");
+ wikipedia_page = new Morebits.wiki.Page('Wikipedia:Miscellany for deletion', "Adding discussion to today's list");
wikipedia_page.setPageSection(2);
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(apiobj.params);
@@ -1544,7 +1544,7 @@ Twinkle.xfd.callbacks = {
// Notification to first contributor and/or notification to owner of userspace
if (apiobj.params.notifycreator || apiobj.params.notifyuserspace) {
- const thispage = new Morebits.wiki.page(mw.config.get('wgPageName'));
+ const thispage = new Morebits.wiki.Page(mw.config.get('wgPageName'));
thispage.setCallbackParameters(apiobj.params);
thispage.lookupCreation(Twinkle.xfd.callbacks.mfd.sendNotifications);
// or, if not notifying, add this nomination to the user's userspace log without the initial contributor's name
@@ -1595,7 +1595,7 @@ Twinkle.xfd.callbacks = {
const params = pageobj.getCallbackParameters();
const statelem = pageobj.getStatusElement();
- const date = new Morebits.date(pageobj.getLoadTime());
+ const date = new Morebits.Date(pageobj.getLoadTime());
const date_header = date.format('===MMMM D, YYYY===\n', 'utc');
const date_header_regex = new RegExp(date.format('(===[\\s]*MMMM[\\s]+D,[\\s]+YYYY[\\s]*===)', 'utc'));
const added_data = '{{subst:mfd3|pg=' + Morebits.pageNameNorm + params.numbering + '}}';
@@ -1645,7 +1645,7 @@ Twinkle.xfd.callbacks = {
let text = pageobj.getPageText();
const params = pageobj.getCallbackParameters();
- const date = new Morebits.date(pageobj.getLoadTime()).format('YYYY MMMM D', 'utc');
+ const date = new Morebits.Date(pageobj.getLoadTime()).format('YYYY MMMM D', 'utc');
params.logpage = 'Wikipedia:Files for discussion/' + date;
params.discussionpage = params.logpage + '#' + Morebits.pageNameNorm;
@@ -1668,7 +1668,7 @@ Twinkle.xfd.callbacks = {
Morebits.wiki.actionCompleted.notice = 'Nomination completed, now redirecting to the discussion page';
// Contributor specific edits
- const wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'));
+ const wikipedia_page = new Morebits.wiki.Page(mw.config.get('wgPageName'));
wikipedia_page.setCallbackParameters(params);
wikipedia_page.lookupCreation(Twinkle.xfd.callbacks.ffd.main);
},
@@ -1679,7 +1679,7 @@ Twinkle.xfd.callbacks = {
params.uploader = initialContrib;
// Adding discussion
- const wikipedia_page = new Morebits.wiki.page(params.logpage, "Adding discussion to today's list");
+ const wikipedia_page = new Morebits.wiki.Page(params.logpage, "Adding discussion to today's list");
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.ffd.todaysList);
@@ -1716,7 +1716,7 @@ Twinkle.xfd.callbacks = {
main: function(pageobj) {
const params = pageobj.getCallbackParameters();
- const date = new Morebits.date(pageobj.getLoadTime());
+ const date = new Morebits.Date(pageobj.getLoadTime());
params.logpage = 'Wikipedia:Categories for discussion/Log/' + date.format('YYYY MMMM D', 'utc');
params.discussionpage = params.logpage + '#' + Morebits.pageNameNorm;
// Add log/discussion page params to the already-loaded page object
@@ -1730,14 +1730,14 @@ Twinkle.xfd.callbacks = {
Morebits.wiki.actionCompleted.notice = "Nomination completed, now redirecting to today's log";
// Adding discussion to list
- let wikipedia_page = new Morebits.wiki.page(params.logpage, "Adding discussion to today's list");
+ let wikipedia_page = new Morebits.wiki.Page(params.logpage, "Adding discussion to today's list");
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.cfd.todaysList);
// Notification to first contributor
if (params.notifycreator) {
- wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'));
+ wikipedia_page = new Morebits.wiki.Page(mw.config.get('wgPageName'));
wikipedia_page.setCallbackParameters(params);
wikipedia_page.lookupCreation((pageobj) => {
Twinkle.xfd.callbacks.notifyUser(pageobj.getCallbackParameters(), pageobj.getCreator());
@@ -1885,7 +1885,7 @@ Twinkle.xfd.callbacks = {
query.titles = mw.config.get('wgPageName');
query.redirects = true;
}
- const wikipedia_api = new Morebits.wiki.api('Finding target of redirect', query, Twinkle.xfd.callbacks.rfd.findTargetCallback(callback));
+ const wikipedia_api = new Morebits.wiki.Api('Finding target of redirect', query, Twinkle.xfd.callbacks.rfd.findTargetCallback(callback));
wikipedia_api.params = params;
wikipedia_api.post();
},
@@ -1913,12 +1913,12 @@ Twinkle.xfd.callbacks = {
};
},
main: function(params) {
- const date = new Morebits.date(params.curtimestamp);
+ const date = new Morebits.Date(params.curtimestamp);
params.logpage = 'Wikipedia:Redirects for discussion/Log/' + date.format('YYYY MMMM D', 'utc');
params.discussionpage = params.logpage + '#' + Morebits.pageNameNorm;
// Tagging redirect
- let wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), 'Adding deletion tag to redirect');
+ let wikipedia_page = new Morebits.wiki.Page(mw.config.get('wgPageName'), 'Adding deletion tag to redirect');
wikipedia_page.setFollowRedirect(false);
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.rfd.taggingRedirect);
@@ -1928,14 +1928,14 @@ Twinkle.xfd.callbacks = {
Morebits.wiki.actionCompleted.notice = "Nomination completed, now redirecting to today's log";
// Adding discussion
- wikipedia_page = new Morebits.wiki.page(params.logpage, "Adding discussion to today's log");
+ wikipedia_page = new Morebits.wiki.Page(params.logpage, "Adding discussion to today's log");
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.rfd.todaysList);
// Notifications
if (params.notifycreator || params.relatedpage) {
- const thispage = new Morebits.wiki.page(mw.config.get('wgPageName'));
+ const thispage = new Morebits.wiki.Page(mw.config.get('wgPageName'));
thispage.setCallbackParameters(params);
thispage.lookupCreation(Twinkle.xfd.callbacks.rfd.sendNotifications);
// or, if not notifying, add this nomination to the user's userspace log without the initial contributor's name
@@ -2085,13 +2085,13 @@ Twinkle.xfd.insertRMTR = function(pageWikitext, wikitextToInsert) {
Twinkle.xfd.callback.evaluate = function(e) {
const form = e.target;
- const params = Morebits.quickForm.getInputData(form);
+ const params = Morebits.QuickForm.getInputData(form);
- Morebits.simpleWindow.setButtonsEnabled(false);
- Morebits.status.init(form);
+ Morebits.SimpleWindow.setButtonsEnabled(false);
+ Morebits.Status.init(form);
Twinkle.xfd.currentRationale = params.reason;
- Morebits.status.onError(Twinkle.xfd.printRationale);
+ Morebits.Status.onError(Twinkle.xfd.printRationale);
let query, wikipedia_page, wikipedia_api;
switch (params.venue) {
@@ -2106,7 +2106,7 @@ Twinkle.xfd.callback.evaluate = function(e) {
aplimit: 'max', // 500 is max for normal users, 5000 for bots and sysops
format: 'json'
};
- wikipedia_api = new Morebits.wiki.api('Tagging article with deletion tag', query, Twinkle.xfd.callbacks.afd.main);
+ wikipedia_api = new Morebits.wiki.Api('Tagging article with deletion tag', query, Twinkle.xfd.callbacks.afd.main);
wikipedia_api.params = params;
wikipedia_api.post();
break;
@@ -2121,17 +2121,17 @@ Twinkle.xfd.callback.evaluate = function(e) {
if (params.xfdcat === 'tfm') { // Merge
// Tag this template/module
if (params.scribunto) {
- wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName') + '/doc', 'Tagging this module documentation with merge tag');
+ wikipedia_page = new Morebits.wiki.Page(mw.config.get('wgPageName') + '/doc', 'Tagging this module documentation with merge tag');
params.otherTemplateName = 'Module:' + params.tfdtarget;
} else {
- wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), 'Tagging this template with merge tag');
+ wikipedia_page = new Morebits.wiki.Page(mw.config.get('wgPageName'), 'Tagging this template with merge tag');
params.otherTemplateName = 'Template:' + params.tfdtarget;
}
} else { // delete
if (params.scribunto) {
- wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName') + '/doc', 'Tagging module documentation with deletion tag');
+ wikipedia_page = new Morebits.wiki.Page(mw.config.get('wgPageName') + '/doc', 'Tagging module documentation with deletion tag');
} else {
- wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), 'Tagging template with deletion tag');
+ wikipedia_page = new Morebits.wiki.Page(mw.config.get('wgPageName'), 'Tagging template with deletion tag');
}
}
wikipedia_page.setFollowRedirect(true); // should never be needed, but if the page is moved, we would want to follow the redirect
@@ -2149,7 +2149,7 @@ Twinkle.xfd.callback.evaluate = function(e) {
aplimit: 'max', // 500 is max for normal users, 5000 for bots and sysops
format: 'json'
};
- wikipedia_api = new Morebits.wiki.api('Looking for prior nominations of this page', query, Twinkle.xfd.callbacks.mfd.main);
+ wikipedia_api = new Morebits.wiki.Api('Looking for prior nominations of this page', query, Twinkle.xfd.callbacks.mfd.main);
wikipedia_api.params = params;
wikipedia_api.post();
break;
@@ -2159,7 +2159,7 @@ Twinkle.xfd.callback.evaluate = function(e) {
// A little out of order with this coming before 'main',
// but tagging doesn't need the uploader parameter,
// while everything else does, so tag then get the uploader
- wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), 'Adding deletion tag to file page');
+ wikipedia_page = new Morebits.wiki.Page(mw.config.get('wgPageName'), 'Adding deletion tag to file page');
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.ffd.taggingImage);
@@ -2188,7 +2188,7 @@ Twinkle.xfd.callback.evaluate = function(e) {
params.action = summaryActions[params.xfdcat];
// Tagging category
- wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), 'Tagging category with ' + params.action + ' tag');
+ wikipedia_page = new Morebits.wiki.Page(mw.config.get('wgPageName'), 'Tagging category with ' + params.action + ' tag');
wikipedia_page.setFollowRedirect(true); // should never be needed, but if the page is moved, we would want to follow the redirect
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.cfd.main);
@@ -2205,13 +2205,13 @@ Twinkle.xfd.callback.evaluate = function(e) {
Morebits.wiki.actionCompleted.notice = 'Nomination completed, now redirecting to the discussion page';
// Tagging category
- wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), 'Tagging category with rename tag');
+ wikipedia_page = new Morebits.wiki.Page(mw.config.get('wgPageName'), 'Tagging category with rename tag');
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.cfds.taggingCategory);
// Adding discussion to list
- wikipedia_page = new Morebits.wiki.page(logpage, 'Adding discussion to the list');
+ wikipedia_page = new Morebits.wiki.Page(logpage, 'Adding discussion to the list');
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.cfds.addToList);
@@ -2231,7 +2231,7 @@ Twinkle.xfd.callback.evaluate = function(e) {
Morebits.wiki.actionCompleted.redirect = nomPageName;
Morebits.wiki.actionCompleted.notice = 'Nomination completed, now redirecting to the discussion page';
- wikipedia_page = new Morebits.wiki.page(nomPageName, params.rmtr ? 'Adding entry at WP:RM/TR' : 'Adding entry on talk page');
+ wikipedia_page = new Morebits.wiki.Page(nomPageName, params.rmtr ? 'Adding entry at WP:RM/TR' : 'Adding entry on talk page');
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(params);
diff --git a/morebits.css b/morebits.css
index fa29111f1..71d1eb7b9 100644
--- a/morebits.css
+++ b/morebits.css
@@ -46,7 +46,7 @@ html {
}
}
-/* Morebits.status */
+/* Morebits.Status */
.morebits_status_status {
color: var(--morebits-color-status-status, #4682B4);
@@ -65,7 +65,7 @@ html {
font-weight: bold;
}
-/* Morebits.quickForm */
+/* Morebits.QuickForm */
form.quickform
{
@@ -176,7 +176,7 @@ form.quickform .morebits-tooltipButton
}
-/* Scrollbox styles, for use within Morebits.simpleWindow */
+/* Scrollbox styles, for use within Morebits.SimpleWindow */
div.morebits-scrollbox
{
@@ -233,7 +233,7 @@ div.morebits-usertext {
}
-/* Morebits.simpleWindow */
+/* Morebits.SimpleWindow */
.morebits-dialog {
border: 1px #666 solid;
diff --git a/twinkle.js b/twinkle.js
index b301d67a8..5fa130e9b 100644
--- a/twinkle.js
+++ b/twinkle.js
@@ -373,7 +373,7 @@ Twinkle.load = function () {
}
// Set custom Api-User-Agent header, for server-side logging purposes
- Morebits.wiki.api.setApiUserAgent('Twinkle (' + mw.config.get('wgWikiID') + ')');
+ Morebits.wiki.Api.setApiUserAgent('Twinkle (' + mw.config.get('wgWikiID') + ')');
Twinkle.disabledModules = Twinkle.getPref('disabledModules').concat(Twinkle.getPref('disabledSysopModules'));
@@ -452,7 +452,7 @@ Twinkle.makeFindSourcesDiv = function makeSourcesDiv(divID) {
return;
}
if (!Twinkle.findSources) {
- const parser = new Morebits.wiki.preview($(divID)[0]);
+ const parser = new Morebits.wiki.Preview($(divID)[0]);
parser.beginRender('({{Find sources|' + Morebits.pageNameNorm + '}})', 'WP:AFD').then(() => {
// Save for second-time around
Twinkle.findSources = parser.previewbox.innerHTML;