Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Constants
- var AUTHENTICATION_BEGIN_MESSAGE = "Logging in...";
- var AUTHENTICATION_SUCCUESS_MESSAGE = ""; // Should never actually show.
- var AUTHENTICATION_FAILURE_MESSAGE = "Incorrect password";
- var PLACEHOLDER_COLOURS = [
- '#FF6138',
- '#FFFF9D',
- '#BEEB9F',
- '#79BD8F',
- '#00A388',
- ];
- // Globals
- var authenticating = false;
- var activeUser = null;
- var activeSession = null;
- var availableUsers = [];
- var availableSessions = [];
- /**
- * Gets the list of available users from lightdm and fills out the #user-list
- * element with them. Records the elements created for each user in the
- * availableUsers array.
- */
- function generateUserList() {
- var userList = $('#user-list');
- for (var i in lightdm.users) {
- var user = lightdm.users[i];
- var userListEntry = $('<div />', {
- class: 'user'
- });
- userListEntry.data('user', user);
- // Add an image to represent the user. If no .face image is available,
- // use a colour from the palette.
- var userImage = $('<div />', {
- class: 'bubble'
- });
- // Set the background colour regardless since the user.image path might
- // be invalid.
- userImage.css({
- backgroundColor: PLACEHOLDER_COLOURS[i % PLACEHOLDER_COLOURS.length]
- });
- if (user.image.length > 0) { //LINE 46 ERR
- userImage.css({
- 'background-image': 'url(' + user.image + ')'
- });
- }
- userImage.appendTo(userListEntry);
- // Add the user's full name if it's specified, otherwise fallback to
- // using just their username.
- var username = $('<div />', {
- class: 'user-name'
- });
- if (user.display_name.length > 0) {
- username.text(user.display_name);
- } else {
- username.text(user.name);
- }
- username.appendTo(userListEntry);
- availableUsers.push(userListEntry);
- userListEntry.appendTo(userList);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment