ソースを参照

Rearange Javascript stub order

Mike Greene 7 ヶ月 前
コミット
20c83a3655
1 ファイル変更38 行追加38 行削除
  1. 38 38
      README.md

+ 38 - 38
README.md

@@ -141,6 +141,44 @@ for (var i = 0; i < cards.length; i++) {
 ```
 
 
+##### javascript to show number cards for sale
+```javascript
+numForSale=[];
+for (var i = 0; i < 153; i++) {numForSale.push(0);}
+let marketSelling = document.createElement('div');
+marketSelling.id = 'market';
+marketSelling.innerHTML=await (await fetch('https://play.boobylegends.com/market/?tab=selling')).text();
+marketCards=marketSelling.getElementsByClassName('wrapper-market-card');
+for (var i = 0; i < marketCards.length; i++) {
+    try{
+    cardNum = parseInt(marketCards.item(i).getElementsByClassName('pornstar-number')[0].innerText);
+    price = parseInt(marketCards.item(i).getElementsByClassName('cost')[0].innerText.trim());
+    numForSale[cardNum]=numForSale[cardNum]+1;
+    }catch(err){console.log('error on '+cardNum.toString());}
+};
+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);
+    if (numForSale[cardNum] > 0){
+        HTMLText = " +" + numForSale[cardNum];
+    }else{HTMLText=""}
+    var cardNB = cards.item(i).getElementsByClassName('card-nb')[0];
+    if (cardNB){try{
+        var priceDiv = cardNB.getElementsByClassName('Price')[0];
+        if (priceDiv){priceDiv.innerText = HTMLText;}
+        else{
+            let qty = document.createElement('div');
+            qty.classList.add('Price');
+            qty.innerText = HTMLText;
+            cardNB.appendChild(qty);
+        }
+    }catch(err){stock=0;}}else{
+        stock=0;
+    }
+}
+```
+
 #### Market Page
 
 ##### javascript to filter Market for needed cards
@@ -258,44 +296,6 @@ for (var i = 0; i < cards.length; i++) {
 }
 ```
 
-##### javascript to show number cards for sale
-```javascript
-numForSale=[];
-for (var i = 0; i < 153; i++) {numForSale.push(0);}
-let marketSelling = document.createElement('div');
-marketSelling.id = 'market';
-marketSelling.innerHTML=await (await fetch('https://play.boobylegends.com/market/?tab=selling')).text();
-marketCards=marketSelling.getElementsByClassName('wrapper-market-card');
-for (var i = 0; i < marketCards.length; i++) {
-    try{
-    cardNum = parseInt(marketCards.item(i).getElementsByClassName('pornstar-number')[0].innerText);
-    price = parseInt(marketCards.item(i).getElementsByClassName('cost')[0].innerText.trim());
-    numForSale[cardNum]=numForSale[cardNum]+1;
-    }catch(err){console.log('error on '+cardNum.toString());}
-};
-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);
-    if (numForSale[cardNum] > 0){
-        HTMLText = " +" + numForSale[cardNum];
-    }else{HTMLText=""}
-    var cardNB = cards.item(i).getElementsByClassName('card-nb')[0];
-    if (cardNB){try{
-        var priceDiv = cardNB.getElementsByClassName('Price')[0];
-        if (priceDiv){priceDiv.innerText = HTMLText;}
-        else{
-            let qty = document.createElement('div');
-            qty.classList.add('Price');
-            qty.innerText = HTMLText;
-            cardNB.appendChild(qty);
-        }
-    }catch(err){stock=0;}}else{
-        stock=0;
-    }
-}
-```
-
 #### Market Selling Page
 
 ##### javascript to show overbid cards for sale