parent
ea3b86dcfe
commit
bb71ea20a3
|
@ -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) {
|
H5P.ActionBar = (function ($, EventDispatcher) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function ActionBar(displayOptions) {
|
function ActionBar(displayOptions) {
|
||||||
EventDispatcher.call(this);
|
EventDispatcher.call(this);
|
||||||
|
|
||||||
|
/** @alias H5P.ActionBar# */
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
var hasActions = false;
|
var hasActions = false;
|
||||||
|
@ -66,7 +76,6 @@ H5P.ActionBar = (function ($, EventDispatcher) {
|
||||||
/**
|
/**
|
||||||
* Returns a reference to the dom element
|
* Returns a reference to the dom element
|
||||||
*
|
*
|
||||||
* @method getDOMElement
|
|
||||||
* @return {H5P.jQuery}
|
* @return {H5P.jQuery}
|
||||||
*/
|
*/
|
||||||
self.getDOMElement = function () {
|
self.getDOMElement = function () {
|
||||||
|
@ -76,7 +85,6 @@ H5P.ActionBar = (function ($, EventDispatcher) {
|
||||||
/**
|
/**
|
||||||
* Does the actionbar contain actions?
|
* Does the actionbar contain actions?
|
||||||
*
|
*
|
||||||
* @method hasActions
|
|
||||||
* @return {Boolean}
|
* @return {Boolean}
|
||||||
*/
|
*/
|
||||||
self.hasActions = function () {
|
self.hasActions = function () {
|
||||||
|
|
|
@ -3,10 +3,17 @@
|
||||||
*
|
*
|
||||||
* Functions here may be overridable by the libraries. In special cases,
|
* Functions here may be overridable by the libraries. In special cases,
|
||||||
* it is also possible to override H5P.ContentType on a global level.
|
* 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) {
|
H5P.ContentType = function (isRootLibrary, library) {
|
||||||
|
|
||||||
function ContentType() {};
|
function ContentType() {}
|
||||||
|
|
||||||
// Inherit from EventDispatcher.
|
// Inherit from EventDispatcher.
|
||||||
ContentType.prototype = new H5P.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
|
* Is library standalone or not? Not beeing standalone, means it is
|
||||||
* included in another library
|
* included in another library
|
||||||
*
|
*
|
||||||
* @method isStandalone
|
|
||||||
* @return {Boolean}
|
* @return {Boolean}
|
||||||
*/
|
*/
|
||||||
ContentType.prototype.isRoot = function () {
|
ContentType.prototype.isRoot = function () {
|
||||||
|
@ -24,7 +30,6 @@ H5P.ContentType = function (isRootLibrary, library) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the file path of a file in the current 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
|
* @param {string} filePath The path to the file relative to the library folder
|
||||||
* @return {string} The full path to the file
|
* @return {string} The full path to the file
|
||||||
*/
|
*/
|
||||||
|
|
12
js/h5p.js
12
js/h5p.js
|
@ -438,7 +438,6 @@ H5P.communicator = (function () {
|
||||||
/**
|
/**
|
||||||
* Enter semi fullscreen for the given H5P instance
|
* Enter semi fullscreen for the given H5P instance
|
||||||
*
|
*
|
||||||
* @method semiFullScreen
|
|
||||||
* @param {H5P.jQuery} $element Content container.
|
* @param {H5P.jQuery} $element Content container.
|
||||||
* @param {Object} instance
|
* @param {Object} instance
|
||||||
* @param {function} exitCallback Callback function called when user exits fullscreen.
|
* @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.
|
* Which DOM element the dialog should be inserted after.
|
||||||
*/
|
*/
|
||||||
H5P.Dialog = function (name, title, content, $element) {
|
H5P.Dialog = function (name, title, content, $element) {
|
||||||
|
/** @alias H5P.Dialog# */
|
||||||
var self = this;
|
var self = this;
|
||||||
var $dialog = H5P.jQuery('<div class="h5p-popup-dialog h5p-' + name + '-dialog">\
|
var $dialog = H5P.jQuery('<div class="h5p-popup-dialog h5p-' + name + '-dialog">\
|
||||||
<div class="h5p-inner">\
|
<div class="h5p-inner">\
|
||||||
|
@ -924,7 +924,10 @@ H5P.Dialog = function (name, title, content, $element) {
|
||||||
.end()
|
.end()
|
||||||
.end();
|
.end();
|
||||||
|
|
||||||
this.open = function () {
|
/**
|
||||||
|
* Opens the dialog.
|
||||||
|
*/
|
||||||
|
self.open = function () {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
$dialog.addClass('h5p-open'); // Fade in
|
$dialog.addClass('h5p-open'); // Fade in
|
||||||
// Triggering an event, in case something has to be done after dialog has been opened.
|
// 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);
|
}, 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.close = function () {
|
/**
|
||||||
|
* Closes the dialog.
|
||||||
|
*/
|
||||||
|
self.close = function () {
|
||||||
$dialog.removeClass('h5p-open'); // Fade out
|
$dialog.removeClass('h5p-open'); // Fade out
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
$dialog.remove();
|
$dialog.remove();
|
||||||
|
|
Loading…
Reference in New Issue