Browse Source

Fixes #24

sisyphus
Dustin Falgout 9 years ago
parent
commit
4a4a683392
  1. 5
      themes/antergos/index.html
  2. 58
      themes/antergos/js/greeter.js

5
themes/antergos/index.html

@ -1,4 +1,5 @@
<!DOCTYPE html><!-- <!DOCTYPE html>
<!--
~ Copyright © 2015 Antergos ~ Copyright © 2015 Antergos
~ ~
~ index.html ~ index.html
@ -15,7 +16,7 @@
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details. ~ GNU General Public License for more details.
~ ~
~ The following additional terms are in effect as per Section 7 of this license: ~ The following additional terms are in effect as per Section 7 of the license:
~ ~
~ The preservation of all legal notices and author attributions in ~ The preservation of all legal notices and author attributions in
~ the material or in the Appropriate Legal Notices displayed ~ the material or in the Appropriate Legal Notices displayed

58
themes/antergos/js/greeter.js

@ -42,7 +42,7 @@ function log(text) {
} }
} }
$(document).ready(function () { $(document).ready(function() {
function buildUserList() { function buildUserList() {
// User list building // User list building
@ -65,9 +65,9 @@ $(document).ready(function () {
$(userList).append(li); $(userList).append(li);
} }
if ($(userList).children().length > 3) { if ($(userList).children().length > 3) {
$(userList).css('column-count', '2'); $(userList).css('column-count', '2');
$(userList).parent().css('max-width', '85%'); $(userList).parent().css('max-width', '85%');
} }
} }
function buildSessionList() { function buildSessionList() {
@ -96,26 +96,26 @@ $(document).ready(function () {
$(window).load(function() { $(window).load(function() {
/** /**
* UI Initialization. * UI Initialization.
*/ */
initialize_timer(); initialize_timer();
get_hostname(); get_hostname();
buildUserList(); buildUserList();
buildSessionList(); buildSessionList();
// Password submit when enter key is pressed // Password submit when enter key is pressed
$(document).keydown(function (e) { $(document).keydown(function(e) {
checkKey(e); checkKey(e);
}); });
// Action buttons // Action buttons
addActionLink("shutdown"); addActionLink("shutdown");
addActionLink("hibernate"); addActionLink("hibernate");
addActionLink("suspend"); addActionLink("suspend");
addActionLink("restart"); addActionLink("restart");
}); });
function get_hostname() { function get_hostname() {
@ -221,7 +221,7 @@ $(document).ready(function () {
return string.charAt(0).toUpperCase() + string.slice(1); return string.charAt(0).toUpperCase() + string.slice(1);
} }
window.handleAction = function (id) { window.handleAction = function(id) {
log("handleAction(" + id + ")"); log("handleAction(" + id + ")");
eval("lightdm." + id + "()"); eval("lightdm." + id + "()");
}; };
@ -249,7 +249,7 @@ $(document).ready(function () {
} }
window.startAuthentication = function (userId) { window.startAuthentication = function(userId) {
log("startAuthentication(" + userId + ")"); log("startAuthentication(" + userId + ")");
if (selectedUser !== null) { if (selectedUser !== null) {
@ -270,8 +270,14 @@ $(document).ready(function () {
var usrSession = localStorage.getItem(userId); var usrSession = localStorage.getItem(userId);
if (! usrSession) {
var user_session = lightdm.get_user_session(userId);
usrSession = user_session ? user_session : lightdm.get_default_session();
localStorage.setItem(userId, usrSession);
}
log("usrSession: " + usrSession); log("usrSession: " + usrSession);
var usrSessionEl = "[data-session-id=" + usrSession + "]"; var usrSessionEl = "[data-session-id=" + usrSession + "]";
var usrSessionName = $(usrSessionEl).html(); var usrSessionName = $(usrSessionEl).html();
log("usrSessionName: " + usrSessionName); log("usrSessionName: " + usrSessionName);
@ -286,7 +292,7 @@ $(document).ready(function () {
lightdm.start_authentication(userId); lightdm.start_authentication(userId);
}; };
window.cancelAuthentication = function () { window.cancelAuthentication = function() {
log("cancelAuthentication()"); log("cancelAuthentication()");
$('#statusArea').hide(); $('#statusArea').hide();
$('#timerArea').hide(); $('#timerArea').hide();
@ -305,7 +311,7 @@ $(document).ready(function () {
return true; return true;
}; };
window.submitPassword = function () { window.submitPassword = function() {
log("provideSecret()"); log("provideSecret()");
lightdm.provide_secret($('#passwordField').val()); lightdm.provide_secret($('#passwordField').val());
$('#passwordArea').hide(); $('#passwordArea').hide();
@ -317,13 +323,13 @@ $(document).ready(function () {
* Image loading management. * Image loading management.
*/ */
window.imgNotFound = function (source) { window.imgNotFound = function(source) {
source.src = 'img/antergos-logo-user.jpg'; source.src = 'img/antergos-logo-user.jpg';
source.onerror = ""; source.onerror = "";
return true; return true;
}; };
window.sessionToggle = function (el) { window.sessionToggle = function(el) {
var selText = $(el).text(); var selText = $(el).text();
var theID = $(el).attr('data-session-id'); var theID = $(el).attr('data-session-id');
var selUser = localStorage.getItem('selUser'); var selUser = localStorage.getItem('selUser');

Loading…
Cancel
Save