Browse Source

still finishing refactoring for better cross distro-compatibility

sisyphus
Dustin Falgout 9 years ago
parent
commit
6a0e54cbe9
  1. 17
      themes/antergos/css/style.css
  2. BIN
      themes/antergos/fonts/TTF/Lato-Light.ttf
  3. BIN
      themes/antergos/fonts/TTF/Lato-Regular.ttf
  4. 2
      themes/antergos/index.theme
  5. 56
      themes/antergos/js/greeter-compiled.js
  6. 2
      themes/antergos/js/greeter-compiled.js.map
  7. 58
      themes/antergos/js/greeter.js

17
themes/antergos/css/style.css

@ -29,13 +29,12 @@
/* Global Styles */ /* Global Styles */
@font-face { @font-face {
font-family: Lato; font-family: 'Open Sans';
src: url('../fonts/TTF/Lato-Regular.ttf'); src: url('../fonts/TTF/OpenSans-Regular.ttf');
} }
@font-face { @font-face {
font-family: LatoLight; font-family: 'Open Sans Light';
src: url('../fonts/TTF/Lato-Light.ttf'); src: url('../fonts/TTF/OpenSans-Light.ttf');
} }
*:focus { *:focus {
@ -89,7 +88,7 @@ body {
height: 100%; height: 100%;
width: 100%; width: 100%;
background-color: #000000; background-color: #000000;
font-family: "Lato", "Open Sans", sans-serif; font-family: "Open Sans", sans-serif;
} }
i { i {
@ -97,7 +96,7 @@ i {
} }
h3, .panel-heading { h3, .panel-heading {
font-family: "Lato", "Open Sans", sans-serif; font-family: "Open Sans", sans-serif;
font-size: 16px; font-size: 16px;
text-align: center; text-align: center;
font-weight: 400; font-weight: 400;
@ -203,7 +202,7 @@ a {
height: 100%; height: 100%;
width: 100%; width: 100%;
position: relative; position: relative;
background-image: url(''); background-color: #000000;
background-size: cover !important; background-size: cover !important;
background-repeat: no-repeat !important; background-repeat: no-repeat !important;
background-position: center !important; background-position: center !important;
@ -230,7 +229,7 @@ a {
/* Clock Widget */ /* Clock Widget */
.time { .time {
font-family: "LatoLight", "Open Sans", sans-serif; font-family: "Open Sans Light", sans-serif;
font-size: 96px; font-size: 96px;
line-height: 1em; line-height: 1em;
text-decoration: none; text-decoration: none;

BIN
themes/antergos/fonts/TTF/Lato-Light.ttf

Binary file not shown.

BIN
themes/antergos/fonts/TTF/Lato-Regular.ttf

Binary file not shown.

2
themes/antergos/index.theme

@ -1,6 +1,6 @@
[theme] [theme]
name=Antergos name=Antergos
version=2.3.2 version=2.4.0
description=Antergos Theme description=Antergos Theme
engine=lightdm-webkit2-greeter engine=lightdm-webkit2-greeter
url=index.html url=index.html

56
themes/antergos/js/greeter-compiled.js

@ -182,12 +182,14 @@ var GreeterThemeComponent = (function () {
key: 'init_config_values', key: 'init_config_values',
value: function init_config_values() { value: function init_config_values() {
var logo = '', var logo = '',
user_image = '',
background_images = [], background_images = [],
background_images_dir = ''; background_images_dir = '';
if ('undefined' !== typeof config) { if ('undefined' !== typeof config) {
if (this instanceof AntergosTheme) { if (this instanceof AntergosTheme) {
logo = config.get_str('branding', 'logo') || ''; logo = config.get_str('branding', 'logo') || '';
user_image = config.get_str('branding', 'user_image') || '';
} else if (this instanceof AntergosBackgroundManager) { } else if (this instanceof AntergosBackgroundManager) {
background_images_dir = config.get_str('branding', 'background_images') || ''; background_images_dir = config.get_str('branding', 'background_images') || '';
if (background_images_dir) { if (background_images_dir) {
@ -229,6 +231,7 @@ var GreeterThemeComponent = (function () {
} }
this.logo = logo; this.logo = logo;
this.user_image = user_image;
this.background_images = background_images; this.background_images = background_images;
this.background_images_dir = background_images_dir; this.background_images_dir = background_images_dir;
} }
@ -255,7 +258,7 @@ var AntergosBackgroundManager = (function (_GreeterThemeComponen) {
_bg_self = _this; _bg_self = _this;
} }
_this.current_background = _this.cache_get('background_config', 'current_background'); _this.current_background = _this.cache_get('background_manager', 'current_background');
if (!_this.background_images_dir.length || !_this.background_images.length) { if (!_this.background_images_dir.length || !_this.background_images.length) {
_this.log('AntergosBackgroundManager: [ERROR] No background images detected.'); _this.log('AntergosBackgroundManager: [ERROR] No background images detected.');
@ -263,10 +266,7 @@ var AntergosBackgroundManager = (function (_GreeterThemeComponen) {
$('.header').fadeTo(300, 0.5, function () { $('.header').fadeTo(300, 0.5, function () {
$('.header').css("background", '#000000'); $('.header').css("background", '#000000');
}).fadeTo(300, 1); }).fadeTo(300, 1);
} else {
_this.initialize();
} }
return _ret = _bg_self, _possibleConstructorReturn(_this, _ret); return _ret = _bg_self, _possibleConstructorReturn(_this, _ret);
} }
@ -295,11 +295,18 @@ var AntergosBackgroundManager = (function (_GreeterThemeComponen) {
if ('true' === random_background || !current_background) { if ('true' === random_background || !current_background) {
current_background = this.get_random_image(); current_background = this.get_random_image();
} }
this.current_background = current_background; this.current_background = current_background;
} }
this.do_background();
}
}, {
key: 'do_background',
value: function do_background() {
$('.header').fadeTo(300, 0.5, function () { $('.header').fadeTo(300, 0.5, function () {
$('.header').css("background", this.current_background); var tpl = 'url(\'file://' + this.current_background + '\')';
$('.header').css("background-image", tpl);
}).fadeTo(300, 1); }).fadeTo(300, 1);
} }
}, { }, {
@ -324,12 +331,13 @@ var AntergosBackgroundManager = (function (_GreeterThemeComponen) {
var image_file = _step4.value; var image_file = _step4.value;
var $link = $('<a href="#"><img>'), var $link = $('<a href="#"><img>'),
$img_el = $link.children('img'); $img_el = $link.children('img'),
tpl = 'file://' + image_file;
$link.addClass('bg clearfix').attr('data-img', image_file); $link.addClass('bg clearfix').attr('data-img', tpl);
$img_el.attr('src', image_file); $img_el.attr('src', tpl);
$link.appendTo($('.bgs')); $link.appendTo($('.bgs')).click(this.background_selected_handler);
} }
} catch (err) { } catch (err) {
_didIteratorError4 = true; _didIteratorError4 = true;
@ -347,6 +355,21 @@ var AntergosBackgroundManager = (function (_GreeterThemeComponen) {
} }
} }
} }
}, {
key: 'background_selected_handler',
value: function background_selected_handler(event) {
var img = $(this).attr('data-img');
if ('random' === img) {
this.cache_set('true', 'background_manager', 'randmom_background');
img = this.get_random_image();
}
this.cache_set(img, 'background_manager', 'current_background');
this.current_background = img;
this.do_background();
}
}]); }]);
return AntergosBackgroundManager; return AntergosBackgroundManager;
@ -369,6 +392,7 @@ var AntergosTheme = (function (_GreeterThemeComponen2) {
if (null === _self) { if (null === _self) {
_self = _this2; _self = _this2;
} }
_this2.tux = 'img/antergos-logo-user.png';
_this2.user_list_visible = false; _this2.user_list_visible = false;
_this2.auth_pending = false; _this2.auth_pending = false;
_this2.selected_user = null; _this2.selected_user = null;
@ -381,6 +405,7 @@ var AntergosTheme = (function (_GreeterThemeComponen2) {
_this2.$msg_area = $('#showMsg'); _this2.$msg_area = $('#showMsg');
_this2.background_manager = new AntergosBackgroundManager(); _this2.background_manager = new AntergosBackgroundManager();
_this2.background_manager.initialize();
_this2.initialize(); _this2.initialize();
return _ret2 = _self, _possibleConstructorReturn(_this2, _ret2); return _ret2 = _self, _possibleConstructorReturn(_this2, _ret2);
@ -431,8 +456,7 @@ var AntergosTheme = (function (_GreeterThemeComponen2) {
}, { }, {
key: 'prepare_user_list', key: 'prepare_user_list',
value: function prepare_user_list() { value: function prepare_user_list() {
var tux = 'img/antergos-logo-user.png', var template;
template;
// Loop through the array of LightDMUser objects to create our user list. // Loop through the array of LightDMUser objects to create our user list.
var _iteratorNormalCompletion5 = true; var _iteratorNormalCompletion5 = true;
@ -444,7 +468,7 @@ var AntergosTheme = (function (_GreeterThemeComponen2) {
var user = _step5.value; var user = _step5.value;
var last_session = this.cache_get('user', user.name, 'session'), var last_session = this.cache_get('user', user.name, 'session'),
image_src = user.image.length ? user.image : tux; image_src = user.image.length ? user.image : this.user_image;
if (null === last_session) { if (null === last_session) {
// For backwards compatibility // For backwards compatibility
@ -462,7 +486,7 @@ var AntergosTheme = (function (_GreeterThemeComponen2) {
template = '\n\t\t\t\t<a href="#" id="' + user.name + '" class="list-group-item ' + user.name + '" data-session="' + last_session + '">\n\t\t\t\t\t<img src="' + image_src + '" class="img-circle" alt="' + user.display_name + '" />\n\t\t\t\t\t<span>' + user.display_name + '</span>\n\t\t\t\t\t<span class="badge"><i class="fa fa-check"></i></span>\n\t\t\t\t</a>'; template = '\n\t\t\t\t<a href="#" id="' + user.name + '" class="list-group-item ' + user.name + '" data-session="' + last_session + '">\n\t\t\t\t\t<img src="' + image_src + '" class="img-circle" alt="' + user.display_name + '" />\n\t\t\t\t\t<span>' + user.display_name + '</span>\n\t\t\t\t\t<span class="badge"><i class="fa fa-check"></i></span>\n\t\t\t\t</a>';
// Register event handler here so we don't have to iterate over the users again later. // 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); $(template).appendTo(this.$user_list).click(this.start_authentication).on('error.antergos', this.user_image_error_handler);
} // END for ( var user of lightdm.users ) } // END for ( var user of lightdm.users )
} catch (err) { } catch (err) {
_didIteratorError5 = true; _didIteratorError5 = true;
@ -856,6 +880,12 @@ var AntergosTheme = (function (_GreeterThemeComponen2) {
value: function user_list_collapse_handler() { value: function user_list_collapse_handler() {
_self.user_list_visible = _self.$user_list.hasClass('in') ? true : false; _self.user_list_visible = _self.$user_list.hasClass('in') ? true : false;
} }
}, {
key: 'user_image_error_handler',
value: function user_image_error_handler(event) {
$(this).off('error.antergos');
$(this).attr('src', _self.tux);
}
/** /**
* LightDM Callback - Show password prompt to user. * LightDM Callback - Show password prompt to user.

2
themes/antergos/js/greeter-compiled.js.map

File diff suppressed because one or more lines are too long

58
themes/antergos/js/greeter.js

@ -116,11 +116,12 @@ class GreeterThemeComponent {
* Get some values from `lightdm-webkit2-greeter.conf` and save them for later. * Get some values from `lightdm-webkit2-greeter.conf` and save them for later.
*/ */
init_config_values() { init_config_values() {
let logo = '', background_images = [], background_images_dir = ''; let logo = '', user_image = '', background_images = [], background_images_dir = '';
if ( 'undefined' !== typeof config ) { if ( 'undefined' !== typeof config ) {
if ( this instanceof AntergosTheme ) { if ( this instanceof AntergosTheme ) {
logo = config.get_str( 'branding', 'logo' ) || ''; logo = config.get_str( 'branding', 'logo' ) || '';
user_image = config.get_str( 'branding', 'user_image' ) || '';
} else if ( this instanceof AntergosBackgroundManager ) { } else if ( this instanceof AntergosBackgroundManager ) {
background_images_dir = config.get_str( 'branding', 'background_images' ) || ''; background_images_dir = config.get_str( 'branding', 'background_images' ) || '';
@ -141,6 +142,7 @@ class GreeterThemeComponent {
} }
this.logo = logo; this.logo = logo;
this.user_image = user_image;
this.background_images = background_images; this.background_images = background_images;
this.background_images_dir = background_images_dir; this.background_images_dir = background_images_dir;
} }
@ -163,7 +165,7 @@ class AntergosBackgroundManager extends GreeterThemeComponent {
_bg_self = this; _bg_self = this;
} }
this.current_background = this.cache_get( 'background_config', 'current_background' ); this.current_background = this.cache_get( 'background_manager', 'current_background' );
if ( ! this.background_images_dir.length || ! this.background_images.length ) { if ( ! this.background_images_dir.length || ! this.background_images.length ) {
this.log('AntergosBackgroundManager: [ERROR] No background images detected.'); this.log('AntergosBackgroundManager: [ERROR] No background images detected.');
@ -172,10 +174,7 @@ class AntergosBackgroundManager extends GreeterThemeComponent {
$( '.header' ).css( "background", '#000000' ); $( '.header' ).css( "background", '#000000' );
} ).fadeTo( 300, 1 ); } ).fadeTo( 300, 1 );
} else {
this.initialize();
} }
return _bg_self; return _bg_self;
} }
@ -203,11 +202,18 @@ class AntergosBackgroundManager extends GreeterThemeComponent {
if ( 'true' === random_background || ! current_background ) { if ( 'true' === random_background || ! current_background ) {
current_background = this.get_random_image(); current_background = this.get_random_image();
} }
this.current_background = current_background; this.current_background = current_background;
} }
this.do_background();
}
do_background() {
$( '.header' ).fadeTo( 300, 0.5, function() { $( '.header' ).fadeTo( 300, 0.5, function() {
$( '.header' ).css( "background", this.current_background ); let tpl = `url('file://${this.current_background}')`;
$( '.header' ).css( "background-image", tpl );
} ).fadeTo( 300, 1 ); } ).fadeTo( 300, 1 );
} }
@ -224,15 +230,32 @@ class AntergosBackgroundManager extends GreeterThemeComponent {
if (this.background_images.length) { if (this.background_images.length) {
for ( var image_file of this.background_images ) { for ( var image_file of this.background_images ) {
let $link = $('<a href="#"><img>'), let $link = $('<a href="#"><img>'),
$img_el = $link.children('img'); $img_el = $link.children('img'),
tpl = `file://${image_file}`;
$link.addClass('bg clearfix').attr('data-img', image_file); $link.addClass('bg clearfix').attr('data-img', tpl);
$img_el.attr('src', image_file); $img_el.attr('src', tpl);
$link.appendTo($('.bgs')); $link.appendTo($('.bgs')).click( this.background_selected_handler );
} }
} }
} }
background_selected_handler( event ) {
let img = $(this).attr('data-img');
if ('random' === img) {
this.cache_set('true', 'background_manager', 'randmom_background' );
img = this.get_random_image();
}
this.cache_set(img, 'background_manager', 'current_background' );
this.current_background = img;
this.do_background();
}
} }
@ -250,6 +273,7 @@ class AntergosTheme extends GreeterThemeComponent {
if ( null === _self ) { if ( null === _self ) {
_self = this; _self = this;
} }
this.tux = 'img/antergos-logo-user.png';
this.user_list_visible = false; this.user_list_visible = false;
this.auth_pending = false; this.auth_pending = false;
this.selected_user = null; this.selected_user = null;
@ -262,6 +286,7 @@ class AntergosTheme extends GreeterThemeComponent {
this.$msg_area = $( '#showMsg' ); this.$msg_area = $( '#showMsg' );
this.background_manager = new AntergosBackgroundManager(); this.background_manager = new AntergosBackgroundManager();
this.background_manager.initialize();
this.initialize(); this.initialize();
return _self; return _self;
@ -305,13 +330,12 @@ class AntergosTheme extends GreeterThemeComponent {
* Initialize the user list. * Initialize the user list.
*/ */
prepare_user_list() { prepare_user_list() {
var tux = 'img/antergos-logo-user.png', var template;
template;
// Loop through the array of LightDMUser objects to create our user list. // Loop through the array of LightDMUser objects to create our user list.
for ( var user of lightdm.users ) { for ( var user of lightdm.users ) {
var last_session = this.cache_get( 'user', user.name, 'session' ), var last_session = this.cache_get( 'user', user.name, 'session' ),
image_src = user.image.length ? user.image : tux; image_src = user.image.length ? user.image : this.user_image;
if ( null === last_session ) { if ( null === last_session ) {
// For backwards compatibility // For backwards compatibility
@ -334,7 +358,7 @@ class AntergosTheme extends GreeterThemeComponent {
</a>`; </a>`;
// Register event handler here so we don't have to iterate over the users again later. // 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 ); $( template ).appendTo( this.$user_list ).click( this.start_authentication ).on('error.antergos', this.user_image_error_handler);
} // END for ( var user of lightdm.users ) } // END for ( var user of lightdm.users )
@ -617,6 +641,12 @@ class AntergosTheme extends GreeterThemeComponent {
} }
user_image_error_handler( event ) {
$(this).off('error.antergos');
$(this).attr('src', _self.tux);
}
/** /**
* LightDM Callback - Show password prompt to user. * LightDM Callback - Show password prompt to user.
* *

Loading…
Cancel
Save