aboutsummaryrefslogtreecommitdiff
path: root/petrichor.js
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 /petrichor.js
parent0d9affe79d1557baedf010411799abdc1734773e (diff)
downloadpetrichor-fc50092d41e7d639eb6780521bd1562e266b1cfb.tar.xz
Throw out old crusty code that used document.write
Diffstat (limited to 'petrichor.js')
-rw-r--r--petrichor.js13
1 files changed, 7 insertions, 6 deletions
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)