Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1429233
mediawiki.checkboxtoggle.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
936 B
Referenced Files
None
Subscribers
None
mediawiki.checkboxtoggle.js
View Options
/*!
* Allows users to perform all / none / invert operations on a list of
* checkboxes on the page.
*
* @licence GNU GPL v2+
* @author Luke Faraone <luke at faraone dot cc>
*
* Based on ext.nuke.js from https://www.mediawiki.org/wiki/Extension:Nuke by
* Jeroen De Dauw <jeroendedauw at gmail dot com>
*/
(
function
()
{
'use strict'
;
$
(
()
=>
{
// FIXME: This shouldn't be a global selector to avoid conflicts
// with unrelated content on the same page. (T131318)
const
$checkboxes
=
$
(
'li input[type="checkbox"]'
);
function
selectAll
(
check
)
{
$checkboxes
.
prop
(
'checked'
,
check
).
trigger
(
'change'
);
}
$
(
'.mw-checkbox-all'
).
on
(
'click'
,
()
=>
{
selectAll
(
true
);
}
);
$
(
'.mw-checkbox-none'
).
on
(
'click'
,
()
=>
{
selectAll
(
false
);
}
);
$
(
'.mw-checkbox-invert'
).
on
(
'click'
,
()
=>
{
$checkboxes
.
prop
(
'checked'
,
(
i
,
val
)
=>
!
val
).
trigger
(
'change'
);
}
);
}
);
}()
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 16, 17:18 (9 h, 44 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
6d/b4/4776a28c1d9513ddcbe4863aa992
Default Alt Text
mediawiki.checkboxtoggle.js (936 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment