Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4041630
contentEnhancements.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
875 B
Referenced Files
None
Subscribers
None
contentEnhancements.js
View Options
/**
* Various enhancements to the page content
*/
/**
* @return {void}
*/
function
init
()
{
addUserAnniversary
();
}
/**
* Append cake emoji to user registration date if it's the user's anniversary
*
* @return {void}
*/
function
addUserAnniversary
()
{
document
.
querySelectorAll
(
'.citizen-user-regdate'
).
forEach
(
(
date
)
=>
{
const
timestamp
=
date
.
getAttribute
(
'datetime'
);
const
anniversary
=
new
Date
(
timestamp
);
const
today
=
new
Date
();
if
(
anniversary
.
getMonth
()
!==
today
.
getMonth
()
||
anniversary
.
getDate
()
!==
today
.
getDate
()
)
{
return
;
}
const
cake
=
document
.
createElement
(
'span'
);
cake
.
textContent
=
' 🎂'
;
cake
.
classList
.
add
(
'citizen-user-regdate-anniversary'
);
cake
.
setAttribute
(
'aria-label'
,
'anniversary'
);
date
.
insertAdjacentElement
(
'beforeend'
,
cake
);
}
);
}
module
.
exports
=
{
init
:
init
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Aug 15 2026, 06:37 (13 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ab/8b/5fa8ce1946dbdf6c48ecd2bcc284
Default Alt Text
contentEnhancements.js (875 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment