Browse Source

update docs

sisyphus
Dustin Falgout 8 years ago
parent
commit
b938ee1f78
  1. 53
      src/gresource/js/Greeter.js
  2. 10
      src/gresource/js/GreeterConfig.js
  3. 9
      src/gresource/js/ThemeUtils.js

53
src/gresource/js/Greeter.js

@ -25,12 +25,22 @@
* along with lightdm-webkit2-greeter; If not, see <http://www.gnu.org/licenses/>. * along with lightdm-webkit2-greeter; If not, see <http://www.gnu.org/licenses/>.
*/ */
/**
* The global window object.
* @typedef {Object} Window
*/
/**
* @namespace {Window} window
* @global
*/
/** /**
* Base class for the greeter's JavaScript Theme API. Greeter themes will interact * 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. * 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 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 * @memberOf LightDM
*/ */
@ -165,6 +175,11 @@ class Greeter {
* @type {LightDMLayout} * @type {LightDMLayout}
*/ */
get layout() {} get layout() {}
/**
* Set the active layout for the selected user.
* @param {LightDMLayout} value
*/
set layout( value ) {} set layout( value ) {}
/** /**
@ -321,9 +336,43 @@ const __lightdm = new Promise( (resolve, reject) => {
/** /**
* @memberOf window * @alias lightdm
* @type {LightDM.Greeter} * @type {LightDM.Greeter}
* @memberOf window
*/ */
__lightdm.then( result => window.lightdm = result ); __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)}
*/

10
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 * 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 * 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`. * with the global variable: [`greeter_config`]({@link window.greeter_config}).
* *
* @memberOf LightDM * @memberOf LightDM
*/ */
@ -151,6 +151,7 @@ class GreeterConfig {
} }
} }
const __greeter_config = new Promise( (resolve, reject) => { const __greeter_config = new Promise( (resolve, reject) => {
let waiting = 0; let waiting = 0;
@ -175,15 +176,18 @@ const __greeter_config = new Promise( (resolve, reject) => {
/** /**
* @memberOf window * @alias greeter_config
* @type {LightDM.GreeterConfig} * @type {LightDM.GreeterConfig}
* @memberOf window
*/ */
__greeter_config.then( result => { __greeter_config.then( result => {
window.greeter_config = result; window.greeter_config = result;
/** /**
* @deprecated * @alias config
* @type {LightDM.GreeterConfig} * @type {LightDM.GreeterConfig}
* @memberOf window
* @deprecated Use [`greeter_config`]({@link window.greeter_config}) instead.
*/ */
window.config = window.greeter_config; window.config = window.greeter_config;
} ); } );

9
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 * 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 * 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 * @memberOf LightDM
*/ */
@ -221,15 +221,18 @@ const __theme_utils = new Promise( (resolve, reject) => {
/** /**
* @memberOf window * @alias theme_utils
* @type {LightDM.ThemeUtils} * @type {LightDM.ThemeUtils}
* @memberOf window
*/ */
__theme_utils.then( result => { __theme_utils.then( result => {
window.theme_utils = result; window.theme_utils = result;
/** /**
* @deprecated * @alias greeterutil
* @type {LightDM.ThemeUtils} * @type {LightDM.ThemeUtils}
* @memberOf window
* @deprecated Use [`theme_utils`]({@link window.theme_utils}) instead.
*/ */
window.greeterutil = window.theme_utils; window.greeterutil = window.theme_utils;
} ); } );

Loading…
Cancel
Save