Runtime module for the Wikidot [[module Rate]] page rating widget.
The Rate module renders a .page-rate-widget-box containing up-vote,
down-vote, and cancel buttons. This module delegates click events to
those buttons and invokes the host application's onRate callback
with the page ID and point value (+1, -1, or 0 for cancel).
When the callback resolves, the widget's displayed score and vote
count are updated in place via updateRateDisplay().
DOM interactions:
Listens for click (bubble) on root, delegated to .btn, .rateup,
.ratedown, and .cancel elements inside .page-rate-widget-box
Updates .rate-points .number and .vote-count text content on success
The destroy() cleanup function removes the click listener.
Runtime module for the Wikidot
[[module Rate]]page rating widget.The Rate module renders a
.page-rate-widget-boxcontaining up-vote, down-vote, and cancel buttons. This module delegates click events to those buttons and invokes the host application'sonRatecallback with the page ID and point value (+1, -1, or 0 for cancel).When the callback resolves, the widget's displayed score and vote count are updated in place via
updateRateDisplay().DOM interactions:
click(bubble) on root, delegated to.btn,.rateup,.ratedown, and.cancelelements inside.page-rate-widget-box.rate-points .numberand.vote-counttext content on successThe
destroy()cleanup function removes the click listener.