aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-05-11 15:25:50 +1200
committerDavid Phillips <david@sighup.nz>2017-05-11 15:25:50 +1200
commitfc50092d41e7d639eb6780521bd1562e266b1cfb (patch)
tree09d41aa51bb831e71e60bd1853a2d6f7230953ad
parent0d9affe79d1557baedf010411799abdc1734773e (diff)
downloadpetrichor-fc50092d41e7d639eb6780521bd1562e266b1cfb.tar.xz
Throw out old crusty code that used document.write
-rw-r--r--index.html1
-rw-r--r--petrichor.js13
2 files changed, 8 insertions, 6 deletions
diff --git a/index.html b/index.html
index 9eb88d2..af5bf0e 100644
--- a/index.html
+++ b/index.html
@@ -42,6 +42,7 @@
</li>
</ul>
</div>
+ <div id="users"></div>
<select id="session-list" class="ease-opacity"></select>
<img id="shutdown" class="ease-opacity" src="image/iec5009.svg" onclick="show_element('power-confirm');show_element('mask');" />
</body>
diff --git a/petrichor.js b/petrichor.js
index bcb14d6..04b12dd 100644
--- a/petrichor.js
+++ b/petrichor.js
@@ -145,7 +145,7 @@ function update_time()
function start()
{
- document.write('<div id="users">');
+ var html = "";
for (i in lightdm.users)
{
user = lightdm.users[i];
@@ -155,15 +155,16 @@ function start()
else
image = user.image;
- document.write('<a href="#" class="user" id="user-' + user.name +'" onclick="start_authentication(\'' + user.name + '\')">');
- document.write('<img class="avatar" src="file:///' + image + '" /><span class="name">'+user.display_name+'</span>');
+ html += '<a href="#" class="user" id="user-' + user.name +'" onclick="start_authentication(\'' + user.name + '\')">';
+ html += '<img class="avatar" src="file:///' + image + '" /><span class="name">'+user.display_name+'</span>';
if (user.name == lightdm.autologin_user && lightdm.autologin_timeout > 0)
- document.write('<span id="countdown-label"></span>');
+ html += '<span id="countdown-label"></span>';
- document.write('</a>');
+ html += '</a>';
}
- document.write('</div>');
+
+ document.getElementById('users').innerHTML = html;
time_remaining = lightdm.autologin_timeout;
if (time_remaining > 0)