-
-
Save mitchthorson/81cae455779b7dd4810343c2698e2800 to your computer and use it in GitHub Desktop.
Copy existing and select static web sites.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Get site selection */ | |
var sites = document.getElementById('id_sites').querySelectorAll('option'); | |
selected_values = []; | |
for (var i=0; i<sites.length; i+=1) { | |
var site = sites[i]; | |
if (site.selected === true) { | |
selected_values.push(site.value); | |
} | |
} | |
console.log('[' + selected_values.toString() + ']'); | |
/* | |
Make site selection | |
Update sites_values if need be | |
*/ | |
var sites = document.getElementById('id_sites').querySelectorAll('option'), | |
sites_values = [152,59,48,38,111,56,147,114,42,184,136,115,39,25,63,64,182,116,27,24,178,153,83,156,91,188,28,52,154,2,23,60,137,146,125,155,171,149,166,150,69,161,30,58,139,162,151,143,185,51,70,26,50,82,134,81,72,180,3,163,87,124,33,173,187,181,118,112,62,157,164,80,61,119,138,120,73,35,85,176,121,34,44,66,204,71,110,45,122,67,46,93,86,165,175,144,183,36,158,159,49,75,92,160,88,31,76,47,177,32,29,55,53,179,148,108,117,90,74,54,68,113,89,186,172,8,174,84,77,78,168,167,123] | |
for (var i=0; i<sites.length; i+=1) { | |
var site = sites[i]; | |
if (sites_values.indexOf(parseInt(site.value)) !== -1) { | |
site.selected = true; | |
} | |
else { | |
site.selected = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment