From b938ee1f78f34e4e8a5dab3c22e2797647f38d5d Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Fri, 2 Dec 2016 01:02:57 -0600 Subject: [PATCH] update docs --- src/gresource/js/Greeter.js | 53 +++++++++++++++++++++++++++++-- src/gresource/js/GreeterConfig.js | 10 ++++-- src/gresource/js/ThemeUtils.js | 9 ++++-- 3 files changed, 64 insertions(+), 8 deletions(-) diff --git a/src/gresource/js/Greeter.js b/src/gresource/js/Greeter.js index a459c81..54ea838 100644 --- a/src/gresource/js/Greeter.js +++ b/src/gresource/js/Greeter.js @@ -25,12 +25,22 @@ * along with lightdm-webkit2-greeter; If not, see . */ +/** + * The global window object. + * @typedef {Object} Window + */ + +/** + * @namespace {Window} window + * @global + */ + /** * Base class for the greeter's JavaScript Theme API. Greeter themes will interact * directly with an object derived from this class to facilitate the user log-in process. * The greeter will automatically create an instance when it starts. - * The instance can be accessed using the global variable: `lightdm` ({@link window.lightdm}). + * The instance can be accessed using the global variable: [`lightdm`]({@link window.lightdm}). * * @memberOf LightDM */ @@ -165,6 +175,11 @@ class Greeter { * @type {LightDMLayout} */ get layout() {} + + /** + * Set the active layout for the selected user. + * @param {LightDMLayout} value + */ set layout( value ) {} /** @@ -321,9 +336,43 @@ const __lightdm = new Promise( (resolve, reject) => { /** - * @memberOf window + * @alias lightdm * @type {LightDM.Greeter} + * @memberOf window */ __lightdm.then( result => window.lightdm = result ); +/** + * Moment.js instance - Loaded and instantiated automatically by the greeter. + * @name moment + * @type {Object} + * @version 2.17.0 + * @memberOf window + * @see {@link [Moment.js Documentation](http://momentjs.com/docs)} + */ + +/** + * jQuery instance - Themes must manually load the included vendor script in order to use this object. + * @name jQuery + * @type {Object} + * @version 3.1.1 + * @memberOf window + * @see {@link [jQuery Documentation](http://api.jquery.com)} + */ + +/** + * @name $ + * @see {@link window.jQuery} + */ + +/** + * JS-Cookie instance - Themes must manually load the included vendor script in order to use this object. + * @name Cookies + * @type {Object} + * @version 2.1.3 + * @memberOf window + * @see {@link [JS Cookie Documentation](https://github.com/js-cookie/js-cookie/tree/latest#readme)} + */ + + diff --git a/src/gresource/js/GreeterConfig.js b/src/gresource/js/GreeterConfig.js index bc0b95c..1f2db75 100644 --- a/src/gresource/js/GreeterConfig.js +++ b/src/gresource/js/GreeterConfig.js @@ -47,7 +47,7 @@ function set_values( defaults, target_obj, method ) { * Provides theme authors with a way to retrieve values from the greeter's config * 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 - * with the global variable: `greeter_config`. + * with the global variable: [`greeter_config`]({@link window.greeter_config}). * * @memberOf LightDM */ @@ -151,6 +151,7 @@ class GreeterConfig { } } + const __greeter_config = new Promise( (resolve, reject) => { let waiting = 0; @@ -175,15 +176,18 @@ const __greeter_config = new Promise( (resolve, reject) => { /** - * @memberOf window + * @alias greeter_config * @type {LightDM.GreeterConfig} + * @memberOf window */ __greeter_config.then( result => { window.greeter_config = result; /** - * @deprecated + * @alias config * @type {LightDM.GreeterConfig} + * @memberOf window + * @deprecated Use [`greeter_config`]({@link window.greeter_config}) instead. */ window.config = window.greeter_config; } ); diff --git a/src/gresource/js/ThemeUtils.js b/src/gresource/js/ThemeUtils.js index 20cef60..f30ea23 100644 --- a/src/gresource/js/ThemeUtils.js +++ b/src/gresource/js/ThemeUtils.js @@ -41,7 +41,7 @@ let localized_invalid_date = moment('today', '!@#'), /** * Provides various utility methods for use by theme authors. The greeter will automatically * create an instance of this class when it starts. The instance can be accessed - * with the global variable: `theme_utils` ({@link window.theme_utils}). + * with the global variable: [`theme_utils`]({@link window.theme_utils}). * * @memberOf LightDM */ @@ -221,15 +221,18 @@ const __theme_utils = new Promise( (resolve, reject) => { /** - * @memberOf window + * @alias theme_utils * @type {LightDM.ThemeUtils} + * @memberOf window */ __theme_utils.then( result => { window.theme_utils = result; /** - * @deprecated + * @alias greeterutil * @type {LightDM.ThemeUtils} + * @memberOf window + * @deprecated Use [`theme_utils`]({@link window.theme_utils}) instead. */ window.greeterutil = window.theme_utils; } );