From 418bd322176d535df999d050f1ff69f74ae7e0a9 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Tue, 11 Oct 2016 00:32:02 +0100 Subject: [PATCH] NWE: Use a different change tag to the visual editor Bug: T147587 Change-Id: If9b466ff8449ceeb0e71f9d36ea0b4ec8c1bae2d --- ApiVisualEditorEdit.php | 5 +++-- VisualEditor.hooks.php | 1 + modules/ve-wmf/i18n/en.json | 2 ++ modules/ve-wmf/i18n/qqq.json | 4 +++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ApiVisualEditorEdit.php b/ApiVisualEditorEdit.php index d7bee073b0..259a1f5f16 100644 --- a/ApiVisualEditorEdit.php +++ b/ApiVisualEditorEdit.php @@ -166,8 +166,9 @@ class ApiVisualEditorEdit extends ApiVisualEditor { if ( $this->veConfig->get( 'VisualEditorUseChangeTagging' ) ) { // Defer till after the RC row is inserted // @TODO: doEditContent should let callers specify desired tags - DeferredUpdates::addCallableUpdate( function() use ( $newRevId ) { - ChangeTags::addTags( 'visualeditor', null, $newRevId, null ); + $tag = $params['wikitext'] ? 'visualeditor-wikitext' : 'visualeditor'; + DeferredUpdates::addCallableUpdate( function() use ( $tag, $newRevId ) { + ChangeTags::addTags( $tag, null, $newRevId, null ); } ); } } else { diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php index 242a2f84ac..a41eb1f789 100644 --- a/VisualEditor.hooks.php +++ b/VisualEditor.hooks.php @@ -663,6 +663,7 @@ class VisualEditorHooks { $tags[] = 'visualeditor'; $tags[] = 'visualeditor-needcheck'; // No longer in active use $tags[] = 'visualeditor-switched'; + $tags[] = 'visualeditor-wikitext'; return true; } diff --git a/modules/ve-wmf/i18n/en.json b/modules/ve-wmf/i18n/en.json index ae7bb27342..abfbd6936c 100644 --- a/modules/ve-wmf/i18n/en.json +++ b/modules/ve-wmf/i18n/en.json @@ -20,6 +20,8 @@ "tag-visualeditor-description": "Edit made using the [[{{MediaWiki:visualeditor-descriptionpagelink}}|visual editor]]", "tag-visualeditor-needcheck": "[[{{MediaWiki:visualeditor-descriptionpagelink}}|Visual edit: Check]]", "tag-visualeditor-needcheck-description": "Edit made using the [[{{MediaWiki:visualeditor-descriptionpagelink}}|visual editor]] where the system detected the wikitext possibly having unintended changes.", + "tag-visualeditor-wikitext": "2017 source edit", + "tag-visualeditor-wikitext-description": "Edit made using the 2017 wikitext editor", "tag-visualeditor-switched": "[[{{MediaWiki:visualeditor-descriptionpagelink}}|Visual edit: Switched]]", "tag-visualeditor-switched-description": "User started to edit using the visual editor, then changed to the wikitext editor.", "visualeditor-feedback-link": "Project:VisualEditor\/Feedback", diff --git a/modules/ve-wmf/i18n/qqq.json b/modules/ve-wmf/i18n/qqq.json index 5ed228f9c6..0fa5339082 100644 --- a/modules/ve-wmf/i18n/qqq.json +++ b/modules/ve-wmf/i18n/qqq.json @@ -24,7 +24,9 @@ "tag-visualeditor": "Short description of the visualeditor tag.\n\nShown on lists of changes (history, recentchanges, etc.) for each edit made using VisualEditor.\n\nRefers to {{msg-mw|Visualeditor-descriptionpagelink}}.\n\nSee also:\n* {{msg-mw|Tag-visualeditor-needcheck}}\n{{Related|Tag-visualeditor}}\n{{Identical|VisualEditor}}", "tag-visualeditor-description": "Long description of the visualeditor tag ({{msg-mw|Tag-visualeditor}}).\n\nShown on [[Special:Tags]].\n\nRefers to {{msg-mw|Visualeditor-descriptionpagelink}}.\n\nSee also:\n* {{msg-mw|Tag-visualeditor-needcheck-description}}\n{{Related|Tag-visualeditor}}", "tag-visualeditor-needcheck": "\"Check\" indicates \"Check needed\".\n\nSee {{msg-mw|Tag-visualeditor-needcheck-description}}.\n\nRefers to {{msg-mw|Visualeditor-descriptionpagelink}}.\n\nSee also:\n* {{msg-mw|Tag-visualeditor|similar message}}\n{{Related|Tag-visualeditor}}", - "tag-visualeditor-needcheck-description": "Long description of the visualeditor tag ({{msg-mw|Tag-visualeditor-needcheck}}).\n\nShown on [[Special:Tags]].\n\nRefers to {{msg-mw|Visualeditor-descriptionpagelink}}.\n\nSee also:\n* {{msg-mw|Tag-visualeditor-description}}\n{{Related|Tag-visualeditor}}", + "tag-visualeditor-needcheck-description": "Long description of the visualeditor-needcheck tag ({{msg-mw|Tag-visualeditor-needcheck}}).\n\nShown on [[Special:Tags]].\n\nRefers to {{msg-mw|Visualeditor-descriptionpagelink}}.\n\nSee also:\n* {{msg-mw|Tag-visualeditor-description}}\n{{Related|Tag-visualeditor}}", + "tag-visualeditor-wikitext": "Short description of the visualeditor-wikitext tag.\n\nShown on lists of changes (history, recentchanges, etc.) for each edit made using VisualEditor in wikitext editor mode.\n\nSee also:\n* {{msg-mw|Tag-visualeditor-wikitext-description}}\n* {{Related|tag-visualeditor}}", + "tag-visualeditor-wikitext-description": "Long description of the visualeditor-wikitext tag ({{msg-mw|Tag-visualeditor-wikitext}}).\n\nShown on [[Special:Tags]].\n\nSee also:\n* {{msg-mw|Tag-visualeditor-wikitext}}\n* {{Related|tag-visualeditor-description}}", "tag-visualeditor-switched": "Short description of the visualeditor-switched tag.\n\nShown on lists of changes (history, recentchanges, etc.) for each edit which was started using VisualEditor and then was moved to the wikitext editor.\n\nRefers to {{msg-mw|Visualeditor-descriptionpagelink}}.\n{{Related|Tag-visualeditor}}", "tag-visualeditor-switched-description": "Long description of the visualeditor-switched tag ({{msg-mw|Tag-visualeditor-switched}}).\n\nShown on [[Special:Tags]].\n\nRefers to {{msg-mw|Visualeditor-descriptionpagelink}}.\n\nSee also:\n* {{msg-mw|Tag-visualeditor-description}}\n{{Related|Tag-visualeditor}}", "visualeditor-feedback-link": "Link to a page where users can leave feedback that is automatically posted using this tool. This should be a sub-page of {{msg-mw|visualeditor-descriptionpagelink}}",