diff --git a/total-cost.handyflash.user.js b/total-cost.handyflash.user.js index 3dea60a..21769f6 100644 --- a/total-cost.handyflash.user.js +++ b/total-cost.handyflash.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Gesamtkosten Handyflash // @namespace http://tampermonkey.net/ -// @version 0.3 +// @version 0.4 // @description Berechnet die Gesamtkosten der Verträge auf handyflash.de // @author Jan Bader // @match http*://www.handyflash.de/handys/* @@ -17,14 +17,20 @@ function actionFunction() { jQuery("article.rate").each( function(i, tarif) { + if(jQuery(tarif).data("gesamt") !== "undefined") + return; + var grundgebuehr_text = jQuery(tarif).find(".tariff_price").text(); var grundgebuehr = parseFloat(grundgebuehr_text.split("€")[0].replace(',', '.')); grundgebuehr = Math.round(grundgebuehr, 2); + jQuery(tarif).data("monatlich", grundgebuehr); var anzahlung_text = jQuery(tarif).find(".tariff_payout").text(); var anzahlung = parseFloat(anzahlung_text.split("€")[0].replace(',', '.')); anzahlung = Math.round(anzahlung, 2); + jQuery(tarif).data("geraet", anzahlung); var gesamt = grundgebuehr * 24 + anzahlung; + jQuery(tarif).data("gesamt", gesamt); var details = jQuery(tarif).find(".tariff_links"); var header = jQuery(tarif).find(".tarife_box_header").text().replace(/^\s+|\s+$/g, '');