Bläddra i källkod

Bug Fixes to JS for filter

KeyMasterOfGozer 7 månader sedan
förälder
incheckning
c725e90093
1 ändrade filer med 12 tillägg och 5 borttagningar
  1. 12 5
      README.md

+ 12 - 5
README.md

@@ -148,22 +148,29 @@ for (var i = 0; i < marketCards.length; i++) {
 cards=document.getElementsByClassName('wrapper-card');
 for (var i = 0; i < cards.length; i++) {
     cardNum = parseInt(cards.item(i).getElementsByClassName('pornstar-number')[0].outerText);
+    cardVal = parseInt(cards.item(i).getElementsByClassName('score-card')[0].outerText);
+    price = clist[cardNum];
     var cardNB = cards.item(i).getElementsByClassName('card-nb')[0];
-    if (cardNB){
+    if (cardNB){try{
         stock = parseInt(cards.item(i).getElementsByClassName('nb-label')[0].outerText.trim());
-        var price = cardNB.getElementsByClassName('Price')[0];
-        if (price){price.innerText = "Price: " + clist[cardNum]}
+        var fuzed = cards.item(i).getElementsByClassName('nb-name')[0];
+        if (fuzed){stock = stock + 1;}
+        var priceDiv = cardNB.getElementsByClassName('Price')[0];
+        if (priceDiv){priceDiv.innerText = "Price: " + price;}
         else{
             let qty = document.createElement('div');
             qty.classList.add('Price');
-            qty.innerText = "Price: " + clist[cardNum];
+            qty.innerText = "Price: " + price;
             cardNB.appendChild(qty);
         }
-    }else{
+    }catch(err){stock=0;}}else{
         stock=0;
     }
     if (stock<2){
         cards.item(i).style.setProperty('Display','None');
     }
+    if (price<4){
+        cards.item(i).style.setProperty('Display','None');
+    }
 }
 ```