Content deleted Content added
[03a9505] various page toolbar improvements; [13892d7] getNameText (deprecated) to getMainText |
v0.4.0; https://github.com/ChlodAlejandro/deputy/releases/tag/v0.4.0 |
||
Line 588:
revisionStatusUpdate: 'acknowledge',
pageNextRevisionRequest: 'pageNextRevisionResponse',
pageNextRevisionResponse: 'pageNextRevisionRequest',
userConfigUpdate: 'userConfigUpdate',
wikiConfigUpdate: 'wikiConfigUpdate'
};
// TODO: debug
Line 2,656 ⟶ 2,658:
this.row = row;
this.originalElement = originalElement;
this.additionalComments = this.extractAdditionalComments();
this.originalWikitext = originalWikitext;
this.section = section;
Line 2,826 ⟶ 2,829:
get autosaveHash() {
return `CASE--${this.row.casePage.title.getPrefixedDb()}+PAGE--${this.row.title.getPrefixedDb()}`;
}
/**
* Extracts HTML elements which may be additional comments left by others.
* The general qualification for this is that it has to be a list block
* element that comes after the main line (in this case, it's detected after
* the last .
* This appears in the following form in wikitext:
*
* ```
* * [[Page]] (...) [[Special:Diff/...|...]]
* *: Hello! <-- definition list block
* ** What!? <-- sub ul
* *# Yes. <-- sub ol
* * [[Page]] (...) [[Special:Diff/...|...]]<div>...</div> <-- inline div
* ```
*
* Everything else (`*<div>...`, `*'''...`, `*<span>`, etc.) is considered
* not to be an additional comment.
*
* If no elements were found, this returns an empty array.
*
* @return An array of HTMLElements
*/
extractAdditionalComments() {
// COMPAT: Specific to MER-C contribution surveyor
// Initialize to first successive diff link.
let lastSuccessiveDiffLink = this.originalElement.querySelector('a[href^="/wiki/Special:Diff/"]');
const elements = [];
if (!lastSuccessiveDiffLink) {
// No diff links. Get last element, check if block element, and crawl backwards.
let nextDiscussionElement = this.originalElement.lastElementChild;
while (nextDiscussionElement &&
window.getComputedStyle(nextDiscussionElement, '').display === 'block') {
elements.push(nextDiscussionElement);
nextDiscussionElement = nextDiscussionElement.previousElementSibling;
}
}
else {
while (lastSuccessiveDiffLink.nextElementSibling &&
lastSuccessiveDiffLink.nextElementSibling.tagName === 'A' &&
lastSuccessiveDiffLink
.nextElementSibling
.getAttribute('href')
.startsWith('/wiki/Special:Diff')) {
lastSuccessiveDiffLink = lastSuccessiveDiffLink.nextElementSibling;
}
// The first block element after `lastSuccessiveDiffLink` is likely discussion,
// and everything after it is likely part of such discussion.
let pushing = false;
let nextDiscussionElement = lastSuccessiveDiffLink.nextElementSibling;
while (nextDiscussionElement != null) {
if (!pushing &&
window.getComputedStyle(nextDiscussionElement).display === 'block') {
pushing = true;
elements.push(nextDiscussionElement);
}
else if (pushing) {
elements.push(nextDiscussionElement);
}
nextDiscussionElement = nextDiscussionElement.nextElementSibling;
}
}
return elements;
}
/**
Line 2,927 ⟶ 2,993:
classes: ['dp-cs-row-closeComments'],
placeholder: mw.msg('deputy.session.row.closeComments'),
value: value !== null && value !== void 0 ? value : '',
autosize: true,
rows: 1
Line 2,974 ⟶ 3,040:
this.unfinishedMessageBox.toggle(false);
revisionList.appendChild(unwrapWidget(this.unfinishedMessageBox));
revisionList.appendChild(unwrapWidget(this.renderCommentsTextInput(this.row.comment)));
for (const revision of diffs.values()) {
const revisionUIEl = new DeputyContributionSurveyRevision(revision, this);
Line 3,134 ⟶ 3,200:
!contentContainer.classList.contains('dp-cs-row-content-empty') &&
unwrapWidget(contentToggle));
}
/**
* Renders additional comments that became part of this row.
*
* @return An HTML element.
*/
renderAdditionalComments() {
const additionalComments = h_1("div", { class: "dp-cs-row-comments" },
h_1("b", null, mw.msg('deputy.session.row.additionalComments')),
h_1("hr", null),
h_1("div", { class: "dp-cs-row-comments-content", dangerouslySetInnerHTML: this.additionalComments.map(e => e.innerHTML).join('') }));
// Open all links in new tabs.
additionalComments.querySelectorAll('.dp-cs-row-comments-content a')
.forEach(a => a.setAttribute('target', '_blank'));
return additionalComments;
}
/**
Line 3,141 ⟶ 3,222:
*/
renderRow(diffs, content) {
var _a;
const contentContainer = h_1("div", { class: classMix([
'dp-cs-row-content',
Line 3,147 ⟶ 3,229:
this.element = swapElements(this.element, h_1("div", null,
this.renderHead(diffs, contentContainer),
((_a = this.additionalComments) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.renderAdditionalComments(),
contentContainer));
}
Line 3,471 ⟶ 3,554:
}
var version = "0.
var gitAbbrevHash = "
var gitBranch = "
var gitDate = "
var gitVersion = "0.
/**
Line 3,496 ⟶ 3,579:
*/
function msgEval(string, ...parameters) {
// Named parameters
let named = {};
if (typeof parameters[0] === 'object') {
named = parameters.shift();
}
const m = new mw.Map();
for (const [from, to] of Object.entries(named)) {
string = string.replace(new RegExp(`\\$${from}`, 'g'), to);
}
m.set('msg', string);
return new mw.Message(m, 'msg', parameters);
Line 3,837 ⟶ 3,928:
return false;
}
this.originalList = firstList
const rowElements = {};
for (let i = 0; i < this.originalList.children.length; i++) {
Line 3,862 ⟶ 3,953:
try {
const csr = new ContributionSurveyRow(this.casePage, line);
if (originalElement) {
rowElement = new DeputyContributionSurveyRow(csr, originalElement, line, this);
}
else {
// Element somehow not in list. Just keep line as-is.
rowElement = line;
}
}
catch (e) {
Line 3,880 ⟶ 3,978:
this.wikitextLines.push(rowElement);
}
// Remove last, this is to preserve as much state as possible
firstList.parentElement.removeChild(firstList);
return true;
});
Line 5,709 ⟶ 5,809:
// is due to VisualEditor using "MediaWiki:" in message values instead of "int:"
mw.jqueryMsg.HtmlEmitter.prototype.mediawiki =
mw.jqueryMsg.HtmlEmitter.prototype.
/**
* Performs a simple if check. Works just like the Extension:ParserFunctions
* version; it checks if the first parameter is blank and returns the second
* parameter if true. The latter parameter is passed if false.
*
* UNLIKE the Extension:ParserFunctions version, this version does not trim
* the parameters.
*
* @see https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#if
* @param nodes
* @return see function description
*/
mw.jqueryMsg.HtmlEmitter.prototype.if = function (nodes) {
return (nodes[0].trim() ? ((_a = nodes[1]) !== null && _a !== void 0 ? _a : '') : ((_b = nodes[2]) !== null && _b !== void 0 ? _b : ''));
};
// "#if" is unsupported due to the parsing done by jqueryMsg.
/**
* Simple function to avoid parsing errors during message expansion. Drops the "Template:"
* prefix before a link.
*
* @param nodes
* @return {{text}}
*/
mw.jqueryMsg.HtmlEmitter.prototype.template = function (nodes) {
return `{{${nodes.join('|')}}}`;
};
/**
* Allows `{{subst:...}}` to work. Does not actually change anything.
*
* @param nodes
* @return {{text}}
*/
mw.jqueryMsg.HtmlEmitter.prototype.subst = function (nodes) {
return `{{subst:${nodes.map((v) => typeof v === 'string' ? v : v.text()).join('|')}}}`;
};
/**
* Works exactly like the localurl magic word. Returns the local href to a page.
* Also adds query strings if given.
*
* @see https://www.mediawiki.org/wiki/Help:Magic_words#URL_data
* @param nodes
* @return /wiki/{page}?{query}
*/
mw.jqueryMsg.HtmlEmitter.prototype.localurl = function (nodes) {
return mw.util.getUrl(nodes[0]) + '?' + nodes[1];
};
}
Line 11,706 ⟶ 11,847:
*/
constructor(serializedData = {}) {
var _a;
super();
this.core = {
Line 11,787 ⟶ 11,929:
onBatchSubmit: new Setting(generateEnumConfigurationProperties(CompletionAction, CompletionAction.Reload))
};
this.type = 'user';
this.all = { core: this.core, cci: this.cci, ante: this.ante, ia: this.ia };
if (serializedData) {
Line 11,793 ⟶ 11,936:
if (mw.storage.get(`mw-${UserConfiguration.optionKey}-lastVersion`) !== version) ;
mw.storage.set(`mw-${UserConfiguration.optionKey}-lastVersion`, version);
if ((_a = window.deputy) === null || _a === void 0 ? void 0 : _a.comms) {
window.deputy.comms.addEventListener('userConfigUpdate', (e) => {
// Update the configuration based on another tab's message.
this.deserialize(e.data.config);
});
}
}
/**
Line 12,029 ⟶ 12,178:
*/
newRadioField(settingKey, setting) {
var _a;
const isDisabled = setting.disabled;
const desc = mw.message(`deputy.setting.${this.mode}.${this.config.group}.${settingKey}.description`);
const field = new OO.ui.RadioSelectWidget({
readOnly: (_a = setting.displayOptions.readOnly) !== null && _a !== void 0 ? _a : false,
disabled: isDisabled !== undefined && isDisabled !== false,
items: this.getAllowedValuesArray(settingKey, setting.allowedValues)
Line 12,073 ⟶ 12,224:
*/
newStringLikeField(FieldClass, settingKey, setting, extraFieldOptions = {}) {
var _a, _b, _c;
const isDisabled = setting.disabled;
const desc = mw.message(`deputy.setting.${this.mode}.${this.config.group}.${settingKey}.description`);
const field = new FieldClass(Object.assign({ readOnly: (_a = setting.displayOptions.readOnly) !== null && _a !== void 0 ? _a : false, value: (
const layout = new OO.ui.FieldLayout(field, {
align: 'top',
Line 12,228 ⟶ 12,379:
"deputy.setting.user.ia.onBatchSubmit.reload": "Reload the noticeboard page",
"deputy.setting.wiki.core": "Core",
"deputy.setting.wiki.core.lastEdited.name": "Configuration last edited",
"deputy.setting.wiki.core.lastEdited.description": "The last time that this configuration was edited, as a timestamp. This is a way to ensure that all users are on the correct wiki-wide configuration version before changes are made. Checks are performed on every page load with Deputy.",
"deputy.setting.wiki.core.dispatchRoot.name": "Deputy Dispatch root URL",
"deputy.setting.wiki.core.dispatchRoot.description": "The URL to a Deputy Dispatch instance that can handle this wiki. Deputy Dispatch is a webserver responsible for centralizing and optimizing data used by Deputy, and can be used to reduce load on wikis. More information can be found at https://github.com/ChlodAlejandro/deputy-dispatch.",
Line 12,236 ⟶ 12,389:
"deputy.setting.wiki.cci.rootPage.description": "The main page that holds all subpages containing valid contribution copyright investigation cases.",
"deputy.setting.wiki.cci.collapseTop.name": "Collapsible wikitext (top)",
"deputy.setting.wiki.cci.collapseTop.description": "Placed just below a section heading when closing a contributor survey section. Use \"$1\" to denote user comments and signature. On the English Wikipedia, this is {{Template:collapse top}}. Other wikis may have an equivalent template. This should go hand in hand with \"{{int:deputy.setting.wiki.cci.collapseBottom.name}}\", as they are used as a pair.",
"deputy.setting.wiki.cci.collapseBottom.name": "Collapsible wikitext (bottom)",
"deputy.setting.wiki.cci.collapseBottom.description": "Placed at the end of a section when closing a contributor survey section. On the English Wikipedia, this is {{Template:collapse bottom}}. Other wikis may have an equivalent template.",
"deputy.setting.wiki.cci.earwigRoot.name": "Earwig's Copyvio Detector root URL",
"deputy.setting.wiki.cci.earwigRoot.description": "The URL to an instance of Earwig's Copyvio Detector that can handle this wiki. The official copyvio detector (copyvios.toolforge.org) can only handle Wikimedia wikis — you may change this behavior by specifying a custom instance that can process this wiki here.",
Line 12,264 ⟶ 12,417:
"deputy.setting.wiki.ia.batchListingPageWikitext.description": "Wikitext to use for every row of text in \"{{int:deputy.setting.wiki.ia.batchListingWikitext.name}}\". No line breaks are automatically added; these must be added into this string.",
"deputy.setting.wiki.ia.hideTemplate.name": "Content hiding wikitext (top)",
"deputy.setting.wiki.ia.hideTemplate.description": "Wikitext to hide offending content with. On the English Wikipedia, this is a usage of {{Template:copyvio}}. Other wikis may have an equivalent template. This should go hand in hand with \"{{int:deputy.setting.wiki.ia.hideTemplateBottom.name}}\", as they are used as a pair.",
"deputy.setting.wiki.ia.hideTemplateBottom.name": "Content hiding wikitext (bottom)",
"deputy.setting.wiki.ia.hideTemplateBottom.description": "Placed at the end of hidden content to hide only part of a page. On the English Wikipedia, this is {{Template:copyvio/bottom}}. Other wikis may have an equivalent template.",
"deputy.setting.wiki.ia.responses.name": "Responses",
"deputy.setting.wiki.ia.responses.description": "Quick responses for copyright problems listings. Used by clerks to resolve specific listings or provide more information about the progress of a given listing."
Line 12,392 ⟶ 12,545:
process.next(this.config.save());
process.next(() => {
var _a, _b;
mw.notify(mw.msg('deputy.settings.saved'), {
type: 'success'
});
if (this.config.type
// Override local Deputy option, just in case the user wishes to
// change the configuration again.
mw.user.options.set(UserConfiguration.optionKey, this.config.serialize());
if ((_a = window.deputy) === null || _a === void 0 ? void 0 : _a.comms) {
window.deputy.comms.send({
type: 'userConfigUpdate',
config: this.config.serialize()
});
}
}
else if (this.config.type === 'wiki') {
// We know it is a WikiConfiguration, the instanceof check here
// is just for type safety.
if ((_b = window.deputy) === null || _b === void 0 ? void 0 : _b.comms) {
window.deputy.comms.send({
type: 'wikiConfigUpdate',
config: {
title: this.config.sourcePage.getPrefixedText(),
editable: this.config.editable,
wt: this.config.serialize()
}
});
}
// Reload the page.
window.___location.reload();
}
});
Line 12,536 ⟶ 12,712:
}
/* eslint-disable max-len */
/*
* Replacement polyfills for wikis that have no configured templates.
Line 12,572 ⟶ 12,749:
<div style="font-size: 1.2rem"><b>{{int:deputy.ia.content.copyvio}}</b></div>
<div>{{int:deputy.ia.content.copyvio.help}}</div>
{{if:$1|<div>{{if:$presumptive|{{int:deputy.ia.content.copyvio.from.pd}} $1|{{int:deputy.ia.content.copyvio.from}} $1}}</div>}}
</div>
<!-- {{int:deputy.ia.content.copyvio.content}} -->
Line 12,591 ⟶ 12,769:
const messageBox = DeputyMessageWidget({
classes: [
'deputy', 'dp-mb', 'dp-wikiConfigUpdateMessage'
],
type: 'info',
Line 12,625 ⟶ 12,803:
*/
constructor(sourcePage, serializedData, editable) {
var _a;
super();
this.sourcePage = sourcePage;
this.serializedData = serializedData;
this.editable = editable;
//
this.static = WikiConfiguration;
this.core = {
Line 12,639 ⟶ 12,818:
defaultValue: WikiConfiguration.configVersion,
displayOptions: { hidden: true },
alwaysSave: true
}),
lastEdited: new Setting({
defaultValue: 0,
displayOptions: { type: 'number', readOnly: true },
alwaysSave: true
}),
Line 12,745 ⟶ 12,929:
responses: new Setting(Object.assign(Object.assign({}, Setting.basicSerializers), { defaultValue: null, displayOptions: { type: 'unimplemented' } }))
};
this.type = 'wiki';
this.all = { core: this.core, cci: this.cci, ante: this.ante, ia: this.ia };
/**
Line 12,756 ⟶ 12,941:
if (serializedData) {
this.deserialize(serializedData);
}
if ((_a = window.deputy) === null || _a === void 0 ? void 0 : _a.comms) {
// Communications is available. Register a listener.
window.deputy.comms.addEventListener('wikiConfigUpdate', (e) => {
this.update(Object.assign({}, e.data.config, {
title: normalizeTitle(e.data.config.title)
}));
});
}
}
Line 12,881 ⟶ 13,074:
/**
* Check for local updates, and update the local configuration as needed.
*
* @param sourceConfig A serialized version of the configuration based on a wiki
* page configuration load.
*/
update(sourceConfig) {
return __awaiter(this, void 0, void 0, function* () {
// Asynchronously load from the wiki.
if (
}
// Asynchronously load from the wiki.
fromWiki = yield WikiConfiguration.loadConfigurationWikitext();
if (fromWiki == null) {
// No configuration found on the wiki.
return;
}
}
const liveWikiConfig = JSON.parse(fromWiki.wt);
// Attempt save if on-wiki config found and doesn't match local.
// Doesn't need to be from the same config page, since this usually means a new config
// page was made, and we need to switch to it.
if
var _a;
// Only mark outdated after saving, so we don't indirectly cause a save operation
Line 12,908 ⟶ 13,104:
this.outdated = true;
// Attempt to add site notice.
if (document.querySelector('.dp-wikiConfigUpdateMessage') == null) {
(_a = document.getElementById('siteNotice')) === null || _a === void 0 ? void 0 : _a.insertAdjacentElement('afterend', ConfigurationReloadBanner()); };
// If updated from a source config (other Deputy tab), do not attempt to save
// to MediaWiki settings. This is most likely already saved by the original tab
// that sent the comms message.
if (!sourceConfig) {
MwApi.action.saveOption(WikiConfiguration.optionKey,
// Use `liveWikiConfig`, since this contains the compressed version and is more
// bandwidth-friendly.
JSON.stringify({
title: fromWiki.title,
editable: fromWiki.editable,
wt: liveWikiConfig
})).then(() => {
var _a;
if ((_a = window.deputy) === null || _a === void 0 ? void 0 : _a.comms) {
// Broadcast the update to other tabs.
window.deputy.comms.send({
type: 'wikiConfigUpdate',
config: {
title: fromWiki.title.getPrefixedText(),
editable: fromWiki.editable,
wt: liveWikiConfig
}
});
}
onSuccess();
}).catch(() => {
// silently fail
});
}
else {
onSuccess();
}
}
});
Line 12,918 ⟶ 13,148:
save() {
return __awaiter(this, void 0, void 0, function* () {
// Update last edited number
this.core.lastEdited.set(Date.now());
yield MwApi.action.postWithEditToken({
action: 'edit',
Line 13,270 ⟶ 13,502:
];
var deputyStyles = "/*=============================================================================== GLOBAL DEPUTY CLASSES===============================================================================*/* > .deputy.dp-heading {position: absolute;opacity: 0;pointer-events: none;}*:hover > .deputy.dp-heading:not(.dp-heading--active) {opacity: 1;pointer-events: all;}.dp-loadingDots-1, .dp-loadingDots-2, .dp-loadingDots-3 {display: inline-block;margin: 0.1em 0.6em 0.1em 0.1em;width: 0.8em;height: 0.8em;background-color: rgba(0, 0, 0, 50%);animation: dp-loadingDots linear 3s infinite;border-radius: 50%;}@keyframes dp-loadingDots {0% {background-color: rgba(0, 0, 0, 10%);}16% {background-color: rgba(0, 0, 0, 40%);}32% {background-color: rgba(0, 0, 0, 10%);}100% {background-color: rgba(0, 0, 0, 10%);}}.dp-loadingDots-1 {animation-delay: -1s;}.dp-loadingDots-2 {animation-delay: -0.5s;}#mw-content-text.dp-reloading {opacity: 0.2;pointer-events: none;}p.dp-messageWidget-message {margin: 0 0 0.5em 0;}.dp-messageWidget-actions .oo-ui-buttonElement {margin-top: 0;}/*=============================================================================== DEPUTY REVIEW DIALOG (DeputyReviewDialog)===============================================================================*/.dp-review-progress {flex: 1;width: 60%;min-width: 300px;}/*=============================================================================== DEPUTY ENTRY POINTS (DeputyCCISessionStartLink, etc.)===============================================================================*/.deputy.dp-sessionStarter {font-size: small;font-weight: normal;margin-left: 0.25em;vertical-align: baseline;line-height: 1em;font-family: sans-serif;}.deputy.dp-sessionStarter::before {content: '\\200B';}.mw-content-ltr .deputy.dp-sessionStarter .dp-sessionStarter-bracket:first-of-type,.mw-content-rtl .deputy.dp-sessionStarter .dp-sessionStarter-bracket:not(:first-of-type) {margin-right: 0.25em;color: #54595d;}.client-js .deputy.dp-sessionStarter .dp-sessionStarter-bracket:first-of-type,.client-js .deputy.dp-sessionStarter .dp-sessionStarter-bracket:not(:first-of-type) {margin-left: 0.25em;color: #54595d}.dp-cs-section-add {position: absolute;top: 0;/* -1.6em derived from MediaWiki list margins. */left: -1.6em;width: calc(100% + 1.6em);height: 100%;background-color: rgba(255, 255, 255, 75%);display: flex;justify-content: center;align-items: center;}.dp-cs-section-add .dp-cs-section-addButton {opacity: 0;transition: opacity 0.2s ease-in-out;}.dp-cs-section-add:hover .dp-cs-section-addButton {opacity: 1;}/*=============================================================================== DEPUTY CONTRIBUTION SURVEY SECTION===============================================================================*/.dp-cs-session-notice {margin-top: 8px;position: sticky;top: 8px;z-index: 50;}.skin-vector-2022.vector-sticky-header-visible .dp-cs-session-notice {top: calc(3.125rem + 8px);}.dp-cs-section-footer {position: relative;padding: 8px;}.dp-cs-section-progress {margin-top: 8px;max-height: 0;transition: max-height 0.2s ease-in-out;display: flex;justify-content: center;align-items: center;overflow: hidden;}.dp-cs-section-progress.active {max-height: 50px;}.dp-cs-section-progress .oo-ui-progressBarWidget {flex: 1}.dp-cs-section-closingCommentsField {margin-top: 8px;}.dp-cs-row {margin-bottom: 8px;}.dp-cs-row .dp--loadingDots {display: flex;align-items: center;justify-content: center;padding: 0.4em;}.dp-cs-row-status {max-width: 5.4em;}.dp-cs-row-status .oo-ui-dropdownWidget-handle .oo-ui-labelElement-label {width: 0;opacity: 0;}.dp-cs-row-status .dp-cs-row-status--unknown:not(.oo-ui-optionWidget-selected) {display: none;}.dp-cs-row-head > * {vertical-align: middle;}.dp-cs-row-comments {padding: 16px;background-color: rgba(0, 159, 255, 10%);margin: 4px 0;}.dp-cs-row-comments > b {letter-spacing: 0.1em;font-weight: bold;text-transform: uppercase;color: rgba(0, 0, 0, 0.5);}.dp-cs-row-comments hr {border-color: rgb(0, 31, 51);}body.mediawiki.ltr .dp-cs-row-head > :not(:first-child):not(:last-child),body.mediawiki.ltr .dp-cs-row-head > :not(:first-child):not(:last-child) {margin-right: 16px;}body.mediawiki.rtl .dp-cs-row-head > :not(:first-child):not(:last-child),body.mediawiki.rtl .dp-cs-row-head > :not(:first-child):not(:last-child) {margin-left: 16px;}.dp-cs-row-links {margin-right: 0 !important;}.dp-cs-row-links > :not(:last-child) {margin-right: 8px !important;}.dp-cs-row-title {font-weight: bold;font-size: 1.2em;vertical-align: middle;}.dp-cs-row-details {color: #4a5054;font-weight: bold;}.dp-cs-row-toggle .oo-ui-iconElement-icon {background-size: 1em;}.dp-cs-row-toggle .oo-ui-buttonElement-button {border-radius: 50%;}.dp-cs-row .history-user,.dp-cs-row :not(.newpage) + .mw-changeslist-date {margin-left: 0.4em;margin-right: 0.2em;}.dp-cs-row .newpage {margin-left: 0.4em;}.dp-cs-row-content {padding: 16px;background-color: rgba(0, 0, 0,
var deputyCoreEnglish = {
Line 13,319 ⟶ 13,551:
"deputy.session.row.checkAll": "Mark all revisions as finished",
"deputy.session.row.checkAll.confirm": "Mark all revisions as finished?",
"deputy.session.row.additionalComments": "Discussion",
"deputy.session.row.closeComments": "Closing comments",
"deputy.session.row.close.sigFound": "The closing comment had a signature. It will not be automatically removed when saved.",
Line 13,372 ⟶ 13,605:
"deputy.ia.content.copyvio": "⛔ Content on this page has been temporarily hidden due to a suspected copyright violation",
"deputy.ia.content.copyvio.help": "Please see this wiki's noticeboard for copyright problems for more information.",
"deputy.ia.content.copyvio.from": "The following reason/source was provided:",
"deputy.ia.content.copyvio.from.pd": "The content was presumptively removed based on the following contributor copyright investigation:",
"deputy.ia.content.copyvio.content": "The following content may be a copyright violation. Please do not unhide it unless you have determined that it is compatible with this wiki's copyright license.",
"deputy.ia.listing.new": "New listing",
Line 13,409 ⟶ 13,644:
"deputy.ia.listing.re.where": "No vio found, claim cannot be validated. Tag removed from article.",
"deputy.ia.listing.re.unsure": "No source found; copy-paste tag removed and cv-unsure tag placed at article talk.",
"deputy.ia.listing.re.deletedcup": "Copyright concerns remain. Article deleted, left {{Template:Cup}} notice.",
"deputy.ia.listing.re.relist": "Permission plausible. Article relisted under today.",
"deputy.ia.listing.re.resolved": "Issue resolved.",
Line 13,451 ⟶ 13,686:
"deputy.ia.report.submit": "Submit",
"deputy.ia.report.hide": "Hide content only",
"deputy.ia.report.hide.confirm": "This will insert the {{Template:copyvio}} template and hide page content as set, but will not post a listing for this page on the noticeboard. Are you sure you don't want to list this page on the noticeboard?",
"deputy.ia.report.success": "Page content hidden and reported",
"deputy.ia.report.success.hide": "Page content hidden",
"deputy.ia.report.success.report": "Page reported",
"deputy.ia.report.error.report": "An error occurred while trying to save the entry to today's noticeboard listings. Please visit the noticeboard page and select \"Add listing\" or file the listing manually.",
"deputy.ia.report.error.shadow": "An error occurred while trying to append the {{Template:copyvio}} template on the page. Please manually insert the template.",
"deputy.ia.hiddenVio": "A user has marked content on this page as a suspected copyright violation. It is currently hidden from normal viewers of this page while awaiting further action.",
"deputy.ia.hiddenVio.show": "Show hidden
"deputy.ia.hiddenVio.hide": "Hide hidden
};
Line 14,346 ⟶ 14,581:
.cci.rootPage.get().getPrefixedText() + '/';
// Simple replace, only 1 replacement made anyway.
const trimmed = value.replace(prefix, '').
if (config.inputFilter) {
return config.inputFilter(trimmed);
Line 14,356 ⟶ 14,591:
this.getQueryValue = function () {
return `${window.InfringementAssistant.wikiConfig.cci.rootPage.get()
.getPrefixedText()}/${this.getValue().trimEnd()}`;
};
}
Line 14,729 ⟶ 14,964:
let finalPageContent;
const wikiConfig = (yield window.InfringementAssistant.getWikiConfig()).ia;
const copyvioWikitext = msgEval(wikiConfig.hideTemplate.get(),
presumptive: this.data.presumptive ? 'true' : '',
presumptiveCase: this.data.presumptiveCase ? 'true' : '',
fromUrls: this.data.fromUrls ? 'true' : '',
sourceUrls: this.data.sourceUrls ? 'true' : '',
sourceText: this.data.sourceText ? 'true' : '',
entirePage: this.data.entirePage ? 'true' : ''
}, this.data.presumptive ?
`[[${window.deputy.wikiConfig.cci.rootPage.get().getPrefixedText()}/${this.data.presumptiveCase}]]` : (this.data.fromUrls ?
(_b = ((_a = this.data.sourceUrls) !== null && _a !== void 0 ? _a : [])[0]) !== null && _b !== void 0 ? _b : '' :
this.data.sourceText), this.data.entirePage ? 'true' : 'false').text();
if (this.data.entirePage) {
finalPageContent = copyvioWikitext + '\n' + this.wikitext;
Line 15,337 ⟶ 15,580:
button.setLabel(shown ? mw.msg('deputy.ia.hiddenVio.hide') : mw.msg('deputy.ia.hiddenVio.show'));
button.setIcon(shown ? 'eyeClosed' : 'eye');
this.vioElement.appendChild(h_1("div", { style: "clear: both;" }));
this.vioElement.classList.toggle('deputy-show', shown);
});
Line 15,543 ⟶ 15,787:
getPageContent: getPageContent,
normalizeTitle: normalizeTitle,
sectionHeadingName: sectionHeadingName,
msgEval: msgEval
};
this.modules = {
|