Saturday, March 18, 2017

get the new list

get the old list    get the new list
paste in the old list and click get the old list to load it, then paste in the new list and click get the new list
*
<div id="sns20170318sa1022o" style="color:goldenrod;font-size:1.5em"></div>

<textarea id="sns20170318sa1022i"></textarea>

<a href="javascript:sns20170318sa1022('get the old list')" style="color:greenyellow;font-size:1.5em">get the old list</a>&nbsp;&nbsp;&nbsp;

<a href="javascript:sns20170318sa1022('get the new list')" style="color:greenyellow;font-size:1.5em">get the new list</a>

<div style="color:burlywood;font-size:.75em">paste in the old list and click get the old list to load it, then paste in the new list and click get the new list</div>

<div id="sns20170318sa1022n" style="color:violet;font-size:1.5em"></div>

<script>

function sns20170318sa1022(request) {
var thenewlistdisplay = document.getElementById("sns20170318sa1022n")
function gettheoldlist() {
var theoldlist = document.getElementById("sns20170318sa1022i")
var theoldliststore = document.getElementById("sns20170318sa1022o")
theoldliststore.innerHTML = theoldlist.value}
if (request === "get the old list") {gettheoldlist()}
function getthenewlist() {
var theoldlist = document.getElementById("sns20170318sa1022o")
var theoldlistarray = theoldlist.innerHTML.split(",")
var thenewlist = document.getElementById("sns20170318sa1022i")
var thenewlistarray = newlist.value.split("\n")
function symbol(listing) {return listing.split('","')[0].split('"')[1]}
function isitonthelist(it,thelist) {
for var (i = 0; i < thelist.length; i = i + 1) {
if (thelist[i] === it) {return "yes it is on the list"}}
return "no it is not on the list"}
var thenewsymbols = []
for var (i = 0; i < newlistarray.length; i = i + 1) {
var thesymbol = symbol(newlistarray[i])
if (isitonthelist(thesymbol,theoldlistarray) === "yes it is on the list") {thenewsymbols.push(thesymbol)}}
if (thenewsymbols.length === 0) {thenewlistdisplay.innerHTML = "there are no new symbols"}
else {thenewlistdisplay.innerHTML = "there are new symbols: " + thenewsymbols.toString()}}
if (request === "get the new list") {getthenewlist()}
}

</script>
*

No comments:

Post a Comment