Changeset 2733313
- Timestamp:
- 05/29/2022 04:10:08 AM (4 years ago)
- Location:
- wp-lightning-comments/trunk
- Files:
-
- 2 edited
-
lightningcomments.js (modified) (8 diffs)
-
lightningcomments.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-lightning-comments/trunk/lightningcomments.js
r2732965 r2733313 1 1 document.addEventListener('DOMContentLoaded', function(){ 2 2 var LightningComments = 'lncomments'; 3 4 // // check localStorage if user previously paid and set the hidden value 5 // var correctId = LightningComments + location.pathname + questions.map(function(q){return q.correct}).join(''); 6 // if(localStorage.getItem(correctId) === correctId){ 7 // var fool = document.getElementById("pmg_comment_titlez"); 8 // fool.value = "youreok"; 9 // } 3 10 4 11 var parseQuiz = function(str){ … … 12 19 quizNode.style.height = '0px'; 13 20 14 console.log("removequiz setTimeout");21 // console.log("removequiz setTimeout"); 15 22 quizNode.style.display = 'none'; 16 23 formNode.style.height = 'auto'; … … 25 32 formNode.style.height = formNode.scrollHeight + 'px'; 26 33 quizNode.style.height = '0px'; 27 console.log("inside removequiz");34 // console.log("inside removequiz"); 28 35 setTimeout(function(){ 29 36 console.log("removequiz setTimeout"); … … 54 61 55 62 if(localStorage.getItem(correctId) === correctId){ //Skip quiz if already solved 63 var fool = document.getElementById("pmg_comment_titlez"); 64 fool.value = "youreok"; 56 65 return quizNode.parentNode.removeChild(quizNode); 57 66 } … … 86 95 87 96 let invoice; 88 const invoiceCheckInterval = 20000;97 const invoiceCheckInterval = 5000; 89 98 90 99 var invoiceDiv = document.createElement('div'); … … 129 138 if(paid?.paid) { 130 139 localStorage.setItem(correctId, correctId); 140 var fool = document.getElementById("pmg_comment_titlez"); 141 fool.value = "youreok"; 131 142 setTimeout(removeQuizDelay, 2500, quizNode, formNode); 132 143 clearInterval(interval) … … 147 158 }) 148 159 invoice = await invoiceResponse.json() 149 console.log('notinvoice ', invoice)160 // console.log('notinvoice ', invoice) 150 161 const actualInvoiceResponse = await fetch(`${btcpayserverUrl}/api/v1/stores/${btcpayserverStoreId}/invoices/${invoice.id}/payment-methods`, 151 162 { … … 174 185 if(paid?.status === 'Settled') { 175 186 localStorage.setItem(correctId, correctId); 187 var fool = document.getElementById("pmg_comment_titlez"); 188 fool.value = "youreok"; 176 189 setTimeout(removeQuizDelay, 2500, quizNode, formNode); 177 190 clearInterval(interval) -
wp-lightning-comments/trunk/lightningcomments.php
r2732965 r2733313 2 2 /* 3 3 Plugin Name: Pay to Comment with Lightning 4 Version: 0.2. 04 Version: 0.2.1 5 5 Plugin URI: https://wordpress.org/plugins/wp-lightning-comments/ 6 6 Author: @citlayik
Note: See TracChangeset
for help on using the changeset viewer.