Content deleted Content added
(bot/CD) |
(bot/CD) |
||
Line 350:
}));
var version = "0.
var gitAbbrevHash = "
var gitBranch = "
var gitDate = "Wed, 14 Feb 2024
var gitVersion = "0.
/**
Line 9,084:
*/
renderFields() {
var _a, _b, _c, _d;
// Use order: `date`, `monthday` + `year`, `year`
const rowDate = (_a = this.backwardsCopyTemplateRow.date) !== null && _a !== void 0 ? _a : (this.backwardsCopyTemplateRow.monthday ?
Line 9,102:
value: rowDate
}),
author: new OO.ui.
allowArbitrary: true,▼
placeholder: mw.msg('deputy.ante.backwardsCopy.entry.author.placeholder'),
}),
url: new OO.ui.TextInputWidget({
Line 9,162 ⟶ 9,161:
const field = _field;
const input = inputs[field];
}▼
else if (value.length > 1) {▼
// TODO: ANTE l10n▼
}▼
else {▼
}▼
});▼
if (input instanceof OO.ui.TextInputWidget) {
// Rechecks the validity of the field.
Line 12,056 ⟶ 12,031:
"deputy.ante.backwardsCopy.entry.date.help": "This is the date on which the article was first published.",
"deputy.ante.backwardsCopy.entry.author.placeholder": "Add author",
"deputy.ante.backwardsCopy.entry.author.label": "Author
"deputy.ante.backwardsCopy.entry.author.help": "
"deputy.ante.backwardsCopy.entry.url.placeholder": "https://example.com/news/a-news-article-that-copies-from-wikipedia",
"deputy.ante.backwardsCopy.entry.url.label": "URL",
Line 13,992 ⟶ 13,967:
}
}
WikiConfiguration.configVersion =
WikiConfiguration.optionKey = 'userjs-deputy-wiki';
WikiConfiguration.configLocations = [
Line 14,731 ⟶ 14,706:
/**
* Extracts a page title from a MediaWiki
* to a MediaWiki page, `false` is returned.
*
* The part of the
* the data is in telling the correct title. If the
* two routes are available: the selflink check and the `title` attribute check.
*
Line 14,748 ⟶ 14,723:
* @return the page linked to
*/
function
const href = el.getAttribute('href');
const articlePathRegex = new RegExp(mw.util.getUrl('(.*)'));
Line 14,800 ⟶ 14,775:
}
* Check if a given copyright problems listing is full.
*
* @param data
* @return `true` if the listing is a {@link FullCopyrightProblemsListingData}
*/
function isFullCopyrightProblemsListing(data) {
return data.basic === false;
}
/**
* Represents an <b>existing</b> copyright problems listing. To add or create new
Line 14,820 ⟶ 14,804:
this.element = data.element;
if (data.basic === false) {
this.anchor = data.anchor;
this.plainlinks = data.plainlinks;
Line 14,830 ⟶ 14,815:
* This regular expression must catch three groups:
* - $1 - The initial `* `, used to keep the correct number of whitespace between parts.
* - $2 - The page title in the `id="..."`, ONLY IF the page is listed with an
* `article-cv`-like template. * - $3 - The page title in the wikilink, ONLY IF the page is
* `article-cv`-like template.
* - $4 - The page title, ONLY IF the page is a bare link to another page and does not use
* `article-cv`.
▲ *
*
* @return A regular expression.
Line 14,869 ⟶ 14,856:
// At this point, previousPivot is likely a MediaWiki level 4 heading.
const h4Anchor = previousPivot.querySelector('.mw-headline a');
listingPage =
// Identify if the page is a proper listing page (within the root page's
// pagespace)
Line 14,906 ⟶ 14,893:
// This ensures we're always using the prefixedDb version of the title (as
// provided by the anchor) for stability.
const
const title =
if (title === false ||
// Not a valid link.
return false;
}
else if (title.getPrefixedText() !== new mw.Title(
// Anchor and link mismatch. Someone tampered with the template?
// In this case, rely on the link instead, as the anchor is merely invisible.
console.warn(`Anchor and link mismatch for "${title.getPrefixedText()}".`, title,
}
// Checks for the <span class="plainlinks"> element.
// This ensures that the listing came from {{article-cv}} and isn't just a
// link with an anchor.
const
const elIndex = elSiblings.indexOf(el);
const plainlinks = el.parentElement.querySelector(`:nth-child(${elIndex}) ~ span.plainlinks`);
if (plainlinks == null ||
elSiblings.indexOf(plainlinks) - elIndex > 2) {
return false;
}
Line 14,936 ⟶ 14,927:
return {
basic: false,
title,
listingPage,
Line 14,973 ⟶ 14,965:
}
// Attempt to extract page title.
const title =
if (!title) {
return false;
Line 15,002 ⟶ 14,994:
* wikitext.
*/
get
return this.
}
/**
Line 15,016 ⟶ 15,008:
*/
getListingWikitextLines() {
return __awaiter(this, void 0, void 0, function* () {
const lines = (yield this.listingPage.getWikitext()).split('\n');
Line 15,022 ⟶ 15,015:
let endLine = null;
let bulletList;
const normalizedId = normalizeTitle((_a = this.id) !== null && _a !== void 0 ? _a : this.title).getPrefixedText()
const idMalformed = normalizedId !== this.title.getPrefixedText();
for (let line = 0; line < lines.length; line++) {
const lineText = lines[line];
Line 15,041 ⟶ 15,036:
.exec(lineText);
if (match != null) {
▲ this.title.getPrefixedText()) {
continue;
}
Line 15,051 ⟶ 15,045:
skipCounter++;
continue;
throw new Error(`Expected malformed listing with ID "${normalizedId}" and title "${this.title.getPrefixedText()}" but got normal listing.`);
}
bulletList = /[*:]/.test((match[1] || '').trim());
Line 16,222 ⟶ 16,219:
headingSets[listingPageTitle] = {};
}
const
const pageSet = headingSets[listingPageTitle];
if (pageSet[
pageSet[
}
else {
pageSet[
}
this.listingMap.set(link, new CopyrightProblemsListing(listingData, this.main ? null : this, pageSet[
links.push(link);
}
Line 16,691 ⟶ 16,690:
var wikiUtil = {
anchorToTitle:
decorateEditSummary: decorateEditSummary,
delink: delink,
|