2018-09-17 14:24:27 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor MediaWiki Initialization MobileCollabTarget class.
|
|
|
|
*
|
2023-12-01 16:06:11 +00:00
|
|
|
* @copyright See AUTHORS.txt
|
2018-09-17 14:24:27 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MediaWiki mobile article target.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.init.mw.Target
|
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @param {mw.Title} title Page sub-title
|
2019-04-16 15:17:29 +00:00
|
|
|
* @param {string} rebaserUrl Rebaser server URL
|
2018-09-17 14:24:27 +00:00
|
|
|
* @param {Object} [config] Configuration options
|
2024-05-27 04:59:02 +00:00
|
|
|
* @param {mw.Title} [config.importTitle] Title to import
|
2018-09-17 14:24:27 +00:00
|
|
|
*/
|
|
|
|
ve.init.mw.MobileCollabTarget = function VeInitMwMobileCollabTarget( title, rebaserUrl, config ) {
|
|
|
|
// Parent constructor
|
|
|
|
ve.init.mw.MobileCollabTarget.super.call( this, title, rebaserUrl, config );
|
|
|
|
|
|
|
|
// Initialization
|
2019-07-22 19:12:35 +00:00
|
|
|
this.$element.addClass( 've-init-mw-mobileArticleTarget ve-init-mw-mobileCollabTarget ve-init-mobileTarget' );
|
2018-09-17 14:24:27 +00:00
|
|
|
|
2019-01-08 17:00:09 +00:00
|
|
|
$( document.body ).removeClass( 'ns-special' );
|
2018-09-17 14:24:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
OO.inheritClass( ve.init.mw.MobileCollabTarget, ve.init.mw.CollabTarget );
|
|
|
|
|
|
|
|
/* Static Properties */
|
|
|
|
|
2019-02-01 18:24:20 +00:00
|
|
|
ve.init.mw.MobileCollabTarget.static.toolbarGroups = [
|
2020-07-31 15:41:18 +00:00
|
|
|
// Back
|
|
|
|
{
|
|
|
|
name: 'back',
|
|
|
|
include: [ 'back' ]
|
|
|
|
},
|
2019-02-01 18:24:20 +00:00
|
|
|
// History
|
|
|
|
{
|
|
|
|
name: 'history',
|
|
|
|
include: [ 'undo' ]
|
|
|
|
},
|
|
|
|
// Style
|
|
|
|
{
|
|
|
|
name: 'style',
|
|
|
|
classes: [ 've-test-toolbar-style' ],
|
|
|
|
type: 'list',
|
|
|
|
icon: 'textStyle',
|
|
|
|
title: OO.ui.deferMsg( 'visualeditor-toolbar-style-tooltip' ),
|
2020-03-13 21:03:50 +00:00
|
|
|
label: OO.ui.deferMsg( 'visualeditor-toolbar-style-tooltip' ),
|
|
|
|
invisibleLabel: true,
|
2019-02-01 18:24:20 +00:00
|
|
|
include: [ { group: 'textStyle' }, 'language', 'clear' ],
|
|
|
|
forceExpand: [ 'bold', 'italic', 'clear' ],
|
|
|
|
promote: [ 'bold', 'italic' ],
|
|
|
|
demote: [ 'strikethrough', 'code', 'underline', 'language', 'clear' ]
|
|
|
|
},
|
|
|
|
// Link
|
|
|
|
{
|
|
|
|
name: 'link',
|
|
|
|
include: [ 'link' ]
|
|
|
|
},
|
|
|
|
// Placeholder for reference tools (e.g. Cite and/or Citoid)
|
|
|
|
{
|
|
|
|
name: 'reference'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'insert',
|
|
|
|
header: OO.ui.deferMsg( 'visualeditor-toolbar-insert' ),
|
|
|
|
title: OO.ui.deferMsg( 'visualeditor-toolbar-insert' ),
|
2020-03-13 21:03:50 +00:00
|
|
|
label: OO.ui.deferMsg( 'visualeditor-toolbar-insert' ),
|
|
|
|
invisibleLabel: true,
|
2019-02-01 18:24:20 +00:00
|
|
|
type: 'list',
|
|
|
|
icon: 'add',
|
2020-07-31 15:41:18 +00:00
|
|
|
promote: [ 'commentAnnotation' ],
|
2019-02-01 18:24:20 +00:00
|
|
|
include: '*',
|
|
|
|
exclude: [ 'comment', 'indent', 'outdent', { group: 'format' } ]
|
2019-09-03 15:41:02 +00:00
|
|
|
},
|
2018-09-17 14:24:27 +00:00
|
|
|
{
|
|
|
|
name: 'authorList',
|
|
|
|
include: [ 'authorList' ]
|
2019-02-01 18:24:20 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'export',
|
|
|
|
include: [ 'export' ]
|
2018-09-17 14:24:27 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2024-11-14 11:46:49 +00:00
|
|
|
ve.init.mw.MobileCollabTarget.static.enforceResizesContent = true;
|
|
|
|
|
2018-09-17 14:24:27 +00:00
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2021-11-15 18:05:58 +00:00
|
|
|
ve.init.mw.MobileCollabTarget.prototype.getSurfaceClasses = function () {
|
2024-05-21 14:22:56 +00:00
|
|
|
const classes = ve.init.mw.MobileCollabTarget.super.prototype.getSurfaceClasses.call( this );
|
2021-11-15 18:05:58 +00:00
|
|
|
return classes.concat( [ 'content' ] );
|
2018-09-17 14:24:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.init.mw.targetFactory.register( ve.init.mw.MobileCollabTarget );
|