2c2 < // Help out input_col_multiple.htm with input type=color pseudo "multiple" attribute control of body element background linear gradient --- > // Help out input_col_multiple.html with input type=color pseudo "multiple" attribute control of body element background linear gradient 8,18c8 < var inplay=0; < var elsel=null; < var elitext=null; < var optionvalmultiple=null; < var optionsuffix=' (but you took too long to select)'; < var dcclick=false; < var willingtotryupto=55; < var documentbody=document.body; < var linear_gradient_part=''; < < var iohuh=''; // if iohuh contains ")," linear gradients will be observed, rather than simple one colour arrangements --- > var iohuh=''; 21,50d10 < function lessinplay() { < if (iohuh.indexOf('),') == -1) { < inplay--; < if (eval('' + inplay) <= 0) { < iohuh=''; < documentbody.style.background=''; < documentbody.style.backgroundColor='white'; < if ((optionvalmultiple ? optionvalmultiple : elsel)) { < if ((optionvalmultiple ? optionvalmultiple : elsel).innerHTML.indexOf(')') == -1) { < iohuh=' '; < if (optionvalmultiple) { < optionvalmultiple.innerHTML+=optionsuffix; < } else { < elsel.innerHTML=elsel.innerHTML.replace('', optionsuffix + ''); < } < } < } < } < } else if ((optionvalmultiple ? optionvalmultiple : elsel)) { < if ((optionvalmultiple ? optionvalmultiple : elsel).innerHTML.indexOf(')') != -1) { < iohuh+=' '; < if (optionvalmultiple) { < optionvalmultiple.innerHTML=optionvalmultiple.innerHTML.replace(optionsuffix, ''); < } else { < elsel.innerHTML=elsel.innerHTML.replace(optionsuffix + '', ''); < } < } < } < } < 52d11 < if (iohuh == iohuh.trim()) { 57,58c16,17 < var huhbackis=('' + documentbody.style.backgroundColor).replace(/^null$/g,''); < if (huhbackis == '') { huhbackis=('' + documentbody.style.backgroundImage).replace(/^null$/g,''); } --- > var huhbackis=('' + document.body.style.backgroundColor).replace(/^null$/g,''); > if (huhbackis == '') { huhbackis=('' + document.body.style.backgroundImage).replace(/^null$/g,''); } 60,61c19 < if (huhbackis.indexOf('linear-gradient') == -1 && documentbody.outerHTML.indexOf('linear-gradient(') != -1) { < if (documentbody == document.body) { --- > if (huhbackis.indexOf('linear-gradient') == -1 && document.body.outerHTML.indexOf('linear-gradient(') != -1) { 63,70c21,24 < } else { < huhbackis=iohuh.replace('linear-gradient(rgb','linear-gradient(to right,rgb'); < } < } < if (huhbackis.indexOf('linear-gradient') == -1 || eval('' + inplay) <= 0) { < dcclick=false; < documentbody.style.backgroundColor=''; < documentbody.style.background='linear-gradient(' + linear_gradient_part + hex2dec(incol.replace(',',''), 0.5) + ',' + hex2dec(('#ffffff').replace(',',''), 0.5) + ')'; --- > } > if (huhbackis.indexOf('linear-gradient') == -1) { > document.body.style.backgroundColor=''; > document.body.style.background='linear-gradient(' + hex2dec(incol.replace(',',''), 0.5) + ',' + hex2dec(('#ffffff').replace(',',''), 0.5) + ')'; 73,86c27,28 < inplay++; < setTimeout(lessinplay, 20000); < //console.log(hex2dec(incol.replace(',',''), 0.5) + ' ... ' + huhbackis + ' ... ' + documentbody.style.backgroundImage + ' +++ ' + 'linear-gradient(' + hex2dec(incol.replace(',',''), 0.5) + ',' + hex2dec(incol.replace(',',''), 0.5) + ');'); < if ((optionvalmultiple ? optionvalmultiple : elsel)) { < if ((optionvalmultiple ? optionvalmultiple : elsel).innerHTML.indexOf(')') != -1) { < iohuh+=' '; < iocolclicks=1; < if (optionvalmultiple) { < optionvalmultiple.innerHTML=optionvalmultiple.innerHTML.replace(optionsuffix, ''); < } else { < elsel.innerHTML=elsel.innerHTML.replace(optionsuffix + '', ''); < } < } < } --- > //alert(iohuh); > console.log(hex2dec(incol.replace(',',''), 0.5) + ' ... ' + huhbackis + ' ... ' + document.body.style.backgroundImage + ' +++ ' + 'linear-gradient(' + hex2dec(incol.replace(',',''), 0.5) + ',' + hex2dec(incol.replace(',',''), 0.5) + ');'); 88,131c30,33 < dcclick=false; < documentbody.style.backgroundImage=(huhbackis.split('))')[0] + '))').replace('))', '),' + hex2dec(incol.replace(',',''), 0.5) + ')'); < iohuh=(huhbackis.split('))')[0].replace('to right,','') + '))').replace('))', '),' + hex2dec(incol.replace(',',''), 0.5) + ')'); < inplay++; < setTimeout(lessinplay, 20000); < //console.log(hex2dec(incol.replace(',',''), 0.5) + ' .+. ' + iohuh + ' ... ' + documentbody.style.backgroundImage + ' +++ ' + 'linear-gradient(' + hex2dec(incol.replace(',',''), 0.5) + ',' + hex2dec(incol.replace(',',''), 0.5) + ');'); < if ((optionvalmultiple ? optionvalmultiple : elsel)) { < if ((optionvalmultiple ? optionvalmultiple : elsel).innerHTML.indexOf(')') != -1) { < iohuh+=' '; < iocolclicks=1; < if (optionvalmultiple) { < optionvalmultiple.innerHTML=optionvalmultiple.innerHTML.replace(optionsuffix, ''); < } else { < elsel.innerHTML=elsel.innerHTML.replace(optionsuffix + '', ''); < } < } < } < } else if (huhbackis.indexOf(')') != -1) { < if (!dcclick) { < dcclick=true; < } else { < //document.title='' + iocolclicks; < dcclick=false; < documentbody.style.backgroundColor=''; < documentbody.style.background='linear-gradient(' + linear_gradient_part + hex2dec(incol.replace(',',''), 0.5) + ',' + hex2dec(('#ffffff').replace(',',''), 0.5) + ')'; < iocoldelim=','; < iohuh='linear-gradient(' + hex2dec(incol.replace(',',''), 0.5) + ')'; < inplay++; < setTimeout(lessinplay, 20000); < //console.log(hex2dec(incol.replace(',',''), 0.5) + ' ... ' + huhbackis + ' ... ' + documentbody.style.backgroundImage + ' +++ ' + 'linear-gradient(' + hex2dec(incol.replace(',',''), 0.5) + ',' + hex2dec(incol.replace(',',''), 0.5) + ');'); < if ((optionvalmultiple ? optionvalmultiple : elsel)) { < if ((optionvalmultiple ? optionvalmultiple : elsel).innerHTML.indexOf(')') != -1) { < iohuh+=' '; < iocolclicks=1; < if (optionvalmultiple) { < optionvalmultiple.innerHTML=optionvalmultiple.innerHTML.replace(optionsuffix, ''); < } else { < elsel.innerHTML=elsel.innerHTML.replace(optionsuffix + '', ''); < } < } < } < } < } else { < dcclick=false; --- > document.body.style.backgroundImage=(huhbackis.split('))')[0] + '))').replace('))', '),' + hex2dec(incol.replace(',',''), 0.5) + ')'); > iohuh=(huhbackis.split('))')[0] + '))').replace('))', '),' + hex2dec(incol.replace(',',''), 0.5) + ')'); > //alert(iohuh); > console.log(hex2dec(incol.replace(',',''), 0.5) + ' .+. ' + iohuh + ' ... ' + document.body.style.backgroundImage + ' +++ ' + 'linear-gradient(' + hex2dec(incol.replace(',',''), 0.5) + ',' + hex2dec(incol.replace(',',''), 0.5) + ');'); 134,137d35 < } else { < iocolclicks=1; < } < iohuh=iohuh.trim(); 173c71 < if (elitext) { elitext.focus(); } --- > //document.getElementById('ootw').focus(); 194,238c92,93 < var el=document.querySelector("input[type='color']"); < if (!el && eval('' + willingtotryupto) > 0) { < willingtotryupto--; < setTimeout(onl, 1000); < return; < } < if (document.getElementById('mycolour') && el) { < documentbody=document.getElementById('mycolour'); < document.getElementById('mycolour').title=('' + document.getElementById('mycolour').title + ' ') + ' (negative opacity value here stops Linear Gradient mode). Multiple selections with colour picker within 20 seconds signify a linear gradient stroke (as relevant)'; < el.title=('' + el.title + ' ') + 'Multiple selections of this colour picker within 20 seconds signify a linear gradient stroke (as relevant)'; < linear_gradient_part='to right,'; < iomultiple='multiple'; < willingtotryupto=555; < } else { < documentbody=document.body; < } < elitext=document.querySelector("input[type='text']"); < optionvalmultiple=document.querySelector("option[value='multiple']"); < if (!optionvalmultiple && iomultiple == '') { iomultiple='multiple'; } < if (el) { < if (!el.onclick) { < el.addEventListener('click', function(event) { checkformultiple(event.target); }); < } else if (('' + el.onclick).indexOf('checkformultiple') == -1) { < el.addEventListener('click', function(event) { checkformultiple(event.target); }); < } < if (!el.onblur) { < el.addEventListener('blur', function(event) { finalchoice(event.target); }); < } else if (('' + el.onblur).indexOf('finalchoice') == -1) { < el.addEventListener('blur', function(event) { finalchoice(event.target); }); < } < if (!el.onchange) { < el.addEventListener('change', function(event) { finalchoice(event.target); }); < } else if (('' + el.onchange).indexOf('finalchoice') == -1) { < el.addEventListener('change', function(event) { finalchoice(event.target); }); < } < } < var elsels=document.querySelectorAll("select"); < if (elsels.length > 0) { < for (var iko=0; iko var elsel=document.querySelector("select"); > if (elsel) { if (('' + elsel.id) == '') { iomultiple='' + elsel.value; } else { sel(('' + elsel.id)); } }