Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name SAVE LIQUIBET
- // @version 1
- // @grant none
- // @match https://www.liquidlegends.net/liquibet/
- // @require http://code.jquery.com/jquery-latest.js
- // ==/UserScript==
- $(document).ready(function() {
- var ul = $('.liquibetForm').length;
- var bps = 10;
- var s = Math.ceil(ul / bps);
- var cb = $('<label class="saved">Hide Completed Bets<input id="hide" type="checkbox" /></label>');
- var dd = '<select id="page" class="saved"><option value="all">all</value>';
- for (var j = 1; j <= s; j++) {
- dd += '<option value="' + j + '">' + j + '</option>';
- }
- dd += '</select>';
- $("#liquibet-upperLinks").append(dd);
- $("#liquibet-upperLinks").append(cb);
- $(".saved").css('float', 'right');
- var i = 0;
- $(".liquibetForm").each(function() {
- $(this).attr('BetNr', i)
- i++;
- });
- $("#hide").change(function() {
- update();
- });
- $("#page").change(function() {
- update();
- });
- })
- function update() {
- var c = $("#hide").is(":checked");
- var p = $("#page").val();
- var bps = 10;
- var bet = 0;
- var open = 0;
- var ul = $('.liquibetForm').length;
- if (p == 'all') {
- $(".liquibetForm").show();
- if (c) {
- $("span[data-bet-open='0']").parent().parent().parent().hide()
- } else {
- $("span[data-bet-open='0']").parent().parent().parent().show()
- }
- } else {
- $(".liquibetForm").each(function() {
- bet = $(this).attr('BetNr');
- if (bet <= (ul - (((p - 1) * bps))) && bet > (ul - (p * bps))) {
- open = $(this).find(".teamVote").first().attr('data-bet-open');
- if (c) {
- if (open == 0) {
- $(this).hide();
- } else {
- $(this).show();
- }
- } else {
- $(this).show();
- }
- } else {
- $(this).hide();
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement