1,956
edits
No edit summary |
(Disabled the [hide heading summaries after putting them in the considerations table] functionality.) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 312: | Line 312: | ||
str += e[i].innerHTML; | str += e[i].innerHTML; | ||
str += "</td></tr>"; | str += "</td></tr>"; | ||
e[i].style.display = "none"; | //e[i].style.display = "none"; | ||
} | } | ||
str += "</table>"; | str += "</table>"; | ||
Line 331: | Line 331: | ||
for (var j=0; j<lines.length; j++) { | for (var j=0; j<lines.length; j++) { | ||
var n=0; while (lines[j][n]==' ') n++; | var n=0; while (lines[j][n]==' ') n++; | ||
var k = Math.exp(-0.16*n); | var k = Math.exp(-0.16*n); | ||
str += "<div style='font-size:"+(1.4*size*k+6)+"px; margin-left:"+(size*(n*0.5 + 12-12*k))+"px; font-family:"+ | str += "<div style='font-size:" +(1.4*size*k+6) | ||
+"px; margin-left:"+(size*(n*0.5 + 12-12*k)) | |||
+"px; font-family:"+((n%2)?"serif":"sans") | |||
+ "; color:RGB(0,"+(255-255*k)+",0)" | |||
+ "; padding:0.15em 0; line-height:1.1em'>" | |||
+(lines[j].substr(n) || (j==lines.length-1 ? "":" "))+"</div>"; | |||
} | } | ||
e[i].innerHTML = str; | e[i].innerHTML = str; | ||
Line 345: | Line 349: | ||
function changeWords(ev) { // to next option | function changeWords(ev) { // to next option | ||
var hide = ev.currentTarget; | var hide = ev.currentTarget; | ||
if(!hide || !hide.classList.contains(" | if(!hide || !hide.classList.contains("altOuter")) return; | ||
var show = hide.nextElementSibling; | var show = hide.nextElementSibling; | ||
if(!show || !show.classList.contains(" | if(!show || !show.classList.contains("altOuter") || !show.innerHTML) { | ||
var find = hide; | var find = hide; | ||
do { // seek back to the first of list | do { // seek back to the first of list | ||
show = find; | show = find; | ||
find = find.previousElementSibling; | find = find.previousElementSibling; | ||
} while (find && find.classList.contains(" | } while (find && find.classList.contains("altOuter")); | ||
} | } | ||
hide.style.display = "none"; | hide.style.display = "none"; | ||
Line 358: | Line 362: | ||
} | } | ||
function parseWordChangers() { // init | function parseWordChangers() { // init | ||
var e = document.getElementsByClassName(" | var e = document.getElementsByClassName("altOuter"); | ||
for (var i=0; i<e.length; i++) { | for (var i=0; i<e.length; i++) { | ||
var str = e[i].innerHTML; | var str = e[i].innerHTML; | ||
if (str) { | if (str) { | ||
e[i].innerHTML = " | e[i].innerHTML = "↕<span class='altInner'>"+str+"</span>↕"; | ||
e[i].onclick = changeWords; | e[i].onclick = changeWords; | ||
} | } |