mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-27 15:50:29 +00:00
Revert "Add tag when reference added to the page"
This reverts commit d4460219bd
.
Bug: T341202
Change-Id: I8e608a5a34a3bb18d1994d5c182c3918e6d6f89d
This commit is contained in:
parent
d4460219bd
commit
235e5aca00
|
@ -18,8 +18,6 @@
|
|||
},
|
||||
"tag-editcheck-newcontent": "-",
|
||||
"tag-editcheck-newcontent-description": "EditCheck thinks new content was added to the page",
|
||||
"tag-editcheck-newreference": "-",
|
||||
"tag-editcheck-newreference-description": "A reference was added to the page",
|
||||
"tag-editcheck-references": "-",
|
||||
"tag-editcheck-references-description": "EditCheck thinks a reference might have been needed",
|
||||
"tag-visualeditor": "[[{{MediaWiki:visualeditor-descriptionpagelink}}|Visual edit]]",
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
},
|
||||
"tag-editcheck-newcontent": "{{ignored}}Short description of the editcheck-newcontent tag.\n\nHidden tag added when EditCheck thinks new content was added to the page.\n\nSee also:\n* {{msg-mw|Tag-editcheck-newcontent-description}}\n{{Related|tag-newcontent-references-description}}",
|
||||
"tag-editcheck-newcontent-description": "Long description of the editcheck-newcontent tag.\n\nHidden tag added when EditCheck thinks new content was added to the page.\n\nSee also:\n* {{msg-mw|Tag-editcheck-newcontent}}\n{{Related|tag-newcontent-references}}",
|
||||
"tag-editcheck-newreference": "{{ignored}}Short description of the editcheck-newreference tag.\n\nHidden tag added when a reference is added to the page.\n\nSee also:\n* {{msg-mw|Tag-editcheck-newreference-description}}\n{{Related|tag-newreference-references-description}}",
|
||||
"tag-editcheck-newreference-description": "Long description of the editcheck-newreference tag.\n\nHidden tag added when a reference is added to the page.\n\nSee also:\n* {{msg-mw|Tag-editcheck-newreference}}\n{{Related|tag-newreference-references}}",
|
||||
"tag-editcheck-references": "{{ignored}}Short description of the editcheck-references tag.\n\nHidden tag added when EditCheck thinks added content might need a reference.\n\nSee also:\n* {{msg-mw|Tag-editcheck-references-description}}\n{{Related|tag-editcheck-references-description}}",
|
||||
"tag-editcheck-references-description": "Long description of the editcheck-references tag.\n\nHidden tag added when EditCheck thinks added content might need a reference.\n\nSee also:\n* {{msg-mw|Tag-editcheck-references}}\n{{Related|tag-editcheck-references}}",
|
||||
"tag-visualeditor": "Short description of the visualeditor tag. Do not translate the link target, but do translate the words \"Visual edit\".\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}}",
|
||||
|
|
|
@ -58,7 +58,6 @@ class Hooks implements TextSlotDiffRendererTablePrefixHook {
|
|||
// Edit check
|
||||
'editcheck-references',
|
||||
'editcheck-newcontent',
|
||||
'editcheck-newreference',
|
||||
// No longer in active use:
|
||||
'visualeditor-needcheck',
|
||||
'visualeditor-switched'
|
||||
|
|
|
@ -79,26 +79,3 @@ mw.editcheck.getContentRanges = function ( documentModel, range ) {
|
|||
} );
|
||||
return ranges;
|
||||
};
|
||||
|
||||
if ( mw.config.get( 'wgVisualEditorConfig' ).editCheckTagging ) {
|
||||
mw.hook( 've.activationComplete' ).add( function () {
|
||||
var target = ve.init.target;
|
||||
// The firstNodes list is a numerically indexed array of reference nodes in the document.
|
||||
// The list is append only, and removed references are set to undefined in place.
|
||||
// To check if a new reference is being published, we just need to know if a reference
|
||||
// with an index beyond the initial list (initLength) is still set.
|
||||
var refNodes = target.getSurface().getModel().getDocument().getInternalList().getNodeGroup( 'mwReference/' ).firstNodes;
|
||||
var initLength = refNodes.length;
|
||||
target.saveFields.vetags = function () {
|
||||
var newLength = refNodes.length;
|
||||
var newNodesInDoc = false;
|
||||
for ( var i = initLength; i < newLength; i++ ) {
|
||||
if ( refNodes[ i ] ) {
|
||||
newNodesInDoc = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return newNodesInDoc ? 'editcheck-newreference' : '';
|
||||
};
|
||||
} );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue