Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1426950
mw.widgets.CopyTextLayout.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
mw.widgets.CopyTextLayout.js
View Options
/*!
* MediaWiki Widgets - CopyTextLayout class.
*
* @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* @classdesc Extends CopyTextLayout with MediaWiki notifications.
*
* @class
* @extends OO.ui.CopyTextLayout
*
* @constructor
* @description Create an instance of `mw.widgets.CopyTextLayout`.
* @param {Object} [config] Configuration options
* @param {string} [config.successMessage] Success message,
* defaults to the {@link mw.Message} 'mw-widgets-copytextlayout-copy-success'.
* @param {string} [config.failMessage] Failure message,
* defaults to the {@link mw.Message} 'mw-widgets-copytextlayout-copy-fail'.
*/
mw
.
widgets
.
CopyTextLayout
=
function
MwWidgetsCopyTextLayout
(
config
)
{
// Parent constructor
mw
.
widgets
.
CopyTextLayout
.
super
.
apply
(
this
,
arguments
);
this
.
successMessage
=
config
.
successMessage
||
mw
.
msg
(
'mw-widgets-copytextlayout-copy-success'
);
this
.
failMessage
=
config
.
failMessage
||
mw
.
msg
(
'mw-widgets-copytextlayout-copy-fail'
);
this
.
connect
(
this
,
{
copy
:
'onMwCopy'
}
);
};
/* Inheritence */
OO
.
inheritClass
(
mw
.
widgets
.
CopyTextLayout
,
OO
.
ui
.
CopyTextLayout
);
/* Methods */
/**
* Handle copy events.
*
* @param {boolean} copied
*/
mw
.
widgets
.
CopyTextLayout
.
prototype
.
onMwCopy
=
function
(
copied
)
{
if
(
copied
)
{
mw
.
notify
(
this
.
successMessage
);
}
else
{
mw
.
notify
(
this
.
failMessage
,
{
type
:
'error'
}
);
}
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 16, 13:58 (1 d, 18 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d4/63/935d577a23bd3bbea5b3c51da898
Default Alt Text
mw.widgets.CopyTextLayout.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment