Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Application: IPB Like System
- * Date: 16/02/2015
- * Version: 1.216022015
- * Copyright (c) 2015 Daemon <bestskins.forumeiros.com>
- * This work is free. You can redistribute it and/or modify it
- */
- function bestskins_ls() {
- // Imagem de reputação
- var plusImg = 'http://i.imgur.com/PTraX1a.png';
- for (var x = $('.vote'), i = 0, vote;(vote = x[i++]);) {
- var qtd = 0,
- barra = $('.vote-bar', vote)[0],
- botao = $('.vote-button', vote)[0];
- if (barra) {
- var numbarra = barra.title.match(/\d+/g);
- qtd = Math.round(parseInt(numbarra[1]) * parseInt(numbarra[0])) / 100;
- }
- botao = botao ? '<li><span onclick="bestskinsVoto(\'' + botao.firstChild.href + '\',this);" class="BS_like"><img src="' + plusImg + '" alt="+" class="rep_up"></span></li>' : '<li style="display: none;"><img src="' + plusImg + '" alt="+" class="rep_up"></li>';
- var numrep = '<li>' + (qtd == 0 ? '<span class="reput_vote zero">' + qtd + '</span>' : '<span class="reput_vote positive">' + qtd + '</span>') + '</li>';
- var htmlFinal =
- '<div class="rep_bar clearfix" id="rep_post">' +
- ' <ul class="bs_inline">' + botao + numrep + '</ul>' +
- '</div>';
- $('.postfoot', vote.parentNode.parentNode.parentNode.parentNode).before(htmlFinal);
- }
- x.remove();
- };
- function bestskinsVoto(b, a) {
- a.onclick = '#';
- $.get(b, function() {
- a.parentNode.style.display = 'none';
- var verify = a.parentNode.nextSibling.firstChild.innerHTML;
- if (verify == 0) {
- a.parentNode.nextSibling.firstChild.classList.remove('zero'),
- a.parentNode.nextSibling.firstChild.classList.add('positive');
- }
- var c = a.parentNode.nextSibling.firstChild,
- b = parseInt(/\d+/.exec(c.innerHTML)[0]) + 1;
- c.innerHTML = c.innerHTML.replace(/\d+/, b);
- });
- };
- if (document.readyState === 'complete') {
- bestskins_ls();
- } else {
- document.addEventListener('DOMContentLoaded', function() {
- bestskins_ls();
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement