User:CanonNi/Scripts/VoteVisualizer.js
const shortConfig = {
'support agree endorse accept good_block' : '9/94/Symbol_support_vote.svg',
'keep allow permit' : 'd/d0/Symbol_keep_vote.svg',
'oppose disagree overturn object disallow decline bad_block opposition objection' : '7/7f/Symbol_oppose_vote.svg',
'delete remove pull' : '8/89/Symbol_delete_vote.svg',
'neutral meh ambivalent unsure' : '8/89/Symbol_neutral_vote.svg',
'merge upmerge' : 'b/b0/Symbol_merge_vote.svg',
'move transwiki convert transwikify' : '5/50/Symbol_move_vote.svg',
'redirect retarget repost' : '0/0c/Symbol_redirect_vote.svg',
'relist change recuse refine mixed' : 'b/ba/Symbol_opinion_vote.svg',
'comment note comments statement' : 'e/e0/Symbol_comment_vote.svg',
'delist demote' : 'f/f6/Symbol_unsupport_vote.svg',
'question query request inquiry' : 'e/e0/Symbol_question.svg',
'disambiguate dab dabify set_index sia' : '2/2a/Symbol_dab_class.svg',
'wait hold postpone' : '5/54/Symbol_wait.svg',
'rename' : '0/0a/Symbol_rename_vote.svg',
'undelete restore' : 'c/c5/Symbol_support2_vote.svg',
'close speedy_close no_consensus bad_rfc invalid_rfc' : '3/3b/Symbol_no_support_vote.svg',
'split' : '0/0d/Symbol_split_vote.svg',
'abstain abstention unnecessary moot mu irrelevant void' : '6/61/Symbol_abstain_vote.svg',
'draftify incubate' : '0/09/Symbol_draft_class.svg',
'userfy' : '1/13/Symbol_user_class.svg',
'listify blurb' : 'd/db/Symbol_list_class.svg',
'reply' : 'd/d2/Symbol_reply.svg',
'salt' : '6/66/Symbol_create_protect_vote.svg',
'withdraw withdrawn' : '8/85/Symbol_unrelated.svg',
'information info' : '8/8c/Symbol_information_vote.svg',
'update answer' : '1/18/Symbol_version_future.svg',
'snow snowball' : 'd/d3/Bouncing_Snowball.png',
'blank keep_blanked' : '1/1b/Symbol_plain_white.svg',
'speedy speedy_delete' : '6/6d/Symbol_speedy_delete_vote.svg',
'speedy_keep' : 'b/bc/Symbol_speedy_keep_vote.svg',
'speedy_redirect' : '2/22/Symbol_speedy_redirect_vote.svg',
'strong_support strongly_support strong_agree strongly_agree strongest_support' : '8/84/Symbol_strong_support_vote.svg',
'strong_oppose strongly_oppose strong_disagree strongly_disagree strong_object strongly_object strong_opposition strong_objection strongest_oppose': '5/5e/Symbol_oppose_vote_oversat.svg',
'weak_support weakly_support weak_agree weakly_agree weakest_support support-ish' : '8/8c/GA_candidate.svg',
'weak_oppose weakly_oppose weak_disagree weakly_disagree weak_object weakly_object weak_opposition weakest_oppose oppose-ish' : 'f/f5/BA_candidate.svg',
'partial_support conditional_support semi-support' : 'b/b2/Symbol_conditional_support.svg',
'ongoing' : 'e/e3/Symbol_wait_blue.svg',
'tag retag' : '8/83/Symbol_template_class_pink.svg',
'historical tag_historical deprecate' : 'c/c5/Symbol_mark_historical_vote.svg',
'speedy_merge' : '6/63/Symbol_speedy_merge_vote.svg',
'speedy_rename' : '0/0a/Symbol_speedy_rename_vote.svg',
'suggestion suggest' : 'a/a2/Symbol_suggestion_vote.svg',
'substitute subst' : '5/5c/Symbol_template_class.svg',
'rd recent_death' : '1/14/Symbol_death.svg',
};
/* Sup. Nobody reads source code, so as a reward, here's an extra secret video of me, enjoy: [https://www.youtube.com/watch?v=dQw4w9WgXcQ]. */
$(() => {
const namespaces = [1, 3, 4, 5, 7, 9, 11, 13, 15, 101, 119, 127, 711, 829];
if (!namespaces.includes(mw.config.get('wgNamespaceNumber'))) return;
let longConfig = {};
Object.entries(shortConfig).forEach(([key, value]) => {
key.split(' ').forEach((keyword) => {
longConfig[keyword.replace('_', ' ')] = value;
});
});
Array.from(document.body.getElementsByClassName('B')).forEach(
(boldElement) => {
boldElement.textContent
.replace(/[<>/]/g, ' ')
.split(' ')
.forEach((boldWord) => {
const voteSymbol =
longConfig[
boldWord.toLowerCase().replace(/[.,!:;+]/g, '')
];
if (voteSymbol) {
const imageUrl = `https://upload.wikimedia.org/wikipedia/commons/thumb/${voteSymbol}/30px-${voteSymbol.replace(
/..\/..\/(.*)/,
'$1'
)}`;
const finalUrl = voteSymbol.endsWith('.svg') ? `${imageURL}.png`: imageUrl
boldElement.innerHTML = `<img src="${finalUrl}" alt="${boldElement.textContent} vote" height="15" /> ${boldElement.innerHTML}`;
}
});
}
);
});
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.