aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <dbphillipsnz@gmail.com>2016-03-06 16:34:20 +1300
committerDavid Phillips <dbphillipsnz@gmail.com>2016-03-06 16:47:24 +1300
commit793d39323efb578a15bfe9b2d979274b6290e1ed (patch)
tree28dbe4e8aa8d41e32dc138b51181528cf8a44106
parent53c4afe792b0c72dafc7df06c9fc5b5cd3dd4c9b (diff)
downloadpetrichor-793d39323efb578a15bfe9b2d979274b6290e1ed.tar.xz
Underscores suck
-rw-r--r--index.html14
-rw-r--r--petrichor.css18
-rw-r--r--petrichor.js32
3 files changed, 32 insertions, 32 deletions
diff --git a/index.html b/index.html
index 067f8ed..5fa7934 100644
--- a/index.html
+++ b/index.html
@@ -11,16 +11,16 @@
<div id="date"></div>
<div id="time"></div>
</div>
- <div id="password_container">
+ <div id="password-container">
<form action="javascript:provide_secret()">
- <span id="password_label"></span>
- <input id="password_entry" type="password" />
+ <span id="password-label"></span>
+ <input id="password-entry" type="password" />
</form>
</div>
- <div id="message_container">
- <span id="message_label"></span>
+ <div id="message-container">
+ <span id="message-label"></span>
</div>
- <select id="session_list" class="ease_opacity"></select>
- <img id="shutdown" class="ease_opacity" src="iec5009.svg" onclick="lightdm.shutdown();" />
+ <select id="session-list" class="ease-opacity"></select>
+ <img id="shutdown" class="ease-opacity" src="iec5009.svg" onclick="lightdm.shutdown();" />
</body>
</html>
diff --git a/petrichor.css b/petrichor.css
index 1cb9696..72d1b6e 100644
--- a/petrichor.css
+++ b/petrichor.css
@@ -13,7 +13,7 @@ body,html
width: 100%;
}
-.ease_opacity
+.ease-opacity
{
transition: opacity ease 0.3s;
}
@@ -67,7 +67,7 @@ a.user
display: block;
}
-#password_prompt, #password_entry
+#password-prompt, #password-entry
{
display: block;
font-size: 20px;
@@ -80,12 +80,12 @@ a.user
left: 50px;
}
-#message_container
+#message-container
{
font-size: 20px;
}
-#password_entry
+#password-entry
{
color: #333;
opacity: inherit;
@@ -95,7 +95,7 @@ a.user
border-radius: 5px;
}
-#message_container, #password_container
+#message-container, #password-container
{
height: 96px;
display: table;
@@ -106,14 +106,14 @@ a.user
transition: visibility 0s linear 0.15s, opacity 0.15s linear;
}
-#password_container.shown, #message_container.shown
+#password-container.shown, #message-container.shown
{
visibility: visible;
opacity: 1;
transition: opacity 0.15s linear 0.05s;
}
-#message_label, #password_container > form
+#message-label, #password-container > form
{
display: table-cell;
vertical-align: middle;
@@ -139,7 +139,7 @@ a.user
font-size: 240px;
}
-#session_list
+#session-list
{
font-family: inherit;
position: absolute;
@@ -156,7 +156,7 @@ a.user
-moz-appearance: none; /* only for when testing */
}
-#session_list:hover
+#session-list:hover
{
opacity: 1;
}
diff --git a/petrichor.js b/petrichor.js
index f56d450..b5e06ed 100644
--- a/petrichor.js
+++ b/petrichor.js
@@ -5,23 +5,23 @@ time_remaining = 0
function show_prompt(text, type)
{
password_prompt = true;
- label = document.getElementById('password_label');
+ label = document.getElementById('password-label');
label.innerHTML = text;
users = document.getElementById('users');
for (i in users.children)
{
user = users.children[i];
- if (user.id != ('user_' + selected_user) && user.style != null)
+ if (user.id != ('user-' + selected_user) && user.style != null)
user.style.opacity = 0.1;
}
- entry = document.getElementById('password_entry');
+ entry = document.getElementById('password-entry');
entry.value = '';
- var selected = document.getElementById("user_" + selected_user);
+ var selected = document.getElementById("user-" + selected_user);
rect = selected.getBoundingClientRect();
- cont = document.getElementById('password_container');
+ cont = document.getElementById('password-container');
cont.style.top = rect.top;
if (cont.style.left != rect.right)
@@ -33,12 +33,12 @@ function show_prompt(text, type)
function show_message(text, type)
{
- cont = document.getElementById('message_container');
- document.getElementById('message_label').innerHTML = text;
+ cont = document.getElementById('message-container');
+ document.getElementById('message-label').innerHTML = text;
if (text.length > 0)
{
- var selected = document.getElementById("user_" + selected_user);
+ var selected = document.getElementById("user-" + selected_user);
rect = selected.getBoundingClientRect();
cont.style.top = rect.top;
@@ -60,13 +60,13 @@ function reset()
if (child.style != null)
child.style.opacity = 1;
}
- document.getElementById('password_container').classList.remove("shown");
+ document.getElementById('password-container').classList.remove("shown");
password_prompt = false;
}
function authentication_complete()
{
- sel = document.getElementById('session_list');
+ sel = document.getElementById('session-list');
session = sel.options[sel.selectedIndex].getAttribute('data-sid');
if (lightdm.is_authenticated)
lightdm.start_session_sync(lightdm.authentication_user, session);
@@ -78,7 +78,7 @@ function authentication_complete()
function start_authentication(username)
{
- document.getElementById('message_container').classList.remove("shown");
+ document.getElementById('message-container').classList.remove("shown");
if (!password_prompt) {
selected_user = username;
@@ -88,7 +88,7 @@ function start_authentication(username)
function provide_secret()
{
- entry = document.getElementById('password_entry');
+ entry = document.getElementById('password-entry');
lightdm.respond(entry.value);
}
@@ -99,7 +99,7 @@ function autologin_timer_expired(username)
function countdown()
{
- label = document.getElementById('countdown_label');
+ label = document.getElementById('countdown-label');
label.innerHTML = ' in ' + time_remaining + ' seconds';
time_remaining--;
if (time_remaining >= 0)
@@ -108,7 +108,7 @@ function countdown()
function build_session_list()
{
- slist = document.getElementById('session_list');
+ slist = document.getElementById('session-list');
slist.innerHTML = "";
for (session of lightdm.sessions)
{
@@ -145,11 +145,11 @@ function start()
else
image = user.image;
- document.write('<a href="#" class="user" id="user_' + user.name +'" onclick="start_authentication(\'' + user.name + '\')">');
+ 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>');
if (user.name == lightdm.autologin_user && lightdm.autologin_timeout > 0)
- document.write('<span id="countdown_label"></span>');
+ document.write('<span id="countdown-label"></span>');
document.write('</a>');
}