~brian-murray/lightdm/bug-967229

« back to all changes in this revision

Viewing changes to themes/webkit/index.html

  • Committer: robert.ancell at canonical
  • Date: 2011-02-12 00:48:57 UTC
  • Revision ID: robert.ancell@canonical.com-20110212004857-45gpv6k0m0uf0liv
Update changelog link

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
<style type="text/css">
 
4
body
 
5
{
 
6
    background-image: url('bg.jpg');
 
7
}
 
8
 
 
9
td
 
10
{
 
11
    font-size: 20px;
 
12
    color: white;
 
13
    verical-align: middle;
 
14
}
 
15
 
 
16
</style>
 
17
<script type="text/javascript">
 
18
 
 
19
password_prompt = false;
 
20
selected_user = null;
 
21
time_remaining = 0
 
22
 
 
23
function show_prompt(text)
 
24
{
 
25
   password_prompt = true;
 
26
 
 
27
   label = document.getElementById('password_prompt');
 
28
   label.innerHTML = text;
 
29
   
 
30
   user_table = document.getElementById('user_table');   
 
31
   for (i in user_table.rows)
 
32
   {
 
33
       row = user_table.rows[i];
 
34
       if (row.id != ('user_' + selected_user) && row.style != null) // FIXME: Don't know why there are rows with styles
 
35
           row.style.opacity = 0.25;
 
36
   }
 
37
 
 
38
   entry = document.getElementById('password_entry');
 
39
   entry.value = '';
 
40
 
 
41
   table = document.getElementById('password_table');
 
42
   table.style.visibility = "visible";
 
43
 
 
44
   entry.focus();
 
45
}
 
46
 
 
47
function show_message(text)
 
48
{
 
49
   table = document.getElementById('message_table');
 
50
   label = document.getElementById('message_label');
 
51
   label.innerHTML = text;
 
52
   if (text.length > 0)
 
53
       table.style.visibility = "visible";
 
54
   else
 
55
       table.style.visibility = "hidden";
 
56
}
 
57
 
 
58
function show_error(text)
 
59
{
 
60
   show_message (text);
 
61
}
 
62
 
 
63
function reset()
 
64
{
 
65
   user_table = document.getElementById('user_table');   
 
66
   for (i in user_table.rows)
 
67
   {
 
68
       row = user_table.rows[i];
 
69
       if (row.style != null) // FIXME: Don't know why there are rows with styles
 
70
           row.style.opacity = 1;
 
71
   }
 
72
   table = document.getElementById('password_table');
 
73
   table.style.visibility = "hidden";
 
74
   password_prompt = false;
 
75
}
 
76
 
 
77
loading_text = ''
 
78
 
 
79
function throbber()
 
80
{
 
81
   loading_text += '.';
 
82
   if (loading_text == '....')
 
83
       loading_text = '.'
 
84
   label = document.getElementById('countdown_label');
 
85
   label.innerHTML = loading_text;
 
86
   setTimeout('throbber()', 1000);
 
87
}
 
88
 
 
89
function authentication_complete()
 
90
{
 
91
   if (lightdm.is_authenticated)
 
92
       lightdm.login (lightdm.authentication_user, lightdm.default_session);
 
93
   else
 
94
       show_message ("Authentication Failed");
 
95
 
 
96
   reset ();
 
97
   setTimeout('throbber()', 1000);
 
98
}
 
99
 
 
100
function timed_login(user)
 
101
{
 
102
   lightdm.login (lightdm.timed_login_user);
 
103
   setTimeout('throbber()', 1000);
 
104
}
 
105
 
 
106
function start_authentication(username)
 
107
{
 
108
   lightdm.cancel_timed_login ();
 
109
   label = document.getElementById('countdown_label');
 
110
   if (label != null)
 
111
       label.style.visibility = "hidden";
 
112
 
 
113
   show_message("");
 
114
   if (!password_prompt) {
 
115
       selected_user = username;
 
116
       lightdm.start_authentication(username);
 
117
   }
 
118
}
 
119
 
 
120
function provide_secret()
 
121
{
 
122
   entry = document.getElementById('password_entry');
 
123
   lightdm.provide_secret(entry.value);
 
124
}
 
125
 
 
126
function countdown()
 
127
{
 
128
   label = document.getElementById('countdown_label');
 
129
   label.innerHTML = ' in ' + time_remaining + ' seconds'
 
130
   time_remaining--;
 
131
   if (time_remaining >= 0)
 
132
       setTimeout('countdown()', 1000);
 
133
}
 
134
 
 
135
document.write('<table id="user_table" style="margin: auto;">');
 
136
for (i in lightdm.users)
 
137
{
 
138
   user = lightdm.users[i];
 
139
 
 
140
   if (user.image.length > 0)
 
141
      image = user.image
 
142
   else
 
143
      image = 'file:///usr/share/icons/gnome/32x32/stock/generic/stock_person.png'
 
144
 
 
145
   document.write('<tr id="user_' + user.name +'"onclick="start_authentication(\'' + user.name + '\')" style="cursor: pointer;">');
 
146
   document.write('<td><img width="48px" height="48px" src="' + image + '" /></td>');
 
147
   document.write('<td>' + user.display_name + '</td>');
 
148
   if (user.name == lightdm.timed_login_user && lightdm.timed_login_delay > 0)
 
149
       document.write('<td id="countdown_label"></td>');
 
150
   document.write('</tr>');
 
151
}
 
152
document.write('</table>');
 
153
document.write('<table id="message_table" style="margin: auto; visibility: hidden;"><td id="message_label"></td></table>');
 
154
document.write('<table id="password_table" style="margin: auto; visibility: hidden; color: red;"><tr>');
 
155
document.write('<td id="password_prompt"></td>');
 
156
document.write('<td><form action="javascript: provide_secret()"><input id="password_entry" type="password" /></form></td>');
 
157
document.write('</tr></table>');
 
158
 
 
159
time_remaining = lightdm.timed_login_delay;
 
160
if (time_remaining > 0)
 
161
    countdown();
 
162
</script>
 
163
</head>
 
164
 
 
165
<body>
 
166
</body>
 
167
 
 
168
</html>