var H5P = H5P || {}; /** * Shape module * * @param {jQuery} $ */ H5P.Shape = (function ($) { /** * Initialize module. * * @param {Object} params Behavior settings * @param {Number} id Content identification * @returns {C} self */ function C(params, id) { H5P.EventDispatcher.call(this); this.params = $.extend(true, { type: 'rectangle', shape: { fillColor: '#ccc', borderWidth: 0, borderStyle: 'solid', borderColor: '#000', borderRadius: 0 } }, params); this.contentId = id; } C.prototype = Object.create(H5P.EventDispatcher.prototype); C.prototype.constructor = C; /** * Attach h5p inside the given container. * * @param {jQuery} $container */ C.prototype.attach = function ($container) { this.$inner = $container.addClass('h5p-shape'); this.$shape = $('
'); this.styleShape(); this.$shape.appendTo(this.$inner); }; /** * Is this a line? * @return {boolean} */ C.prototype.isLine = function () { return this.params.type === 'vertical-line' || this.params.type === 'horizontal-line'; }; /** * Style the shape */ C.prototype.styleShape = function () { var props = this.isLine() ? this.params.line : this.params.shape; var borderWidth = (props.borderWidth * 0.0835) + 'em'; var css = { 'border-color': props.borderColor }; if (this.params.type == "vertical-line") { css['border-left-width'] = borderWidth; css['border-left-style'] = props.borderStyle; this.trigger('set-size', {width: borderWidth, maxWidth: borderWidth}); } else if (this.params.type == "horizontal-line") { css['border-top-width'] = borderWidth; css['border-top-style'] = props.borderStyle; this.trigger('set-size', {height: borderWidth, maxHeight: borderWidth}); } else { css['background-color'] = props.fillColor; css['border-width'] = borderWidth; css['border-style'] = props.borderStyle; } if (this.params.type == "rectangle") { css['border-radius'] = props.borderRadius * 0.25 + 'em'; } this.$shape.css(css); }; return C; })(H5P.jQuery); ; /* * flowplayer.js 3.2.12. The Flowplayer API * * Copyright 2009-2011 Flowplayer Oy * * This file is part of Flowplayer. * * Flowplayer is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Flowplayer is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Flowplayer. If not, seeClick here to download latest version
":"Download latest version from here
");if(f.tagName=="A"||f.tagName=="DIV"){f.onclick=function(){location.href=j}}}if(n.onFail){var l=n.onFail.call(this);if(typeof l=="string"){f.innerHTML=l}}}}if(h){window[n.id]=document.getElementById(n.id)}i(this,{getRoot:function(){return f},getOptions:function(){return n},getConf:function(){return m},getApi:function(){return f.firstChild}})}if(c){jQuery.tools=jQuery.tools||{version:"3.2.12"};jQuery.tools.flashembed={conf:b};jQuery.fn.flashembed=function(l,f){return this.each(function(){$(this).data("flashembed",flashembed(this,l,f))})}}}();; var H5P = H5P || {}; /** * H5P audio module * * @external {jQuery} $ H5P.jQuery */ H5P.Audio = (function ($) { /** * @param {Object} params Options for this library. * @param {Number} id Content identifier. * @param {Object} extras Extras. * @returns {undefined} */ function C(params, id, extras) { H5P.EventDispatcher.call(this); this.contentId = id; this.params = params; this.extras = extras; this.toggleButtonEnabled = true; // Retrieve previous state if (extras && extras.previousState !== undefined) { this.oldTime = extras.previousState.currentTime; } this.params = $.extend({}, { playerMode: 'minimalistic', fitToWrapper: false, controls: true, autoplay: false, audioNotSupported: "Your browser does not support this audio", playAudio: "Play audio", pauseAudio: "Pause audio" }, params); this.on('resize', this.resize, this); } C.prototype = Object.create(H5P.EventDispatcher.prototype); C.prototype.constructor = C; /** * Adds a minimalistic audio player with only "play" and "pause" functionality. * * @param {jQuery} $container Container for the player. * @param {boolean} transparentMode true: the player is only visible when hovering over it; false: player's UI always visible */ C.prototype.addMinimalAudioPlayer = function ($container, transparentMode) { var INNER_CONTAINER = 'h5p-audio-inner'; var AUDIO_BUTTON = 'h5p-audio-minimal-button'; var PLAY_BUTTON = 'h5p-audio-minimal-play'; var PLAY_BUTTON_PAUSED = 'h5p-audio-minimal-play-paused'; var PAUSE_BUTTON = 'h5p-audio-minimal-pause'; var self = this; this.$container = $container; self.$inner = $('', { 'class': INNER_CONTAINER + (transparentMode ? ' h5p-audio-transparent' : '') }).appendTo($container); var audioButton = $('', { 'class': AUDIO_BUTTON + " " + PLAY_BUTTON, 'aria-label': this.params.playAudio }).appendTo(self.$inner) .click( function () { if (!self.isEnabledToggleButton()) { return; } // Prevent ARIA from playing over audio on click this.setAttribute('aria-hidden', 'true'); if (self.audio.paused) { self.play(); } else { self.pause(); } }) .on('focusout', function () { // Restore ARIA, required when playing longer audio and tabbing out and back in this.setAttribute('aria-hidden', 'false'); }); //Fit to wrapper if (this.params.fitToWrapper) { audioButton.css({ 'width': '100%', 'height': '100%' }); } // cpAutoplay is passed from coursepresentation if (this.params.autoplay) { self.play(); } //Event listeners that change the look of the player depending on events. self.audio.addEventListener('ended', function () { audioButton .attr('aria-hidden', false) .attr('aria-label', self.params.playAudio) .removeClass(PAUSE_BUTTON) .removeClass(PLAY_BUTTON_PAUSED) .addClass(PLAY_BUTTON); }); self.audio.addEventListener('play', function () { audioButton .attr('aria-label', self.params.pauseAudio) .removeClass(PLAY_BUTTON) .removeClass(PLAY_BUTTON_PAUSED) .addClass(PAUSE_BUTTON); }); self.audio.addEventListener('pause', function () { audioButton .attr('aria-hidden', false) .attr('aria-label', self.params.playAudio) .removeClass(PAUSE_BUTTON) .addClass(PLAY_BUTTON_PAUSED); }); this.$audioButton = audioButton; //Scale icon to container self.resize(); }; /** * Resizes the audio player icon when the wrapper is resized. */ C.prototype.resize = function () { // Find the smallest value of height and width, and use it to choose the font size. if (this.params.fitToWrapper && this.$container && this.$container.width()) { var w = this.$container.width(); var h = this.$container.height(); if (w < h) { this.$audioButton.css({'font-size': w / 2 + 'px'}); } else { this.$audioButton.css({'font-size': h / 2 + 'px'}); } } }; return C; })(H5P.jQuery); /** * Wipe out the content of the wrapper and put our HTML in it. * * @param {jQuery} $wrapper Our poor container. */ H5P.Audio.prototype.attach = function ($wrapper) { $wrapper.addClass('h5p-audio-wrapper'); // Check if browser supports audio. var audio = document.createElement('audio'); if (audio.canPlayType === undefined) { // Try flash this.attachFlash($wrapper); return; } // Add supported source files. if (this.params.files !== undefined && this.params.files instanceof Object) { for (var i = 0; i < this.params.files.length; i++) { var file = this.params.files[i]; if (audio.canPlayType(file.mime)) { var source = document.createElement('source'); source.src = H5P.getPath(file.path, this.contentId); source.type = file.mime; audio.appendChild(source); } } } if (!audio.children.length) { // Try flash this.attachFlash($wrapper); return; } if (this.endedCallback !== undefined) { audio.addEventListener('ended', this.endedCallback, false); } audio.className = 'h5p-audio'; audio.controls = this.params.controls === undefined ? true : this.params.controls; audio.preload = 'auto'; audio.style.display = 'block'; if (this.params.fitToWrapper === undefined || this.params.fitToWrapper) { audio.style.width = '100%'; if (!this.isRoot()) { // Only set height if this isn't a root audio.style.height = '100%'; } } this.audio = audio; if (this.params.playerMode === 'minimalistic') { audio.controls = false; this.addMinimalAudioPlayer($wrapper, false); } else if (this.params.playerMode === 'transparent') { audio.controls = false; this.addMinimalAudioPlayer($wrapper, true); } else { audio.autoplay = this.params.autoplay === undefined ? false : this.params.autoplay; $wrapper.html(audio); } // Set time to saved time from previous run if (this.oldTime) { this.seekTo(this.oldTime); } }; /** * Attaches a flash audio player to the wrapper. * * @param {jQuery} $wrapper Our dear container. */ H5P.Audio.prototype.attachFlash = function ($wrapper) { if (this.params.files !== undefined && this.params.files instanceof Object) { for (var i = 0; i < this.params.files.length; i++) { var file = this.params.files[i]; if (file.mime === 'audio/mpeg' || file.mime === 'audio/mp3') { var audioSource = H5P.getPath(file.path, this.contentId); break; } } } if (audioSource === undefined) { $wrapper.addClass('h5p-audio-not-supported'); $wrapper.html( ''+a+"%
"+e[n].score+"/"+e[n].maxScore+"
'+i.cp.l10n.slide+' | '+i.cp.l10n.score+"/"+i.cp.l10n.total.toLowerCase()+" |
---|
'+i.cp.l10n.totalScore+'