2018-09-17 14:24:27 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor MediaWiki Initialization MobileCollabTarget class.
|
|
|
|
*
|
|
|
|
* @copyright 2011-2016 VisualEditor Team and others; see AUTHORS.txt
|
|
|
|
* @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
|
|
|
|
* @cfg {mw.Title} [importTitle] Title to import
|
|
|
|
*/
|
|
|
|
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
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2019-09-03 15:41:02 +00:00
|
|
|
ve.init.mw.MobileCollabTarget.static.actionGroups = [];
|
|
|
|
|
2018-09-17 14:24:27 +00:00
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
ve.init.mw.MobileCollabTarget.prototype.setSurface = function ( surface ) {
|
|
|
|
surface.$element.addClass( 'content' );
|
|
|
|
|
|
|
|
// Parent method
|
|
|
|
ve.init.mw.MobileCollabTarget.super.prototype.setSurface.apply( this, arguments );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.init.mw.targetFactory.register( ve.init.mw.MobileCollabTarget );
|