Browse Source

still needs testing and a few more code improvements that I didn't get to yet

sisyphus
Dustin Falgout 9 years ago
parent
commit
249ba7c0da
  1. 8
      themes/antergos/css/style.css
  2. 8680
      themes/antergos/css/vendor/bootstrap.min.css
  3. 147
      themes/antergos/index.html
  4. 510
      themes/antergos/js/greeter.js
  5. 54
      themes/antergos/js/greeting_translations.js
  6. 11523
      themes/antergos/js/vendor/moment-with-locales.min.js

8
themes/antergos/css/style.css

@ -30,12 +30,12 @@
@font-face {
font-family: Lato;
src: url('../fonts/fonts/Lato-Regular.ttf');
src: url('../fonts/TTF/Lato-Regular.ttf');
}
@font-face {
font-family: LatoLight;
src: url('../fonts/fonts/Lato-Light.ttf');
src: url('../fonts/TTF/Lato-Light.ttf');
}
*:focus {
@ -335,10 +335,6 @@ a {
transition: all ease 3s;
}
.panel-footer .btn {
padding: 7px 12px;
}
.panel-body {
background-color: rgb(252, 247, 247);
padding: 10px;

8680
themes/antergos/css/vendor/bootstrap.min.css vendored

File diff suppressed because it is too large Load Diff

147
themes/antergos/index.html

@ -52,76 +52,77 @@
<script src="js/vendor/moment-with-locales.min.js"></script>
<!-- Theme JavaScript -->
<script type="text/javascript" src="js/greeting_translations.js"></script>
<script type="text/javascript" src="js/greeter.js"></script>
<script type="text/javascript">
function randomBG() {
localStorage.setItem("bgsaved", '');
$(".bgs .bg .random").first().addClass('active');
localStorage.setItem( "bgsaved", '' );
$( ".bgs .bg .random" ).first().addClass( 'active' );
var arrayBackground = [];
$('.bgs .clearfix').each(function (i) {
if (i > 0) {
arrayBackground.push($(this).attr('data-img'));
$( '.bgs .clearfix' ).each( function( i ) {
if ( i > 0 ) {
arrayBackground.push( $( this ).attr( 'data-img' ) );
}
});
var randBG = arrayBackground[Math.floor(Math.random() * arrayBackground.length)];
$('.header').fadeTo(300, 0.5, function () {
$(".header").css("background", "url('/usr/share/antergos/wallpapers/" + randBG + "')");
}).fadeTo(300, 1);
} );
var randBG = arrayBackground[ Math.floor( Math.random() * arrayBackground.length ) ];
$( '.header' ).fadeTo( 300, 0.5, function() {
$( ".header" ).css( "background", "url('/usr/share/antergos/wallpapers/" + randBG + "')" );
} ).fadeTo( 300, 1 );
}
$(function () {
$( function() {
// bg switcher
var $btns = $(".bg-switch .bg");
$btns.click(function (e) {
var $btns = $( ".bg-switch .bg" );
$btns.click( function( e ) {
e.preventDefault();
$btns.removeClass("active");
$(".bgs .bg .random").first().removeClass('active');
$(this).addClass("active");
var bg = $(this).data("img");
if (bg == 'random') {
console.log("Sets random background");
localStorage.setItem("bgrandom", '1');
$btns.removeClass( "active" );
$( ".bgs .bg .random" ).first().removeClass( 'active' );
$( this ).addClass( "active" );
var bg = $( this ).data( "img" );
if ( bg == 'random' ) {
console.log( "Sets random background" );
localStorage.setItem( "bgrandom", '1' );
randomBG();
} else {
console.log("Turn off random");
localStorage.setItem("bgrandom", '0');
$('.header').fadeTo(300, 0.5, function () {
$(".header").css("background", "url('/usr/share/antergos/wallpapers/" + bg + "')");
}).fadeTo(300, 1);
console.log( "Turn off random" );
localStorage.setItem( "bgrandom", '0' );
$( '.header' ).fadeTo( 300, 0.5, function() {
$( ".header" ).css( "background", "url('/usr/share/antergos/wallpapers/" + bg + "')" );
} ).fadeTo( 300, 1 );
var bgurl = "url('/usr/share/antergos/wallpapers/" + bg + "')";
localStorage.setItem("bgsaved", bgurl)
localStorage.setItem( "bgsaved", bgurl )
}
});
} );
});
} );
$(document).ready(function () {
if ((localStorage.getItem("bgsaved") !== null) && (localStorage.getItem("bgrandom") == '0')) {
$('.header').fadeTo(300, 0.5, function () {
$(".header").css("background", localStorage.getItem('bgsaved'));
}).fadeTo(300, 1);
$( document ).ready( function() {
if ( (localStorage.getItem( "bgsaved" ) !== null) && (localStorage.getItem( "bgrandom" ) == '0') ) {
$( '.header' ).fadeTo( 300, 0.5, function() {
$( ".header" ).css( "background", localStorage.getItem( 'bgsaved' ) );
} ).fadeTo( 300, 1 );
}
if (localStorage.getItem("bgrandom") !== '0') {
console.log("Is random");
if ( localStorage.getItem( "bgrandom" ) !== '0' ) {
console.log( "Is random" );
randomBG();
}
if (localStorage.getItem("bgrandom") == null) {
localStorage.setItem("bgrandom", "1");
if ( localStorage.getItem( "bgrandom" ) == null ) {
localStorage.setItem( "bgrandom", "1" );
}
$('.dropdown-toggle').dropdown();
});
$( '.dropdown-toggle' ).dropdown();
} );
function showAlert() {
$("#login").addClass("in");
$( "#login" ).addClass( "in" );
}
window.setTimeout(function () {
window.setTimeout( function() {
showAlert();
}, 500);
}, 500 );
function showLog() {
$("#logArea").show();
$( "#logArea" ).show();
}
</script>
@ -203,7 +204,7 @@
<div class="panel-heading text-center">
<span class="pull-left">
<img src="img/antergos.png" alt="Antergos"/>
</span> <span class="welcome">Welcome!</span>
</span> <span class="welcome"></span>
<span id="hostname" class="pull-right"></span>
</div>
<div id="panelfix" class="panel-body panel-shadow">
@ -230,7 +231,7 @@
<div class="user-wrap2">
<div id="user-list2" class="list-group"></div>
<a id="user-target2" class="user-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" onclick="cancelAuthentication()">
<a id="user-target2" class="user-toggle cancel_auth" data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
<i class="fa fa-toggle-down" style="position:absolute;"></i>
</a>
@ -245,7 +246,7 @@
<div class="input-group-btn">
<div class="btn-group">
<button class="btn btn-primary" type="button" onclick="submitPassword()">
<button class="btn btn-primary submit_passwd" type="button">
<i class="fa fa-sign-in"></i>
</button>
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
@ -253,7 +254,7 @@
</button>
<ul class="dropdown-menu pull-right">
<li>
<a href="#" onclick="cancelAuthentication()">
<a href="#" class="cancel_auth">
<i class="fa fa-times"></i> Cancel</a>
</li>
<li>
@ -282,7 +283,7 @@
<tr>
<td>
<div class="alert alert-danger fade in">
<button type="button" class="close" onclick="cancelAuthentication()" data-dismiss="alert" aria-hidden="true">&nbsp;&times;</button>
<button type="button" class="close cancel_auth" data-dismiss="alert" aria-hidden="true">&nbsp;&times;</button>
<span id="showMsg">
<strong>Uh Oh!!</strong>Authentication failed. Please try again.
</span>
@ -293,10 +294,6 @@
</div>
</div>
<!-- This is a hack to work-around webkit2gtk glitches with drawing on screen.
The spinner animation makes GTK constantly repaint the screen which prevents
WSOD (White Screen Of Death)
<i class="fa fa-spinner fa-spin" style="color: transparent"></i>-->
</div>
</div>
@ -327,35 +324,35 @@
<!-- Custom JavaScript for the BG Switcher & Clock Toggle -->
<script>
$("#bg-switch-close").click(function (e) {
$( "#bg-switch-close" ).click( function( e ) {
e.preventDefault();
$("#bg-switch-wrapper").toggleClass("active");
$(this).hide();
$("#bg-switch-toggle").show();
});
$("#bg-switch-toggle").click(function (e) {
$( "#bg-switch-wrapper" ).toggleClass( "active" );
$( this ).hide();
$( "#bg-switch-toggle" ).show();
} );
$( "#bg-switch-toggle" ).click( function( e ) {
e.preventDefault();
$("#bg-switch-wrapper").toggleClass("active");
$(this).hide();
$("#bg-switch-close").show();
});
$( "#bg-switch-wrapper" ).toggleClass( "active" );
$( this ).hide();
$( "#bg-switch-close" ).show();
} );
$('*').each(function () {
$(this).attr('tabindex', -1);
});
$( '*' ).each( function() {
$( this ).attr( 'tabindex', - 1 );
} );
$('#collapseTwo').on('shown.bs.collapse', function () {
$('#collapseTwo a').filter(':not(.dropdown-menu *)').each(function (index) {
$( '#collapseTwo' ).on( 'shown.bs.collapse', function() {
$( '#collapseTwo a' ).filter( ':not(.dropdown-menu *)' ).each( function( index ) {
var i = index + 1;
$(this).attr('tabindex', i);
});
});
$('#collapseTwo').on('hidden.bs.collapse', function () {
$('#collapseTwo a').filter(':not(.dropdown-menu *)').each(function (index) {
$(this).attr('tabindex', -1);
});
});
$( this ).attr( 'tabindex', i );
} );
} );
$( '#collapseTwo' ).on( 'hidden.bs.collapse', function() {
$( '#collapseTwo a' ).filter( ':not(.dropdown-menu *)' ).each( function( index ) {
$( this ).attr( 'tabindex', - 1 );
} );
} );
</script>

510
themes/antergos/js/greeter.js

@ -26,32 +26,42 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
var DEBUG = true,
selectedUser = null,
authPending = null,
users_shown = null,
userList;
String.prototype.capitalize = function() {
return this.charAt( 0 ).toUpperCase() + this.slice( 1 );
};
var _self;
class AntergosTheme {
constructor() {
this.debug = this.cache_get( 'debug', 'enabled' );
this.user_list_visible = false;
this.auth_pending = false;
this.selected_user = null;
this.$user_list = $( '#user-list2' );
this.$session_list = $( '#sessions' );
this.$clock_container = $( '#collapseOne' );
this.lang = window.navigator.language;
this.$clock = $( "#current_time" );
this.$actions_container = $( "#actionsArea" );
this.$msg_area_container = $( '#statusArea' );
this.$msg_area = $( '#showMsg' );
this.lang = window.navigator.language.split( '-' )[ 0 ].toLocaleLowerCase();
this.translations = window.ant_translations;
this.initialize();
//this.register_events();
}
initialize() {
this.initialize_clock();
this.prepare_login_panel_header();
this.prepare_user_list();
this.prepare_session_list();
//this.maybe_create_thumbnails();
//this.prepare_session_list();
//this.prepare_system_actions();
this.prepare_system_action_buttons();
this.register_callbacks();
}
/**
@ -60,7 +70,7 @@ class AntergosTheme {
* @param {string} text - To be added to the log.
*/
log( text ) {
if ( 'true' === this.debug ) {
if ( 'true' === this.debug || true ) {
$( '#logArea' ).append( `${text}<br/>` );
}
}
@ -75,7 +85,7 @@ class AntergosTheme {
var key = `ant`,
index = 0;
for (part of key_parts) {
for ( var part of key_parts ) {
key += `:${part}`;
index += 1;
}
@ -93,13 +103,27 @@ class AntergosTheme {
var key = `ant`,
index = 0;
for ( part of key_parts ) {
for ( var part of key_parts ) {
key += `:${part}`;
index += 1;
}
return localStorage.setItem( key, value );
}
/**
* Register callbacks for LightDM as well as any others that haven't been registered elsewhere.
*/
register_callbacks() {
$( document ).keydown( this, this.key_press_handler);
$('.cancel_auth').click(this, this.cancel_authentication);
$('.submit_passwd').click(this, this.submit_password);
window.show_prompt = this.show_prompt;
window.show_message = this.show_message;
window.start_authentication = this.start_authentication;
window.cancel_authentication = this.cancel_authentication;
window.authentication_complete = this.authentication_complete;
}
/**
* Initialize the user list.
*/
@ -114,9 +138,10 @@ class AntergosTheme {
if ( null === last_session ) {
// For backwards compatibility
last_session = localStorage.getItem(user.name);
last_session = localStorage.getItem( user.name );
if ( null === last_session ) {
// This user has never logged in before let's enable the system's default session.
// This user has never logged in before let's enable the system's default
// session.
last_session = lightdm.default_session;
}
this.cache_set( last_session, 'user', user.name, 'session' );
@ -125,21 +150,20 @@ class AntergosTheme {
this.log( `Last session for ${user.name} was: ${last_session}` );
template = `
<a href="#${user.name}" class="list-group-item ${user.name}" data-session="${last_session}">
<a href="#" id="${user.name}" class="list-group-item ${user.name}" data-session="${last_session}">
<img src="${image_src}" class="img-circle" alt="${user.display_name}" />
<span>${user.display_name}</span>
<span class="badge"><i class="fa fa-check"></i></span>
</a>`;
// 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 ).children( 'img' ).on( 'error', this.image_not_found );
$( template ).appendTo( this.$user_list ).click( this, this.start_authentication ).children( 'img' ).on( 'error', this.image_not_found );
} // END for ( var user of lightdm.users )
if ( $( $user_list ).children().length > 3 ) {
if ( $( this.$user_list ).children().length > 3 ) {
// Make the user list two columns instead of one.
$( $user_list ).css( 'column-count', '2' );
$( $user_list ).parent().css( 'max-width', '85%' );
$( this.$user_list ).css( 'column-count', '2' ).parent().css( 'max-width', '85%' );
}
}
@ -149,339 +173,265 @@ class AntergosTheme {
*/
prepare_session_list() {
// Loop through the array of LightDMSession objects to create our session list.
for (var session of lightdm.sessions) {
var css_class = session.name.replace(/ /g, ''),
for ( var session of lightdm.sessions ) {
var css_class = session.name.replace( / /g, '' ),
template;
this.log(`Adding ${session.name} to the session list...`);
this.log( `Adding ${session.name} to the session list...` );
template = `
<li>
<a href="#" data-session-id="${session.key}" class="${css_class}">${session.name}</a>
</li>`;
$(template).appendTo(this.$session_list).click(this.session_toggle_handler);
$( template ).appendTo( this.$session_list ).click( this, this.session_toggle_handler );
} // END for (var session of lightdm.sessions)
$( '.dropdown-toggle' ).dropdown();
}
initialize_clock() {
this.update_clock();
setInterval( this.update_clock, 60000 );
/**
* Initialize the system action buttons
*/
prepare_system_action_buttons() {
var actions = {
shutdown: "power-off",
hibernate: "asterisk",
suspend: "arrow-down",
restart: "refresh"
},
template;
for ( var action of Object.keys( actions ) ) {
var cmd = `can_${action}`;
console.log( action );
template = `
<a href="#" id="${action}" class="btn btn-default ${action}" data-toggle="tooltip" data-placement="top" title="${action.capitalize()}" data-container="body">
<i class="fa fa-${actions[ action ]}"></i>
</a>`;
if ( lightdm[ cmd ] ) {
$( template ).appendTo( $( this.$actions_container ) ).click( action, ( event ) => {
lightdm[ event.data ]();
} );
}
} // END for (var [action, icon] of actions)
$( '[data-toggle=tooltip]' ).tooltip();
}
session_toggle_handler(event) {
var session = event.target,
session_name = $( session ).text(),
session_key = $( session ).attr( 'data-session-id' ),
selected_user = this.cache_get( 'misc', 'selected_user' );
initialize_clock() {
var saved_format = this.cache_get( 'clock', 'time_format' ),
format = (null !== saved_format) ? saved_format : 'LT',
detected_language = null;
// Workaround for moment.js bug: https://github.com/moment/moment/issues/2856
for ( var lang of window.navigator.languages ) {
try {
detected_language = lang.split( '-' )[ 0 ].toLowerCase();
break;
} catch ( err ) {
this.log( String( err ) );
}
}
if ( null === detected_language ) {
detected_language = 'en';
}
$( session ).parents( '.btn-group' ).find( '.selected' ).attr( 'data-session-id', session_key ).html(session_name);
moment.locale( detected_language );
this.$clock.html( moment().format( format ) );
setInterval( () => {
this.$clock.html( moment().format( format ) );
}, 60000 );
}
show_user_list() {
if ( $(this.$clock_container).hasClass( 'in' ) ) {
if ( $( this.$clock_container ).hasClass( 'in' ) ) {
$( '#trigger' ).trigger( 'click' );
this.user_list_visible = true;
}
if ( $(this.$user_list).length <= 1 ) {
$(this.$user_list).find('a').trigger( 'click' );
if ( $( this.$user_list ).length <= 1 ) {
$( this.$user_list ).find( 'a' ).trigger( 'click', this );
}
}
image_not_found() {
prepare_login_panel_header() {
var greeting = null;
}
if ( this.translations.hasOwnProperty( this.lang ) ) {
greeting = this.translations[ this.lang ];
start_authentication() {
} else {
}
}
for ( var lang of window.navigator.languages ) {
if ( this.translations.hasOwnProperty( lang ) ) {
greeting = this.translations[ lang ];
break;
}
}
greeting = (null === greeting) ? 'Welcome!' : greeting;
}
$( '.welcome' ).text( greeting );
$( '#hostname' ).append( lightdm.hostname );
}
$(document).ready(function() {
start_authentication( event ) {
var user_id = $( this ).attr( 'id' ),
selector = `.${user_id}`,
self = event.data,
user_session = self.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}` );
self.selected_user = null;
}
$(window).load(function() {
self.log( `Starting authentication for ${user_id}.` );
self.selected_user = user_id;
/**
* UI Initialization.
*/
// CSS hack to workaround webkit bug
if ( $( self.$user_list ).children().length > 3 ) {
$( self.$user_list ).css( 'column-count', 'initial' ).parent().css( 'max-width', '50%' );
}
$( selector ).addClass( 'hovered' ).siblings().hide();
$( '.fa-toggle-down' ).hide();
self.log( `Session for ${user_id} is ${user_session}` );
initialize_timer();
get_hostname();
$( `[data-session-id="${user_session}"]` ).parent().trigger( 'click', this );
theme = new AntergosTheme();
buildSessionList();
// Password submit when enter key is pressed
$( '#session-list' ).removeClass( 'hidden' ).show();
$( '#passwordArea' ).show();
$( '.dropdown-toggle' ).dropdown();
$(document).keydown(function(e) {
checkKey(e);
});
// Action buttons
addActionLink("shutdown");
addActionLink("hibernate");
addActionLink("suspend");
addActionLink("restart");
});
self.auth_pending = true;
function get_hostname() {
var hostname = lightdm.hostname;
var hostname_span = document.getElementById('hostname');
$(hostname_span).append(hostname);
lightdm.start_authentication( user_id );
}
/**
* Actions management.
*
*
*/
cancel_authentication(event) {
var self = event.data,
selectors = [ '#statusArea', '#timerArea', '#passwordArea', '#session-list' ];
function update_time() {
var time = document.getElementById("current_time");
var date = new Date();
var twelveHr = [
'sq-al',
'zh-cn',
'zh-tw',
'en-au',
'en-bz',
'en-ca',
'en-cb',
'en-jm',
'en-ng',
'en-nz',
'en-ph',
'en-us',
'en-tt',
'en-zw',
'es-us',
'es-mx'];
var userLang = window.navigator.language;
var is_twelveHr = twelveHr.indexOf(userLang);
var hh = date.getHours();
var mm = date.getMinutes();
var suffix = "AM";
if (hh >= 12) {
suffix = "PM";
if (is_twelveHr !== -1 && is_twelveHr !== 12) {
hh = hh - 12;
}
for ( var selector of selectors ) {
$( selector ).hide();
}
if (mm < 10) {
mm = "0" + mm;
lightdm.cancel_authentication();
self.log( 'Cancelled authentication.' );
// CSS hack to work-around webkit bug
if ( $( self.$user_list ).children().length > 3 ) {
$( self.$user_list ).css( 'column-count', '2' ).parent().css( 'max-width', '85%' );
}
if (hh === 0 && is_twelveHr !== -1) {
hh = 12;
$( '.hovered' ).removeClass( 'hovered' ).siblings().show();
$( '.fa-toggle-down' ).show();
self.selected_user = null;
self.auth_pending = false;
}
authentication_complete() {
var selected_session = $( '.selected' ).attr( 'data-session-id' );
_self.auth_pending = false;
_self.cache_set( selected_session, 'user', lightdm.authentication_user, 'session' );
$( '#timerArea' ).hide();
if ( lightdm.is_authenticated ) {
lightdm.login( lightdm.authentication_user, selected_session );
} else {
$( '#statusArea' ).show();
}
time.innerHTML = hh + ":" + mm + " " + suffix;
}
function initialize_timer() {
var userLang = window.navigator.language;
submit_password(event) {
lightdm.provide_secret( $( '#passwordField' ).val() );
$( '#passwordArea' ).hide();
$( '#timerArea' ).show();
}
session_toggle_handler( event ) {
var self = event.data,
$session = $(this).children('a'),
session_name = $session.text(),
session_key = $session.attr( 'data-session-id' );
console.log($session);
update_time();
setInterval(update_time, 60000);
$session.parents( '.btn-group' ).find( '.selected' ).attr( 'data-session-id', session_key ).html( session_name );
}
function checkKey(event) {
var action;
switch (event.which) {
key_press_handler( event ) {
var self = event.data,
action;
switch ( event.which ) {
case 13:
action = authPending ? submitPassword() : !users_shown ? show_users() : 0;
log(action);
action = self.auth_pending ? self.submit_password() : ! self.user_list_visible ? self.show_user_list() : 0;
self.log( action );
break;
case 27:
action = authPending ? cancelAuthentication() : 0;
log(action);
action = self.auth_pending ? self.cancel_authentication() : 0;
self.log( action );
break;
case 32:
action = !users_shown && !authPending ? show_users() : 0;
log(action);
action = (! self.user_list_visible && ! self.auth_pending) ? self.show_user_list() : 0;
self.log( action );
break;
default:
break;
}
}
function addActionLink(id) {
if (eval("lightdm.can_" + id)) {
var label = id.substr(0, 1).toUpperCase() + id.substr(1, id.length - 1);
var id2;
if (id == "shutdown") {
id2 = "power-off"
}
if (id == "hibernate") {
id2 = "asterisk"
}
if (id == "suspend") {
id2 = "arrow-down"
}
if (id == "restart") {
id2 = "refresh"
}
$("#actionsArea").append('\n<button type="button" class="btn btn-default ' + id + '" data-toggle="tooltip" data-placement="top" title="' + label + '" data-container="body" onclick="handleAction(\'' + id + '\')"><i class="fa fa-' + id2 + '"></i></button>');
}
}
function capitalize(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
/**
* User image on('error') handler.
*/
image_not_found( source ) {
source.onerror = "";
source.src = 'img/antergos-logo-user.png';
return true;
}
window.handleAction = function(id) {
eval("lightdm." + id + "()");
};
function getUserObj(username) {
var user = null;
for (var i = 0; i < lightdm.users.length; ++i) {
if (lightdm.users[i].name == username) {
user = lightdm.users[i];
break;
}
}
return user;
}
/**
* LightDM Callback - Show password prompt to user.
*
* @param text
*/
show_prompt( text ) {
function getSessionObj(sessionname) {
var session = null;
for (var i = 0; i < lightdm.sessions.length; ++i) {
if (lightdm.sessions[i].name == sessionname) {
session = lightdm.sessions[i];
break;
}
}
return session;
$( '#passwordField' ).val( "" );
$( '#passwordArea' ).show();
$( '#passwordField' ).focus();
}
window.startAuthentication = function(userId) {
log("startAuthentication(" + userId + ")");
if (selectedUser !== null) {
lightdm.cancel_authentication();
localStorage.setItem('selUser', null);
log("authentication cancelled for " + selectedUser);
}
localStorage.setItem('selUser', userId);
selectedUser = '.' + userId;
$(selectedUser).addClass('hovered');
console.log(userList);
if ($(userList).children().length > 3) {
$(userList).css('column-count', 'initial');
$(userList).parent().css('max-width', '50%');
}
$(selectedUser).siblings().hide();
$('.fa-toggle-down').hide();
var usrSession = localStorage.getItem(userId);
if (! usrSession) {
var user_session = lightdm.get_user_session(userId);
usrSession = user_session ? user_session : lightdm.get_default_session();
localStorage.setItem(userId, usrSession);
}
log("usrSession: " + usrSession);
var usrSessionEl = "[data-session-id=" + usrSession + "]";
var usrSessionName = $(usrSessionEl).html();
$('.selected').html(usrSessionName);
$('.selected').attr('data-session-id', usrSession);
$('#session-list').removeClass('hidden');
$('#session-list').show();
$('#passwordArea').show();
$('.dropdown-toggle').dropdown();
authPending = true;
lightdm.start_authentication(userId);
};
window.cancelAuthentication = function() {
$('#statusArea').hide();
$('#timerArea').hide();
$('#passwordArea').hide();
$('#session-list').hide();
lightdm.cancel_authentication();
if ($(userList).children().length > 3) {
$(userList).css('column-count', '2');
$(userList).parent().css('max-width', '85%');
}
$('.list-group-item').removeClass('hovered').siblings().show();
$('.fa-toggle-down').show();
selectedUser = null;
authPending = false;
return true;
};
window.submitPassword = function() {
lightdm.provide_secret($('#passwordField').val());
$('#passwordArea').hide();
$('#timerArea').show();
};
/**
* Image loading management.
* LightDM Callback - Show message to user.
*
* @param msg
*/
window.imgNotFound = function(source) {
source.src = 'img/antergos-logo-user.png';
source.onerror = "";
return true;
};
window.sessionToggle = function(el) {
var selText = $(el).text();
var theID = $(el).attr('data-session-id');
var selUser = localStorage.getItem('selUser');
$(el).parents('.btn-group').find('.selected').attr('data-session-id', theID);
$(el).parents('.btn-group').find('.selected').html(selText);
localStorage.setItem(selUser, theID)
};
});
/**
* Lightdm Callbacks
*/
function show_prompt(text) {
$('#passwordField').val("");
$('#passwordArea').show();
$('#passwordField').focus();
show_message( msg ) {
if ( msg.length > 0 ) {
$( this.$msg_area ).html( msg );
$( '#passwordArea' ).hide();
$( this.$msg_area_container ).show();
}
}
}
function authentication_complete() {
authPending = false;
$('#timerArea').hide();
var selSession = $('.selected').attr('data-session-id');
if (lightdm.is_authenticated) {
$( window ).load( function() {
lightdm.login(lightdm.authentication_user, selSession);
} else {
_self = new AntergosTheme();
$('#statusArea').show();
}
}
function show_message(text) {
var msgWrap = document.getElementById('statusArea'),
showMsg = document.getElementById('showMsg');
showMsg.innerHTML = text;
if (text.length > 0) {
$('#passwordArea').hide();
$(msgWrap).show();
}
}
} );
function show_error(text) {
show_message(text);
}

54
themes/antergos/js/greeting_translations.js

@ -0,0 +1,54 @@
window.ant_translations = {
"ca": "Benvingut!",
"ru": "Добро пожаловат!",
"gu": "આપનગત છ!",
"pa": "ਸਆਗਤ ਹ!",
"ta": "வரவி!",
"it": "Ben arrivata!",
"gl": "Benvido!",
"pl": "Zapraszamy!",
"tr": "Hoşgeldiniz!",
"sr": "Dobrodošao!",
"hi": "आपकगत ह!",
"mk": "Добредојдовте!",
"af": "Welkom!",
"pt": "Bem-vindo!",
"et": "Tere tulemast!",
"ko": "환영!",
"ro": "Bine ati venit!",
"el": "Καλωσόρισμα!",
"ja": "ようこそ!",
"lt": "Sveiki!",
"uk": "Ласкаво просимо!",
"de": "Herzlich willkommen!",
"fr": "Bienvenue!",
"tg": "Хуш омадед!",
"nb": "Velkommen!",
"mr": "आपलगत आह!",
"zh": "欢迎!",
"hu": "Fogadtatás!",
"cs": "Vítejte!",
"ms": "Selamat Datang!",
"ar": "!ﻚﺑ أهلا",
"az": "Xoş gəlmisiniz!",
"hr": "Dobrodošli!",
"da": "Velkomst!",
"fi": "Tervetuloa!",
"be": "Сардэчна запрашаем!",
"sk": "Vitajte!",
"nl": "Welkom!",
"sl": "Dobrodošli!",
"es": "¡Bienvenida!",
"eo": "Bonvenon!",
"ka": "გამარჯობა!",
"he": "!ךאוב ךורב",
"id": "Menyambut!",
"eu": "Ongi etorri!",
"en": "Welcome!",
"vi": "Chào mừng!",
"fa": "!ﯼﺪﻣﺁ ﺵﻮﺧ",
"sv": "Välkomna!",
"tl": "Maligayang pagdating!",
"bg": "Добре дошла!",
"zu": "Siyakwamukela!"
};

11523
themes/antergos/js/vendor/moment-with-locales.min.js vendored

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save