diff --git a/themes/antergos/index.html b/themes/antergos/index.html
index 7fd70ca..a7c92df 100644
--- a/themes/antergos/index.html
+++ b/themes/antergos/index.html
@@ -53,7 +53,7 @@
-
+
@@ -94,7 +94,7 @@
-
+
diff --git a/themes/antergos/js/greeter-compiled.js b/themes/antergos/js/greeter-compiled.js
index 928652c..30a1602 100644
--- a/themes/antergos/js/greeter-compiled.js
+++ b/themes/antergos/js/greeter-compiled.js
@@ -30,7 +30,8 @@
* This is used to access our classes from within jQuery callbacks.
*/
var _self = null,
- _bg_self = null;
+ _bg_self = null,
+ _util = null;
/**
* Capitalize a string.
@@ -44,9 +45,14 @@ String.prototype.capitalize = function () {
/**
* This is the base class for the theme's components.
*/
-class GreeterThemeComponent {
+class AntergosThemeUtils {
constructor() {
+ if (null !== _util) {
+ return _util;
+ }
+ _util = this;
+
this.debug = true;
this.lang = window.navigator.language.split('-')[0].toLowerCase();
this.translations = window.ant_translations;
@@ -79,7 +85,7 @@ class GreeterThemeComponent {
cache_get() {
var key = `ant`;
- for (var _len = arguments.length, key_parts = Array(_len), _key = 0; _key < _len; _key++) {
+ for (var _len = arguments.length, key_parts = new Array(_len), _key = 0; _key < _len; _key++) {
key_parts[_key] = arguments[_key];
}
@@ -99,7 +105,7 @@ class GreeterThemeComponent {
cache_set(value) {
var key = `ant`;
- for (var _len2 = arguments.length, key_parts = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
+ for (var _len2 = arguments.length, key_parts = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
key_parts[_key2 - 1] = arguments[_key2];
}
@@ -119,24 +125,23 @@ class GreeterThemeComponent {
background_images_dir = '';
if ('undefined' !== typeof config) {
- if (this instanceof AntergosTheme) {
- logo = config.get_str('branding', 'logo') || '';
- user_image = config.get_str('branding', 'user_image') || '';
- } else if (this instanceof AntergosBackgroundManager) {
- background_images_dir = config.get_str('branding', 'background_images') || '';
- if (background_images_dir) {
- background_images = greeterutil.dirlist(background_images_dir) || [];
- }
- if (background_images.length) {
- let images = [];
- for (var file of background_images) {
- if (file.match(/(png|PNG)|(jpg|JPEG)|(bmp|BMP)/)) {
- images.push(file);
- }
+ logo = config.get_str('branding', 'logo') || '';
+ user_image = config.get_str('branding', 'user_image') || '';
+
+ background_images_dir = config.get_str('branding', 'background_images') || '';
+ if (background_images_dir) {
+ background_images = greeterutil.dirlist(background_images_dir) || [];
+ }
+
+ if (background_images && background_images.length) {
+ var images = [];
+ for (var file of background_images) {
+ if (file.match(/(png|PNG)|(jpg|JPEG)|(bmp|BMP)/)) {
+ images.push(file);
}
- background_images = images;
}
+ background_images = images;
}
}
@@ -150,23 +155,25 @@ class GreeterThemeComponent {
/**
* This class handles the theme's background switcher.
*/
-class AntergosBackgroundManager extends GreeterThemeComponent {
+class AntergosBackgroundManager {
constructor() {
- super();
- if (null === _bg_self) {
- _bg_self = this;
+ if (null !== _bg_self) {
+ return _bg_self;
}
- this.current_background = this.cache_get('background_manager', 'current_background');
+ _bg_self = this;
+
+ this.current_background = _util.cache_get('background_manager', 'current_background');
- if (!this.background_images_dir.length || !this.background_images.length) {
+ if (!_util.background_images_dir.length || !_util.background_images.length) {
this.log('AntergosBackgroundManager: [ERROR] No background images detected.');
$('.header').fadeTo(300, 0.5, function () {
$('.header').css("background", '#000000');
}).fadeTo(300, 1);
}
+
return _bg_self;
}
@@ -175,53 +182,55 @@ class AntergosBackgroundManager extends GreeterThemeComponent {
// For backwards compatibility
if (null !== localStorage.getItem('bgsaved') && '0' === localStorage.getItem('bgrandom')) {
this.current_background = localStorage.getItem('bgsaved');
- this.cache_set(this.current_background, 'background_manager', 'current_background');
+ _util.cache_set(this.current_background, 'background_manager', 'current_background');
localStorage.removeItem('bgrandom');
localStorage.removeItem('bgsaved');
- } else if ('0' === localStorage.getItem('bgrandom')) {
- this.current_background = this.get_random_image();
- this.cache_set('true', 'background_manager', 'random_background');
- localStorage.removeItem('bgrandom');
+ } else {
+ if ('0' === localStorage.getItem('bgrandom')) {
+ this.current_background = this.get_random_image();
+ _util.cache_set('true', 'background_manager', 'random_background');
+ localStorage.removeItem('bgrandom');
+ }
}
}
if (!this.current_background) {
// For current and future versions
- let current_background = this.cache_get('background_manager', 'current_background'),
- random_background = this.cache_get('background_manager', 'random_background');
+ let current_background = _util.cache_get('background_manager', 'current_background'),
+ random_background = _util.cache_get('background_manager', 'random_background');
if ('true' === random_background || !current_background) {
current_background = this.get_random_image();
- this.cache_set('true', 'background_manager', 'random_background');
+ _util.cache_set('true', 'background_manager', 'random_background');
}
this.current_background = current_background;
- this.cache_set(this.current_background, 'background_manager', 'current_background');
+ _util.cache_set(this.current_background, 'background_manager', 'current_background');
}
this.do_background();
}
do_background() {
- if ('undefined' !== typeof this.current_background) {
- $('.header').fadeTo(300, 0.5, function () {
- var tpl = `url(${ this.current_background })`;
- $('.header').css("background-image", tpl);
- }).fadeTo(300, 1);
- }
+ $('.header').fadeTo(300, 0.5, function () {
+ var tpl = `url(${ _bg_self.current_background })`;
+ $('.header').css("background-image", tpl);
+ }).fadeTo(300, 1);
}
get_random_image() {
var random_bg;
- random_bg = Math.floor(Math.random() * this.background_images.length);
+ random_bg = Math.floor(Math.random() * _util.background_images.length);
- return this.background_images[random_bg];
+ return _util.background_images[random_bg];
}
setup_background_thumbnails() {
- if (this.background_images.length) {
- for (var image_file of this.background_images) {
+ if (_util.background_images.length) {
+ $('[data-img="random"]').click(this.background_selected_handler);
+
+ for (var image_file of _util.background_images) {
var $link = $(''),
$img_el = $link.children('img'),
tpl = `file://${ image_file }`;
@@ -238,11 +247,11 @@ class AntergosBackgroundManager extends GreeterThemeComponent {
var img = $(this).attr('data-img');
if ('random' === img) {
- _bg_self.cache_set('true', 'background_manager', 'random_background');
+ _util.cache_set('true', 'background_manager', 'random_background');
img = _bg_self.get_random_image();
}
- _bg_self.cache_set(img, 'background_manager', 'current_background');
+ _util.cache_set(img, 'background_manager', 'current_background');
_bg_self.current_background = img;
_bg_self.do_background();
@@ -252,13 +261,14 @@ class AntergosBackgroundManager extends GreeterThemeComponent {
/**
* This is the theme's main class object. It contains almost all the theme's logic.
*/
-class AntergosTheme extends GreeterThemeComponent {
+class AntergosTheme {
constructor() {
- super();
- if (null === _self) {
- _self = this;
+ if (null !== _self) {
+ return _self;
}
+ _self = this;
+
this.tux = 'img/antergos-logo-user.png';
this.user_list_visible = false;
this.auth_pending = false;
@@ -270,9 +280,10 @@ class AntergosTheme extends GreeterThemeComponent {
this.$actions_container = $("#actionsArea");
this.$msg_area_container = $('#statusArea');
this.$msg_area = $('#showMsg');
- this.background_manager = new AntergosBackgroundManager();
+ this.background_manager = new AntergosBackgroundManager();
this.background_manager.initialize();
+
this.initialize();
return _self;
@@ -286,7 +297,6 @@ class AntergosTheme extends GreeterThemeComponent {
this.prepare_user_list();
this.prepare_session_list();
this.prepare_system_action_buttons();
- $("#login").addClass("in");
this.register_callbacks();
this.background_manager.setup_background_thumbnails();
}
@@ -319,8 +329,8 @@ class AntergosTheme extends GreeterThemeComponent {
// Loop through the array of LightDMUser objects to create our user list.
for (var user of lightdm.users) {
- var last_session = this.cache_get('user', user.name, 'session'),
- image_src = user.image.length ? user.image : this.user_image;
+ var last_session = _util.cache_get('user', user.name, 'session'),
+ image_src = user.image.length ? user.image : _util.user_image;
if (null === last_session) {
// For backwards compatibility
@@ -330,10 +340,10 @@ class AntergosTheme extends GreeterThemeComponent {
// session.
last_session = lightdm.default_session;
}
- this.cache_set(last_session, 'user', user.name, 'session');
+ _util.cache_set(last_session, 'user', user.name, 'session');
}
- this.log(`Last session for ${ user.name } was: ${ last_session }`);
+ _util.log(`Last session for ${ user.name } was: ${ last_session }`);
template = `
@@ -361,7 +371,7 @@ class AntergosTheme extends GreeterThemeComponent {
var css_class = session.name.replace(/ /g, ''),
template;
- this.log(`Adding ${ session.name } to the session list...`);
+ _util.log(`Adding ${ session.name } to the session list...`);
template = `
@@ -404,7 +414,7 @@ class AntergosTheme extends GreeterThemeComponent {
}
initialize_clock() {
- var saved_format = this.cache_get('clock', 'time_format'),
+ var saved_format = _util.cache_get('clock', 'time_format'),
format = null !== saved_format ? saved_format : 'LT';
moment.locale(window.navigator.languages);
@@ -429,8 +439,8 @@ class AntergosTheme extends GreeterThemeComponent {
}
prepare_login_panel_header() {
- var greeting = this.translations.greeting ? this.translations.greeting : 'Welcome!',
- logo = '' !== this.logo ? this.logo : 'img/antergos.png';
+ var greeting = _util.translations.greeting ? _util.translations.greeting : 'Welcome!',
+ logo = '' !== _util.logo ? _util.logo : 'img/antergos.png';
$('.welcome').text(greeting);
$('#hostname').append(lightdm.hostname);
@@ -438,19 +448,19 @@ class AntergosTheme extends GreeterThemeComponent {
}
prepare_translations() {
- if (!this.translations.hasOwnProperty(this.lang)) {
+ if (!_util.translations.hasOwnProperty(this.lang)) {
for (var lang of window.navigator.languages) {
- if (this.translations.hasOwnProperty(lang)) {
+ if (_util.translations.hasOwnProperty(lang)) {
this.lang = lang;
break;
}
}
}
- if (!this.translations.hasOwnProperty(this.lang)) {
+ if (!_util.translations.hasOwnProperty(this.lang)) {
this.lang = 'en';
}
- this.translations = this.translations[this.lang];
+ _util.translations = _util.translations[this.lang];
}
/**
@@ -462,7 +472,7 @@ class AntergosTheme extends GreeterThemeComponent {
$('[data-i18n]').each(function () {
var key = $(this).attr('data-i18n'),
html = $(this).html(),
- translated = _self.translations[key],
+ translated = _util.translations[key],
new_html = html.replace('${i18n}', translated);
$(this).html(new_html);
@@ -477,15 +487,15 @@ class AntergosTheme extends GreeterThemeComponent {
start_authentication(event) {
var user_id = $(this).attr('id'),
selector = `.${ user_id }`,
- user_session = _self.cache_get('user', user_id, 'session');
+ user_session = _util.cache_get('user', user_id, 'session');
if (_self.auth_pending || null !== _self.selected_user) {
lightdm.cancel_authentication();
- _self.log(`Authentication cancelled for ${ _self.selected_user }`);
+ _util.log(`Authentication cancelled for ${ _self.selected_user }`);
_self.selected_user = null;
}
- _self.log(`Starting authentication for ${ user_id }.`);
+ _util.log(`Starting authentication for ${ user_id }.`);
_self.selected_user = user_id;
// CSS hack to workaround webkit bug
@@ -495,7 +505,7 @@ class AntergosTheme extends GreeterThemeComponent {
$(selector).addClass('hovered').siblings().hide();
$('.fa-toggle-down').hide();
- _self.log(`Session for ${ user_id } is ${ user_session }`);
+ _util.log(`Session for ${ user_id } is ${ user_session }`);
$(`[data-session-id="${ user_session }"]`).parent().trigger('click', this);
@@ -522,7 +532,7 @@ class AntergosTheme extends GreeterThemeComponent {
lightdm.cancel_authentication();
- _self.log('Cancelled authentication.');
+ _util.log('Cancelled authentication.');
// CSS hack to work-around webkit bug
if ($(_self.$user_list).children().length > 3) {
@@ -543,17 +553,18 @@ class AntergosTheme extends GreeterThemeComponent {
*/
authentication_complete() {
var selected_session = $('.selected').attr('data-session-id'),
- err_msg = _self.translations.auth_failed[_self.lang];
+ err_msg = _util.translations.auth_failed[_self.lang];
_self.auth_pending = false;
- _self.cache_set(selected_session, 'user', lightdm.authentication_user, 'session');
+ _util.cache_set(selected_session, 'user', lightdm.authentication_user, 'session');
$('#timerArea').hide();
if (lightdm.is_authenticated) {
// The user entered the correct password. Let's log them in.
- $('body').fadeOut(1000);
- lightdm.login(lightdm.authentication_user, selected_session);
+ $('body').fadeOut(1000, () => {
+ lightdm.login(lightdm.authentication_user, selected_session);
+ });
} else {
// The user did not enter the correct password. Show error message.
$('#statusArea').show();
@@ -598,7 +609,7 @@ class AntergosTheme extends GreeterThemeComponent {
var action = $(this).attr('id'),
$modal = $('.modal');
- $modal.find('.btn-primary').text(_self.translations[action]).click(action, event => {
+ $modal.find('.btn-primary').text(_util.translations[action]).click(action, event => {
$(this).off('click');
lightdm[event.data]();
});
@@ -650,7 +661,8 @@ class AntergosTheme extends GreeterThemeComponent {
* Initialize the theme once the window has loaded.
*/
$(window).load(() => {
- _self = new AntergosTheme();
+ new AntergosThemeUtils();
+ new AntergosTheme();
});
//# sourceMappingURL=greeter-compiled.js.map
\ No newline at end of file
diff --git a/themes/antergos/js/greeter-compiled.js.map b/themes/antergos/js/greeter-compiled.js.map
index 9ad0412..eb7010e 100644
--- a/themes/antergos/js/greeter-compiled.js.map
+++ b/themes/antergos/js/greeter-compiled.js.map
@@ -1 +1 @@
-{"version":3,"sources":["greeter.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAI,QAAQ,IAAR;IACH,WAAW,IAAX;;;;;;;AAQD,OAAO,SAAP,CAAiB,UAAjB,GAA8B,YAAW;AACxC,QAAO,KAAK,MAAL,CAAa,CAAb,EAAiB,WAAjB,KAAiC,KAAK,KAAL,CAAY,CAAZ,CAAjC,CADiC;CAAX;;;;;AAY9B,MAAM,qBAAN,CAA4B;;AAE3B,eAAc;AACb,OAAK,KAAL,GAAa,IAAb,CADa;AAEb,OAAK,IAAL,GAAY,OAAO,SAAP,CAAiB,QAAjB,CAA0B,KAA1B,CAAiC,GAAjC,EAAwC,CAAxC,EAA4C,WAA5C,EAAZ,CAFa;AAGb,OAAK,YAAL,GAAoB,OAAO,gBAAP,CAHP;;AAKb,MAAK,gBAAgB,OAAO,OAAO,SAAP,CAAiB,SAAjB,EAA6B;AACxD,UAAO,SAAP,CAAiB,SAAjB,GAA6B,CAAE,OAAO,SAAP,CAAiB,QAAjB,CAA/B,CADwD;GAAzD;;AAIA,OAAK,kBAAL,GATa;EAAd;;;;;;;AAF2B,IAoB3B,CAAK,IAAL,EAAY;AACX,MAAK,SAAS,KAAK,KAAL,EAAa;AAC1B,WAAQ,GAAR,CAAa,IAAb,EAD0B;GAA3B;AAGA,IAAG,UAAH,EAAgB,MAAhB,CAAwB,CAAC,GAAE,IAAH,EAAQ,KAAR,CAAxB,EAJW;EAAZ;;;;;;;;AApB2B,UAkC3B,GAA0B;AACzB,MAAI,MAAM,CAAC,GAAD,CAAN,CADqB;;oCAAZ;;GAAY;;AAGzB,OAAM,IAAI,IAAJ,IAAY,SAAlB,EAA8B;AAC7B,UAAO,CAAC,CAAD,GAAI,IAAJ,EAAS,CAA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AApB,CAA0B,IAA1B,EADsB;AAEtB,KAAG,eAAH,EAAqB,IAArB,GAFsB;AAGtB,KAAG,KAAK,mBAAL,CAAH,CAA8B,IAA9B,GAHsB;GAAvB;EADD;CAhZD;;;;;AA6ZA,EAAG,MAAH,EAAY,IAAZ,CAAkB,MAAM;AACvB,SAAQ,IAAI,aAAJ,EAAR,CADuB;CAAN,CAAlB","file":"greeter-compiled.js","sourcesContent":["/*\n *\n * Copyright © 2015-2016 Antergos\n *\n * greeter.js\n *\n * This file is part of lightdm-webkit-theme-antergos\n *\n * lightdm-webkit-theme-antergos is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License,\n * or any later version.\n *\n * lightdm-webkit-theme-antergos is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * The following additional terms are in effect as per Section 7 of this license:\n *\n * The preservation of all legal notices and author attributions in\n * the material or in the Appropriate Legal Notices displayed\n * by works containing it is required.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n */\n\n\n/**\n * This is used to access our classes from within jQuery callbacks.\n */\nvar _self = null,\n\t_bg_self = null;\n\n\n/**\n * Capitalize a string.\n *\n * @returns {string}\n */\nString.prototype.capitalize = function() {\n\treturn this.charAt( 0 ).toUpperCase() + this.slice( 1 );\n};\n\n\n\n\n\n\n/**\n * This is the base class for the theme's components.\n */\nclass GreeterThemeComponent {\n\n\tconstructor() {\n\t\tthis.debug = true;\n\t\tthis.lang = window.navigator.language.split( '-' )[ 0 ].toLowerCase();\n\t\tthis.translations = window.ant_translations;\n\n\t\tif ( 'undefined' === typeof window.navigator.languages ) {\n\t\t\twindow.navigator.languages = [ window.navigator.language ];\n\t\t}\n\n\t\tthis.init_config_values();\n\t}\n\n\n\t/**\n\t * Add text to the debug log element (accessible from the login screen).\n\t *\n\t * @param {string} text - To be added to the log.\n\t */\n\tlog( text ) {\n\t\tif ( true === this.debug ) {\n\t\t\tconsole.log( text );\n\t\t}\n\t\t$( '#logArea' ).append( `${text}
` );\n\t}\n\n\n\t/**\n\t * Get a key's value from localStorage. Keys can have two or more parts.\n\t * For example: \"ant:user:john:session\".\n\t *\n\t * @param {...string} key_parts - Strings that are combined to form the key.\n\t */\n\tcache_get( ...key_parts ) {\n\t\tvar key = `ant`;\n\n\t\tfor ( var part of key_parts ) {\n\t\t\tkey += `:${part}`;\n\t\t}\n\t\treturn localStorage.getItem( key );\n\t}\n\n\n\t/**\n\t * Set a key's value in localStorage. Keys can have two or more parts.\n\t * For example: \"ant:user:john:session\".\n\t *\n\t * @param {string} value - The value to set.\n\t * @param {...string} key_parts - Strings that are combined to form the key.\n\t */\n\tcache_set( value, ...key_parts ) {\n\t\tvar key = `ant`;\n\n\t\tfor ( var part of key_parts ) {\n\t\t\tkey += `:${part}`;\n\t\t}\n\t\treturn localStorage.setItem( key, value );\n\t}\n\n\n\t/**\n\t * Get some values from `lightdm-webkit2-greeter.conf` and save them for later.\n\t */\n\tinit_config_values() {\n\t\tvar logo = '', user_image = '', background_images = [], background_images_dir = '';\n\n\t\tif ( 'undefined' !== typeof config ) {\n\t\t\tif ( this instanceof AntergosTheme ) {\n\t\t\t\tlogo = config.get_str( 'branding', 'logo' ) || '';\n\t\t\t\tuser_image = config.get_str( 'branding', 'user_image' ) || '';\n\n\t\t\t} else if ( this instanceof AntergosBackgroundManager ) {\n\t\t\t\tbackground_images_dir = config.get_str( 'branding', 'background_images' ) || '';\n\t\t\t\tif (background_images_dir) {\n\t\t\t\t\tbackground_images = greeterutil.dirlist(background_images_dir) || [];\n\t\t\t\t}\n\n\t\t\t\tif (background_images.length) {\n\t\t\t\t\tlet images = [];\n\t\t\t\t\tfor (var file of background_images) {\n\t\t\t\t\t\tif (file.match(/(png|PNG)|(jpg|JPEG)|(bmp|BMP)/)) {\n\t\t\t\t\t\t\timages.push(file);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbackground_images = images;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.logo = logo;\n\t\tthis.user_image = user_image;\n\t\tthis.background_images = background_images;\n\t\tthis.background_images_dir = background_images_dir;\n\t}\n}\n\n\n\n\n\n\n/**\n * This class handles the theme's background switcher.\n */\nclass AntergosBackgroundManager extends GreeterThemeComponent {\n\n\tconstructor() {\n\t\tsuper();\n\t\tif ( null === _bg_self ) {\n\t\t\t_bg_self = this;\n\t\t}\n\n\t\tthis.current_background = this.cache_get( 'background_manager', 'current_background' );\n\n\t\tif ( ! this.background_images_dir.length || ! this.background_images.length ) {\n\t\t\tthis.log('AntergosBackgroundManager: [ERROR] No background images detected.');\n\n\t\t\t$( '.header' ).fadeTo( 300, 0.5, function() {\n\t\t\t\t$( '.header' ).css( \"background\", '#000000' );\n\t\t\t} ).fadeTo( 300, 1 );\n\n\t\t}\n\t\treturn _bg_self;\n\t}\n\n\n\tinitialize() {\n\t\tif ( ! this.current_background ) {\n\t\t\t// For backwards compatibility\n\t\t\tif ( null !== localStorage.getItem( 'bgsaved' ) && '0' === localStorage.getItem( 'bgrandom' ) ) {\n\t\t\t\tthis.current_background = localStorage.getItem( 'bgsaved' );\n\t\t\t\tthis.cache_set( this.current_background, 'background_manager', 'current_background' );\n\t\t\t\tlocalStorage.removeItem( 'bgrandom' );\n\t\t\t\tlocalStorage.removeItem( 'bgsaved' );\n\t\t\t} else if ( '0' === localStorage.getItem( 'bgrandom' ) ) {\n\t\t\t\tthis.current_background = this.get_random_image();\n\t\t\t\tthis.cache_set( 'true', 'background_manager', 'random_background' );\n\t\t\t\tlocalStorage.removeItem( 'bgrandom' );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! this.current_background ) {\n\t\t\t// For current and future versions\n\t\t\tlet current_background = this.cache_get('background_manager', 'current_background' ),\n\t\t\t\trandom_background = this.cache_get('background_manager', 'random_background' );\n\n\t\t\tif ( 'true' === random_background || ! current_background ) {\n\t\t\t\tcurrent_background = this.get_random_image();\n\t\t\t\tthis.cache_set( 'true', 'background_manager', 'random_background' );\n\t\t\t}\n\n\t\t\tthis.current_background = current_background;\n\t\t\tthis.cache_set( this.current_background, 'background_manager', 'current_background' );\n\t\t}\n\n\t\tthis.do_background();\n\t}\n\n\n\tdo_background() {\n\t\tif ('undefined' !== typeof this.current_background) {\n\t\t\t$( '.header' ).fadeTo( 300, 0.5, function() {\n\t\t\t\tvar tpl = `url(${this.current_background})`;\n\t\t\t\t$( '.header' ).css(\"background-image\", tpl );\n\t\t\t} ).fadeTo( 300, 1 );\n\t\t}\n\t}\n\n\n\tget_random_image() {\n\t\tvar random_bg;\n\n\t\trandom_bg = Math.floor( Math.random() * this.background_images.length );\n\n\t\treturn this.background_images[ random_bg ];\n\t}\n\n\tsetup_background_thumbnails() {\n\t\tif (this.background_images.length) {\n\t\t\tfor ( var image_file of this.background_images ) {\n\t\t\t\tvar $link = $(''),\n\t\t\t\t\t$img_el = $link.children('img'),\n\t\t\t\t\ttpl = `file://${image_file}`;\n\n\t\t\t\t$link.addClass('bg clearfix').attr('data-img', tpl);\n\t\t\t\t$img_el.attr('src', tpl);\n\n\t\t\t\t$link.appendTo($('.bgs')).click( this.background_selected_handler );\n\t\t\t}\n\t\t}\n\t}\n\n\n\tbackground_selected_handler( event ) {\n\t\tvar img = $(this).attr('data-img');\n\n\t\tif ('random' === img) {\n\t\t\t_bg_self.cache_set('true', 'background_manager', 'random_background' );\n\t\t\timg = _bg_self.get_random_image();\n\t\t}\n\n\t\t_bg_self.cache_set(img, 'background_manager', 'current_background' );\n\t\t_bg_self.current_background = img;\n\n\t\t_bg_self.do_background();\n\n\t}\n}\n\n\n\n\n\n/**\n * This is the theme's main class object. It contains almost all the theme's logic.\n */\nclass AntergosTheme extends GreeterThemeComponent {\n\n\tconstructor() {\n\t\tsuper();\n\t\tif ( null === _self ) {\n\t\t\t_self = this;\n\t\t}\n\t\tthis.tux = 'img/antergos-logo-user.png';\n\t\tthis.user_list_visible = false;\n\t\tthis.auth_pending = false;\n\t\tthis.selected_user = null;\n\t\tthis.$user_list = $( '#user-list2' );\n\t\tthis.$session_list = $( '#sessions' );\n\t\tthis.$clock_container = $( '#collapseOne' );\n\t\tthis.$clock = $( \"#current_time\" );\n\t\tthis.$actions_container = $( \"#actionsArea\" );\n\t\tthis.$msg_area_container = $( '#statusArea' );\n\t\tthis.$msg_area = $( '#showMsg' );\n\t\tthis.background_manager = new AntergosBackgroundManager();\n\n\t\tthis.background_manager.initialize();\n\t\tthis.initialize();\n\n\t\treturn _self;\n\t}\n\n\tinitialize() {\n\t\tthis.prepare_translations();\n\t\tthis.do_static_translations();\n\t\tthis.initialize_clock();\n\t\tthis.prepare_login_panel_header();\n\t\tthis.prepare_user_list();\n\t\tthis.prepare_session_list();\n\t\tthis.prepare_system_action_buttons();\n\t\t$( \"#login\" ).addClass( \"in\" );\n\t\tthis.register_callbacks();\n\t\tthis.background_manager.setup_background_thumbnails();\n\t}\n\n\n\t/**\n\t * Register callbacks for the LDM Greeter as well as any others that haven't been registered\n\t * elsewhere.\n\t */\n\tregister_callbacks() {\n\t\tvar events = 'shown.bs.collapse, hidden.bs.collapse';\n\n\t\tthis.$user_list.parents( '.collapse' ).on( events, this.user_list_collapse_handler );\n\t\t$( document ).keydown( this.key_press_handler );\n\t\t$( '.cancel_auth' ).click( this.cancel_authentication );\n\t\t$( '.submit_passwd' ).click( this.submit_password );\n\n\t\twindow.show_prompt = this.show_prompt;\n\t\twindow.show_message = this.show_message;\n\t\twindow.start_authentication = this.start_authentication;\n\t\twindow.cancel_authentication = this.cancel_authentication;\n\t\twindow.authentication_complete = this.authentication_complete;\n\t\twindow.autologin_timer_expired = this.cancel_authentication;\n\t}\n\n\t/**\n\t * Initialize the user list.\n\t */\n\tprepare_user_list() {\n\t\tvar template;\n\n\t\t// Loop through the array of LightDMUser objects to create our user list.\n\t\tfor ( var user of lightdm.users ) {\n\t\t\tvar last_session = this.cache_get( 'user', user.name, 'session' ),\n\t\t\t\timage_src = user.image.length ? user.image : this.user_image;\n\n\t\t\tif ( null === last_session ) {\n\t\t\t\t// For backwards compatibility\n\t\t\t\tlast_session = localStorage.getItem( user.name );\n\t\t\t\tif ( null === last_session ) {\n\t\t\t\t\t// This user has never logged in before let's enable the system's default\n\t\t\t\t\t// session.\n\t\t\t\t\tlast_session = lightdm.default_session;\n\t\t\t\t}\n\t\t\t\tthis.cache_set( last_session, 'user', user.name, 'session' );\n\t\t\t}\n\n\t\t\tthis.log( `Last session for ${user.name} was: ${last_session}` );\n\n\t\t\ttemplate = `\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${user.display_name}\n\t\t\t\t\t\n\t\t\t\t`;\n\n\t\t\t// Register event handler here so we don't have to iterate over the users again later.\n\t\t\t$( template ).appendTo( this.$user_list ).click( this.start_authentication ).on('error.antergos', this.user_image_error_handler);\n\n\t\t} // END for ( var user of lightdm.users )\n\n\t\tif ( $( this.$user_list ).children().length > 3 ) {\n\t\t\t// Make the user list two columns instead of one.\n\t\t\t$( this.$user_list ).css( 'column-count', '2' ).parent().css( 'max-width', '85%' );\n\t\t}\n\n\t}\n\n\t/**\n\t * Initialize the session selection dropdown.\n\t */\n\tprepare_session_list() {\n\t\t// Loop through the array of LightDMSession objects to create our session list.\n\t\tfor ( var session of lightdm.sessions ) {\n\t\t\tvar css_class = session.name.replace( / /g, '' ),\n\t\t\t\ttemplate;\n\n\t\t\tthis.log( `Adding ${session.name} to the session list...` );\n\n\t\t\ttemplate = `\n\t\t\t\t\n\t\t\t\t\t${session.name}\n\t\t\t\t`;\n\n\t\t\t$( template ).appendTo( this.$session_list ).click( this.session_toggle_handler );\n\n\t\t} // END for (var session of lightdm.sessions)\n\n\t\t$( '.dropdown-toggle' ).dropdown();\n\t}\n\n\t/**\n\t * Initialize the system action buttons\n\t */\n\tprepare_system_action_buttons() {\n\t\tvar actions = {\n\t\t\t\tshutdown: \"power-off\",\n\t\t\t\thibernate: \"asterisk\",\n\t\t\t\tsuspend: \"arrow-down\",\n\t\t\t\trestart: \"refresh\"\n\t\t\t},\n\t\t\ttemplate;\n\n\t\tfor ( var action of Object.keys( actions ) ) {\n\t\t\tvar cmd = `can_${action}`;\n\n\t\t\ttemplate = `\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t`;\n\n\t\t\tif ( lightdm[ cmd ] ) {\n\t\t\t\t$( template ).appendTo( $( this.$actions_container ) ).click( this.system_action_handler );\n\t\t\t}\n\t\t} // END for (var [action, icon] of actions)\n\n\t\t$( '[data-toggle=tooltip]' ).tooltip();\n\t\t$('.modal').modal({show: false});\n\t}\n\n\tinitialize_clock() {\n\t\tvar saved_format = this.cache_get( 'clock', 'time_format' ),\n\t\t\tformat = (null !== saved_format) ? saved_format : 'LT';\n\n\t\tmoment.locale( window.navigator.languages );\n\t\tthis.$clock.html( moment().format( format ) );\n\n\t\tsetInterval( () => {\n\t\t\t_self.$clock.html( moment().format( format ) );\n\t\t}, 60000 );\n\t}\n\n\n\t/**\n\t * Show the user list if its not already shown. This is used to allow the user to\n\t * display the user list by pressing Enter or Spacebar.\n\t */\n\tshow_user_list() {\n\t\tif ( $( this.$clock_container ).hasClass( 'in' ) ) {\n\t\t\t$( '#trigger' ).trigger( 'click' );\n\t\t}\n\t\tif ( $( this.$user_list ).length <= 1 ) {\n\t\t\t$( this.$user_list ).find( 'a' ).trigger( 'click', this );\n\t\t}\n\t}\n\n\n\tprepare_login_panel_header() {\n\t\tvar greeting = (this.translations.greeting) ? this.translations.greeting : 'Welcome!',\n\t\t\tlogo = ( '' !== this.logo ) ? this.logo : 'img/antergos.png';\n\n\t\t$( '.welcome' ).text( greeting );\n\t\t$( '#hostname' ).append( lightdm.hostname );\n\t\t$('[data-greeter-config=\"logo\"]').attr('src', logo);\n\t}\n\n\n\tprepare_translations() {\n\t\tif ( ! this.translations.hasOwnProperty( this.lang ) ) {\n\t\t\tfor ( var lang of window.navigator.languages ) {\n\t\t\t\tif ( this.translations.hasOwnProperty( lang ) ) {\n\t\t\t\t\tthis.lang = lang;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ( ! this.translations.hasOwnProperty( this.lang ) ) {\n\t\t\tthis.lang = 'en';\n\t\t}\n\n\t\tthis.translations = this.translations[ this.lang ];\n\t}\n\n\n\t/**\n\t * Replace '${i18n}' with translated string for all elements that\n\t * have the data-i18n attribute. This is for elements that are not generated\n\t * dynamically (they can be found in index.html).\n\t */\n\tdo_static_translations() {\n\t\t$( '[data-i18n]' ).each( function() {\n\t\t\tvar key = $( this ).attr( 'data-i18n' ),\n\t\t\t\thtml = $( this ).html(),\n\t\t\t\ttranslated = _self.translations[ key ],\n\t\t\t\tnew_html = html.replace( '${i18n}', translated );\n\n\t\t\t$( this ).html( new_html );\n\t\t} );\n\t}\n\n\n\t/**\n\t * Start the authentication process for the selected user.\n\t *\n\t * @param {object} event - jQuery.Event object from 'click' event.\n\t */\n\tstart_authentication( event ) {\n\t\tvar user_id = $( this ).attr( 'id' ),\n\t\t\tselector = `.${user_id}`,\n\t\t\tuser_session = _self.cache_get( 'user', user_id, 'session' );\n\n\t\tif ( _self.auth_pending || null !== _self.selected_user ) {\n\t\t\tlightdm.cancel_authentication();\n\t\t\t_self.log( `Authentication cancelled for ${_self.selected_user}` );\n\t\t\t_self.selected_user = null;\n\t\t}\n\n\t\t_self.log( `Starting authentication for ${user_id}.` );\n\t\t_self.selected_user = user_id;\n\n\t\t// CSS hack to workaround webkit bug\n\t\tif ( $( _self.$user_list ).children().length > 3 ) {\n\t\t\t$( _self.$user_list ).css( 'column-count', 'initial' ).parent().css( 'max-width', '50%' );\n\t\t}\n\t\t$( selector ).addClass( 'hovered' ).siblings().hide();\n\t\t$( '.fa-toggle-down' ).hide();\n\n\t\t_self.log( `Session for ${user_id} is ${user_session}` );\n\n\t\t$( `[data-session-id=\"${user_session}\"]` ).parent().trigger( 'click', this );\n\n\t\t$( '#session-list' ).removeClass( 'hidden' ).show();\n\t\t$( '#passwordArea' ).show();\n\t\t$( '.dropdown-toggle' ).dropdown();\n\n\t\t_self.auth_pending = true;\n\n\t\tlightdm.authenticate( user_id );\n\t}\n\n\n\t/**\n\t * Cancel the pending authentication.\n\t *\n\t * @param {object} event - jQuery.Event object from 'click' event.\n\t */\n\tcancel_authentication( event ) {\n\t\tvar selectors = [ '#statusArea', '#timerArea', '#passwordArea', '#session-list' ];\n\n\t\tfor ( var selector of selectors ) {\n\t\t\t$( selector ).hide();\n\t\t}\n\n\t\tlightdm.cancel_authentication();\n\n\t\t_self.log( 'Cancelled authentication.' );\n\n\t\t// CSS hack to work-around webkit bug\n\t\tif ( $( _self.$user_list ).children().length > 3 ) {\n\t\t\t$( _self.$user_list ).css( 'column-count', '2' ).parent().css( 'max-width', '85%' );\n\t\t}\n\n\t\t$( '.hovered' ).removeClass( 'hovered' ).siblings().show();\n\t\t$( '.fa-toggle-down' ).show();\n\n\t\t_self.selected_user = null;\n\t\t_self.auth_pending = false;\n\n\t}\n\n\n\t/**\n\t * Called when the user attempts to authenticate (inputs password).\n\t * We check to see if the user successfully authenticated and if so tell the LDM\n\t * Greeter to log them in with the session they selected.\n\t */\n\tauthentication_complete() {\n\t\tvar selected_session = $( '.selected' ).attr( 'data-session-id' ),\n\t\t\terr_msg = _self.translations.auth_failed[ _self.lang ];\n\n\t\t_self.auth_pending = false;\n\t\t_self.cache_set( selected_session, 'user', lightdm.authentication_user, 'session' );\n\n\t\t$( '#timerArea' ).hide();\n\n\t\tif ( lightdm.is_authenticated ) {\n\t\t\t// The user entered the correct password. Let's log them in.\n\t\t\t$('body').fadeOut(1000);\n\t\t\tlightdm.login( lightdm.authentication_user, selected_session );\n\t\t} else {\n\t\t\t// The user did not enter the correct password. Show error message.\n\t\t\t$( '#statusArea' ).show();\n\t\t}\n\t}\n\n\tsubmit_password( event ) {\n\t\tlightdm.respond( $( '#passwordField' ).val() );\n\t\t$( '#passwordArea' ).hide();\n\t\t$( '#timerArea' ).show();\n\t}\n\n\tsession_toggle_handler( event ) {\n\t\tvar $session = $( this ).children( 'a' ),\n\t\t\tsession_name = $session.text(),\n\t\t\tsession_key = $session.attr( 'data-session-id' );\n\n\t\t$session.parents( '.btn-group' ).find( '.selected' ).attr( 'data-session-id', session_key ).html( session_name );\n\t}\n\n\tkey_press_handler( event ) {\n\t\tvar action;\n\t\tswitch ( event.which ) {\n\t\t\tcase 13:\n\t\t\t\taction = _self.auth_pending ? _self.submit_password() : ! _self.user_list_visible ? _self.show_user_list() : 0;\n\t\t\t\t_self.log( action );\n\t\t\t\tbreak;\n\t\t\tcase 27:\n\t\t\t\taction = _self.auth_pending ? _self.cancel_authentication() : 0;\n\t\t\t\t_self.log( action );\n\t\t\t\tbreak;\n\t\t\tcase 32:\n\t\t\t\taction = (! _self.user_list_visible && ! _self.auth_pending) ? _self.show_user_list() : 0;\n\t\t\t\t_self.log( action );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsystem_action_handler() {\n\t\tvar action = $( this ).attr( 'id' ),\n\t\t\t$modal = $( '.modal' );\n\n\t\t$modal.find( '.btn-primary' ).text( _self.translations[ action ] ).click( action, ( event ) => {\n\t\t\t$( this ).off( 'click' );\n\t\t\tlightdm[ event.data ]();\n\t\t} );\n\t\t$modal.find( '.btn-default' ).click( () => {\n\t\t\t$( this ).next().off( 'click' );\n\t\t} );\n\n\t\t$modal.modal('toggle');\n\t}\n\n\n\tuser_list_collapse_handler() {\n\t\t_self.user_list_visible = _self.$user_list.hasClass( 'in' ) ? true : false;\n\t}\n\n\n\tuser_image_error_handler( event ) {\n\t\t$(this).off('error.antergos');\n\t\t$(this).attr('src', _self.tux);\n\t}\n\n\n\t/**\n\t * LightDM Callback - Show password prompt to user.\n\t *\n\t * @param text\n\t * @param type\n\t */\n\tshow_prompt( text, type ) {\n\t\tif ( 'password' === type ) {\n\t\t\t$( '#passwordField' ).val( \"\" );\n\t\t\t$( '#passwordArea' ).show();\n\t\t\t$( '#passwordField' ).focus();\n\t\t}\n\t}\n\n\t/**\n\t * LightDM Callback - Show message to user.\n\t *\n\t * @param text\n\t */\n\tshow_message( text, type ) {\n\t\tif ( text.length > 0 ) {\n\t\t\t$( this.$msg_area ).html( text );\n\t\t\t$( '#passwordArea' ).hide();\n\t\t\t$( this.$msg_area_container ).show();\n\t\t}\n\t}\n}\n\n\n/**\n * Initialize the theme once the window has loaded.\n */\n$( window ).load( () => {\n\t_self = new AntergosTheme();\n} );\n\n"]}
\ No newline at end of file
+{"version":3,"sources":["greeter.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAI,QAAQ,IAAR;IACH,WAAW,IAAX;IACA,QAAQ,IAAR;;;;;;;AAQD,OAAO,SAAP,CAAiB,UAAjB,GAA8B,YAAW;AACxC,QAAO,KAAK,MAAL,CAAa,CAAb,EAAiB,WAAjB,KAAiC,KAAK,KAAL,CAAY,CAAZ,CAAjC,CADiC;CAAX;;;;;AAY9B,MAAM,kBAAN,CAAyB;;AAExB,eAAc;AACb,MAAK,SAAS,KAAT,EAAiB;AACrB,UAAO,KAAP,CADqB;GAAtB;AAGA,UAAQ,IAAR,CAJa;;AAMb,OAAK,KAAL,GAAa,IAAb,CANa;AAOb,OAAK,IAAL,GAAY,OAAO,SAAP,CAAiB,QAAjB,CAA0B,KAA1B,CAAiC,GAAjC,EAAwC,CAAxC,EAA4C,WAA5C,EAAZ,CAPa;AAQb,OAAK,YAAL,GAAoB,OAAO,gBAAP,CARP;;AAUb,MAAK,gBAAgB,OAAO,OAAO,SAAP,CAAiB,SAAjB,EAA6B;AACxD,UAAO,SAAP,CAAiB,SAAjB,GAA6B,CAAE,OAAO,SAAP,CAAiB,QAAjB,CAA/B,CADwD;GAAzD;;AAIA,OAAK,kBAAL,GAda;EAAd;;;;;;;AAFwB,IAyBxB,CAAK,IAAL,EAAY;AACX,MAAK,SAAS,KAAK,KAAL,EAAa;AAC1B,WAAQ,GAAR,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A6B;AAC5B,QAAM,iBAAN,GAA0B,MAAM,UAAN,CAAiB,QAAjB,CAA2B,IAA3B,IAAoC,IAApC,GAA2C,KAA3C,CADE;EAA7B;;AAKA,0BAA0B,KAA1B,EAAkC;AACjC,IAAG,IAAH,EAAU,GAAV,CAAe,gBAAf,EADiC;AAEjC,IAAG,IAAH,EAAU,IAAV,CAAgB,KAAhB,EAAuB,MAAM,GAAN,CAAvB,CAFiC;EAAlC;;;;;;;;AAzXmB,YAqYnB,CAAa,IAAb,EAAmB,IAAnB,EAA0B;AACzB,MAAK,eAAe,IAAf,EAAsB;AAC1B,KAAG,gBAAH,EAAsB,GAAtB,CAA2B,EAA3B,EAD0B;AAE1B,KAAG,eAAH,EAAqB,IAArB,GAF0B;AAG1B,KAAG,gBAAH,EAAsB,KAAtB,GAH0B;GAA3B;EADD;;;;;;;AArYmB,aAkZnB,CAAc,IAAd,EAAoB,IAApB,EAA2B;AAC1B,MAAK,KAAK,MAAL,GAAc,CAAd,EAAkB;AACtB,KAAG,KAAK,SAAL,CAAH,CAAoB,IAApB,CAA0B,IAA1B,EADsB;AAEtB,KAAG,eAAH,EAAqB,IAArB,GAFsB;AAGtB,KAAG,KAAK,mBAAL,CAAH,CAA8B,IAA9B,GAHsB;GAAvB;EADD;CAlZD;;;;;AA+ZA,EAAG,MAAH,EAAY,IAAZ,CAAkB,MAAM;AACvB,KAAI,kBAAJ,GADuB;AAEvB,KAAI,aAAJ,GAFuB;CAAN,CAAlB","file":"greeter-compiled.js","sourcesContent":["/*\n *\n * Copyright © 2015-2016 Antergos\n *\n * greeter.js\n *\n * This file is part of lightdm-webkit-theme-antergos\n *\n * lightdm-webkit-theme-antergos is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License,\n * or any later version.\n *\n * lightdm-webkit-theme-antergos is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * The following additional terms are in effect as per Section 7 of this license:\n *\n * The preservation of all legal notices and author attributions in\n * the material or in the Appropriate Legal Notices displayed\n * by works containing it is required.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n */\n\n\n/**\n * This is used to access our classes from within jQuery callbacks.\n */\nvar _self = null,\n\t_bg_self = null,\n\t_util = null;\n\n\n/**\n * Capitalize a string.\n *\n * @returns {string}\n */\nString.prototype.capitalize = function() {\n\treturn this.charAt( 0 ).toUpperCase() + this.slice( 1 );\n};\n\n\n\n\n\n\n/**\n * This is the base class for the theme's components.\n */\nclass AntergosThemeUtils {\n\n\tconstructor() {\n\t\tif ( null !== _util ) {\n\t\t\treturn _util;\n\t\t}\n\t\t_util = this;\n\n\t\tthis.debug = true;\n\t\tthis.lang = window.navigator.language.split( '-' )[ 0 ].toLowerCase();\n\t\tthis.translations = window.ant_translations;\n\n\t\tif ( 'undefined' === typeof window.navigator.languages ) {\n\t\t\twindow.navigator.languages = [ window.navigator.language ];\n\t\t}\n\n\t\tthis.init_config_values();\n\t}\n\n\n\t/**\n\t * Add text to the debug log element (accessible from the login screen).\n\t *\n\t * @param {string} text - To be added to the log.\n\t */\n\tlog( text ) {\n\t\tif ( true === this.debug ) {\n\t\t\tconsole.log( text );\n\t\t}\n\t\t$( '#logArea' ).append( `${text}
` );\n\t}\n\n\n\t/**\n\t * Get a key's value from localStorage. Keys can have two or more parts.\n\t * For example: \"ant:user:john:session\".\n\t *\n\t * @param {...string} key_parts - Strings that are combined to form the key.\n\t */\n\tcache_get() {\n\t\tvar key = `ant`;\n\n\t\tfor (var _len = arguments.length, key_parts = new Array(_len), _key = 0; _key < _len; _key++) {\n\t\t\tkey_parts[_key] = arguments[_key];\n\t\t}\n\n\t\tfor ( var part of key_parts ) {\n\t\t\tkey += `:${part}`;\n\t\t}\n\t\treturn localStorage.getItem( key );\n\t}\n\n\n\t/**\n\t * Set a key's value in localStorage. Keys can have two or more parts.\n\t * For example: \"ant:user:john:session\".\n\t *\n\t * @param {string} value - The value to set.\n\t * @param {...string} key_parts - Strings that are combined to form the key.\n\t */\n\tcache_set( value ) {\n\t\tvar key = `ant`;\n\n\t\tfor (var _len2 = arguments.length, key_parts = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n\t\t\tkey_parts[_key2 - 1] = arguments[_key2];\n\t\t}\n\n\t\tfor ( var part of key_parts ) {\n\t\t\tkey += `:${part}`;\n\t\t}\n\t\treturn localStorage.setItem( key, value );\n\t}\n\n\n\t/**\n\t * Get some values from `lightdm-webkit2-greeter.conf` and save them for later.\n\t */\n\tinit_config_values() {\n\t\tvar logo = '', user_image = '', background_images = [], background_images_dir = '';\n\n\t\tif ( 'undefined' !== typeof config ) {\n\n\t\t\tlogo = config.get_str( 'branding', 'logo' ) || '';\n\t\t\tuser_image = config.get_str( 'branding', 'user_image' ) || '';\n\n\n\t\t\tbackground_images_dir = config.get_str( 'branding', 'background_images' ) || '';\n\t\t\tif ( background_images_dir ) {\n\t\t\t\tbackground_images = greeterutil.dirlist( background_images_dir ) || [];\n\t\t\t}\n\n\t\t\tif ( background_images && background_images.length ) {\n\t\t\t\tvar images = [];\n\t\t\t\tfor ( var file of background_images ) {\n\t\t\t\t\tif ( file.match( /(png|PNG)|(jpg|JPEG)|(bmp|BMP)/ ) ) {\n\t\t\t\t\t\timages.push( file );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbackground_images = images;\n\t\t\t}\n\n\t\t}\n\n\t\tthis.logo = logo;\n\t\tthis.user_image = user_image;\n\t\tthis.background_images = background_images;\n\t\tthis.background_images_dir = background_images_dir;\n\t}\n}\n\n\n\n\n\n\n/**\n * This class handles the theme's background switcher.\n */\nclass AntergosBackgroundManager {\n\n\tconstructor() {\n\t\tif ( null !== _bg_self ) {\n\t\t\treturn _bg_self;\n\t\t}\n\n\t\t_bg_self = this;\n\n\t\tthis.current_background = _util.cache_get( 'background_manager', 'current_background' );\n\n\t\tif ( ! _util.background_images_dir.length || ! _util.background_images.length ) {\n\t\t\tthis.log( 'AntergosBackgroundManager: [ERROR] No background images detected.' );\n\n\t\t\t$( '.header' ).fadeTo( 300, 0.5, function() {\n\t\t\t\t$( '.header' ).css( \"background\", '#000000' );\n\t\t\t} ).fadeTo( 300, 1 );\n\n\t\t}\n\n\t\treturn _bg_self;\n\t}\n\n\n\tinitialize() {\n\t\tif ( ! this.current_background ) {\n\t\t\t// For backwards compatibility\n\t\t\tif ( null !== localStorage.getItem( 'bgsaved' ) && '0' === localStorage.getItem( 'bgrandom' ) ) {\n\t\t\t\tthis.current_background = localStorage.getItem( 'bgsaved' );\n\t\t\t\t_util.cache_set( this.current_background, 'background_manager', 'current_background' );\n\t\t\t\tlocalStorage.removeItem( 'bgrandom' );\n\t\t\t\tlocalStorage.removeItem( 'bgsaved' );\n\t\t\t} else {\n\t\t\t\tif ( '0' === localStorage.getItem( 'bgrandom' ) ) {\n\t\t\t\t\tthis.current_background = this.get_random_image();\n\t\t\t\t\t_util.cache_set( 'true', 'background_manager', 'random_background' );\n\t\t\t\t\tlocalStorage.removeItem( 'bgrandom' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! this.current_background ) {\n\t\t\t// For current and future versions\n\t\t\tlet current_background = _util.cache_get( 'background_manager', 'current_background' ),\n\t\t\t\trandom_background = _util.cache_get( 'background_manager', 'random_background' );\n\n\t\t\tif ( 'true' === random_background || ! current_background ) {\n\t\t\t\tcurrent_background = this.get_random_image();\n\t\t\t\t_util.cache_set( 'true', 'background_manager', 'random_background' );\n\t\t\t}\n\n\t\t\tthis.current_background = current_background;\n\t\t\t_util.cache_set( this.current_background, 'background_manager', 'current_background' );\n\t\t}\n\n\t\tthis.do_background();\n\t}\n\n\n\tdo_background() {\n\t\t\t$( '.header' ).fadeTo( 300, 0.5, function() {\n\t\t\t\tvar tpl = `url(${_bg_self.current_background})`;\n\t\t\t\t$( '.header' ).css( \"background-image\", tpl );\n\t\t\t} ).fadeTo( 300, 1 );\n\t}\n\n\n\tget_random_image() {\n\t\tvar random_bg;\n\n\t\trandom_bg = Math.floor( Math.random() * _util.background_images.length );\n\n\t\treturn _util.background_images[ random_bg ];\n\t}\n\n\tsetup_background_thumbnails() {\n\t\tif ( _util.background_images.length ) {\n\t\t\t$('[data-img=\"random\"]').click(this.background_selected_handler);\n\n\t\t\tfor ( var image_file of _util.background_images ) {\n\t\t\t\tvar $link = $( '' ),\n\t\t\t\t\t$img_el = $link.children( 'img' ),\n\t\t\t\t\ttpl = `file://${image_file}`;\n\n\t\t\t\t$link.addClass( 'bg clearfix' ).attr( 'data-img', tpl );\n\t\t\t\t$img_el.attr( 'src', tpl );\n\n\t\t\t\t$link.appendTo( $( '.bgs' ) ).click( this.background_selected_handler );\n\t\t\t}\n\t\t}\n\t}\n\n\n\tbackground_selected_handler( event ) {\n\t\tvar img = $( this ).attr( 'data-img' );\n\n\t\tif ( 'random' === img ) {\n\t\t\t_util.cache_set( 'true', 'background_manager', 'random_background' );\n\t\t\timg = _bg_self.get_random_image();\n\t\t}\n\n\t\t_util.cache_set( img, 'background_manager', 'current_background' );\n\t\t_bg_self.current_background = img;\n\n\t\t_bg_self.do_background();\n\n\t}\n}\n\n\n\n\n\n/**\n * This is the theme's main class object. It contains almost all the theme's logic.\n */\nclass AntergosTheme {\n\n\tconstructor() {\n\t\tif ( null !== _self ) {\n\t\t\treturn _self;\n\t\t}\n\t\t_self = this;\n\n\t\tthis.tux = 'img/antergos-logo-user.png';\n\t\tthis.user_list_visible = false;\n\t\tthis.auth_pending = false;\n\t\tthis.selected_user = null;\n\t\tthis.$user_list = $( '#user-list2' );\n\t\tthis.$session_list = $( '#sessions' );\n\t\tthis.$clock_container = $( '#collapseOne' );\n\t\tthis.$clock = $( \"#current_time\" );\n\t\tthis.$actions_container = $( \"#actionsArea\" );\n\t\tthis.$msg_area_container = $( '#statusArea' );\n\t\tthis.$msg_area = $( '#showMsg' );\n\n\t\tthis.background_manager = new AntergosBackgroundManager();\n\t\tthis.background_manager.initialize();\n\n\t\tthis.initialize();\n\n\t\treturn _self;\n\t}\n\n\tinitialize() {\n\t\tthis.prepare_translations();\n\t\tthis.do_static_translations();\n\t\tthis.initialize_clock();\n\t\tthis.prepare_login_panel_header();\n\t\tthis.prepare_user_list();\n\t\tthis.prepare_session_list();\n\t\tthis.prepare_system_action_buttons();\n\t\tthis.register_callbacks();\n\t\tthis.background_manager.setup_background_thumbnails();\n\t}\n\n\n\t/**\n\t * Register callbacks for the LDM Greeter as well as any others that haven't been registered\n\t * elsewhere.\n\t */\n\tregister_callbacks() {\n\t\tvar events = 'shown.bs.collapse, hidden.bs.collapse';\n\n\t\tthis.$user_list.parents( '.collapse' ).on( events, this.user_list_collapse_handler );\n\t\t$( document ).keydown( this.key_press_handler );\n\t\t$( '.cancel_auth' ).click( this.cancel_authentication );\n\t\t$( '.submit_passwd' ).click( this.submit_password );\n\n\t\twindow.show_prompt = this.show_prompt;\n\t\twindow.show_message = this.show_message;\n\t\twindow.start_authentication = this.start_authentication;\n\t\twindow.cancel_authentication = this.cancel_authentication;\n\t\twindow.authentication_complete = this.authentication_complete;\n\t\twindow.autologin_timer_expired = this.cancel_authentication;\n\t}\n\n\t/**\n\t * Initialize the user list.\n\t */\n\tprepare_user_list() {\n\t\tvar template;\n\n\t\t// Loop through the array of LightDMUser objects to create our user list.\n\t\tfor ( var user of lightdm.users ) {\n\t\t\tvar last_session = _util.cache_get( 'user', user.name, 'session' ),\n\t\t\t\timage_src = user.image.length ? user.image : _util.user_image;\n\n\t\t\tif ( null === last_session ) {\n\t\t\t\t// For backwards compatibility\n\t\t\t\tlast_session = localStorage.getItem( user.name );\n\t\t\t\tif ( null === last_session ) {\n\t\t\t\t\t// This user has never logged in before let's enable the system's default\n\t\t\t\t\t// session.\n\t\t\t\t\tlast_session = lightdm.default_session;\n\t\t\t\t}\n\t\t\t\t_util.cache_set( last_session, 'user', user.name, 'session' );\n\t\t\t}\n\n\t\t\t_util.log( `Last session for ${user.name} was: ${last_session}` );\n\n\t\t\ttemplate = `\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${user.display_name}\n\t\t\t\t\t\n\t\t\t\t`;\n\n\t\t\t// Register event handler here so we don't have to iterate over the users again later.\n\t\t\t$( template ).appendTo( this.$user_list ).click( this.start_authentication ).on( 'error.antergos', this.user_image_error_handler );\n\n\t\t} // END for ( var user of lightdm.users )\n\n\t\tif ( $( this.$user_list ).children().length > 3 ) {\n\t\t\t// Make the user list two columns instead of one.\n\t\t\t$( this.$user_list ).css( 'column-count', '2' ).parent().css( 'max-width', '85%' );\n\t\t}\n\n\t}\n\n\t/**\n\t * Initialize the session selection dropdown.\n\t */\n\tprepare_session_list() {\n\t\t// Loop through the array of LightDMSession objects to create our session list.\n\t\tfor ( var session of lightdm.sessions ) {\n\t\t\tvar css_class = session.name.replace( / /g, '' ),\n\t\t\t\ttemplate;\n\n\t\t\t_util.log( `Adding ${session.name} to the session list...` );\n\n\t\t\ttemplate = `\n\t\t\t\t\n\t\t\t\t\t${session.name}\n\t\t\t\t`;\n\n\t\t\t$( template ).appendTo( this.$session_list ).click( this.session_toggle_handler );\n\n\t\t} // END for (var session of lightdm.sessions)\n\n\t\t$( '.dropdown-toggle' ).dropdown();\n\t}\n\n\t/**\n\t * Initialize the system action buttons\n\t */\n\tprepare_system_action_buttons() {\n\t\tvar actions = {\n\t\t\t\tshutdown: \"power-off\",\n\t\t\t\thibernate: \"asterisk\",\n\t\t\t\tsuspend: \"arrow-down\",\n\t\t\t\trestart: \"refresh\"\n\t\t\t},\n\t\t\ttemplate;\n\n\t\tfor ( var action of Object.keys( actions ) ) {\n\t\t\tvar cmd = `can_${action}`;\n\n\t\t\ttemplate = `\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t`;\n\n\t\t\tif ( lightdm[ cmd ] ) {\n\t\t\t\t$( template ).appendTo( $( this.$actions_container ) ).click( this.system_action_handler );\n\t\t\t}\n\t\t} // END for (var [action, icon] of actions)\n\n\t\t$( '[data-toggle=tooltip]' ).tooltip();\n\t\t$( '.modal' ).modal( { show: false } );\n\t}\n\n\tinitialize_clock() {\n\t\tvar saved_format = _util.cache_get( 'clock', 'time_format' ),\n\t\t\tformat = (null !== saved_format) ? saved_format : 'LT';\n\n\t\tmoment.locale( window.navigator.languages );\n\t\tthis.$clock.html( moment().format( format ) );\n\n\t\tsetInterval( () => {\n\t\t\t_self.$clock.html( moment().format( format ) );\n\t\t}, 60000 );\n\t}\n\n\n\t/**\n\t * Show the user list if its not already shown. This is used to allow the user to\n\t * display the user list by pressing Enter or Spacebar.\n\t */\n\tshow_user_list() {\n\t\tif ( $( this.$clock_container ).hasClass( 'in' ) ) {\n\t\t\t$( '#trigger' ).trigger( 'click' );\n\t\t}\n\t\tif ( $( this.$user_list ).length <= 1 ) {\n\t\t\t$( this.$user_list ).find( 'a' ).trigger( 'click', this );\n\t\t}\n\t}\n\n\n\tprepare_login_panel_header() {\n\t\tvar greeting = (_util.translations.greeting) ? _util.translations.greeting : 'Welcome!',\n\t\t\tlogo = ( '' !== _util.logo ) ? _util.logo : 'img/antergos.png';\n\n\t\t$( '.welcome' ).text( greeting );\n\t\t$( '#hostname' ).append( lightdm.hostname );\n\t\t$( '[data-greeter-config=\"logo\"]' ).attr( 'src', logo );\n\t}\n\n\n\tprepare_translations() {\n\t\tif ( ! _util.translations.hasOwnProperty( this.lang ) ) {\n\t\t\tfor ( var lang of window.navigator.languages ) {\n\t\t\t\tif ( _util.translations.hasOwnProperty( lang ) ) {\n\t\t\t\t\tthis.lang = lang;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ( ! _util.translations.hasOwnProperty( this.lang ) ) {\n\t\t\tthis.lang = 'en';\n\t\t}\n\n\t\t_util.translations = _util.translations[ this.lang ];\n\t}\n\n\n\t/**\n\t * Replace '${i18n}' with translated string for all elements that\n\t * have the data-i18n attribute. This is for elements that are not generated\n\t * dynamically (they can be found in index.html).\n\t */\n\tdo_static_translations() {\n\t\t$( '[data-i18n]' ).each( function() {\n\t\t\tvar key = $( this ).attr( 'data-i18n' ),\n\t\t\t\thtml = $( this ).html(),\n\t\t\t\ttranslated = _util.translations[ key ],\n\t\t\t\tnew_html = html.replace( '${i18n}', translated );\n\n\t\t\t$( this ).html( new_html );\n\t\t} );\n\t}\n\n\n\t/**\n\t * Start the authentication process for the selected user.\n\t *\n\t * @param {object} event - jQuery.Event object from 'click' event.\n\t */\n\tstart_authentication( event ) {\n\t\tvar user_id = $( this ).attr( 'id' ),\n\t\t\tselector = `.${user_id}`,\n\t\t\tuser_session = _util.cache_get( 'user', user_id, 'session' );\n\n\t\tif ( _self.auth_pending || null !== _self.selected_user ) {\n\t\t\tlightdm.cancel_authentication();\n\t\t\t_util.log( `Authentication cancelled for ${_self.selected_user}` );\n\t\t\t_self.selected_user = null;\n\t\t}\n\n\t\t_util.log( `Starting authentication for ${user_id}.` );\n\t\t_self.selected_user = user_id;\n\n\t\t// CSS hack to workaround webkit bug\n\t\tif ( $( _self.$user_list ).children().length > 3 ) {\n\t\t\t$( _self.$user_list ).css( 'column-count', 'initial' ).parent().css( 'max-width', '50%' );\n\t\t}\n\t\t$( selector ).addClass( 'hovered' ).siblings().hide();\n\t\t$( '.fa-toggle-down' ).hide();\n\n\t\t_util.log( `Session for ${user_id} is ${user_session}` );\n\n\t\t$( `[data-session-id=\"${user_session}\"]` ).parent().trigger( 'click', this );\n\n\t\t$( '#session-list' ).removeClass( 'hidden' ).show();\n\t\t$( '#passwordArea' ).show();\n\t\t$( '.dropdown-toggle' ).dropdown();\n\n\t\t_self.auth_pending = true;\n\n\t\tlightdm.authenticate( user_id );\n\t}\n\n\n\t/**\n\t * Cancel the pending authentication.\n\t *\n\t * @param {object} event - jQuery.Event object from 'click' event.\n\t */\n\tcancel_authentication( event ) {\n\t\tvar selectors = [ '#statusArea', '#timerArea', '#passwordArea', '#session-list' ];\n\n\t\tfor ( var selector of selectors ) {\n\t\t\t$( selector ).hide();\n\t\t}\n\n\t\tlightdm.cancel_authentication();\n\n\t\t_util.log( 'Cancelled authentication.' );\n\n\t\t// CSS hack to work-around webkit bug\n\t\tif ( $( _self.$user_list ).children().length > 3 ) {\n\t\t\t$( _self.$user_list ).css( 'column-count', '2' ).parent().css( 'max-width', '85%' );\n\t\t}\n\n\t\t$( '.hovered' ).removeClass( 'hovered' ).siblings().show();\n\t\t$( '.fa-toggle-down' ).show();\n\n\t\t_self.selected_user = null;\n\t\t_self.auth_pending = false;\n\n\t}\n\n\n\t/**\n\t * Called when the user attempts to authenticate (inputs password).\n\t * We check to see if the user successfully authenticated and if so tell the LDM\n\t * Greeter to log them in with the session they selected.\n\t */\n\tauthentication_complete() {\n\t\tvar selected_session = $( '.selected' ).attr( 'data-session-id' ),\n\t\t\terr_msg = _util.translations.auth_failed[ _self.lang ];\n\n\t\t_self.auth_pending = false;\n\t\t_util.cache_set( selected_session, 'user', lightdm.authentication_user, 'session' );\n\n\t\t$( '#timerArea' ).hide();\n\n\t\tif ( lightdm.is_authenticated ) {\n\t\t\t// The user entered the correct password. Let's log them in.\n\t\t\t$( 'body' ).fadeOut( 1000, () => {\n\t\t\t\tlightdm.login( lightdm.authentication_user, selected_session );\n\t\t\t} );\n\t\t} else {\n\t\t\t// The user did not enter the correct password. Show error message.\n\t\t\t$( '#statusArea' ).show();\n\t\t}\n\t}\n\n\tsubmit_password( event ) {\n\t\tlightdm.respond( $( '#passwordField' ).val() );\n\t\t$( '#passwordArea' ).hide();\n\t\t$( '#timerArea' ).show();\n\t}\n\n\tsession_toggle_handler( event ) {\n\t\tvar $session = $( this ).children( 'a' ),\n\t\t\tsession_name = $session.text(),\n\t\t\tsession_key = $session.attr( 'data-session-id' );\n\n\t\t$session.parents( '.btn-group' ).find( '.selected' ).attr( 'data-session-id', session_key ).html( session_name );\n\t}\n\n\tkey_press_handler( event ) {\n\t\tvar action;\n\t\tswitch ( event.which ) {\n\t\t\tcase 13:\n\t\t\t\taction = _self.auth_pending ? _self.submit_password() : ! _self.user_list_visible ? _self.show_user_list() : 0;\n\t\t\t\t_self.log( action );\n\t\t\t\tbreak;\n\t\t\tcase 27:\n\t\t\t\taction = _self.auth_pending ? _self.cancel_authentication() : 0;\n\t\t\t\t_self.log( action );\n\t\t\t\tbreak;\n\t\t\tcase 32:\n\t\t\t\taction = (! _self.user_list_visible && ! _self.auth_pending) ? _self.show_user_list() : 0;\n\t\t\t\t_self.log( action );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsystem_action_handler() {\n\t\tvar action = $( this ).attr( 'id' ),\n\t\t\t$modal = $( '.modal' );\n\n\t\t$modal.find( '.btn-primary' ).text( _util.translations[ action ] ).click( action, ( event ) => {\n\t\t\t$( this ).off( 'click' );\n\t\t\tlightdm[ event.data ]();\n\t\t} );\n\t\t$modal.find( '.btn-default' ).click( () => {\n\t\t\t$( this ).next().off( 'click' );\n\t\t} );\n\n\t\t$modal.modal( 'toggle' );\n\t}\n\n\n\tuser_list_collapse_handler() {\n\t\t_self.user_list_visible = _self.$user_list.hasClass( 'in' ) ? true : false;\n\t}\n\n\n\tuser_image_error_handler( event ) {\n\t\t$( this ).off( 'error.antergos' );\n\t\t$( this ).attr( 'src', _self.tux );\n\t}\n\n\n\t/**\n\t * LightDM Callback - Show password prompt to user.\n\t *\n\t * @param text\n\t * @param type\n\t */\n\tshow_prompt( text, type ) {\n\t\tif ( 'password' === type ) {\n\t\t\t$( '#passwordField' ).val( \"\" );\n\t\t\t$( '#passwordArea' ).show();\n\t\t\t$( '#passwordField' ).focus();\n\t\t}\n\t}\n\n\t/**\n\t * LightDM Callback - Show message to user.\n\t *\n\t * @param text\n\t */\n\tshow_message( text, type ) {\n\t\tif ( text.length > 0 ) {\n\t\t\t$( this.$msg_area ).html( text );\n\t\t\t$( '#passwordArea' ).hide();\n\t\t\t$( this.$msg_area_container ).show();\n\t\t}\n\t}\n}\n\n\n/**\n * Initialize the theme once the window has loaded.\n */\n$( window ).load( () => {\n\tnew AntergosThemeUtils();\n\tnew AntergosTheme();\n} );\n\n"]}
\ No newline at end of file
diff --git a/themes/antergos/js/greeter.js b/themes/antergos/js/greeter.js
index fbc2bb0..72125e5 100644
--- a/themes/antergos/js/greeter.js
+++ b/themes/antergos/js/greeter.js
@@ -31,7 +31,8 @@
* This is used to access our classes from within jQuery callbacks.
*/
var _self = null,
- _bg_self = null;
+ _bg_self = null,
+ _util = null;
/**
@@ -51,9 +52,14 @@ String.prototype.capitalize = function() {
/**
* This is the base class for the theme's components.
*/
-class GreeterThemeComponent {
+class AntergosThemeUtils {
constructor() {
+ if ( null !== _util ) {
+ return _util;
+ }
+ _util = this;
+
this.debug = true;
this.lang = window.navigator.language.split( '-' )[ 0 ].toLowerCase();
this.translations = window.ant_translations;
@@ -85,9 +91,13 @@ class GreeterThemeComponent {
*
* @param {...string} key_parts - Strings that are combined to form the key.
*/
- cache_get( ...key_parts ) {
+ cache_get() {
var key = `ant`;
+ for (var _len = arguments.length, key_parts = new Array(_len), _key = 0; _key < _len; _key++) {
+ key_parts[_key] = arguments[_key];
+ }
+
for ( var part of key_parts ) {
key += `:${part}`;
}
@@ -102,9 +112,13 @@ class GreeterThemeComponent {
* @param {string} value - The value to set.
* @param {...string} key_parts - Strings that are combined to form the key.
*/
- cache_set( value, ...key_parts ) {
+ cache_set( value ) {
var key = `ant`;
+ for (var _len2 = arguments.length, key_parts = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
+ key_parts[_key2 - 1] = arguments[_key2];
+ }
+
for ( var part of key_parts ) {
key += `:${part}`;
}
@@ -119,26 +133,26 @@ class GreeterThemeComponent {
var logo = '', user_image = '', background_images = [], background_images_dir = '';
if ( 'undefined' !== typeof config ) {
- if ( this instanceof AntergosTheme ) {
- logo = config.get_str( 'branding', 'logo' ) || '';
- user_image = config.get_str( 'branding', 'user_image' ) || '';
-
- } else if ( this instanceof AntergosBackgroundManager ) {
- background_images_dir = config.get_str( 'branding', 'background_images' ) || '';
- if (background_images_dir) {
- background_images = greeterutil.dirlist(background_images_dir) || [];
- }
- if (background_images.length) {
- let images = [];
- for (var file of background_images) {
- if (file.match(/(png|PNG)|(jpg|JPEG)|(bmp|BMP)/)) {
- images.push(file);
- }
+ logo = config.get_str( 'branding', 'logo' ) || '';
+ user_image = config.get_str( 'branding', 'user_image' ) || '';
+
+
+ background_images_dir = config.get_str( 'branding', 'background_images' ) || '';
+ if ( background_images_dir ) {
+ background_images = greeterutil.dirlist( background_images_dir ) || [];
+ }
+
+ if ( background_images && background_images.length ) {
+ var images = [];
+ for ( var file of background_images ) {
+ if ( file.match( /(png|PNG)|(jpg|JPEG)|(bmp|BMP)/ ) ) {
+ images.push( file );
}
- background_images = images;
}
+ background_images = images;
}
+
}
this.logo = logo;
@@ -156,24 +170,26 @@ class GreeterThemeComponent {
/**
* This class handles the theme's background switcher.
*/
-class AntergosBackgroundManager extends GreeterThemeComponent {
+class AntergosBackgroundManager {
constructor() {
- super();
- if ( null === _bg_self ) {
- _bg_self = this;
+ if ( null !== _bg_self ) {
+ return _bg_self;
}
- this.current_background = this.cache_get( 'background_manager', 'current_background' );
+ _bg_self = this;
+
+ this.current_background = _util.cache_get( 'background_manager', 'current_background' );
- if ( ! this.background_images_dir.length || ! this.background_images.length ) {
- this.log('AntergosBackgroundManager: [ERROR] No background images detected.');
+ if ( ! _util.background_images_dir.length || ! _util.background_images.length ) {
+ this.log( 'AntergosBackgroundManager: [ERROR] No background images detected.' );
$( '.header' ).fadeTo( 300, 0.5, function() {
$( '.header' ).css( "background", '#000000' );
} ).fadeTo( 300, 1 );
}
+
return _bg_self;
}
@@ -183,28 +199,30 @@ class AntergosBackgroundManager extends GreeterThemeComponent {
// For backwards compatibility
if ( null !== localStorage.getItem( 'bgsaved' ) && '0' === localStorage.getItem( 'bgrandom' ) ) {
this.current_background = localStorage.getItem( 'bgsaved' );
- this.cache_set( this.current_background, 'background_manager', 'current_background' );
+ _util.cache_set( this.current_background, 'background_manager', 'current_background' );
localStorage.removeItem( 'bgrandom' );
localStorage.removeItem( 'bgsaved' );
- } else if ( '0' === localStorage.getItem( 'bgrandom' ) ) {
- this.current_background = this.get_random_image();
- this.cache_set( 'true', 'background_manager', 'random_background' );
- localStorage.removeItem( 'bgrandom' );
+ } else {
+ if ( '0' === localStorage.getItem( 'bgrandom' ) ) {
+ this.current_background = this.get_random_image();
+ _util.cache_set( 'true', 'background_manager', 'random_background' );
+ localStorage.removeItem( 'bgrandom' );
+ }
}
}
if ( ! this.current_background ) {
// For current and future versions
- let current_background = this.cache_get('background_manager', 'current_background' ),
- random_background = this.cache_get('background_manager', 'random_background' );
+ let current_background = _util.cache_get( 'background_manager', 'current_background' ),
+ random_background = _util.cache_get( 'background_manager', 'random_background' );
if ( 'true' === random_background || ! current_background ) {
current_background = this.get_random_image();
- this.cache_set( 'true', 'background_manager', 'random_background' );
+ _util.cache_set( 'true', 'background_manager', 'random_background' );
}
this.current_background = current_background;
- this.cache_set( this.current_background, 'background_manager', 'current_background' );
+ _util.cache_set( this.current_background, 'background_manager', 'current_background' );
}
this.do_background();
@@ -212,48 +230,48 @@ class AntergosBackgroundManager extends GreeterThemeComponent {
do_background() {
- if ('undefined' !== typeof this.current_background) {
$( '.header' ).fadeTo( 300, 0.5, function() {
- var tpl = `url(${this.current_background})`;
- $( '.header' ).css("background-image", tpl );
+ var tpl = `url(${_bg_self.current_background})`;
+ $( '.header' ).css( "background-image", tpl );
} ).fadeTo( 300, 1 );
- }
}
get_random_image() {
var random_bg;
- random_bg = Math.floor( Math.random() * this.background_images.length );
+ random_bg = Math.floor( Math.random() * _util.background_images.length );
- return this.background_images[ random_bg ];
+ return _util.background_images[ random_bg ];
}
setup_background_thumbnails() {
- if (this.background_images.length) {
- for ( var image_file of this.background_images ) {
- var $link = $(''),
- $img_el = $link.children('img'),
+ if ( _util.background_images.length ) {
+ $('[data-img="random"]').click(this.background_selected_handler);
+
+ for ( var image_file of _util.background_images ) {
+ var $link = $( '' ),
+ $img_el = $link.children( 'img' ),
tpl = `file://${image_file}`;
- $link.addClass('bg clearfix').attr('data-img', tpl);
- $img_el.attr('src', tpl);
+ $link.addClass( 'bg clearfix' ).attr( 'data-img', tpl );
+ $img_el.attr( 'src', tpl );
- $link.appendTo($('.bgs')).click( this.background_selected_handler );
+ $link.appendTo( $( '.bgs' ) ).click( this.background_selected_handler );
}
}
}
background_selected_handler( event ) {
- var img = $(this).attr('data-img');
+ var img = $( this ).attr( 'data-img' );
- if ('random' === img) {
- _bg_self.cache_set('true', 'background_manager', 'random_background' );
+ if ( 'random' === img ) {
+ _util.cache_set( 'true', 'background_manager', 'random_background' );
img = _bg_self.get_random_image();
}
- _bg_self.cache_set(img, 'background_manager', 'current_background' );
+ _util.cache_set( img, 'background_manager', 'current_background' );
_bg_self.current_background = img;
_bg_self.do_background();
@@ -268,13 +286,14 @@ class AntergosBackgroundManager extends GreeterThemeComponent {
/**
* This is the theme's main class object. It contains almost all the theme's logic.
*/
-class AntergosTheme extends GreeterThemeComponent {
+class AntergosTheme {
constructor() {
- super();
- if ( null === _self ) {
- _self = this;
+ if ( null !== _self ) {
+ return _self;
}
+ _self = this;
+
this.tux = 'img/antergos-logo-user.png';
this.user_list_visible = false;
this.auth_pending = false;
@@ -286,9 +305,10 @@ class AntergosTheme extends GreeterThemeComponent {
this.$actions_container = $( "#actionsArea" );
this.$msg_area_container = $( '#statusArea' );
this.$msg_area = $( '#showMsg' );
- this.background_manager = new AntergosBackgroundManager();
+ this.background_manager = new AntergosBackgroundManager();
this.background_manager.initialize();
+
this.initialize();
return _self;
@@ -302,7 +322,6 @@ class AntergosTheme extends GreeterThemeComponent {
this.prepare_user_list();
this.prepare_session_list();
this.prepare_system_action_buttons();
- $( "#login" ).addClass( "in" );
this.register_callbacks();
this.background_manager.setup_background_thumbnails();
}
@@ -336,8 +355,8 @@ class AntergosTheme extends GreeterThemeComponent {
// Loop through the array of LightDMUser objects to create our user list.
for ( var user of lightdm.users ) {
- var last_session = this.cache_get( 'user', user.name, 'session' ),
- image_src = user.image.length ? user.image : this.user_image;
+ var last_session = _util.cache_get( 'user', user.name, 'session' ),
+ image_src = user.image.length ? user.image : _util.user_image;
if ( null === last_session ) {
// For backwards compatibility
@@ -347,10 +366,10 @@ class AntergosTheme extends GreeterThemeComponent {
// session.
last_session = lightdm.default_session;
}
- this.cache_set( last_session, 'user', user.name, 'session' );
+ _util.cache_set( last_session, 'user', user.name, 'session' );
}
- this.log( `Last session for ${user.name} was: ${last_session}` );
+ _util.log( `Last session for ${user.name} was: ${last_session}` );
template = `
@@ -360,7 +379,7 @@ class AntergosTheme extends GreeterThemeComponent {
`;
// Register event handler here so we don't have to iterate over the users again later.
- $( template ).appendTo( this.$user_list ).click( this.start_authentication ).on('error.antergos', this.user_image_error_handler);
+ $( template ).appendTo( this.$user_list ).click( this.start_authentication ).on( 'error.antergos', this.user_image_error_handler );
} // END for ( var user of lightdm.users )
@@ -380,7 +399,7 @@ class AntergosTheme extends GreeterThemeComponent {
var css_class = session.name.replace( / /g, '' ),
template;
- this.log( `Adding ${session.name} to the session list...` );
+ _util.log( `Adding ${session.name} to the session list...` );
template = `
@@ -420,11 +439,11 @@ class AntergosTheme extends GreeterThemeComponent {
} // END for (var [action, icon] of actions)
$( '[data-toggle=tooltip]' ).tooltip();
- $('.modal').modal({show: false});
+ $( '.modal' ).modal( { show: false } );
}
initialize_clock() {
- var saved_format = this.cache_get( 'clock', 'time_format' ),
+ var saved_format = _util.cache_get( 'clock', 'time_format' ),
format = (null !== saved_format) ? saved_format : 'LT';
moment.locale( window.navigator.languages );
@@ -451,29 +470,29 @@ class AntergosTheme extends GreeterThemeComponent {
prepare_login_panel_header() {
- var greeting = (this.translations.greeting) ? this.translations.greeting : 'Welcome!',
- logo = ( '' !== this.logo ) ? this.logo : 'img/antergos.png';
+ var greeting = (_util.translations.greeting) ? _util.translations.greeting : 'Welcome!',
+ logo = ( '' !== _util.logo ) ? _util.logo : 'img/antergos.png';
$( '.welcome' ).text( greeting );
$( '#hostname' ).append( lightdm.hostname );
- $('[data-greeter-config="logo"]').attr('src', logo);
+ $( '[data-greeter-config="logo"]' ).attr( 'src', logo );
}
prepare_translations() {
- if ( ! this.translations.hasOwnProperty( this.lang ) ) {
+ if ( ! _util.translations.hasOwnProperty( this.lang ) ) {
for ( var lang of window.navigator.languages ) {
- if ( this.translations.hasOwnProperty( lang ) ) {
+ if ( _util.translations.hasOwnProperty( lang ) ) {
this.lang = lang;
break;
}
}
}
- if ( ! this.translations.hasOwnProperty( this.lang ) ) {
+ if ( ! _util.translations.hasOwnProperty( this.lang ) ) {
this.lang = 'en';
}
- this.translations = this.translations[ this.lang ];
+ _util.translations = _util.translations[ this.lang ];
}
@@ -486,7 +505,7 @@ class AntergosTheme extends GreeterThemeComponent {
$( '[data-i18n]' ).each( function() {
var key = $( this ).attr( 'data-i18n' ),
html = $( this ).html(),
- translated = _self.translations[ key ],
+ translated = _util.translations[ key ],
new_html = html.replace( '${i18n}', translated );
$( this ).html( new_html );
@@ -502,15 +521,15 @@ class AntergosTheme extends GreeterThemeComponent {
start_authentication( event ) {
var user_id = $( this ).attr( 'id' ),
selector = `.${user_id}`,
- user_session = _self.cache_get( 'user', user_id, 'session' );
+ user_session = _util.cache_get( 'user', user_id, 'session' );
if ( _self.auth_pending || null !== _self.selected_user ) {
lightdm.cancel_authentication();
- _self.log( `Authentication cancelled for ${_self.selected_user}` );
+ _util.log( `Authentication cancelled for ${_self.selected_user}` );
_self.selected_user = null;
}
- _self.log( `Starting authentication for ${user_id}.` );
+ _util.log( `Starting authentication for ${user_id}.` );
_self.selected_user = user_id;
// CSS hack to workaround webkit bug
@@ -520,7 +539,7 @@ class AntergosTheme extends GreeterThemeComponent {
$( selector ).addClass( 'hovered' ).siblings().hide();
$( '.fa-toggle-down' ).hide();
- _self.log( `Session for ${user_id} is ${user_session}` );
+ _util.log( `Session for ${user_id} is ${user_session}` );
$( `[data-session-id="${user_session}"]` ).parent().trigger( 'click', this );
@@ -548,7 +567,7 @@ class AntergosTheme extends GreeterThemeComponent {
lightdm.cancel_authentication();
- _self.log( 'Cancelled authentication.' );
+ _util.log( 'Cancelled authentication.' );
// CSS hack to work-around webkit bug
if ( $( _self.$user_list ).children().length > 3 ) {
@@ -571,17 +590,18 @@ class AntergosTheme extends GreeterThemeComponent {
*/
authentication_complete() {
var selected_session = $( '.selected' ).attr( 'data-session-id' ),
- err_msg = _self.translations.auth_failed[ _self.lang ];
+ err_msg = _util.translations.auth_failed[ _self.lang ];
_self.auth_pending = false;
- _self.cache_set( selected_session, 'user', lightdm.authentication_user, 'session' );
+ _util.cache_set( selected_session, 'user', lightdm.authentication_user, 'session' );
$( '#timerArea' ).hide();
if ( lightdm.is_authenticated ) {
// The user entered the correct password. Let's log them in.
- $('body').fadeOut(1000);
- lightdm.login( lightdm.authentication_user, selected_session );
+ $( 'body' ).fadeOut( 1000, () => {
+ lightdm.login( lightdm.authentication_user, selected_session );
+ } );
} else {
// The user did not enter the correct password. Show error message.
$( '#statusArea' ).show();
@@ -626,7 +646,7 @@ class AntergosTheme extends GreeterThemeComponent {
var action = $( this ).attr( 'id' ),
$modal = $( '.modal' );
- $modal.find( '.btn-primary' ).text( _self.translations[ action ] ).click( action, ( event ) => {
+ $modal.find( '.btn-primary' ).text( _util.translations[ action ] ).click( action, ( event ) => {
$( this ).off( 'click' );
lightdm[ event.data ]();
} );
@@ -634,7 +654,7 @@ class AntergosTheme extends GreeterThemeComponent {
$( this ).next().off( 'click' );
} );
- $modal.modal('toggle');
+ $modal.modal( 'toggle' );
}
@@ -644,8 +664,8 @@ class AntergosTheme extends GreeterThemeComponent {
user_image_error_handler( event ) {
- $(this).off('error.antergos');
- $(this).attr('src', _self.tux);
+ $( this ).off( 'error.antergos' );
+ $( this ).attr( 'src', _self.tux );
}
@@ -682,6 +702,7 @@ class AntergosTheme extends GreeterThemeComponent {
* Initialize the theme once the window has loaded.
*/
$( window ).load( () => {
- _self = new AntergosTheme();
+ new AntergosThemeUtils();
+ new AntergosTheme();
} );