Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- KurahenPremium.prototype.colorizeAndNamePosters = function () {
- var postersIds = document.getElementsByClassName('posteruid');
- var postersStats = {};
- var opId;
- for (var i = 0; i < postersIds.length; i++) {
- var posterId = this.parsePosterId(postersIds[i].textContent);
- postersIds[i].title = posterId;
- posterId = posterId.replace(/[\.|\/|\+|\-]/g, '_');
- if (i === 0) {
- opId = posterId;
- }
- postersIds[i].className += ' poster-id-' + posterId;
- if (roundedIdBackground) {
- postersIds[i].className += ' id-rounded';
- }
- if (posterId === opId) {
- postersIds[i].textContent = '\u00a0OP nitki';
- } else {
- postersIds[i].textContent = '\u00a0' + posterId;
- }
- if (typeof postersStats[posterId] === 'undefined') {
- postersStats[posterId] = [postersIds[i]];
- } else {
- postersStats[posterId].push(postersIds[i]);
- }
- }
- var style = '';
- for (var id in postersStats) {
- if (postersStats.hasOwnProperty(id) && postersStats[id].length > 1) {
- style += '.poster-id-' + id + '{color:#000;background-color: ' + this.getNextColor() + ';}\n';
- var numeral;
- if (postersStats[id].length < 5) {
- numeral = ' posty';
- } else {
- numeral = ' postów';
- }
- if (showPostCountNearId) {
- style += '.poster-id-' + id + ':after{content:" (';
- style += postersStats[id].length + numeral + ')\u00a0"}\n';
- }
- if (enableHighlightPostsButton) {
- this.setHighlightPostsButton(postersStats[id], id);
- }
- if (enableJumpButtons) {
- this.setJumpButtons(postersStats[id]);
- }
- }
- }
- if (roundedIdBackground) {
- style += '.id-rounded { font-size: 11px; border-radius: 6px; padding: 0px 6px 0px 2px;}\n';
- }
- style += '.small-icon { font-size: 16px; vertical-align: middle }\n';
- style += '.post-animated { transition: opacity 0.4s}\n';
- style += '.hiden-post { opacity: ' + unhighlightedPostOpacity + '}\n';
- style += '.highlighting-button { font-size: 11px; cursor:pointer}\n';
- style += '.highlighting-button:hover { color: orange;}\n';
- GM_addStyle(style);
- var allUserPosts = document.getElementsByClassName('postContainer');
- for (i = 0; i < allUserPosts.length; i++) {
- allUserPosts[i].classList.add('post-animated');
- }
- var firstPostBar = document.querySelector('.opContainer .postInfo');
- var threadPostersStats = document.createElement('span');
- threadPostersStats.textContent = ' (' + postersIds.length + ' postów od ' + Object.keys(postersStats).length +
- ' anonów)';
- firstPostBar.appendChild(threadPostersStats);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement