From f97e5b2c60ebad42b6a3982d48ed3bec48cde267 Mon Sep 17 00:00:00 2001 From: ChlodAlejandro Date: Tue, 9 Aug 2022 01:15:56 +0800 Subject: [PATCH] renaming CTE to ANTE (part) --- .editorconfig | 5 + i18n/ante/en.json | 202 ++++++++++++++++++ i18n/cte/en.json | 202 ------------------ rollup.config.js | 4 +- src/Deputy.ts | 2 +- src/modules/DeputyModule.ts | 77 +++++++ src/modules/{cte => ante}/BANNER.txt | 0 .../{cte => ante}/CopiedTemplateEditor.ts | 57 +---- .../CopiedTemplateEditorStandalone.ts | 0 .../css/copied-template-editor.css | 0 .../{cte => ante}/events/RowChangeEvent.ts | 0 .../events/TemplateInsertEvent.ts | 0 .../{cte => ante}/models/AttributionNotice.ts | 0 .../models/AttributionNoticeRow.ts | 0 .../models/CTEParsoidDocument.ts | 0 .../CTEParsoidTransclusionTemplateNode.ts | 0 .../{cte => ante}/models/MediaWikiData.ts | 0 .../models/RowedAttributionNotice.ts | 0 .../{cte => ante}/models/TemplateFactory.ts | 0 .../{cte => ante}/models/TemplateMerger.ts | 0 .../models/WikiAttributionNotices.ts | 0 .../models/templates/BackwardsCopyTemplate.ts | 0 .../templates/BackwardsCopyTemplateRow.ts | 0 .../models/templates/CopiedTemplate.ts | 0 .../models/templates/CopiedTemplateRow.ts | 0 .../models/templates/MergedFromTemplate.ts | 0 .../models/templates/MergedToTemplate.ts | 0 .../{cte => ante}/models/templates/README.md | 0 .../models/templates/SplitArticleTemplate.ts | 0 .../templates/SplitArticleTemplateRow.ts | 0 .../templates/TranslatedPageTemplate.ts | 0 .../ui/AttributionNoticeAddMenu.ts | 0 .../ui/AttributionNoticePageGenerator.ts | 0 .../ui/CopiedTemplateEditorDialog.tsx | 34 +-- .../{cte => ante}/ui/RowPageShared.tsx | 28 +-- .../ui/pages/AttributionNoticePageLayout.ts | 0 .../ui/pages/AttributionNoticesEmptyPage.tsx | 8 +- .../ui/pages/BackwardsCopyTemplatePage.tsx | 26 +-- .../ui/pages/BackwardsCopyTemplateRowPage.tsx | 34 +-- .../ui/pages/CopiedTemplatePage.tsx | 14 +- .../ui/pages/CopiedTemplateRowPage.tsx | 76 +++---- .../ui/pages/MergedFromTemplatePage.tsx | 32 +-- .../ui/pages/MergedToTemplatePage.tsx | 20 +- .../ui/pages/SplitArticleTemplatePage.tsx | 16 +- .../ui/pages/SplitArticleTemplateRowPage.tsx | 28 +-- .../ui/pages/TranslatedPageTemplatePage.tsx | 50 ++--- .../ui/pages/messages/DemoTemplateMessage.tsx | 0 47 files changed, 481 insertions(+), 434 deletions(-) create mode 100644 i18n/ante/en.json delete mode 100644 i18n/cte/en.json create mode 100644 src/modules/DeputyModule.ts rename src/modules/{cte => ante}/BANNER.txt (100%) rename src/modules/{cte => ante}/CopiedTemplateEditor.ts (76%) rename src/modules/{cte => ante}/CopiedTemplateEditorStandalone.ts (100%) rename src/modules/{cte => ante}/css/copied-template-editor.css (100%) rename src/modules/{cte => ante}/events/RowChangeEvent.ts (100%) rename src/modules/{cte => ante}/events/TemplateInsertEvent.ts (100%) rename src/modules/{cte => ante}/models/AttributionNotice.ts (100%) rename src/modules/{cte => ante}/models/AttributionNoticeRow.ts (100%) rename src/modules/{cte => ante}/models/CTEParsoidDocument.ts (100%) rename src/modules/{cte => ante}/models/CTEParsoidTransclusionTemplateNode.ts (100%) rename src/modules/{cte => ante}/models/MediaWikiData.ts (100%) rename src/modules/{cte => ante}/models/RowedAttributionNotice.ts (100%) rename src/modules/{cte => ante}/models/TemplateFactory.ts (100%) rename src/modules/{cte => ante}/models/TemplateMerger.ts (100%) rename src/modules/{cte => ante}/models/WikiAttributionNotices.ts (100%) rename src/modules/{cte => ante}/models/templates/BackwardsCopyTemplate.ts (100%) rename src/modules/{cte => ante}/models/templates/BackwardsCopyTemplateRow.ts (100%) rename src/modules/{cte => ante}/models/templates/CopiedTemplate.ts (100%) rename src/modules/{cte => ante}/models/templates/CopiedTemplateRow.ts (100%) rename src/modules/{cte => ante}/models/templates/MergedFromTemplate.ts (100%) rename src/modules/{cte => ante}/models/templates/MergedToTemplate.ts (100%) rename src/modules/{cte => ante}/models/templates/README.md (100%) rename src/modules/{cte => ante}/models/templates/SplitArticleTemplate.ts (100%) rename src/modules/{cte => ante}/models/templates/SplitArticleTemplateRow.ts (100%) rename src/modules/{cte => ante}/models/templates/TranslatedPageTemplate.ts (100%) rename src/modules/{cte => ante}/ui/AttributionNoticeAddMenu.ts (100%) rename src/modules/{cte => ante}/ui/AttributionNoticePageGenerator.ts (100%) rename src/modules/{cte => ante}/ui/CopiedTemplateEditorDialog.tsx (93%) rename src/modules/{cte => ante}/ui/RowPageShared.tsx (87%) rename src/modules/{cte => ante}/ui/pages/AttributionNoticePageLayout.ts (100%) rename src/modules/{cte => ante}/ui/pages/AttributionNoticesEmptyPage.tsx (93%) rename src/modules/{cte => ante}/ui/pages/BackwardsCopyTemplatePage.tsx (92%) rename src/modules/{cte => ante}/ui/pages/BackwardsCopyTemplateRowPage.tsx (89%) rename src/modules/{cte => ante}/ui/pages/CopiedTemplatePage.tsx (95%) rename src/modules/{cte => ante}/ui/pages/CopiedTemplateRowPage.tsx (87%) rename src/modules/{cte => ante}/ui/pages/MergedFromTemplatePage.tsx (87%) rename src/modules/{cte => ante}/ui/pages/MergedToTemplatePage.tsx (91%) rename src/modules/{cte => ante}/ui/pages/SplitArticleTemplatePage.tsx (94%) rename src/modules/{cte => ante}/ui/pages/SplitArticleTemplateRowPage.tsx (88%) rename src/modules/{cte => ante}/ui/pages/TranslatedPageTemplatePage.tsx (81%) rename src/modules/{cte => ante}/ui/pages/messages/DemoTemplateMessage.tsx (100%) diff --git a/.editorconfig b/.editorconfig index e730e245..01d6515a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,5 +14,10 @@ indent_style = tab indent_style = space indent_size = 4 +[i18n/**.json] +end_of_line = lf +indent_style = space +indent_size = 4 + [/*.{json,js}] end_of_line = lf diff --git a/i18n/ante/en.json b/i18n/ante/en.json new file mode 100644 index 00000000..bc4276ba --- /dev/null +++ b/i18n/ante/en.json @@ -0,0 +1,202 @@ +{ + "deputy.ante": "Attribution Notice Template Editor", + + "deputy.ante.edit": "Modify content attribution notices for this page", + "deputy.ante.close": "Close", + "deputy.ante.save": "Save", + "deputy.ante.add": "Add a notice", + "deputy.ante.mergeAll": "Merge all notices", + "deputy.ante.mergeAll.confirm": "You are about to merge $1 {{PLURAL:$1|notice|notices}}. Continue?", + "deputy.ante.reset": "Reset all changes", + "deputy.ante.reset.confirm": "This will reset all changes. Proceed?", + "deputy.ante.delete": "Delete all notices", + "deputy.ante.delete.confirm": "You are about to delete $1 {{PLURAL:$1|notice|notices}}. Continue?", + + "deputy.ante.nocat.head": "nocat is enabled", + "deputy.ante.nocat.help": "This notice has the nocat parameter enabled and, as an effect, is not being tracked in categories. This usually means that the template is for demonstration purposes only.", + "deputy.ante.nocat.clear": "Restore tracking", + "deputy.ante.demo.head": "demo is enabled", + "deputy.ante.demo.help": "This notice has the demo parameter enabled. This usually means that the template is for demonstration purposes only.", + "deputy.ante.demo.clear": "Clear demo mode", + + "deputy.ante.invalid": "Some fields are still invalid.", + "deputy.ante.adding": "Adding content attribution notices", + "deputy.ante.modifying": "Modifying content attribution notices", + + "deputy.ante.dirty": "This dialog did not close properly last time. Your changes will be reset.", + "deputy.ante.empty.header": "No notices", + "deputy.ante.empty.removed": "All notices will be removed from the page. To reset your changes and restore previous templates, press the reset button at the bottom of the dialog.", + "deputy.ante.empty.none": "There are currently no notices on the talk page.", + "deputy.ante.empty.add": "Add a notice", + "deputy.ante.noSpot": "Sorry, but a notice cannot be automatically added. Please contact the developer to possibly add support for this talk page.", + + "deputy.ante.merge": "Merge", + "deputy.ante.merge.title": "Merge notices", + "deputy.ante.merge.from.label": "Notices to merge", + "deputy.ante.merge.from.select": "Select a notice", + "deputy.ante.merge.from.empty": "No notices to merge", + "deputy.ante.merge.all": "Merge all", + "deputy.ante.merge.all.confirm": "You are about to merge $1 'copied' {{PLURAL:$1|notice|notices}} into this notice. Continue?", + "deputy.ante.merge.button": "Merge", + + "deputy.ante.templateOptions": "Template options", + + "deputy.ante.copied.label": "Copied $1", + + "deputy.ante.copied.remove": "Remove notice", + "deputy.ante.copied.remove.confirm": "This will destroy $1 {{PLURAL:$1|entry|entries}}. Continue?", + "deputy.ante.copied.add": "Add entry", + + "deputy.ante.copied.entry.label": "Template entry", + "deputy.ante.copied.entry.short": "$1 to $2", + "deputy.ante.copied.entry.shortTo": "To $1", + "deputy.ante.copied.entry.shortFrom": "From $1", + + "deputy.ante.copied.entry.remove": "Remove entry", + "deputy.ante.copied.entry.copy": "Copy attribution edit summary", + "deputy.ante.copied.entry.copy.lacking": "Attribution edit summary copied to clipboard with lacking properties. Ensure that `from` is supplied.", + "deputy.ante.copied.entry.copy.success": "Attribution edit summary copied to clipboard.", + + "deputy.ante.copied.collapse": "Collapse", + "deputy.ante.copied.small": "Small", + + "deputy.ante.copied.from.placeholder": "Page A", + "deputy.ante.copied.from.label": "Page copied from", + "deputy.ante.copied.from.help": "This is the page from which the content was copied from.", + "deputy.ante.copied.from_oldid.placeholder": "from_oldid", + "deputy.ante.copied.from_oldid.label": "Revision ID", + "deputy.ante.copied.from_oldid.help": "The specific revision ID at the time that the content was copied, if known.", + "deputy.ante.copied.to.placeholder": "Page B", + "deputy.ante.copied.to.label": "Page copied to", + "deputy.ante.copied.to.help": "This is the page where the content was copied into.", + "deputy.ante.copied.to_diff.placeholder": "to_diff", + "deputy.ante.copied.to_diff.label": "Revision ID", + "deputy.ante.copied.to_diff.help": "The specific revision ID of the revision that copied content into the target page. If the copying spans multiple revisions, this is the ID of the last revision that copies content into the page.", + "deputy.ante.copied.to_oldid.placeholder": "to_oldid", + "deputy.ante.copied.to_oldid.label": "Starting revision ID", + "deputy.ante.copied.to_oldid.help": "The ID of the revision before any content was copied. This can be omitted unless multiple revisions copied content into the page.", + "deputy.ante.copied.diff.placeholder": "https://en.wikipedia.org/w/index.php?diff=123456", + "deputy.ante.copied.diff.label": "Diff URL", + "deputy.ante.copied.diff.help": "The URL of the diff. Using to_diff and to_oldid is preferred, although supplying this parameter will override both.", + "deputy.ante.copied.merge.label": "Merged?", + "deputy.ante.copied.merge.help": "Whether the copying was done as a result of merging two pages.", + "deputy.ante.copied.afd.placeholder": "AfD page (without Wikipedia:Articles for deletion/)", + "deputy.ante.copied.afd.label": "AfD page", + "deputy.ante.copied.afd.help": "The AfD page if the copy was made due to an AfD closed as \"merge\".", + + "deputy.ante.copied.advanced": "Advanced", + "deputy.ante.copied.dateInvalid": "The previous date value, \"$1\", was not a valid date.", + "deputy.ante.copied.diffDeprecate": "The to_diff and to_oldid parameters are preferred in favor of the diff parameter.", + "deputy.ante.copied.diffDeprecate.replace": "The current value of '$1', \"$2\", will be replaced with \"$3\". Continue?", + "deputy.ante.copied.diffDeprecate.failed": "Cannot convert `diff` parameter to URL. See your browser console for more details.", + + "deputy.ante.splitArticle.label": "Split article $1", + + "deputy.ante.splitArticle.remove": "Remove notice", + "deputy.ante.splitArticle.remove.confirm": "This will destroy $1 {{PLURAL:$1|entry|entries}}. Continue?", + "deputy.ante.splitArticle.add": "Add entry", + + "deputy.ante.splitArticle.entry.label": "Template entry", + "deputy.ante.splitArticle.entry.remove": "Remove entry", + "deputy.ante.splitArticle.entry.short": "$1 on $2", + + "deputy.ante.splitArticle.collapse": "Collapse", + "deputy.ante.splitArticle.from": "From", + "deputy.ante.splitArticle.from.help": "This is the page where the content was split from. In most cases, this is the current page, and can be left blank.", + + "deputy.ante.splitArticle.to.placeholder": "Subpage A", + "deputy.ante.splitArticle.to.label": "Page split to", + "deputy.ante.splitArticle.to.help": "This is the name of page that material was copied to; the \"merge target\".", + "deputy.ante.splitArticle.from_oldid.placeholder": "from_oldid", + "deputy.ante.splitArticle.from_oldid.label": "As of revision ID", + "deputy.ante.splitArticle.from_oldid.help": "The revision ID of the original page prior to the split. This is the revision that still contains content that will eventually become part of the split, with the following revision (or succeeding revisions) progressively transferring content to the other pages.", + "deputy.ante.splitArticle.date.label": "Date of split", + "deputy.ante.splitArticle.date.help": "The date that the split occurred.", + "deputy.ante.splitArticle.diff.placeholder": "https://en.wikipedia.org/w/index.php?diff=123456&oldid=123455", + "deputy.ante.splitArticle.diff.label": "Diff URL", + "deputy.ante.splitArticle.diff.help": "The diff URL of the split.", + + "deputy.ante.mergedFrom.label": "Merged from $1", + "deputy.ante.mergedFrom.remove": "Remove notice", + + "deputy.ante.mergedFrom.article.placeholder": "Page A", + "deputy.ante.mergedFrom.article.label": "Original article", + "deputy.ante.mergedFrom.article.help": "This is the page where the merged content is or used to be.", + "deputy.ante.mergedFrom.date.label": "Date", + "deputy.ante.mergedFrom.date.help": "The date (in UTC) when the content was merged into this page.", + "deputy.ante.mergedFrom.talk.label": "Link to talk?", + "deputy.ante.mergedFrom.talk.help": "Whether to link to the original article's talk page or not.", + "deputy.ante.mergedFrom.target.placeholder": "Page B", + "deputy.ante.mergedFrom.target.label": "Merge target", + "deputy.ante.mergedFrom.target.help": "The page that the content was merged into. Used if the page that the content was merged into was the talk page.", + "deputy.ante.mergedFrom.afd.placeholder": "Wikipedia:Articles for deletion/Page A", + "deputy.ante.mergedFrom.afd.label": "AfD", + "deputy.ante.mergedFrom.afd.help": "The AfD discussion that led to the merge. If this merge was not the result of an AfD discussion, leave this blank.", + + "deputy.ante.mergedTo.label": "Merged to $1", + "deputy.ante.mergedTo.remove": "Remove notice", + + "deputy.ante.mergedTo.to.placeholder": "Page A", + "deputy.ante.mergedTo.to.label": "Target article", + "deputy.ante.mergedTo.to.help": "This is the page where content was copied into.", + "deputy.ante.mergedTo.date.label": "Date", + "deputy.ante.mergedTo.date.help": "The date (in UTC) when the content was merged into this page.", + "deputy.ante.mergedTo.small.label": "Small", + "deputy.ante.mergedTo.small.help": "If enabled, makes the banner small.", + + "deputy.ante.backwardsCopy.label": "Backwards copy $1", + "deputy.ante.backwardsCopy.remove": "Remove notice", + "deputy.ante.backwardsCopy.bot": "This notice was automatically added in by [[User:$1|$1]] ([[User talk:$1|talk]]). Changing this template will remove this warning as it is assumed that you have properly vetted the bot-added parameters.", + + "deputy.ante.backwardsCopy.entry.label": "Template entry", + "deputy.ante.backwardsCopy.entry.short": "Copied in '$1'", + "deputy.ante.backwardsCopy.entry.remove": "Remove entry", + + "deputy.ante.backwardsCopy.comments.placeholder": "Additional information", + "deputy.ante.backwardsCopy.comments.label": "Comments", + "deputy.ante.backwardsCopy.comments.help": "Additional comments related to the backwards copies.", + "deputy.ante.backwardsCopy.id.placeholder": "123456789", + "deputy.ante.backwardsCopy.id.label": "Revision ID", + "deputy.ante.backwardsCopy.id.help": "The last revision ID of this article that does not contain content that was duplicated by copying media.", + + "deputy.ante.backwardsCopy.entry.title.placeholder": "Article, journal, or medium name", + "deputy.ante.backwardsCopy.entry.title.label": "Publication name", + "deputy.ante.backwardsCopy.entry.title.help": "The publication title. This is the title of the medium that copied from Wikipedia", + "deputy.ante.backwardsCopy.entry.date.label": "Publishing date", + "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(s)", + "deputy.ante.backwardsCopy.entry.author.help": "A list of the article's authors.", + "deputy.ante.backwardsCopy.entry.url.placeholder": "https://example.com/news/a-news-article-that-copies-from-wikipedia", + "deputy.ante.backwardsCopy.entry.url.label": "URL", + "deputy.ante.backwardsCopy.entry.url.help": "A URL to the published media, if it exists as an online resource. If this is not an online resource (newspaper media, other printed media), leave this blank.", + "deputy.ante.backwardsCopy.entry.org.placeholder": "Example Publishing", + "deputy.ante.backwardsCopy.entry.org.label": "Publisher", + "deputy.ante.backwardsCopy.entry.org.help": "The publisher of the media. This may be a news company or a book publishing company.", + + "deputy.ante.translatedPage.label": "Translated from $1:$2", + "deputy.ante.translatedPage.remove": "Remove notice", + + "deputy.ante.translatedPage.lang.placeholder": "en, de, fr, es, etc.", + "deputy.ante.translatedPage.lang.label": "Language code", + "deputy.ante.translatedPage.lang.help": "The language code of the wiki that the page was translated from. This is the \"en\" of the English Wikipedia, or the \"fr\" of the French Wikipedia.", + "deputy.ante.translatedPage.page.placeholder": "Page on other wiki", + "deputy.ante.translatedPage.page.label": "Source page", + "deputy.ante.translatedPage.page.help": "The page on the other wiki that the content was copied from. Do not translate the page title.", + "deputy.ante.translatedPage.comments.placeholder": "Additional comments", + "deputy.ante.translatedPage.comments.label": "Comments", + "deputy.ante.translatedPage.comments.help": "Additional comments that are pertinent to translation.", + "deputy.ante.translatedPage.version.placeholder": "123456789", + "deputy.ante.translatedPage.version.label": "Source revision ID", + "deputy.ante.translatedPage.version.help": "The revision ID of the source page at the time of translation.", + "deputy.ante.translatedPage.insertversion.placeholder": "987654321", + "deputy.ante.translatedPage.insertversion.label": "Insertion revision ID", + "deputy.ante.translatedPage.insertversion.help": "The revision ID of the revision where the translated content was inserted into the page bearing this notice.", + "deputy.ante.translatedPage.section.placeholder": "Section name", + "deputy.ante.translatedPage.section.label": "Section", + "deputy.ante.translatedPage.section.help": "The section of the page that was translated, if a specific section was translated. Leave blank if this does not apply, or if translation was performed on the entire page or more than one section.", + "deputy.ante.translatedPage.small.label": "Small?", + "deputy.ante.translatedPage.small.help": "Whether to render the template as a small message box or not. By default, a small box is used. If you have a good reason to use a full-sized banner, disable this option.", + "deputy.ante.translatedPage.partial.label": "Partial?", + "deputy.ante.translatedPage.partial.help": "Whether this translation is a partial translation or not." +} diff --git a/i18n/cte/en.json b/i18n/cte/en.json deleted file mode 100644 index 667a6506..00000000 --- a/i18n/cte/en.json +++ /dev/null @@ -1,202 +0,0 @@ -{ - "deputy.cte": "Attribution Notice Template Editor", - - "deputy.cte.edit": "Modify content attribution notices for this page", - "deputy.cte.close": "Close", - "deputy.cte.save": "Save", - "deputy.cte.add": "Add a notice", - "deputy.cte.mergeAll": "Merge all notices", - "deputy.cte.mergeAll.confirm": "You are about to merge $1 {{PLURAL:$1|notice|notices}}. Continue?", - "deputy.cte.reset": "Reset all changes", - "deputy.cte.reset.confirm": "This will reset all changes. Proceed?", - "deputy.cte.delete": "Delete all notices", - "deputy.cte.delete.confirm": "You are about to delete $1 {{PLURAL:$1|notice|notices}}. Continue?", - - "deputy.cte.nocat.head": "nocat is enabled", - "deputy.cte.nocat.help": "This notice has the nocat parameter enabled and, as an effect, is not being tracked in categories. This usually means that the template is for demonstration purposes only.", - "deputy.cte.nocat.clear": "Restore tracking", - "deputy.cte.demo.head": "demo is enabled", - "deputy.cte.demo.help": "This notice has the demo parameter enabled. This usually means that the template is for demonstration purposes only.", - "deputy.cte.demo.clear": "Clear demo mode", - - "deputy.cte.invalid": "Some fields are still invalid.", - "deputy.cte.adding": "Adding content attribution notices", - "deputy.cte.modifying": "Modifying content attribution notices", - - "deputy.cte.dirty": "This dialog did not close properly last time. Your changes will be reset.", - "deputy.cte.empty.header": "No notices", - "deputy.cte.empty.removed": "All notices will be removed from the page. To reset your changes and restore previous templates, press the reset button at the bottom of the dialog.", - "deputy.cte.empty.none": "There are currently no notices on the talk page.", - "deputy.cte.empty.add": "Add a notice", - "deputy.cte.noSpot": "Sorry, but a notice cannot be automatically added. Please contact the developer to possibly add support for this talk page.", - - "deputy.cte.merge": "Merge", - "deputy.cte.merge.title": "Merge notices", - "deputy.cte.merge.from.label": "Notices to merge", - "deputy.cte.merge.from.select": "Select a notice", - "deputy.cte.merge.from.empty": "No notices to merge", - "deputy.cte.merge.all": "Merge all", - "deputy.cte.merge.all.confirm": "You are about to merge $1 'copied' {{PLURAL:$1|notice|notices}} into this notice. Continue?", - "deputy.cte.merge.button": "Merge", - - "deputy.cte.templateOptions": "Template options", - - "deputy.cte.copied.label": "Copied $1", - - "deputy.cte.copied.remove": "Remove notice", - "deputy.cte.copied.remove.confirm": "This will destroy $1 {{PLURAL:$1|entry|entries}}. Continue?", - "deputy.cte.copied.add": "Add entry", - - "deputy.cte.copied.entry.label": "Template entry", - "deputy.cte.copied.entry.short": "$1 to $2", - "deputy.cte.copied.entry.shortTo": "To $1", - "deputy.cte.copied.entry.shortFrom": "From $1", - - "deputy.cte.copied.entry.remove": "Remove entry", - "deputy.cte.copied.entry.copy": "Copy attribution edit summary", - "deputy.cte.copied.entry.copy.lacking": "Attribution edit summary copied to clipboard with lacking properties. Ensure that `from` is supplied.", - "deputy.cte.copied.entry.copy.success": "Attribution edit summary copied to clipboard.", - - "deputy.cte.copied.collapse": "Collapse", - "deputy.cte.copied.small": "Small", - - "deputy.cte.copied.from.placeholder": "Page A", - "deputy.cte.copied.from.label": "Page copied from", - "deputy.cte.copied.from.help": "This is the page from which the content was copied from.", - "deputy.cte.copied.from_oldid.placeholder": "from_oldid", - "deputy.cte.copied.from_oldid.label": "Revision ID", - "deputy.cte.copied.from_oldid.help": "The specific revision ID at the time that the content was copied, if known.", - "deputy.cte.copied.to.placeholder": "Page B", - "deputy.cte.copied.to.label": "Page copied to", - "deputy.cte.copied.to.help": "This is the page where the content was copied into.", - "deputy.cte.copied.to_diff.placeholder": "to_diff", - "deputy.cte.copied.to_diff.label": "Revision ID", - "deputy.cte.copied.to_diff.help": "The specific revision ID of the revision that copied content into the target page. If the copying spans multiple revisions, this is the ID of the last revision that copies content into the page.", - "deputy.cte.copied.to_oldid.placeholder": "to_oldid", - "deputy.cte.copied.to_oldid.label": "Starting revision ID", - "deputy.cte.copied.to_oldid.help": "The ID of the revision before any content was copied. This can be omitted unless multiple revisions copied content into the page.", - "deputy.cte.copied.diff.placeholder": "https://en.wikipedia.org/w/index.php?diff=123456", - "deputy.cte.copied.diff.label": "Diff URL", - "deputy.cte.copied.diff.help": "The URL of the diff. Using to_diff and to_oldid is preferred, although supplying this parameter will override both.", - "deputy.cte.copied.merge.label": "Merged?", - "deputy.cte.copied.merge.help": "Whether the copying was done as a result of merging two pages.", - "deputy.cte.copied.afd.placeholder": "AfD page (without Wikipedia:Articles for deletion/)", - "deputy.cte.copied.afd.label": "AfD page", - "deputy.cte.copied.afd.help": "The AfD page if the copy was made due to an AfD closed as \"merge\".", - - "deputy.cte.copied.advanced": "Advanced", - "deputy.cte.copied.dateInvalid": "The previous date value, \"$1\", was not a valid date.", - "deputy.cte.copied.diffDeprecate": "The to_diff and to_oldid parameters are preferred in favor of the diff parameter.", - "deputy.cte.copied.diffDeprecate.replace": "The current value of '$1', \"$2\", will be replaced with \"$3\". Continue?", - "deputy.cte.copied.diffDeprecate.failed": "Cannot convert `diff` parameter to URL. See your browser console for more details.", - - "deputy.cte.splitArticle.label": "Split article $1", - - "deputy.cte.splitArticle.remove": "Remove notice", - "deputy.cte.splitArticle.remove.confirm": "This will destroy $1 {{PLURAL:$1|entry|entries}}. Continue?", - "deputy.cte.splitArticle.add": "Add entry", - - "deputy.cte.splitArticle.entry.label": "Template entry", - "deputy.cte.splitArticle.entry.remove": "Remove entry", - "deputy.cte.splitArticle.entry.short": "$1 on $2", - - "deputy.cte.splitArticle.collapse": "Collapse", - "deputy.cte.splitArticle.from": "From", - "deputy.cte.splitArticle.from.help": "This is the page where the content was split from. In most cases, this is the current page, and can be left blank.", - - "deputy.cte.splitArticle.to.placeholder": "Subpage A", - "deputy.cte.splitArticle.to.label": "Page split to", - "deputy.cte.splitArticle.to.help": "This is the name of page that material was copied to; the \"merge target\".", - "deputy.cte.splitArticle.from_oldid.placeholder": "from_oldid", - "deputy.cte.splitArticle.from_oldid.label": "As of revision ID", - "deputy.cte.splitArticle.from_oldid.help": "The revision ID of the original page prior to the split. This is the revision that still contains content that will eventually become part of the split, with the following revision (or succeeding revisions) progressively transferring content to the other pages.", - "deputy.cte.splitArticle.date.label": "Date of split", - "deputy.cte.splitArticle.date.help": "The date that the split occurred.", - "deputy.cte.splitArticle.diff.placeholder": "https://en.wikipedia.org/w/index.php?diff=123456&oldid=123455", - "deputy.cte.splitArticle.diff.label": "Diff URL", - "deputy.cte.splitArticle.diff.help": "The diff URL of the split.", - - "deputy.cte.mergedFrom.label": "Merged from $1", - "deputy.cte.mergedFrom.remove": "Remove notice", - - "deputy.cte.mergedFrom.article.placeholder": "Page A", - "deputy.cte.mergedFrom.article.label": "Original article", - "deputy.cte.mergedFrom.article.help": "This is the page where the merged content is or used to be.", - "deputy.cte.mergedFrom.date.label": "Date", - "deputy.cte.mergedFrom.date.help": "The date (in UTC) when the content was merged into this page.", - "deputy.cte.mergedFrom.talk.label": "Link to talk?", - "deputy.cte.mergedFrom.talk.help": "Whether to link to the original article's talk page or not.", - "deputy.cte.mergedFrom.target.placeholder": "Page B", - "deputy.cte.mergedFrom.target.label": "Merge target", - "deputy.cte.mergedFrom.target.help": "The page that the content was merged into. Used if the page that the content was merged into was the talk page.", - "deputy.cte.mergedFrom.afd.placeholder": "Wikipedia:Articles for deletion/Page A", - "deputy.cte.mergedFrom.afd.label": "AfD", - "deputy.cte.mergedFrom.afd.help": "The AfD discussion that led to the merge. If this merge was not the result of an AfD discussion, leave this blank.", - - "deputy.cte.mergedTo.label": "Merged to $1", - "deputy.cte.mergedTo.remove": "Remove notice", - - "deputy.cte.mergedTo.to.placeholder": "Page A", - "deputy.cte.mergedTo.to.label": "Target article", - "deputy.cte.mergedTo.to.help": "This is the page where content was copied into.", - "deputy.cte.mergedTo.date.label": "Date", - "deputy.cte.mergedTo.date.help": "The date (in UTC) when the content was merged into this page.", - "deputy.cte.mergedTo.small.label": "Small", - "deputy.cte.mergedTo.small.help": "If enabled, makes the banner small.", - - "deputy.cte.backwardsCopy.label": "Backwards copy $1", - "deputy.cte.backwardsCopy.remove": "Remove notice", - "deputy.cte.backwardsCopy.bot": "This notice was automatically added in by [[User:$1|$1]] ([[User talk:$1|talk]]). Changing this template will remove this warning as it is assumed that you have properly vetted the bot-added parameters.", - - "deputy.cte.backwardsCopy.entry.label": "Template entry", - "deputy.cte.backwardsCopy.entry.short": "Copied in '$1'", - "deputy.cte.backwardsCopy.entry.remove": "Remove entry", - - "deputy.cte.backwardsCopy.comments.placeholder": "Additional information", - "deputy.cte.backwardsCopy.comments.label": "Comments", - "deputy.cte.backwardsCopy.comments.help": "Additional comments related to the backwards copies.", - "deputy.cte.backwardsCopy.id.placeholder": "123456789", - "deputy.cte.backwardsCopy.id.label": "Revision ID", - "deputy.cte.backwardsCopy.id.help": "The last revision ID of this article that does not contain content that was duplicated by copying media.", - - "deputy.cte.backwardsCopy.entry.title.placeholder": "Article, journal, or medium name", - "deputy.cte.backwardsCopy.entry.title.label": "Publication name", - "deputy.cte.backwardsCopy.entry.title.help": "The publication title. This is the title of the medium that copied from Wikipedia", - "deputy.cte.backwardsCopy.entry.date.label": "Publishing date", - "deputy.cte.backwardsCopy.entry.date.help": "This is the date on which the article was first published.", - "deputy.cte.backwardsCopy.entry.author.placeholder": "Add author", - "deputy.cte.backwardsCopy.entry.author.label": "Author(s)", - "deputy.cte.backwardsCopy.entry.author.help": "A list of the article's authors.", - "deputy.cte.backwardsCopy.entry.url.placeholder": "https://example.com/news/a-news-article-that-copies-from-wikipedia", - "deputy.cte.backwardsCopy.entry.url.label": "URL", - "deputy.cte.backwardsCopy.entry.url.help": "A URL to the published media, if it exists as an online resource. If this is not an online resource (newspaper media, other printed media), leave this blank.", - "deputy.cte.backwardsCopy.entry.org.placeholder": "Example Publishing", - "deputy.cte.backwardsCopy.entry.org.label": "Publisher", - "deputy.cte.backwardsCopy.entry.org.help": "The publisher of the media. This may be a news company or a book publishing company.", - - "deputy.cte.translatedPage.label": "Translated from $1:$2", - "deputy.cte.translatedPage.remove": "Remove notice", - - "deputy.cte.translatedPage.lang.placeholder": "en, de, fr, es, etc.", - "deputy.cte.translatedPage.lang.label": "Language code", - "deputy.cte.translatedPage.lang.help": "The language code of the wiki that the page was translated from. This is the \"en\" of the English Wikipedia, or the \"fr\" of the French Wikipedia.", - "deputy.cte.translatedPage.page.placeholder": "Page on other wiki", - "deputy.cte.translatedPage.page.label": "Source page", - "deputy.cte.translatedPage.page.help": "The page on the other wiki that the content was copied from. Do not translate the page title.", - "deputy.cte.translatedPage.comments.placeholder": "Additional comments", - "deputy.cte.translatedPage.comments.label": "Comments", - "deputy.cte.translatedPage.comments.help": "Additional comments that are pertinent to translation.", - "deputy.cte.translatedPage.version.placeholder": "123456789", - "deputy.cte.translatedPage.version.label": "Source revision ID", - "deputy.cte.translatedPage.version.help": "The revision ID of the source page at the time of translation.", - "deputy.cte.translatedPage.insertversion.placeholder": "987654321", - "deputy.cte.translatedPage.insertversion.label": "Insertion revision ID", - "deputy.cte.translatedPage.insertversion.help": "The revision ID of the revision where the translated content was inserted into the page bearing this notice.", - "deputy.cte.translatedPage.section.placeholder": "Section name", - "deputy.cte.translatedPage.section.label": "Section", - "deputy.cte.translatedPage.section.help": "The section of the page that was translated, if a specific section was translated. Leave blank if this does not apply, or if translation was performed on the entire page or more than one section.", - "deputy.cte.translatedPage.small.label": "Small?", - "deputy.cte.translatedPage.small.help": "Whether to render the template as a small message box or not. By default, a small box is used. If you have a good reason to use a full-sized banner, disable this option.", - "deputy.cte.translatedPage.partial.label": "Partial?", - "deputy.cte.translatedPage.partial.help": "Whether this translation is a partial translation or not." -} diff --git a/rollup.config.js b/rollup.config.js index bd23a6da..a87121c7 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -141,12 +141,12 @@ export default [ } ), // Standalone Attribution Notice Template Editor auto( 'cte', { - input: 'src/modules/cte/CopiedTemplateEditorStandalone.ts', + input: 'src/modules/ante/CopiedTemplateEditorStandalone.ts', output: { sourcemap: true, file: 'build/deputy-ante.js', format: 'iife', - banner: loadBanner( 'src', 'modules', 'cte', 'BANNER.txt' ) + + banner: loadBanner( 'src', 'modules', 'ante', 'BANNER.txt' ) + '\n// ', footer: '// \n// <3' }, diff --git a/src/Deputy.ts b/src/Deputy.ts index 12a25639..b2e3065e 100644 --- a/src/Deputy.ts +++ b/src/Deputy.ts @@ -13,7 +13,7 @@ import { DeputyPreferences } from './DeputyPreferences'; import performHacks from './util/performHacks'; import DeputyCase from './wiki/DeputyCase'; import unwrapWidget from './util/unwrapWidget'; -import CopiedTemplateEditor from './modules/cte/CopiedTemplateEditor'; +import CopiedTemplateEditor from './modules/ante/CopiedTemplateEditor'; import DeputyLanguage from './DeputyLanguage'; import deputyVersion from './DeputyVersion'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment diff --git a/src/modules/DeputyModule.ts b/src/modules/DeputyModule.ts new file mode 100644 index 00000000..de8ce244 --- /dev/null +++ b/src/modules/DeputyModule.ts @@ -0,0 +1,77 @@ +import { Deputy } from '../Deputy'; +import unwrapWidget from '../util/unwrapWidget'; +import DeputyLanguage from '../DeputyLanguage'; + +/** + * A Deputy module. Modules are parts of Deputy that can usually be removed + * and turned into standalone components that can load without Deputy. + */ +export default abstract class DeputyModule { + + /** + * An instance of Deputy. This is commonly `window.deputy`. Instantiating this class + * with a Deputy instances enables connection with the Deputy core, which shares the + * OOUI window manager and API manager for Deputy. + */ + readonly deputy?: Deputy; + /** + * An OOUI WindowManager. If this class is instantiated standalone (without Deputy), + * this will be a set value. + */ + _windowManager: any; + /** + * A MediaWiki API object. If this class is instantiated standalone (without Deputy), + * this will be a set value. + */ + _wiki: mw.Api; + + /** + * @return The responsible window manager for this class. + */ + get windowManager(): any { + if ( !this.deputy ) { + if ( !this._windowManager ) { + this._windowManager = new OO.ui.WindowManager(); + document.body.appendChild( unwrapWidget( this._windowManager ) ); + } + return this._windowManager; + } else { + return this.deputy.windowManager; + } + } + + /** + * + * @param deputy + */ + constructor( deputy?: Deputy ) { + this.deputy = deputy; + } + + /** + * @return the symbolic name of this module. Eventually used for getting translation + * strings, etc. + */ + abstract getName(): string; + + /** + * Load the language pack for this module, with a fallback in case one could not be + * loaded. + * + * @param fallback The fallback to use if a language pack could not be loaded. + */ + async loadLanguages( fallback: Record ): Promise { + await DeputyLanguage.load( this.getName(), fallback ); + } + + /** + * Pre-initialize the module. This is the opportunity of the module to load language + * strings, append important UI elements, add portlets, etc. + * + * @param languageFallback The fallback language pack to use if one could not be loaded. + */ + async preInit( languageFallback: Record ): Promise { + await this.loadLanguages( languageFallback ); + } + +} diff --git a/src/modules/cte/BANNER.txt b/src/modules/ante/BANNER.txt similarity index 100% rename from src/modules/cte/BANNER.txt rename to src/modules/ante/BANNER.txt diff --git a/src/modules/cte/CopiedTemplateEditor.ts b/src/modules/ante/CopiedTemplateEditor.ts similarity index 76% rename from src/modules/cte/CopiedTemplateEditor.ts rename to src/modules/ante/CopiedTemplateEditor.ts index 5474e1b6..3bb39004 100644 --- a/src/modules/cte/CopiedTemplateEditor.ts +++ b/src/modules/ante/CopiedTemplateEditor.ts @@ -1,13 +1,11 @@ import CopiedTemplateEditorDialog from './ui/CopiedTemplateEditorDialog'; -import type { Deputy } from '../../Deputy'; -import unwrapWidget from '../../util/unwrapWidget'; import CopiedTemplate from './models/templates/CopiedTemplate'; +import deputyAnteEnglish from '../../../i18n/ante/en.json'; +import WikiAttributionNotices from './models/WikiAttributionNotices'; +import DeputyModule from '../DeputyModule'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import cteStyles from './css/copied-template-editor.css'; -import deputyCteEnglish from '../../../i18n/cte/en.json'; -import DeputyLanguage from '../../DeputyLanguage'; -import WikiAttributionNotices from './models/WikiAttributionNotices'; declare global { interface Window { @@ -18,27 +16,10 @@ declare global { /** * Main class for CopiedTemplateEditor. */ -export default class CopiedTemplateEditor { +export default class CopiedTemplateEditor extends DeputyModule { readonly CopiedTemplate = CopiedTemplate; - /** - * An instance of Deputy. This is commonly `window.deputy`. Instantiating this class - * with a Deputy instances enables connection with the Deputy core, which shares the - * OOUI window manager and API manager for Deputy. - */ - readonly deputy?: Deputy; - /** - * An OOUI WindowManager. If this class is instantiated standalone (without Deputy), - * this will be a set value. - */ - _windowManager: any; - /** - * A MediaWiki API object. If this class is instantiated standalone (without Deputy), - * this will be a set value. - */ - _wiki: mw.Api; - /** * The `loader` variable is set (in JavaScript) by a CTE loader. This prevents UI * elements (such as "start" buttons and the toolbox link) from being appended @@ -65,26 +46,10 @@ export default class CopiedTemplateEditor { dialog: any; /** - * @return The responsible window manager for this class. - */ - get windowManager(): any { - if ( !this.deputy ) { - if ( !this._windowManager ) { - this._windowManager = new OO.ui.WindowManager(); - document.body.appendChild( unwrapWidget( this._windowManager ) ); - } - return this._windowManager; - } else { - return this.deputy.windowManager; - } - } - - /** - * - * @param deputy + * @inheritDoc */ - constructor( deputy?: Deputy ) { - this.deputy = deputy; + getName(): string { + return 'ante'; } /** @@ -92,7 +57,7 @@ export default class CopiedTemplateEditor { * adding in necessary UI elements that serve as an entry point to CTE. */ async preInit(): Promise { - await DeputyLanguage.load( 'cte', deputyCteEnglish ); + await super.preInit( deputyAnteEnglish ); if ( // Button not yet appended @@ -103,7 +68,7 @@ export default class CopiedTemplateEditor { mw.util.addPortletLink( 'p-tb', '#', - mw.message( 'deputy.cte' ).text(), + mw.message( 'deputy.ante' ).text(), 'pt-cte' ).addEventListener( 'click', ( event ) => { event.preventDefault(); @@ -141,8 +106,8 @@ export default class CopiedTemplateEditor { const startButton = new OO.ui.ButtonWidget( { icon: 'edit', - title: mw.message( 'deputy.cte.edit' ).text(), - label: mw.message( 'deputy.cte.edit' ).text() + title: mw.message( 'deputy.ante.edit' ).text(), + label: mw.message( 'deputy.ante.edit' ).text() } ).setInvisibleLabel( true ); this.startButtons.push( startButton ); const td = document.createElement( 'td' ); diff --git a/src/modules/cte/CopiedTemplateEditorStandalone.ts b/src/modules/ante/CopiedTemplateEditorStandalone.ts similarity index 100% rename from src/modules/cte/CopiedTemplateEditorStandalone.ts rename to src/modules/ante/CopiedTemplateEditorStandalone.ts diff --git a/src/modules/cte/css/copied-template-editor.css b/src/modules/ante/css/copied-template-editor.css similarity index 100% rename from src/modules/cte/css/copied-template-editor.css rename to src/modules/ante/css/copied-template-editor.css diff --git a/src/modules/cte/events/RowChangeEvent.ts b/src/modules/ante/events/RowChangeEvent.ts similarity index 100% rename from src/modules/cte/events/RowChangeEvent.ts rename to src/modules/ante/events/RowChangeEvent.ts diff --git a/src/modules/cte/events/TemplateInsertEvent.ts b/src/modules/ante/events/TemplateInsertEvent.ts similarity index 100% rename from src/modules/cte/events/TemplateInsertEvent.ts rename to src/modules/ante/events/TemplateInsertEvent.ts diff --git a/src/modules/cte/models/AttributionNotice.ts b/src/modules/ante/models/AttributionNotice.ts similarity index 100% rename from src/modules/cte/models/AttributionNotice.ts rename to src/modules/ante/models/AttributionNotice.ts diff --git a/src/modules/cte/models/AttributionNoticeRow.ts b/src/modules/ante/models/AttributionNoticeRow.ts similarity index 100% rename from src/modules/cte/models/AttributionNoticeRow.ts rename to src/modules/ante/models/AttributionNoticeRow.ts diff --git a/src/modules/cte/models/CTEParsoidDocument.ts b/src/modules/ante/models/CTEParsoidDocument.ts similarity index 100% rename from src/modules/cte/models/CTEParsoidDocument.ts rename to src/modules/ante/models/CTEParsoidDocument.ts diff --git a/src/modules/cte/models/CTEParsoidTransclusionTemplateNode.ts b/src/modules/ante/models/CTEParsoidTransclusionTemplateNode.ts similarity index 100% rename from src/modules/cte/models/CTEParsoidTransclusionTemplateNode.ts rename to src/modules/ante/models/CTEParsoidTransclusionTemplateNode.ts diff --git a/src/modules/cte/models/MediaWikiData.ts b/src/modules/ante/models/MediaWikiData.ts similarity index 100% rename from src/modules/cte/models/MediaWikiData.ts rename to src/modules/ante/models/MediaWikiData.ts diff --git a/src/modules/cte/models/RowedAttributionNotice.ts b/src/modules/ante/models/RowedAttributionNotice.ts similarity index 100% rename from src/modules/cte/models/RowedAttributionNotice.ts rename to src/modules/ante/models/RowedAttributionNotice.ts diff --git a/src/modules/cte/models/TemplateFactory.ts b/src/modules/ante/models/TemplateFactory.ts similarity index 100% rename from src/modules/cte/models/TemplateFactory.ts rename to src/modules/ante/models/TemplateFactory.ts diff --git a/src/modules/cte/models/TemplateMerger.ts b/src/modules/ante/models/TemplateMerger.ts similarity index 100% rename from src/modules/cte/models/TemplateMerger.ts rename to src/modules/ante/models/TemplateMerger.ts diff --git a/src/modules/cte/models/WikiAttributionNotices.ts b/src/modules/ante/models/WikiAttributionNotices.ts similarity index 100% rename from src/modules/cte/models/WikiAttributionNotices.ts rename to src/modules/ante/models/WikiAttributionNotices.ts diff --git a/src/modules/cte/models/templates/BackwardsCopyTemplate.ts b/src/modules/ante/models/templates/BackwardsCopyTemplate.ts similarity index 100% rename from src/modules/cte/models/templates/BackwardsCopyTemplate.ts rename to src/modules/ante/models/templates/BackwardsCopyTemplate.ts diff --git a/src/modules/cte/models/templates/BackwardsCopyTemplateRow.ts b/src/modules/ante/models/templates/BackwardsCopyTemplateRow.ts similarity index 100% rename from src/modules/cte/models/templates/BackwardsCopyTemplateRow.ts rename to src/modules/ante/models/templates/BackwardsCopyTemplateRow.ts diff --git a/src/modules/cte/models/templates/CopiedTemplate.ts b/src/modules/ante/models/templates/CopiedTemplate.ts similarity index 100% rename from src/modules/cte/models/templates/CopiedTemplate.ts rename to src/modules/ante/models/templates/CopiedTemplate.ts diff --git a/src/modules/cte/models/templates/CopiedTemplateRow.ts b/src/modules/ante/models/templates/CopiedTemplateRow.ts similarity index 100% rename from src/modules/cte/models/templates/CopiedTemplateRow.ts rename to src/modules/ante/models/templates/CopiedTemplateRow.ts diff --git a/src/modules/cte/models/templates/MergedFromTemplate.ts b/src/modules/ante/models/templates/MergedFromTemplate.ts similarity index 100% rename from src/modules/cte/models/templates/MergedFromTemplate.ts rename to src/modules/ante/models/templates/MergedFromTemplate.ts diff --git a/src/modules/cte/models/templates/MergedToTemplate.ts b/src/modules/ante/models/templates/MergedToTemplate.ts similarity index 100% rename from src/modules/cte/models/templates/MergedToTemplate.ts rename to src/modules/ante/models/templates/MergedToTemplate.ts diff --git a/src/modules/cte/models/templates/README.md b/src/modules/ante/models/templates/README.md similarity index 100% rename from src/modules/cte/models/templates/README.md rename to src/modules/ante/models/templates/README.md diff --git a/src/modules/cte/models/templates/SplitArticleTemplate.ts b/src/modules/ante/models/templates/SplitArticleTemplate.ts similarity index 100% rename from src/modules/cte/models/templates/SplitArticleTemplate.ts rename to src/modules/ante/models/templates/SplitArticleTemplate.ts diff --git a/src/modules/cte/models/templates/SplitArticleTemplateRow.ts b/src/modules/ante/models/templates/SplitArticleTemplateRow.ts similarity index 100% rename from src/modules/cte/models/templates/SplitArticleTemplateRow.ts rename to src/modules/ante/models/templates/SplitArticleTemplateRow.ts diff --git a/src/modules/cte/models/templates/TranslatedPageTemplate.ts b/src/modules/ante/models/templates/TranslatedPageTemplate.ts similarity index 100% rename from src/modules/cte/models/templates/TranslatedPageTemplate.ts rename to src/modules/ante/models/templates/TranslatedPageTemplate.ts diff --git a/src/modules/cte/ui/AttributionNoticeAddMenu.ts b/src/modules/ante/ui/AttributionNoticeAddMenu.ts similarity index 100% rename from src/modules/cte/ui/AttributionNoticeAddMenu.ts rename to src/modules/ante/ui/AttributionNoticeAddMenu.ts diff --git a/src/modules/cte/ui/AttributionNoticePageGenerator.ts b/src/modules/ante/ui/AttributionNoticePageGenerator.ts similarity index 100% rename from src/modules/cte/ui/AttributionNoticePageGenerator.ts rename to src/modules/ante/ui/AttributionNoticePageGenerator.ts diff --git a/src/modules/cte/ui/CopiedTemplateEditorDialog.tsx b/src/modules/ante/ui/CopiedTemplateEditorDialog.tsx similarity index 93% rename from src/modules/cte/ui/CopiedTemplateEditorDialog.tsx rename to src/modules/ante/ui/CopiedTemplateEditorDialog.tsx index 18a249fa..befd789f 100644 --- a/src/modules/cte/ui/CopiedTemplateEditorDialog.tsx +++ b/src/modules/ante/ui/CopiedTemplateEditorDialog.tsx @@ -35,20 +35,20 @@ function initCopiedTemplateEditorDialog() { static static = { name: 'copiedTemplateEditorDialog', - title: mw.message( 'deputy.cte' ).text(), + title: mw.message( 'deputy.ante' ).text(), size: 'huge', actions: [ { flags: [ 'primary', 'progressive' ], - label: mw.message( 'deputy.cte.save' ).text(), - title: mw.message( 'deputy.cte.save' ).text(), + label: mw.message( 'deputy.ante.save' ).text(), + title: mw.message( 'deputy.ante.save' ).text(), action: 'save' }, { flags: [ 'safe', 'close' ], icon: 'close', - label: mw.message( 'deputy.cte.close' ).text(), - title: mw.message( 'deputy.cte.close' ).text(), + label: mw.message( 'deputy.ante.close' ).text(), + title: mw.message( 'deputy.ante.close' ).text(), invisibleLabel: true, action: 'close' } @@ -215,8 +215,8 @@ function initCopiedTemplateEditorDialog() { icon: 'add', framed: false, invisibleLabel: true, - label: mw.message( 'deputy.cte.add' ).text(), - title: mw.message( 'deputy.cte.add' ).text(), + label: mw.message( 'deputy.ante.add' ).text(), + title: mw.message( 'deputy.ante.add' ).text(), flags: [ 'progressive' ] } ); @@ -224,8 +224,8 @@ function initCopiedTemplateEditorDialog() { icon: 'tableMergeCells', framed: false, invisibleLabel: true, - label: mw.message( 'deputy.cte.mergeAll' ).text(), - title: mw.message( 'deputy.cte.mergeAll' ).text(), + label: mw.message( 'deputy.ante.mergeAll' ).text(), + title: mw.message( 'deputy.ante.mergeAll' ).text(), disabled: true } ); // TODO: Repair mergeButton @@ -234,7 +234,7 @@ function initCopiedTemplateEditorDialog() { if ( notices.length > 1 ) { return OO.ui.confirm( mw.message( - 'deputy.cte.mergeAll.confirm', + 'deputy.ante.mergeAll.confirm', `${notices.length}` ).text() ).done( ( confirmed: boolean ) => { @@ -253,12 +253,12 @@ function initCopiedTemplateEditorDialog() { icon: 'reload', framed: false, invisibleLabel: true, - label: mw.message( 'deputy.cte.reset' ).text(), - title: mw.message( 'deputy.cte.reset' ).text() + label: mw.message( 'deputy.ante.reset' ).text(), + title: mw.message( 'deputy.ante.reset' ).text() } ); resetButton.on( 'click', () => { return OO.ui.confirm( - mw.message( 'deputy.cte.reset.confirm' ).text() + mw.message( 'deputy.ante.reset.confirm' ).text() ).done( ( confirmed: boolean ) => { if ( confirmed ) { this.parsoid.reload().then( () => { @@ -273,8 +273,8 @@ function initCopiedTemplateEditorDialog() { icon: 'trash', framed: false, invisibleLabel: true, - label: mw.message( 'deputy.cte.delete' ).text(), - title: mw.message( 'deputy.cte.delete' ).text(), + label: mw.message( 'deputy.ante.delete' ).text(), + title: mw.message( 'deputy.ante.delete' ).text(), flags: [ 'destructive' ] } ); deleteButton.on( 'click', () => { @@ -282,7 +282,7 @@ function initCopiedTemplateEditorDialog() { const notices = this.parsoid.findNotices(); return OO.ui.confirm( mw.message( - 'deputy.cte.delete.confirm', + 'deputy.ante.delete.confirm', `${notices.length}` ).text() ).done( ( confirmed: boolean ) => { @@ -401,7 +401,7 @@ function initCopiedTemplateEditorDialog() { .querySelector( '.oo-ui-flaggedElement-invalid' ) != null ) { return new OO.ui.Process( () => { - OO.ui.alert( mw.message( 'deputy.cte.invalid' ).text() ); + OO.ui.alert( mw.message( 'deputy.ante.invalid' ).text() ); } ); } diff --git a/src/modules/cte/ui/RowPageShared.tsx b/src/modules/ante/ui/RowPageShared.tsx similarity index 87% rename from src/modules/cte/ui/RowPageShared.tsx rename to src/modules/ante/ui/RowPageShared.tsx index 8073f18d..8fd93e08 100644 --- a/src/modules/cte/ui/RowPageShared.tsx +++ b/src/modules/ante/ui/RowPageShared.tsx @@ -24,7 +24,7 @@ export function renderMergePanel( const mergePanel = new OO.ui.FieldsetLayout( { classes: [ 'cte-merge-panel' ], icon: 'tableMergeCells', - label: mw.message( 'deputy.cte.merge.title' ).text() + label: mw.message( 'deputy.ante.merge.title' ).text() } ); unwrapWidget( mergePanel ).style.padding = '16px'; unwrapWidget( mergePanel ).style.zIndex = '20'; @@ -34,10 +34,10 @@ export function renderMergePanel( //