Browse Source

starting to hate jsdoc

sisyphus
Dustin Falgout 9 years ago
parent
commit
a248c9e2e1
  1. 105
      themes/_vendor/js/mock.js

105
themes/_vendor/js/mock.js vendored

@ -25,174 +25,181 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
let lightdm = null,
greeter_util = null,
config = null,
MockData;
if ( 'undefined' !== typeof lightdm ) { if ( 'undefined' !== typeof lightdm ) {
throw new Error('Cannot use LightDM Mock while the greeter is running!'); throw new Error('Cannot use LightDM Mock while the greeter is running!');
} }
/**
* @ignore /** @ignore */
*/
String.prototype.capitalize = function() { String.prototype.capitalize = function() {
return this.charAt(0).toUpperCase() + this.slice(1); return this.charAt(0).toUpperCase() + this.slice(1);
}; };
/**
* @namespace window
*/
var lightdm = null,
greeter_util = null,
config = null;
/**
* @namespace LightDM
*/
/** /**
* Interface for object that holds info about a session. Session objects are not * Interface for object that holds info about a session. Session objects are not
* created by the theme's code, but rather by the {@link LightDMGreeter} class. * created by the theme's code, but rather by the {@link LightDMGreeter} class.
*/ */
let LightDMSession = function( { comment, key, name } ) { class LightDMSession {
return { constructor( { comment, key, name } ) {
/** /**
* The comment for the session. * The comment for the session.
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
comment, this.comment = comment;
/** /**
* The key for the session. * The key for the session.
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
key, this.key = key;
/** /**
* The name for the session. * The name for the session.
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
name this.name = name;
} }
}; }
/** /**
* Interface for object that holds info about a language on this system. Language objects are not * Interface for object that holds info about a language on this system. Language objects are not
* created by the theme's code, but rather by the {@link LightDMGreeter} class. * created by the theme's code, but rather by the {@link LightDMGreeter} class.
*/ */
let LightDMLanguage = function( { code, name, territory } ) { class LightDMLanguage {
return { constructor( { code, name, territory } ) {
/** /**
* The code for the language. * The code for the language.
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
code, this.code = code;
/** /**
* The name for the language. * The name for the language.
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
name, this.name = name;
/** /**
* The territory for the language. * The territory for the language.
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
territory this.territory = territory;
} }
}; }
/** /**
* Interface for object that holds info about a keyboard layout on this system. Language * Interface for object that holds info about a keyboard layout on this system. Language
* objects are not created by the theme's code, but rather by the {@link LightDMGreeter} class. * objects are not created by the theme's code, but rather by the {@link LightDMGreeter} class.
*/ */
let LightDMLayout = function( { description, name, short_description } ) { class LightDMLayout {
return { constructor( { description, name, short_description } ) {
/** /**
* The description for the layout. * The description for the layout.
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
description, this.description = description;
/** /**
* The name for the layout. * The name for the layout.
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
name, this.name = name;
/** /**
* The territory for the layout. * The territory for the layout.
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
short_description this.short_description = short_description;
} }
}; }
/** /**
* Interface for object that holds info about a user account on this system. User * Interface for object that holds info about a user account on this system. User
* objects are not created by the theme's code, but rather by the {@link LightDMGreeter} class. * objects are not created by the theme's code, but rather by the {@link LightDMGreeter} class.
*/ */
let LightDMUser = function( user_info ) { class LightDMUser {
return { constructor( user_info ) {
/** /**
* The display name for the user. * The display name for the user.
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
display_name: user_info.display_name || '', this.display_name = user_info.display_name;
/** /**
* The language for the user. * The language for the user.
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
language: user_info.language || '', this.language = user_info.language;
/** /**
* The keyboard layout for the user. * The keyboard layout for the user.
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
layout: user_info.layout || '', this.layout = user_info.layout;
/** /**
* The image for the user. * The image for the user.
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
image: user_info.image || '', this.image = user_info.image;
/** /**
* The home_directory for the user. * The home_directory for the user.
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
home_directory: user_info.home_directory || '', this.home_directory = user_info.home_directory;
/** /**
* The username for the user. * The username for the user.
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
username: user_info.username || '', this.username = user_info.username;
/** /**
* Whether or not the user is currently logged in. * Whether or not the user is currently logged in.
* @type {Boolean} * @type {Boolean}
* @readonly * @readonly
*/ */
logged_in: user_info.logged_in || false, this.logged_in = user_info.logged_in;
/** /**
* The last session that the user logged into. * The last session that the user logged into.
* @type {String|null} * @type {String|null}
* @readonly * @readonly
*/ */
session: user_info.session || '', this.session = user_info.session;
/** /**
* DEPRECATED! * DEPRECATED!
@ -200,7 +207,7 @@ let LightDMUser = function( user_info ) {
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
name: user_info.name || '', this.name = user_info.name;
/** /**
* DEPRECATED! * DEPRECATED!
@ -208,20 +215,9 @@ let LightDMUser = function( user_info ) {
* @type {String} * @type {String}
* @readonly * @readonly
*/ */
real_name: user_info.real_name || '' this.real_name = user_info.real_name;
} }
}; }
/**
* @ignore
*/
let MockObjects = {
LightDMLanguage: LightDMLanguage,
LightDMLayout: LightDMLayout,
LightDMSession: LightDMSession,
LightDMUser: LightDMUser,
};
/** /**
@ -318,6 +314,17 @@ class ConfigFile {
} }
/**
* @ignore
*/
let MockObjects = {
LightDMLanguage( obj ) { return new LightDMLanguage( obj ); },
LightDMLayout( obj ) { return new LightDMLayout( obj ); },
LightDMSession( obj ) { return new LightDMSession( obj ); },
LightDMUser( obj ) { return new LightDMUser( obj ); }
};
/** /**
* Singleton class which implements the LightDMGreeter Interface. Greeter themes will * Singleton class which implements the LightDMGreeter Interface. Greeter themes will
* interact directly with this class to facilitate the user log in processes. * interact directly with this class to facilitate the user log in processes.

Loading…
Cancel
Save