From bb71ea20a36a9e31237c180e953abfac0997810d Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Tue, 7 Feb 2017 13:48:42 +0100 Subject: [PATCH] Update JSDoc --- js/h5p-action-bar.js | 12 ++++++++++-- js/h5p-content-type.js | 13 +++++++++---- js/h5p.js | 12 +++++++++--- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/js/h5p-action-bar.js b/js/h5p-action-bar.js index 261082d..9a0f441 100644 --- a/js/h5p-action-bar.js +++ b/js/h5p-action-bar.js @@ -1,9 +1,19 @@ +/** + * @class + * @augments H5P.EventDispatcher + * @param {Object} displayOptions + * @param {boolean} displayOptions.export Triggers the display of the 'Download' button + * @param {boolean} displayOptions.copyright Triggers the display of the 'Copyright' button + * @param {boolean} displayOptions.embed Triggers the display of the 'Embed' button + * @param {boolean} displayOptions.icon Triggers the display of the 'H5P icon' link + */ H5P.ActionBar = (function ($, EventDispatcher) { "use strict"; function ActionBar(displayOptions) { EventDispatcher.call(this); + /** @alias H5P.ActionBar# */ var self = this; var hasActions = false; @@ -66,7 +76,6 @@ H5P.ActionBar = (function ($, EventDispatcher) { /** * Returns a reference to the dom element * - * @method getDOMElement * @return {H5P.jQuery} */ self.getDOMElement = function () { @@ -76,7 +85,6 @@ H5P.ActionBar = (function ($, EventDispatcher) { /** * Does the actionbar contain actions? * - * @method hasActions * @return {Boolean} */ self.hasActions = function () { diff --git a/js/h5p-content-type.js b/js/h5p-content-type.js index afe4136..8be8fcd 100644 --- a/js/h5p-content-type.js +++ b/js/h5p-content-type.js @@ -3,10 +3,17 @@ * * Functions here may be overridable by the libraries. In special cases, * it is also possible to override H5P.ContentType on a global level. - * */ + * + * NOTE that this doesn't actually 'extend' the event dispatcher but instead + * it creates a single instance which all content types shares as their base + * prototype. (in some cases this may be the root of strange event behavior) + * + * @class + * @augments H5P.EventDispatcher + */ H5P.ContentType = function (isRootLibrary, library) { - function ContentType() {}; + function ContentType() {} // Inherit from EventDispatcher. ContentType.prototype = new H5P.EventDispatcher(); @@ -15,7 +22,6 @@ H5P.ContentType = function (isRootLibrary, library) { * Is library standalone or not? Not beeing standalone, means it is * included in another library * - * @method isStandalone * @return {Boolean} */ ContentType.prototype.isRoot = function () { @@ -24,7 +30,6 @@ H5P.ContentType = function (isRootLibrary, library) { /** * Returns the file path of a file in the current library - * @method getLibraryFilePath * @param {string} filePath The path to the file relative to the library folder * @return {string} The full path to the file */ diff --git a/js/h5p.js b/js/h5p.js index 08a6586..36e2709 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -438,7 +438,6 @@ H5P.communicator = (function () { /** * Enter semi fullscreen for the given H5P instance * - * @method semiFullScreen * @param {H5P.jQuery} $element Content container. * @param {Object} instance * @param {function} exitCallback Callback function called when user exits fullscreen. @@ -896,6 +895,7 @@ H5P.t = function (key, vars, ns) { * Which DOM element the dialog should be inserted after. */ H5P.Dialog = function (name, title, content, $element) { + /** @alias H5P.Dialog# */ var self = this; var $dialog = H5P.jQuery('
\
\ @@ -924,7 +924,10 @@ H5P.Dialog = function (name, title, content, $element) { .end() .end(); - this.open = function () { + /** + * Opens the dialog. + */ + self.open = function () { setTimeout(function () { $dialog.addClass('h5p-open'); // Fade in // Triggering an event, in case something has to be done after dialog has been opened. @@ -932,7 +935,10 @@ H5P.Dialog = function (name, title, content, $element) { }, 1); }; - this.close = function () { + /** + * Closes the dialog. + */ + self.close = function () { $dialog.removeClass('h5p-open'); // Fade out setTimeout(function () { $dialog.remove();