Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ShlomoCode/61faf431e21311ed32d7101734568689 to your computer and use it in GitHub Desktop.
Save ShlomoCode/61faf431e21311ed32d7101734568689 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name אישור לפני נתינת דיסלייק
// @version 0.2
// @author @ShlomoCode
// @match https://mitmachim.top/*
// ==/UserScript==
$(window).on('action:post.toggleVote', (e, d) => {
if (d.delta === -1 && d.unvote === false) {
if (!confirm('האם אתה בטוח שברצונך לתת דיסלייק?')) {
$(`[data-pid="${d.pid}"]`).find('[component="post/downvote"]').click();
app.alert({
type: 'warning',
title: 'שים לב!',
message: "המערכת ניסתה לבטל את הדיסלייק. יש לוודא שהוא באמת בוטל",
timeout: 2500
})
} else {
app.alert({
type: 'success',
title: 'הדיסלייק ניתן בהצלחה',
timeout: 2500
});
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment