Debian Codegraph @

extensions/VisualEditor/modules/ve-mw-collab/ve.init.mw.MobileCollabTarget.js

raw symbols SCIP
1 /*!
2 * VisualEditor MediaWiki Initialization MobileCollabTarget class.
3 *
4 * @copyright See AUTHORS.txt
5 * @license The MIT License (MIT); see LICENSE.txt
6 */
7
8 /**
9 * MediaWiki mobile article target.
10 *
11 * @class
12 * @extends ve.init.mw.Target
13 *
14 * @constructor
15 * @param {mw.Title} title Page sub-title
16 * @param {string} rebaserUrl Rebaser server URL
17 * @param {Object} [config] Configuration options
18 * @param {mw.Title} [config.importTitle] Title to import
19 */
20 ve.init.mw.MobileCollabTarget = function VeInitMwMobileCollabTarget( title, rebaserUrl, config ) {
21 // Parent constructor
22 ve.init.mw.MobileCollabTarget.super.call( this, title, rebaserUrl, config );
23
24 // Initialization
25 this.$element.addClass( 've-init-mw-mobileArticleTarget ve-init-mw-mobileCollabTarget ve-init-mobileTarget' );
26
27 $( document.body ).removeClass( 'ns-special' );
28 };
29
30 /* Inheritance */
31
32 OO.inheritClass( ve.init.mw.MobileCollabTarget, ve.init.mw.CollabTarget );
33
34 /* Static Properties */
35
36 ve.init.mw.MobileCollabTarget.static.toolbarGroups = [
37 // Back
38 {
39 name: 'back',
40 include: [ 'back' ]
41 },
42 // History
43 {
44 name: 'history',
45 include: [ 'undo' ]
46 },
47 // Style
48 {
49 name: 'style',
50 classes: [ 've-test-toolbar-style' ],
51 type: 'list',
52 icon: 'textStyle',
53 title: OO.ui.deferMsg( 'visualeditor-toolbar-style-tooltip' ),
54 label: OO.ui.deferMsg( 'visualeditor-toolbar-style-tooltip' ),
55 invisibleLabel: true,
56 include: [ { group: 'textStyle' }, 'language', 'clear' ],
57 forceExpand: [ 'bold', 'italic', 'clear' ],
58 promote: [ 'bold', 'italic' ],
59 demote: [ 'strikethrough', 'code', 'underline', 'language', 'clear' ]
60 },
61 // Link
62 {
63 name: 'link',
64 include: [ 'link' ]
65 },
66 // Placeholder for reference tools (e.g. Cite and/or Citoid)
67 {
68 name: 'reference'
69 },
70 {
71 name: 'insert',
72 header: OO.ui.deferMsg( 'visualeditor-toolbar-insert' ),
73 title: OO.ui.deferMsg( 'visualeditor-toolbar-insert' ),
74 label: OO.ui.deferMsg( 'visualeditor-toolbar-insert' ),
75 invisibleLabel: true,
76 type: 'list',
77 icon: 'add',
78 promote: [ 'commentAnnotation' ],
79 include: '*',
80 exclude: [ 'comment', 'indent', 'outdent', { group: 'format' } ]
81 },
82 {
83 name: 'authorList',
84 include: [ 'authorList' ]
85 },
86 {
87 name: 'export',
88 include: [ 'export' ]
89 }
90 ];
91
92 /* Methods */
93
94 /**
95 * @inheritdoc
96 */
97 ve.init.mw.MobileCollabTarget.prototype.getSurfaceClasses = function () {
98 const classes = ve.init.mw.MobileCollabTarget.super.prototype.getSurfaceClasses.call( this );
99 return classes.concat( [ 'content' ] );
100 };
101
102 /* Registration */
103
104 ve.init.mw.targetFactory.register( ve.init.mw.MobileCollabTarget );