content.write("];\n const searchstring = document.getElementById('cardinput').value;\n const dupesarray = searchstring.replaceAll('','').replaceAll('\\n',',').replaceAll('\\r',',').toLowerCase().split(',');\n const searcharray = [ ...new Set(dupesarray) ];\n const hpwfound = [];\n const mpwfound = [];\n const lpwfound = [];\n const hptfound = [];\n const mptfound = [];\n const lptfound = [];\n for (const element of searcharray) {\n let cardend = element.substring(element.length, element.length - 2);\n if (!(thecards.includes(cardend))) {\n for (const ending of thecards) {\n searcharray.push(element + ending);\n };\n };\n };\n for (const element of searcharray) {\n if (hpw.includes(element)) {\n hpwfound.push(element);\n };\n if (mpw.includes(element)) {\n mpwfound.push(element);\n };\n if (lpw.includes(element)) {\n lpwfound.push(element);\n };\n if (hpt.includes(element)) {\n hptfound.push(element);\n };\n if (mpt.includes(element)) {\n mptfound.push(element);\n };\n if (lpt.includes(element)) {\n lptfound.push(element);\n };\n };\n if ((hpwfound.length) > 0) {\n document.getElementById('hpwfound').innerHTML = '<span class=\"sorttitle\">Wanted (high priority):</span> <span class=\"searchresults\">' + hpwfound.join(', ') + '</span>';\n } else {\n document.getElementById('hpwfound').innerHTML = '';\n };\n if ((mpwfound.length) > 0) {\n document.getElementById('mpwfound').innerHTML = '<span class=\"sorttitle\">Wanted (medium priority):</span> <span class=\"searchresults\">' + mpwfound.join(', ') + '</span>';\n } else {\n document.getElementById('mpwfound').innerHTML = '';\n };\n if ((lpwfound.length) > 0) {\n document.getElementById('lpwfound').innerHTML = '<span class=\"sorttitle\">Wanted (low priority):</span> <span class=\"searchresults\">' + lpwfound.join(', ') + '</span>';\n } else {\n document.getElementById('lpwfound').innerHTML = '';\n };")
ifvariables.trademedium:
content.write("\n if ((hptfound.length) > 0) {\n document.getElementById('hptfound').innerHTML = '<span class=\"sorttitle\">Will trade out for <a href=\"")
content.write("\n if ((mptfound.length) > 0) {\n document.getElementById('mptfound').innerHTML = '<span class=\"sorttitle\">Will trade out for <a href=\"")
iflen(variables.subfolder)>0:
content.write("/"+variables.subfolder)
content.write("/wanted\">high or medium priority cards</a>:</span> <span class=\"searchresults\">' + mptfound.join(', ') + '</span>';\n } else {\n document.getElementById('mptfound').innerHTML = '';\n };\n if ((lptfound.length) > 0) {\n document.getElementById('lptfound').innerHTML = '<span class=\"sorttitle\">Will trade out for <a href=\"")