2024-03-14 17:17:36 +00:00
|
|
|
mw.editcheck = {
|
|
|
|
config: require( './config.json' ),
|
|
|
|
ecenable: !!( new URL( location.href ).searchParams.get( 'ecenable' ) || window.MWVE_FORCE_EDIT_CHECK_ENABLED )
|
|
|
|
};
|
|
|
|
|
2023-08-31 16:29:54 +00:00
|
|
|
require( './EditCheckContextItem.js' );
|
|
|
|
require( './EditCheckInspector.js' );
|
2024-03-14 17:17:36 +00:00
|
|
|
require( './EditCheckDialog.js' );
|
|
|
|
require( './EditCheckFactory.js' );
|
|
|
|
require( './EditCheckAction.js' );
|
|
|
|
require( './BaseEditCheck.js' );
|
2023-08-31 16:29:54 +00:00
|
|
|
|
2024-03-14 17:17:36 +00:00
|
|
|
// TODO: Load these checks behind feature flags
|
|
|
|
// require( './ConvertReferenceEditCheck.js' );
|
|
|
|
// require( './TextMatchEditCheck.js' );
|
2024-09-04 15:23:43 +00:00
|
|
|
require( './AddReferenceEditCheck.js' );
|
2023-09-28 16:48:05 +00:00
|
|
|
|
2023-07-03 13:34:51 +00:00
|
|
|
/**
|
2024-03-14 17:17:36 +00:00
|
|
|
* Return the content ranges (content branch node interiors) contained within a range
|
2023-07-03 13:34:51 +00:00
|
|
|
*
|
2024-03-14 17:17:36 +00:00
|
|
|
* For a content branch node entirely contained within the range, its entire interior
|
|
|
|
* range will be included. For a content branch node overlapping with the range boundary,
|
|
|
|
* only the covered part of its interior range will be included.
|
|
|
|
*
|
|
|
|
* @param {ve.dm.Document} documentModel The documentModel to search
|
|
|
|
* @param {ve.Range} range The range to include
|
|
|
|
* @param {boolean} covers Only include ranges which cover the whole of their node
|
|
|
|
* @return {ve.Range[]} The contained content ranges (content branch node interiors)
|
2023-07-03 13:34:51 +00:00
|
|
|
*/
|
2024-03-14 17:17:36 +00:00
|
|
|
mw.editcheck.getContentRanges = function ( documentModel, range, covers ) {
|
|
|
|
const ranges = [];
|
|
|
|
documentModel.selectNodes( range, 'branches' ).forEach( ( spec ) => {
|
|
|
|
if (
|
|
|
|
spec.node.canContainContent() && (
|
|
|
|
!covers || (
|
|
|
|
!spec.range || // an empty range means the node is covered
|
|
|
|
spec.range.equalsSelection( spec.nodeRange )
|
|
|
|
)
|
|
|
|
)
|
|
|
|
) {
|
|
|
|
ranges.push( spec.range || spec.nodeRange );
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
return ranges;
|
|
|
|
};
|
2023-08-16 14:58:27 +00:00
|
|
|
|
2024-10-01 11:31:17 +00:00
|
|
|
mw.editcheck.hasAddedContentNeedingReference = function ( documentModel, includeReferencedContent ) {
|
|
|
|
// helper for ve.init.mw.ArticleTarget save-tagging, keep logic below in-sync with AddReferenceEditCheck.
|
|
|
|
// This is bypassing the normal "should this check apply?" logic for creation, so we need to manually
|
|
|
|
// apply the "only the main namespace" rule.
|
|
|
|
if ( mw.config.get( 'wgNamespaceNumber' ) !== mw.config.get( 'wgNamespaceIds' )[ '' ] ) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const check = mw.editcheck.editCheckFactory.create( 'addReference', mw.editcheck.config.addReference );
|
|
|
|
return check.findAddedContent( documentModel, includeReferencedContent ).length > 0;
|
2024-03-14 17:17:36 +00:00
|
|
|
};
|
2024-10-01 11:31:17 +00:00
|
|
|
|
|
|
|
mw.editcheck.getModifiedRanges = function ( documentModel, coveredNodesOnly ) {
|
2023-08-16 14:57:54 +00:00
|
|
|
if ( !documentModel.completeHistory.getLength() ) {
|
2023-05-10 14:23:42 +00:00
|
|
|
return [];
|
2023-08-16 14:57:54 +00:00
|
|
|
}
|
2024-10-01 13:20:52 +00:00
|
|
|
const operations = documentModel.completeHistory.squash().transactions[ 0 ].operations;
|
2024-05-21 14:22:56 +00:00
|
|
|
const ranges = [];
|
|
|
|
let offset = 0;
|
|
|
|
const endOffset = documentModel.getDocumentRange().end;
|
2024-04-30 16:44:25 +00:00
|
|
|
operations.every( ( op ) => {
|
2023-08-16 14:58:27 +00:00
|
|
|
if ( op.type === 'retain' ) {
|
|
|
|
offset += op.length;
|
|
|
|
} else if ( op.type === 'replace' ) {
|
2024-05-21 14:22:56 +00:00
|
|
|
const insertedRange = new ve.Range( offset, offset + op.insert.length );
|
2023-08-16 14:58:27 +00:00
|
|
|
offset += op.insert.length;
|
2023-09-01 13:32:07 +00:00
|
|
|
// 1. Only trigger if the check is a pure insertion, with no adjacent content removed (T340088)
|
2023-08-16 14:58:27 +00:00
|
|
|
if ( op.remove.length === 0 ) {
|
|
|
|
ve.batchPush(
|
|
|
|
ranges,
|
2023-09-01 13:32:07 +00:00
|
|
|
// 2. Only fully inserted paragraphs (ranges that cover the whole node) (T345121)
|
2024-03-14 17:17:36 +00:00
|
|
|
mw.editcheck.getContentRanges( documentModel, insertedRange, coveredNodesOnly )
|
2023-08-16 14:58:27 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Reached the end of the doc / start of internal list, stop searching
|
|
|
|
return offset < endOffset;
|
|
|
|
} );
|
2023-06-08 13:01:18 +00:00
|
|
|
return ranges;
|
|
|
|
};
|
2023-07-06 13:16:49 +00:00
|
|
|
|
2023-08-24 03:16:02 +00:00
|
|
|
mw.editcheck.rejections = [];
|
|
|
|
|
|
|
|
mw.editcheck.getRejectionReasons = function () {
|
|
|
|
return mw.editcheck.rejections;
|
|
|
|
};
|
|
|
|
|
2023-08-07 12:18:38 +00:00
|
|
|
mw.editcheck.refCheckShown = false;
|
|
|
|
|
2023-07-06 13:16:49 +00:00
|
|
|
if ( mw.config.get( 'wgVisualEditorConfig' ).editCheckTagging ) {
|
2024-04-30 16:44:25 +00:00
|
|
|
mw.hook( 've.activationComplete' ).add( () => {
|
2024-05-21 14:22:56 +00:00
|
|
|
const target = ve.init.target;
|
2023-07-06 13:16:49 +00:00
|
|
|
|
|
|
|
function getRefNodes() {
|
|
|
|
// 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.
|
2024-05-21 14:22:56 +00:00
|
|
|
const internalList = target.getSurface().getModel().getDocument().getInternalList();
|
|
|
|
const group = internalList.getNodeGroup( 'mwReference/' );
|
2023-07-06 13:16:49 +00:00
|
|
|
return group ? group.firstNodes || [] : [];
|
|
|
|
}
|
|
|
|
|
2024-05-21 14:22:56 +00:00
|
|
|
const initLength = getRefNodes().length;
|
2023-07-06 13:16:49 +00:00
|
|
|
target.saveFields.vetags = function () {
|
2024-05-21 14:22:56 +00:00
|
|
|
const refNodes = getRefNodes();
|
|
|
|
const newLength = refNodes.length;
|
|
|
|
let newNodesInDoc = false;
|
|
|
|
for ( let i = initLength; i < newLength; i++ ) {
|
2023-07-06 13:16:49 +00:00
|
|
|
if ( refNodes[ i ] ) {
|
|
|
|
newNodesInDoc = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2024-05-21 14:22:56 +00:00
|
|
|
const tags = [];
|
2023-08-07 12:18:38 +00:00
|
|
|
if ( newNodesInDoc ) {
|
|
|
|
tags.push( 'editcheck-newreference' );
|
|
|
|
}
|
|
|
|
if ( mw.editcheck.refCheckShown ) {
|
|
|
|
tags.push( 'editcheck-references-activated' );
|
|
|
|
}
|
|
|
|
return tags.join( ',' );
|
2023-07-06 13:16:49 +00:00
|
|
|
};
|
|
|
|
} );
|
2024-04-30 16:44:25 +00:00
|
|
|
mw.hook( 've.deactivationComplete' ).add( () => {
|
2024-05-21 14:22:56 +00:00
|
|
|
const target = ve.init.target;
|
2023-09-12 10:37:34 +00:00
|
|
|
delete target.saveFields.vetags;
|
|
|
|
} );
|
2023-07-06 13:16:49 +00:00
|
|
|
}
|
2023-05-10 14:23:42 +00:00
|
|
|
|
2024-03-14 17:17:36 +00:00
|
|
|
if ( mw.config.get( 'wgVisualEditorConfig' ).editCheck || mw.editcheck.ecenable ) {
|
2024-05-21 14:22:56 +00:00
|
|
|
let saveProcessDeferred;
|
2024-03-14 17:17:36 +00:00
|
|
|
|
2024-04-30 16:44:25 +00:00
|
|
|
mw.hook( 've.preSaveProcess' ).add( ( saveProcess, target ) => {
|
2024-05-21 14:22:56 +00:00
|
|
|
const surface = target.getSurface();
|
2023-05-10 14:23:42 +00:00
|
|
|
|
2024-02-15 18:20:03 +00:00
|
|
|
if ( surface.getMode() !== 'visual' ) {
|
|
|
|
// Some checks will entirely work in source mode for most cases.
|
|
|
|
// But others will fail spectacularly -- e.g. reference check
|
|
|
|
// isn't aware of <ref> tags and so will suggest that all content
|
|
|
|
// has references added. As such, disable in source mode for now.
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-09-18 15:26:50 +00:00
|
|
|
ve.track( 'counter.editcheck.preSaveChecksAvailable' );
|
|
|
|
|
2023-08-24 03:16:02 +00:00
|
|
|
// clear rejection-reasons between runs of the save process, so only the last one counts
|
|
|
|
mw.editcheck.rejections.length = 0;
|
|
|
|
|
2024-10-01 11:31:17 +00:00
|
|
|
let checks = mw.editcheck.editCheckFactory.createAllByListener( 'onBeforeSave', surface.getModel() );
|
2024-03-14 17:17:36 +00:00
|
|
|
if ( checks.length ) {
|
2024-08-01 16:16:04 +00:00
|
|
|
ve.track( 'counter.editcheck.preSaveChecksShown' );
|
2023-08-07 12:18:38 +00:00
|
|
|
mw.editcheck.refCheckShown = true;
|
|
|
|
|
2024-05-21 14:22:56 +00:00
|
|
|
const surfaceView = surface.getView();
|
|
|
|
const toolbar = target.getToolbar();
|
|
|
|
const reviewToolbar = new ve.ui.PositionedTargetToolbar( target, target.toolbarConfig );
|
2023-05-10 14:23:42 +00:00
|
|
|
reviewToolbar.setup( [
|
|
|
|
{
|
|
|
|
name: 'back',
|
|
|
|
type: 'bar',
|
|
|
|
include: [ 'editCheckBack' ]
|
|
|
|
},
|
|
|
|
// Placeholder toolbar groups
|
|
|
|
// TODO: Make a proper TitleTool?
|
|
|
|
{
|
|
|
|
name: 'title',
|
|
|
|
type: 'bar',
|
|
|
|
include: []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'save',
|
|
|
|
// TODO: MobileArticleTarget should ignore 'align'
|
|
|
|
align: OO.ui.isMobile() ? 'before' : 'after',
|
|
|
|
type: 'bar',
|
|
|
|
include: [ 'showSaveDisabled' ]
|
|
|
|
}
|
|
|
|
], surface );
|
2024-08-22 06:23:27 +00:00
|
|
|
reviewToolbar.$element.addClass( 've-ui-editCheck-toolbar' );
|
2023-05-10 14:23:42 +00:00
|
|
|
|
|
|
|
reviewToolbar.items[ 1 ].$element.removeClass( 'oo-ui-toolGroup-empty' );
|
|
|
|
reviewToolbar.items[ 1 ].$group.append(
|
|
|
|
$( '<span>' ).addClass( 've-ui-editCheck-toolbar-title' ).text( ve.msg( 'editcheck-dialog-title' ) )
|
|
|
|
);
|
|
|
|
if ( OO.ui.isMobile() ) {
|
|
|
|
reviewToolbar.$element.addClass( 've-init-mw-mobileArticleTarget-toolbar' );
|
|
|
|
}
|
|
|
|
target.toolbar.$element.before( reviewToolbar.$element );
|
|
|
|
target.toolbar = reviewToolbar;
|
|
|
|
|
2024-02-22 17:45:12 +00:00
|
|
|
saveProcessDeferred = ve.createDeferred();
|
|
|
|
const context = surface.getContext();
|
2023-05-10 14:23:42 +00:00
|
|
|
|
2024-03-14 17:17:36 +00:00
|
|
|
// TODO: Allow multiple checks to be shown when multicheck is enabled
|
|
|
|
checks = checks.slice( 0, 1 );
|
2023-05-10 14:23:42 +00:00
|
|
|
|
2024-02-22 17:45:12 +00:00
|
|
|
// eslint-disable-next-line no-shadow
|
2024-03-14 17:17:36 +00:00
|
|
|
const drawSelections = ( checks ) => {
|
2024-02-22 17:45:12 +00:00
|
|
|
const highlightNodes = [];
|
2024-03-14 17:17:36 +00:00
|
|
|
const selections = [];
|
|
|
|
checks.forEach( ( check ) => {
|
2024-11-05 11:41:50 +00:00
|
|
|
check.highlights.forEach( ( highlight ) => {
|
|
|
|
highlightNodes.push.apply( highlightNodes, surfaceView.getDocument().selectNodes( highlight.getSelection().getCoveringRange(), 'branches' ).map( ( spec ) => spec.node ) );
|
|
|
|
const selection = ve.ce.Selection.static.newFromModel( highlight.getSelection(), surfaceView );
|
|
|
|
selections.push( selection );
|
|
|
|
} );
|
2024-02-22 17:45:12 +00:00
|
|
|
} );
|
|
|
|
// TODO: Make selections clickable when multicheck is enabled
|
2024-10-29 17:37:58 +00:00
|
|
|
surfaceView.getSelectionManager().drawSelections(
|
2024-02-22 17:45:12 +00:00
|
|
|
'editCheck',
|
2024-11-11 05:19:13 +00:00
|
|
|
selections
|
2024-02-22 17:45:12 +00:00
|
|
|
);
|
|
|
|
surfaceView.setReviewMode( true, highlightNodes );
|
|
|
|
};
|
|
|
|
|
|
|
|
const contextDone = ( responseData, contextData ) => {
|
|
|
|
if ( !responseData ) {
|
|
|
|
// this is the back button
|
|
|
|
return saveProcessDeferred.resolve();
|
|
|
|
}
|
2024-03-14 17:17:36 +00:00
|
|
|
const selectionIndex = checks.indexOf( contextData.action );
|
2023-05-10 14:23:42 +00:00
|
|
|
|
2024-02-22 17:45:12 +00:00
|
|
|
if ( responseData.action !== 'reject' ) {
|
|
|
|
mw.notify( ve.msg( 'editcheck-dialog-addref-success-notify' ), { type: 'success' } );
|
|
|
|
} else if ( responseData.reason ) {
|
|
|
|
mw.editcheck.rejections.push( responseData.reason );
|
|
|
|
}
|
|
|
|
// TODO: Move on to the next issue, when multicheck is enabled
|
2024-10-01 11:31:17 +00:00
|
|
|
// checks = mw.editcheck.editCheckFactory.createAllByListener( 'onBeforeSave', surface.getModel() );
|
2024-03-14 17:17:36 +00:00
|
|
|
checks = [];
|
2023-05-10 14:23:42 +00:00
|
|
|
|
2024-03-14 17:17:36 +00:00
|
|
|
if ( checks.length ) {
|
2024-02-22 17:45:12 +00:00
|
|
|
context.removePersistentSource( 'editCheckReferences' );
|
|
|
|
setTimeout( () => {
|
|
|
|
// timeout needed to wait out the newly added content being focused
|
|
|
|
surface.getModel().setNullSelection();
|
2024-03-14 17:17:36 +00:00
|
|
|
drawSelections( checks );
|
2024-02-22 17:45:12 +00:00
|
|
|
setTimeout( () => {
|
|
|
|
// timeout needed to allow the context to reposition
|
2024-03-14 17:17:36 +00:00
|
|
|
showCheckContext( checks[ Math.min( selectionIndex, checks.length - 1 ) ] );
|
2024-02-22 17:45:12 +00:00
|
|
|
} );
|
|
|
|
}, 500 );
|
|
|
|
} else {
|
|
|
|
saveProcessDeferred.resolve( true );
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// eslint-disable-next-line no-inner-declarations
|
2024-03-14 17:17:36 +00:00
|
|
|
function showCheckContext( check ) {
|
2024-11-05 11:41:50 +00:00
|
|
|
const fragment = check.highlights[ 0 ];
|
2024-02-22 17:45:12 +00:00
|
|
|
|
|
|
|
// Select the found content to correctly position the context on desktop
|
2023-05-10 14:23:42 +00:00
|
|
|
fragment.select();
|
|
|
|
|
|
|
|
context.addPersistentSource( {
|
|
|
|
embeddable: false,
|
|
|
|
data: {
|
2024-03-14 17:17:36 +00:00
|
|
|
action: check,
|
2023-05-10 14:23:42 +00:00
|
|
|
fragment: fragment,
|
2024-02-22 17:45:12 +00:00
|
|
|
callback: contextDone,
|
2023-05-10 14:23:42 +00:00
|
|
|
saveProcessDeferred: saveProcessDeferred
|
|
|
|
},
|
2023-08-14 16:07:00 +00:00
|
|
|
name: 'editCheckReferences'
|
2023-05-10 14:23:42 +00:00
|
|
|
} );
|
|
|
|
|
2024-02-22 17:45:12 +00:00
|
|
|
// Deactivate to prevent selection suppressing mobile context
|
|
|
|
surface.getView().deactivate();
|
|
|
|
|
2023-05-10 14:23:42 +00:00
|
|
|
// Once the context is positioned, clear the selection
|
2024-04-30 16:44:25 +00:00
|
|
|
setTimeout( () => {
|
2023-05-10 14:23:42 +00:00
|
|
|
surface.getModel().setNullSelection();
|
|
|
|
} );
|
2024-02-22 17:45:12 +00:00
|
|
|
}
|
|
|
|
|
2024-03-14 17:17:36 +00:00
|
|
|
drawSelections( checks );
|
2024-02-22 17:45:12 +00:00
|
|
|
toolbar.toggle( false );
|
|
|
|
target.onContainerScroll();
|
|
|
|
|
|
|
|
saveProcess.next( () => {
|
2024-03-14 17:17:36 +00:00
|
|
|
showCheckContext( checks[ 0 ] );
|
2023-05-10 14:23:42 +00:00
|
|
|
|
2024-04-30 16:44:25 +00:00
|
|
|
return saveProcessDeferred.promise().then( ( data ) => {
|
2023-08-14 16:07:00 +00:00
|
|
|
context.removePersistentSource( 'editCheckReferences' );
|
2023-05-10 14:23:42 +00:00
|
|
|
|
2024-10-29 17:37:58 +00:00
|
|
|
surfaceView.getSelectionManager().drawSelections( 'editCheck', [] );
|
2023-05-10 14:23:42 +00:00
|
|
|
surfaceView.setReviewMode( false );
|
|
|
|
|
|
|
|
reviewToolbar.$element.remove();
|
|
|
|
toolbar.toggle( true );
|
|
|
|
target.toolbar = toolbar;
|
|
|
|
target.onContainerScroll();
|
|
|
|
|
|
|
|
// Check the user inserted a citation
|
2024-02-22 17:45:12 +00:00
|
|
|
if ( data ) {
|
2024-05-21 14:22:56 +00:00
|
|
|
const delay = ve.createDeferred();
|
2023-05-10 14:23:42 +00:00
|
|
|
// If they inserted, wait 2 seconds on desktop before showing save dialog
|
2024-04-30 16:44:25 +00:00
|
|
|
setTimeout( () => {
|
2024-08-01 16:16:04 +00:00
|
|
|
ve.track( 'counter.editcheck.preSaveChecksCompleted' );
|
2023-05-10 14:23:42 +00:00
|
|
|
delay.resolve();
|
|
|
|
}, !OO.ui.isMobile() && data.action !== 'reject' ? 2000 : 0 );
|
|
|
|
return delay.promise();
|
|
|
|
} else {
|
2024-08-01 16:16:04 +00:00
|
|
|
ve.track( 'counter.editcheck.preSaveChecksAbandoned' );
|
2023-05-10 14:23:42 +00:00
|
|
|
return ve.createDeferred().reject().promise();
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
} );
|
2024-08-08 02:01:17 +00:00
|
|
|
} else {
|
|
|
|
// Counterpart to earlier preSaveChecksShown, for use in tracking
|
|
|
|
// errors in check-generation:
|
|
|
|
ve.track( 'counter.editcheck.preSaveChecksNotShown' );
|
2023-05-10 14:23:42 +00:00
|
|
|
}
|
|
|
|
} );
|
2024-04-30 16:44:25 +00:00
|
|
|
mw.hook( 've.deactivationComplete' ).add( () => {
|
2023-10-07 02:49:16 +00:00
|
|
|
if ( saveProcessDeferred ) {
|
|
|
|
saveProcessDeferred.reject();
|
|
|
|
}
|
2023-09-12 10:37:34 +00:00
|
|
|
} );
|
2023-05-10 14:23:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ve.ui.EditCheckBack = function VeUiEditCheckBack() {
|
|
|
|
// Parent constructor
|
|
|
|
ve.ui.EditCheckBack.super.apply( this, arguments );
|
|
|
|
|
|
|
|
this.setDisabled( false );
|
|
|
|
};
|
|
|
|
OO.inheritClass( ve.ui.EditCheckBack, ve.ui.Tool );
|
|
|
|
ve.ui.EditCheckBack.static.name = 'editCheckBack';
|
|
|
|
ve.ui.EditCheckBack.static.icon = 'previous';
|
|
|
|
ve.ui.EditCheckBack.static.autoAddToCatchall = false;
|
|
|
|
ve.ui.EditCheckBack.static.autoAddToGroup = false;
|
|
|
|
ve.ui.EditCheckBack.static.title =
|
|
|
|
OO.ui.deferMsg( 'visualeditor-backbutton-tooltip' );
|
|
|
|
ve.ui.EditCheckBack.prototype.onSelect = function () {
|
2024-05-21 14:22:56 +00:00
|
|
|
const context = this.toolbar.getSurface().getContext();
|
2023-05-10 14:23:42 +00:00
|
|
|
if ( context.inspector ) {
|
|
|
|
context.inspector.close();
|
|
|
|
} else {
|
|
|
|
context.items[ 0 ].close();
|
|
|
|
}
|
|
|
|
this.setActive( false );
|
|
|
|
};
|
|
|
|
ve.ui.EditCheckBack.prototype.onUpdateState = function () {
|
|
|
|
this.setDisabled( false );
|
|
|
|
};
|
|
|
|
ve.ui.toolFactory.register( ve.ui.EditCheckBack );
|
|
|
|
|
|
|
|
ve.ui.EditCheckSaveDisabled = function VeUiEditCheckSaveDisabled() {
|
|
|
|
// Parent constructor
|
|
|
|
ve.ui.EditCheckSaveDisabled.super.apply( this, arguments );
|
|
|
|
};
|
|
|
|
OO.inheritClass( ve.ui.EditCheckSaveDisabled, ve.ui.MWSaveTool );
|
|
|
|
ve.ui.EditCheckSaveDisabled.static.name = 'showSaveDisabled';
|
|
|
|
ve.ui.EditCheckSaveDisabled.static.autoAddToCatchall = false;
|
|
|
|
ve.ui.EditCheckSaveDisabled.static.autoAddToGroup = false;
|
|
|
|
ve.ui.EditCheckSaveDisabled.prototype.onUpdateState = function () {
|
|
|
|
this.setDisabled( true );
|
|
|
|
};
|
|
|
|
|
|
|
|
ve.ui.toolFactory.register( ve.ui.EditCheckSaveDisabled );
|