Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4140083
ManualWidget.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
ManualWidget.js
View Options
/* global RealtimePreview */
/**
* @class
* @constructor
* @param {RealtimePreview} realtimePreview
* @param {OO.ui.ButtonWidget} reloadHoverButton
*/
function
ManualWidget
(
realtimePreview
,
reloadHoverButton
)
{
const
config
=
{
classes
:
[
'ext-WikiEditor-ManualWidget'
],
$element
:
$
(
'<a>'
)
};
ManualWidget
.
super
.
call
(
this
,
config
);
// Mixins.
OO
.
ui
.
mixin
.
AccessKeyedElement
.
call
(
this
,
{}
);
OO
.
ui
.
mixin
.
ButtonElement
.
call
(
this
,
Object
.
assign
(
{
$button
:
this
.
$element
},
config
)
);
OO
.
ui
.
mixin
.
IconElement
.
call
(
this
,
{
icon
:
'reload'
}
);
OO
.
ui
.
mixin
.
TitledElement
.
call
(
this
,
{
title
:
mw
.
msg
(
'wikieditor-realtimepreview-reload-title'
)
}
);
this
.
reloadHoverButton
=
reloadHoverButton
;
// UI elements.
const
$reloadLabel
=
$
(
'<span>'
)
.
text
(
mw
.
msg
(
'wikieditor-realtimepreview-manual'
)
);
const
$reloadButton
=
$
(
'<span>'
)
.
addClass
(
'ext-WikiEditor-realtimepreview-manual-reload'
)
.
text
(
mw
.
msg
(
'wikieditor-realtimepreview-reload'
)
);
this
.
connect
(
realtimePreview
,
{
click
:
function
()
{
if
(
!
this
.
isScreenWideEnough
()
)
{
// Do nothing if realtime preview is not visible.
return
;
}
// Only refresh the preview if we're enabled.
if
(
this
.
enabled
)
{
this
.
doRealtimePreview
();
}
mw
.
hook
(
'ext.WikiEditor.realtimepreview.reloadManual'
).
fire
(
this
);
}.
bind
(
realtimePreview
)
}
);
this
.
$element
.
append
(
this
.
$icon
,
$reloadLabel
,
$reloadButton
);
}
OO
.
inheritClass
(
ManualWidget
,
OO
.
ui
.
Widget
);
OO
.
mixinClass
(
ManualWidget
,
OO
.
ui
.
mixin
.
AccessKeyedElement
);
OO
.
mixinClass
(
ManualWidget
,
OO
.
ui
.
mixin
.
ButtonElement
);
OO
.
mixinClass
(
ManualWidget
,
OO
.
ui
.
mixin
.
IconElement
);
OO
.
mixinClass
(
ManualWidget
,
OO
.
ui
.
mixin
.
TitledElement
);
ManualWidget
.
prototype
.
toggle
=
function
(
show
)
{
ManualWidget
.
super
.
prototype
.
toggle
.
call
(
this
,
show
);
if
(
show
)
{
this
.
reloadHoverButton
.
$element
.
remove
();
// Use the same access key as the hover reload button, because this won't ever be displayed at the same time as that.
this
.
setAccessKey
(
mw
.
msg
(
'accesskey-wikieditor-realtimepreview'
)
);
}
};
module
.
exports
=
ManualWidget
;
File Metadata
Details
Attached
Mime Type
text/x-asm
Expires
Wed, Aug 19, 15:20 (3 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
6a/f4/069ec5e90876ac4dcb7c0f66eb44
Default Alt Text
ManualWidget.js (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment