Proveiling Totals

Adds totals per auction on mylots of proveiling.nl

  1. // ==UserScript==
  2. // @name Proveiling Totals
  3. // @namespace nl.veiling.pro
  4. // @description Adds totals per auction on mylots of proveiling.nl
  5. // @include http://www.proveiling.nl/MyLots.aspx
  6. // @version 1
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. var ch = $("td");
  11. var cost = 0;
  12.  
  13. $("#itemPlaceholderContainer tr").each(function() {
  14. if ($(this).data("type") === "header") {
  15. cost = 0;
  16. ch = $(this).children("td");
  17. ch.append($("<strong class='total right'>-</strong>"))
  18. }
  19. if ($(this).hasClass("clickable")) {
  20. cost = cost + parseFloat($(this).find("#next").text().replace(/,/, '.'));
  21. ch.children(".total").text("€ " + parseFloat(Math.round(cost * 100) / 100).toFixed(2).replace('.', ','));
  22. }
  23. });