Browse Source

...

sisyphus
Dustin Falgout 8 years ago
parent
commit
468548cb2d
  1. 18
      src/gresource/js/GreeterConfig.js
  2. 50
      src/gresource/js/LightDMObjects.js
  3. 10
      src/gresource/js/ThemeUtils.js

18
src/gresource/js/GreeterConfig.js

@ -44,7 +44,7 @@ function set_values( defaults, target_obj, method ) {
/** /**
* Provides theme authors with a way to retrieve values from the greeter's config * Provides greeter themes with a way to access values from the greeter's config
* file located at `/etc/lightdm/lightdm-webkit2-greeter.conf`. The greeter will * file located at `/etc/lightdm/lightdm-webkit2-greeter.conf`. The greeter will
* create an instance of this class when it starts. The instance can be accessed * create an instance of this class when it starts. The instance can be accessed
* with the global variable: [`greeter_config`](#dl-window-greeter_config). * with the global variable: [`greeter_config`](#dl-window-greeter_config).
@ -109,9 +109,9 @@ class GreeterConfig {
} }
/** /**
* Returns the value of `key` from the `config_section` of the greeter's config file. * ***Deprecated!*** Access config sections directly as properties of this object instead.
* *
* @deprecated Access config sections directly as properties of this object instead. * @deprecated
* *
* @arg {string} config_section * @arg {string} config_section
* @arg {string} key * @arg {string} key
@ -123,9 +123,9 @@ class GreeterConfig {
} }
/** /**
* Returns the value of `key` from the `config_section` of the greeter's config file. * ***Deprecated!*** Access config sections directly as properties of this object instead.
* *
* @deprecated Access config sections directly as properties of this object instead. * @deprecated
* *
* @arg {string} config_section * @arg {string} config_section
* @arg {string} key * @arg {string} key
@ -137,9 +137,9 @@ class GreeterConfig {
} }
/** /**
* Returns the value of `key` from the `config_section` of the greeter's config file. * ***Deprecated!*** Access config sections directly as properties of this object instead.
* *
* @deprecated Access config sections directly as properties of this object instead. * @deprecated
* *
* @arg {string} config_section * @arg {string} config_section
* @arg {string} key * @arg {string} key
@ -176,6 +176,7 @@ const __greeter_config = new Promise( (resolve, reject) => {
/** /**
* Greeter Config - Access values from the greeter's config file.
* @name greeter_config * @name greeter_config
* @type {LightDM.GreeterConfig} * @type {LightDM.GreeterConfig}
* @memberOf window * @memberOf window
@ -184,10 +185,11 @@ __greeter_config.then( result => {
window.greeter_config = result; window.greeter_config = result;
/** /**
* ***Deprecated!*** Use {@link window.greeter_config} instead.
* @name config * @name config
* @type {LightDM.GreeterConfig} * @type {LightDM.GreeterConfig}
* @memberOf window * @memberOf window
* @deprecated Use {@link window.greeter_config} instead. * @deprecated
*/ */
window.config = window.greeter_config; window.config = window.greeter_config;
} ); } );

50
src/gresource/js/LightDMObjects.js

@ -28,27 +28,28 @@
/** /**
* 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 LightDM.Greeter} class. * created by the theme's code, but rather by the {@link LightDM.Greeter} class.
*
* @memberOf LightDM * @memberOf LightDM
*/ */
class Session { class Session {
constructor( { comment, key, name } ) { constructor( { comment, key, name } ) {
/** /**
* The comment for the session. * The comment for the session.
* @type {String} * @type {string}
* @readonly * @readonly
*/ */
this.comment = comment; this.comment = comment;
/** /**
* The key for the session. * The key for the session.
* @type {String} * @type {string}
* @readonly * @readonly
*/ */
this.key = key; this.key = key;
/** /**
* The name for the session. * The name for the session.
* @type {String} * @type {string}
* @readonly * @readonly
*/ */
this.name = name; this.name = name;
@ -59,27 +60,28 @@ class Session {
/** /**
* Interface for object that holds info about a language on the system. Language objects are not * Interface for object that holds info about a language on the system. Language objects are not
* created by the theme's code, but rather by the {@link LightDM.Greeter} class. * created by the theme's code, but rather by the {@link LightDM.Greeter} class.
*
* @memberOf LightDM * @memberOf LightDM
*/ */
class Language { class Language {
constructor( { code, name, territory } ) { constructor( { code, name, territory } ) {
/** /**
* The code for the language. * The code for the language.
* @type {String} * @type {string}
* @readonly * @readonly
*/ */
this.code = code; this.code = code;
/** /**
* The name for the language. * The name for the language.
* @type {String} * @type {string}
* @readonly * @readonly
*/ */
this.name = name; this.name = name;
/** /**
* The territory for the language. * The territory for the language.
* @type {String} * @type {string}
* @readonly * @readonly
*/ */
this.territory = territory; this.territory = territory;
@ -90,27 +92,28 @@ class Language {
/** /**
* Interface for object that holds info about a keyboard layout on the system. Language * Interface for object that holds info about a keyboard layout on the system. Language
* objects are not created by the theme's code, but rather by the {@link LightDM.Greeter} class. * objects are not created by the theme's code, but rather by the {@link LightDM.Greeter} class.
*
* @memberOf LightDM * @memberOf LightDM
*/ */
class Layout { class Layout {
constructor( { description, name, short_description } ) { constructor( { description, name, short_description } ) {
/** /**
* The description for the layout. * The description for the layout.
* @type {String} * @type {string}
* @readonly * @readonly
*/ */
this.description = description; this.description = description;
/** /**
* The name for the layout. * The name for the layout.
* @type {String} * @type {string}
* @readonly * @readonly
*/ */
this.name = name; this.name = name;
/** /**
* The territory for the layout. * The territory for the layout.
* @type {String} * @type {string}
* @readonly * @readonly
*/ */
this.short_description = short_description; this.short_description = short_description;
@ -121,78 +124,79 @@ class Layout {
/** /**
* Interface for object that holds info about a user account on the system. User * Interface for object that holds info about a user account on the system. User
* objects are not created by the theme's code, but rather by the {@link LightDM.Greeter} class. * objects are not created by the theme's code, but rather by the {@link LightDM.Greeter} class.
*
* @memberOf LightDM * @memberOf LightDM
*/ */
class User { class User {
constructor( user_info ) { constructor( user_info ) {
/** /**
* The display name for the user. * The display name for the user.
* @type {String} * @type {string}
* @readonly * @readonly
*/ */
this.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
*/ */
this.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
*/ */
this.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
*/ */
this.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
*/ */
this.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
*/ */
this.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
*/ */
this.logged_in = user_info.logged_in; 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
*/ */
this.session = user_info.session; this.session = user_info.session;
/** /**
* DEPRECATED! * ***Deprecated!*** See {@link LightDM.User#username}.
* @deprecated See {@link LightDMUser.username}. * @deprecated
* @type {String} * @type {string}
* @readonly * @readonly
*/ */
this.name = user_info.name; this.name = user_info.name;
/** /**
* DEPRECATED! * ***Deprecated!*** See {@link LightDM.User#display_name}.
* @deprecated See {@link LightDMUser.display_name}. * @deprecated
* @type {String} * @type {string}
* @readonly * @readonly
*/ */
this.real_name = user_info.real_name; this.real_name = user_info.real_name;

10
src/gresource/js/ThemeUtils.js

@ -39,7 +39,7 @@ let localized_invalid_date = moment('today', '!@#'),
/** /**
* Provides various utility methods for use by theme authors. The greeter will automatically * Provides various utility methods for use in greeter themes. The greeter will automatically
* create an instance of this class when it starts. The instance can be accessed * create an instance of this class when it starts. The instance can be accessed
* with the global variable: [`theme_utils`](#dl-window-theme_utils). * with the global variable: [`theme_utils`](#dl-window-theme_utils).
* *
@ -186,7 +186,9 @@ class ThemeUtils {
/** /**
* @deprecated Use {@link window.theme_utils.esc_html()} instead. * Use {@link window.theme_utils.esc_html()} instead.
*
* @deprecated
*/ */
txt2html( text ) { txt2html( text ) {
try { try {
@ -224,6 +226,7 @@ const __theme_utils = new Promise( (resolve, reject) => {
/** /**
* Theme Utils - various utility methods for use in greeter themes.
* @name theme_utils * @name theme_utils
* @type {LightDM.ThemeUtils} * @type {LightDM.ThemeUtils}
* @memberOf window * @memberOf window
@ -232,10 +235,11 @@ __theme_utils.then( result => {
window.theme_utils = result; window.theme_utils = result;
/** /**
* ***Deprecated!*** Use {@link window.theme_utils} instead.
* @name greeterutil * @name greeterutil
* @type {LightDM.ThemeUtils} * @type {LightDM.ThemeUtils}
* @memberOf window * @memberOf window
* @deprecated Use [`theme_utils`](#dl-window-theme_utils) instead. * @deprecated
*/ */
window.greeterutil = window.theme_utils; window.greeterutil = window.theme_utils;
} ); } );

Loading…
Cancel
Save