Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5962911
ve.init.MWEditingTabDialog.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
ve.init.MWEditingTabDialog.js
View Options
/*!
* VisualEditor user interface MWEditingTabDialog class.
*
* @copyright See AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
mw
.
libs
.
ve
=
mw
.
libs
.
ve
||
{};
/**
* Dialog for allowing new users to change editing tab preferences.
*
* @class
* @extends OO.ui.MessageDialog
*
* @constructor
* @param {Object} [config] Configuration options
*/
mw
.
libs
.
ve
.
EditingTabDialog
=
function
MWLibsVEMWEditingTabDialog
(
config
)
{
// Parent constructor
mw
.
libs
.
ve
.
EditingTabDialog
.
super
.
call
(
this
,
config
);
};
/* Inheritance */
OO
.
inheritClass
(
mw
.
libs
.
ve
.
EditingTabDialog
,
OO
.
ui
.
MessageDialog
);
/* Static Properties */
mw
.
libs
.
ve
.
EditingTabDialog
.
static
.
name
=
'editingtab'
;
mw
.
libs
.
ve
.
EditingTabDialog
.
static
.
size
=
'medium'
;
mw
.
libs
.
ve
.
EditingTabDialog
.
static
.
title
=
mw
.
msg
(
'visualeditor-editingtabdialog-title'
);
mw
.
libs
.
ve
.
EditingTabDialog
.
static
.
message
=
mw
.
msg
(
'visualeditor-editingtabdialog-body'
);
mw
.
libs
.
ve
.
EditingTabDialog
.
static
.
actions
=
[
{
action
:
'prefer-wt'
,
label
:
mw
.
msg
(
'visualeditor-preference-tabs-prefer-wt'
)
},
{
action
:
'prefer-ve'
,
label
:
mw
.
msg
(
'visualeditor-preference-tabs-prefer-ve'
)
},
{
action
:
'multi-tab'
,
label
:
mw
.
msg
(
'visualeditor-preference-tabs-multi-tab'
)
},
{
label
:
mw
.
msg
(
'visualeditor-editingtabdialog-ok'
),
flags
:
[
'progressive'
,
'primary'
]
}
];
/* Methods */
/**
* @inheritdoc
*/
mw
.
libs
.
ve
.
EditingTabDialog
.
prototype
.
getSetupProcess
=
function
(
action
)
{
return
mw
.
libs
.
ve
.
EditingTabDialog
.
super
.
prototype
.
getSetupProcess
.
call
(
this
,
action
)
.
next
(
()
=>
{
// Same as ve.init.target.getLocalApi()
new
mw
.
Api
().
saveOption
(
'visualeditor-hidetabdialog'
,
1
);
mw
.
user
.
options
.
set
(
'visualeditor-hidetabdialog'
,
1
);
}
);
};
/**
* @inheritdoc
*/
mw
.
libs
.
ve
.
EditingTabDialog
.
prototype
.
getActionProcess
=
function
(
action
)
{
if
(
action
)
{
return
new
OO
.
ui
.
Process
(
()
=>
{
const
actionWidget
=
this
.
getActions
().
get
(
{
actions
:
action
}
)[
0
];
actionWidget
.
pushPending
();
this
.
pushPending
();
// Same as ve.init.target.getLocalApi()
new
mw
.
Api
().
saveOption
(
'visualeditor-tabs'
,
action
).
done
(
()
=>
{
actionWidget
.
popPending
();
mw
.
user
.
options
.
set
(
'visualeditor-tabs'
,
action
);
this
.
close
(
{
action
:
action
}
);
}
);
}
);
}
else
{
// Parent method
return
mw
.
libs
.
ve
.
EditingTabDialog
.
super
.
prototype
.
getActionProcess
.
call
(
this
,
action
);
}
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 3, 09:16 (1 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
2a/96/8b40e665ac6d92a9ffec4a719f8a
Default Alt Text
ve.init.MWEditingTabDialog.js (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment