Content deleted Content added
←Created page with '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 oppositi...' |
fix? |
||
(2 intermediate revisions by the same user not shown) | |||
Line 56:
Object.entries(shortConfig).forEach(([key, value]) => {
key.split(' ').forEach((keyword) => {
longConfig[keyword.replace('_', ' ')] = value;
});
});
Line 68:
const voteSymbol =
longConfig[
boldWord.toLowerCase().replace(/[.,!:;+]/g, '')
];
if (voteSymbol) {
)}`;
const finalUrl = voteSymbol.endsWith('.svg') ? `${imageURL}.png`: imageUrl
boldElement.innerHTML = `<img src="${finalUrl}" alt="${boldElement.textContent} vote" height="15" /> ${boldElement.innerHTML}`;
}
});
|