Skip to content

Commit

Permalink
Update Design
Browse files Browse the repository at this point in the history
  • Loading branch information
sujaykumarh committed Oct 30, 2018
1 parent fc1360f commit fa2b85f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 64 deletions.
2 changes: 1 addition & 1 deletion css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ body, head{
color: #ffffff;
cursor: default;
min-width: 800px;
min-height: 800px;
min-height: 500px;
}

@keyframes shake{
Expand Down
Binary file added images/user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 0 additions & 57 deletions images/user.svg

This file was deleted.

24 changes: 18 additions & 6 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
var _currentUserId = 0;
var _currentUserSessionId = 0;
var _snackbar;
var _defaultUserImage = "images/user.png";

$(document).ready(function () {
// enable tooltip
//$('[data-toggle="tooltip"]').tooltip();
Expand All @@ -29,6 +31,7 @@ $(document).ready(function () {

function ThemeManager() {
this.init();
//console.log('LightDM: ', window.lightdm);
}

ThemeManager.prototype = {
Expand Down Expand Up @@ -73,17 +76,17 @@ ThemeManager.prototype = {
var _sb_action = '<span class="snackbar-action">ACTION</span>';

$(_sb_content).html(message);
if(actionTitle){
if (actionTitle) {
$(_sb_action).html(actionTitle);
$(_sb_action).click(function(){
$(_sb_action).click(function () {
callback();
});
$(_sb_container).append(_sb_action);
}

$(_sb_container).append(_sb_content);
$(this).append(_sb_container);

var snackbar = this;
$(this).find('.snackbar-container').addClass('show').delay(2500).queue(function (next) {
$(snackbar).find('.snackbar-container').first().remove();
Expand Down Expand Up @@ -140,23 +143,31 @@ ThemeManager.prototype = {
manager.showUsers();
});

//ControlButtons
// Control Buttons
var manager = this;
// ShutDown Button
if(!window.lightdm.can_shutdown) $('#control-shutdown').hide();
$('#control-shutdown').click(function () {
manager.createAlert("Shutdown", "Do you Want to shutdown System?", function () {
lightdm.shutdown();
});
});
// Hibernate Button
if(!window.lightdm.can_hibernate) $('#control-hibernate').hide();
$('#control-hibernate').click(function () {
manager.createAlert("Hibernate", "Do you Want to Hibernate System?", function () {
lightdm.hibernate();
});
});
// Suspend Button
if(!window.lightdm.can_suspend) $('#control-suspend').hide();
$('#control-suspend').click(function () {
manager.createAlert("Suspend", "Do you Want to Suspend System?", function () {
lightdm.suspend();
});
});
// Restart Button
if(!window.lightdm.can_restart) $('#control-restart').hide();
$('#control-restart').click(function () {
manager.createAlert("Restart", "Do you Want to Restart System?", function () {
lightdm.restart();
Expand Down Expand Up @@ -186,6 +197,7 @@ ThemeManager.prototype = {
$('.input-password input').val('');
},
updateSessionId: function (pos) {
if (lightdm.users[pos].session === null) return; // retrun if no default session is set
var _session = lightdm.users[pos].session.toLowerCase();
_currentUserSessionId = lightdm.sessions.map(function (e) {
return e.key;
Expand All @@ -202,7 +214,7 @@ ThemeManager.prototype = {
return lightdm.sessions[_currentUserSessionId].name;
},
userImage: function () {
return lightdm.users[_currentUserId].image;
return (lightdm.users[_currentUserId].image !== null) ? lightdm.users[_currentUserId].image : _defaultUserImage;
}
},
createAlert: function (title, message, callback) {
Expand Down Expand Up @@ -261,7 +273,7 @@ ThemeManager.prototype = {
$(userBtn).attr('id', '');
$(userBtn).find('span.name').html(user.display_name);
$(userBtn).find('span.username').html(user.name);
$(userBtn).find('img').attr('src', user.image);
$(userBtn).find('img').attr('src', (user.image !== null) ? user.image : _defaultUserImage);
$(userBtn).click(function () {
$("#login").show();
$("#login-users").hide();
Expand Down

0 comments on commit fa2b85f

Please sign in to comment.