Debian Codegraph @

extensions/VisualEditor/modules/ve-mw/ui/dialogs/ve.ui.MWMobileSaveDialog.js

raw symbols SCIP
1 /*!
2 * VisualEditor UserInterface MWMobileSaveDialog class.
3 *
4 * @copyright See AUTHORS.txt
5 * @license The MIT License (MIT); see LICENSE.txt
6 */
7
8 /**
9 * Dialog for saving MediaWiki pages in mobile.
10 *
11 * TODO: Currently this does no overriding so could be removed, but we may want
12 * to customise the mobile save dialog in the near future.
13 *
14 * @class
15 * @extends ve.ui.MWSaveDialog
16 *
17 * @constructor
18 * @param {Object} [config] Config options
19 */
20 ve.ui.MWMobileSaveDialog = function VeUiMwMobileSaveDialog() {
21 // Parent constructor
22 ve.ui.MWMobileSaveDialog.super.apply( this, arguments );
23
24 // Initialization
25 this.$element.addClass( 've-ui-mwMobileSaveDialog' );
26 };
27
28 /* Inheritance */
29
30 OO.inheritClass( ve.ui.MWMobileSaveDialog, ve.ui.MWSaveDialog );
31
32 /* Methods */
33
34 /**
35 * @inheritdoc
36 */
37 ve.ui.MWMobileSaveDialog.prototype.initialize = function () {
38 // Parent method
39 ve.ui.MWMobileSaveDialog.super.prototype.initialize.call( this );
40
41 this.$reviewVisualDiff.addClass( 'content' );
42 this.previewPanel.$element.addClass( 'content' );
43
44 mw.loader.using( 'mobile.startup' ).then( ( req ) => {
45 const licenseMsg = req( 'mobile.startup' ).license();
46 if ( licenseMsg ) {
47 // eslint-disable-next-line no-jquery/no-html
48 this.$license.html( licenseMsg );
49 }
50 } );
51 };
52
53 /* Registration */
54
55 ve.ui.windowFactory.register( ve.ui.MWMobileSaveDialog );