fix(index.html): minor variable optimisation

This commit is contained in:
yanas 2016-12-13 18:43:45 -06:00
parent c5cacd7955
commit 2785e76e23
1 changed files with 7 additions and 4 deletions

View File

@ -61,6 +61,9 @@
if (isNaN(delay) || delay < 2000 || delay > 60000) if (isNaN(delay) || delay < 2000 || delay > 60000)
delay = 10000; delay = 10000;
var showMoreText = "show more";
var showLessText = "show less";
document.body.innerHTML document.body.innerHTML
= "<div style='" = "<div style='"
+ "position: absolute;top: 50%;left: 50%;" + "position: absolute;top: 50%;left: 50%;"
@ -78,7 +81,7 @@
+ "<a id='showMore' style='" + "<a id='showMore' style='"
+ "text-decoration: underline;" + "text-decoration: underline;"
+ "font-size:small;" + "font-size:small;"
+ "cursor: pointer'>show more</a>" + "cursor: pointer'>" + showMoreText + "</a>"
+ "&nbsp;&nbsp;&nbsp;" + "&nbsp;&nbsp;&nbsp;"
+ "<a href='" + href + "' style='" + "<a href='" + href + "' style='"
+ "text-decoration: underline;" + "text-decoration: underline;"
@ -91,19 +94,19 @@
var moreInfoElem var moreInfoElem
= document.getElementById("moreInfo"); = document.getElementById("moreInfo");
if (showMoreElem.innerHTML === "show more") { if (showMoreElem.innerHTML === showMoreText) {
moreInfoElem.setAttribute( moreInfoElem.setAttribute(
"style", "style",
"display: block;" "display: block;"
+ "color:#FF991F;" + "color:#FF991F;"
+ "font-size:small;" + "font-size:small;"
+ "user-select:text;"); + "user-select:text;");
showMoreElem.innerHTML = "show less"; showMoreElem.innerHTML = showLessText;
} }
else { else {
moreInfoElem.setAttribute( moreInfoElem.setAttribute(
"style", "display: none;"); "style", "display: none;");
showMoreElem.innerHTML = "show more"; showMoreElem.innerHTML = showMoreText;
} }
}); });