From c4229f4ec8fcb848e908e946bf25affc82eecae4 Mon Sep 17 00:00:00 2001 From: Jake Lee Kennedy Date: Wed, 9 May 2018 18:18:48 +0100 Subject: [PATCH] Bugfix displayOptions was not working --- README.md | 5 +-- bower.json | 2 +- dist/js/h5p-standalone-main.js | 55 +++++++++++++++++++----------- dist/js/h5p-standalone-main.min.js | 2 +- package-lock.json | 7 +--- package.json | 2 +- src/js/h5pintegration.es6 | 51 +++++++++++++-------------- src/js/h5pintegration.js | 55 +++++++++++++++++++----------- 8 files changed, 100 insertions(+), 79 deletions(-) diff --git a/README.md b/README.md index 67ea84a4..d393561c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# h5p-standalone +# h5p-standalone 1.3.3 Display H5P content with plain old HTML ## Usage @@ -14,7 +14,8 @@ $('.h5p-container').h5p({ copyright: true, embed: false, download: false, - icon: true + icon: true, + export: false } }); ``` diff --git a/bower.json b/bower.json index 3256a270..b165902d 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "h5p-standalone", - "version": "1.3.2", + "version": "1.3.3", "homepage": "https://github.com/tunapanda/h5p-standalone", "authors": [ "Jake Lee Kennedy " diff --git a/dist/js/h5p-standalone-main.js b/dist/js/h5p-standalone-main.js index 0e3480e1..0ebc4b56 100644 --- a/dist/js/h5p-standalone-main.js +++ b/dist/js/h5p-standalone-main.js @@ -10081,27 +10081,42 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [ }); }; - $.fn.h5p = function (options) { - - options.id = options.id || 1; - - this.append("
\n \n
"); - - options.frameJs = options.frameJs || 'dist/h5p-standalone-frame.min.js'; - options.frameCss = options.frameCss || 'dist/css/h5p.css'; - options.h5pContent = options.h5pContent || 'workspace'; - - var displayOptions = options.displayOptions || {}; - - displayOptions.export = displayOptions.export || true; - displayOptions.frame = displayOptions.frame || true; - displayOptions.copyright = displayOptions.copyright || true; - displayOptions.embed = displayOptions.embed || true; - displayOptions.icon = displayOptions.icon || true; + $.fn.h5p = function () { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref$id = _ref.id, + id = _ref$id === undefined ? 1 : _ref$id, + _ref$frameJs = _ref.frameJs, + frameJs = _ref$frameJs === undefined ? 'dist/h5p-standalone-frame.min.js' : _ref$frameJs, + _ref$frameCss = _ref.frameCss, + frameCss = _ref$frameCss === undefined ? 'dist/css/h5p.css' : _ref$frameCss, + _ref$h5pContent = _ref.h5pContent, + h5pContent = _ref$h5pContent === undefined ? 'workspace' : _ref$h5pContent, + _ref$displayOptions = _ref.displayOptions, + displayOptions = _ref$displayOptions === undefined ? {} : _ref$displayOptions; + + var _displayOptions$frame = displayOptions.frame; + displayOptions.frame = _displayOptions$frame === undefined ? true : _displayOptions$frame; + var _displayOptions$copyr = displayOptions.copyright; + displayOptions.copyright = _displayOptions$copyr === undefined ? true : _displayOptions$copyr; + var _displayOptions$embed = displayOptions.embed; + displayOptions.embed = _displayOptions$embed === undefined ? true : _displayOptions$embed; + var _displayOptions$downl = displayOptions.download; + displayOptions.download = _displayOptions$downl === undefined ? true : _displayOptions$downl; + var _displayOptions$icon = displayOptions.icon; + displayOptions.icon = _displayOptions$icon === undefined ? true : _displayOptions$icon; + var _displayOptions$expor = displayOptions.export; + displayOptions.export = _displayOptions$expor === undefined ? true : _displayOptions$expor; + + + this.append("
\n \n
"); + + // options.frameJs = options.frameJs || 'dist/h5p-standalone-frame.min.js'; + // options.frameCss = options.frameCss || 'dist/css/h5p.css'; + // options.h5pContent = options.h5pContent || 'workspace'; H5PIntegration.core = { - styles: [options.frameCss], - scripts: [options.frameJs + styles: [frameCss], + scripts: [frameJs // 'bower_components/jquery/dist/jquery.js', // 'lib/js/h5p-jquery.js', // 'bower_components/h5p-php-library/js/h5p-content-type.js', @@ -10113,7 +10128,7 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [ ] }; - H5PIntegration.init(options.id, options.h5pContent, displayOptions); + H5PIntegration.init(id, h5pContent, displayOptions); }; })(H5P.jQuery); /** diff --git a/dist/js/h5p-standalone-main.min.js b/dist/js/h5p-standalone-main.min.js index 66f4e95d..c3c64eb8 100644 --- a/dist/js/h5p-standalone-main.min.js +++ b/dist/js/h5p-standalone-main.min.js @@ -1 +1 @@ -!function(e,t){if("function"==typeof define&&define.amd)define("Toposort",["exports","module"],t);else if("undefined"!=typeof exports&&"undefined"!=typeof module)t(exports,module);else{var n={exports:{}};t(n.exports,n),e.Toposort=n.exports}}(this,function(e,t){"use strict";var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.edges=[],this.Toposort=e}return e.prototype.add=function(e,t){if("string"!=typeof e||!e)throw new TypeError("Dependent name must be given as a not empty string");if(0<(t=Array.isArray(t)?t:[t]).length){var n=t,r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if((i=n.next()).done)break;o=i.value}var a=o;if("string"!=typeof a||!a)throw new TypeError("Dependency name must be given as a not empty string");this.edges.push([e,a])}}else this.edges.push([e]);return this},e.prototype.sort=function(){var u=this,d=[],e=this.edges,t=Array.isArray(e),n=0;for(e=t?e:e[Symbol.iterator]();;){var r;if(t){if(n>=e.length)break;r=e[n++]}else{if((n=e.next()).done)break;r=n.value}var i=b=r,o=Array.isArray(i),a=0;for(i=o?i:i[Symbol.iterator]();;){var s;if(o){if(a>=i.length)break;s=i[a++]}else{if((a=i.next()).done)break;s=a.value}var c=s;-1===d.indexOf(c)&&d.push(c)}}for(var f=d.length,p=new Array(d.length),l=function e(t,n){if(0!==n.length&&-1!==n.indexOf(t))throw new Error("Cyclic dependency found. "+t+" is dependent of itself.\nDependency chain: "+n.join(" -> ")+" => "+t);var r=d.indexOf(t);if(-1!==r){var i=!1;d[r]=!1;var o=u.edges,a=Array.isArray(o),s=0;for(o=a?o:o[Symbol.iterator]();;){var c;if(a){if(s>=o.length)break;c=o[s++]}else{if((s=o.next()).done)break;c=s.value}var l=c;l[0]===t&&(i=i||n.concat([t]),e(l[1],i))}p[--f]=t}},h=0;h=g.length)break;v=g[y++]}else{if((y=g.next()).done)break;v=y.value}(b=v)[0]===c&&l(b[1],[c])}p[--f]=c}}return p},e.prototype.clear=function(){return this.edges=[],this},e}();t.exports=n}),function(h,w){var t,n,y=typeof w,g=h.document,e=h.location,r=h.jQuery,i=h.$,o={},d=[],a="1.9.1",v=d.concat,s=d.push,u=d.slice,c=d.indexOf,l=o.toString,m=o.hasOwnProperty,f=a.trim,ye=function(e,t){return new ye.fn.init(e,t,n)},p=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,C=/\S+/g,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,x=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,P=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,H=/^[\],:{}\s]*$/,T=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,E=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,N=/^-ms-/,k=/-([\da-z])/gi,A=function(e,t){return t.toUpperCase()},D=function(e){(g.addEventListener||"load"===e.type||"complete"===g.readyState)&&(I(),ye.ready())},I=function(){g.addEventListener?(g.removeEventListener("DOMContentLoaded",D,!1),h.removeEventListener("load",D,!1)):(g.detachEvent("onreadystatechange",D),h.detachEvent("onload",D))};function j(e){var t=e.length,n=ye.type(e);return!ye.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||"function"!==n&&(0===t||"number"==typeof t&&0"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:x.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ye?t[0]:t,ye.merge(this,ye.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),P.test(r[1])&&ye.isPlainObject(t))for(r in t)ye.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if((i=g.getElementById(r[2]))&&i.parentNode){if(i.id!==r[2])return n.find(e);this.length=1,this[0]=i}return this.context=g,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):ye.isFunction(e)?n.ready(e):(e.selector!==w&&(this.selector=e.selector,this.context=e.context),ye.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return u.call(this)},get:function(e){return null==e?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e){var t=ye.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return ye.each(this,e,t)},ready:function(e){return ye.ready.promise().done(e),this},slice:function(){return this.pushStack(u.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n
a",e=u.getElementsByTagName("*"),t=u.getElementsByTagName("a")[0],!e||!t||!e.length)return{};a=(r=g.createElement("select")).appendChild(g.createElement("option")),n=u.getElementsByTagName("input")[0],t.style.cssText="top:1px;float:left;opacity:.5",o={getSetAttribute:"t"!==u.className,leadingWhitespace:3===u.firstChild.nodeType,tbody:!u.getElementsByTagName("tbody").length,htmlSerialize:!!u.getElementsByTagName("link").length,style:/top/.test(t.getAttribute("style")),hrefNormalized:"/a"===t.getAttribute("href"),opacity:/^0.5/.test(t.style.opacity),cssFloat:!!t.style.cssFloat,checkOn:!!n.value,optSelected:a.selected,enctype:!!g.createElement("form").enctype,html5Clone:"<:nav>"!==g.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===g.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},n.checked=!0,o.noCloneChecked=n.cloneNode(!0).checked,r.disabled=!0,o.optDisabled=!a.disabled;try{delete u.test}catch(e){o.deleteExpando=!1}for(l in(n=g.createElement("input")).setAttribute("value",""),o.input=""===n.getAttribute("value"),n.value="t",n.setAttribute("type","radio"),o.radioValue="t"===n.value,n.setAttribute("checked","t"),n.setAttribute("name","t"),(i=g.createDocumentFragment()).appendChild(n),o.appendChecked=n.checked,o.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,u.attachEvent&&(u.attachEvent("onclick",function(){o.noCloneEvent=!1}),u.cloneNode(!0).click()),{submit:!0,change:!0,focusin:!0})u.setAttribute(s="on"+l,"t"),o[l+"Bubbles"]=s in h||!1===u.attributes[s].expando;return u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===u.style.backgroundClip,ye(function(){var e,t,n,r="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",i=g.getElementsByTagName("body")[0];i&&((e=g.createElement("div")).style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",i.appendChild(e).appendChild(u),u.innerHTML="
t
",(n=u.getElementsByTagName("td"))[0].style.cssText="padding:0;margin:0;border:0;display:none",c=0===n[0].offsetHeight,n[0].style.display="",n[1].style.display="none",o.reliableHiddenOffsets=c&&0===n[0].offsetHeight,u.innerHTML="",u.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",o.boxSizing=4===u.offsetWidth,o.doesNotIncludeMarginInBodyOffset=1!==i.offsetTop,h.getComputedStyle&&(o.pixelPosition="1%"!==(h.getComputedStyle(u,null)||{}).top,o.boxSizingReliable="4px"===(h.getComputedStyle(u,null)||{width:"4px"}).width,(t=u.appendChild(g.createElement("div"))).style.cssText=u.style.cssText=r,t.style.marginRight=t.style.width="0",u.style.width="1px",o.reliableMarginRight=!parseFloat((h.getComputedStyle(t,null)||{}).marginRight)),typeof u.style.zoom!==y&&(u.innerHTML="",u.style.cssText=r+"width:1px;padding:1px;display:inline;zoom:1",o.inlineBlockNeedsLayout=3===u.offsetWidth,u.style.display="block",u.innerHTML="
",u.firstChild.style.width="5px",o.shrinkWrapBlocks=3!==u.offsetWidth,o.inlineBlockNeedsLayout&&(i.style.zoom=1)),i.removeChild(e),e=u=n=t=null)}),e=r=i=a=t=n=null,o}();var F=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,O=/([A-Z])/g;function M(e,t,n,r){if(ye.acceptData(e)){var i,o,a=ye.expando,s="string"==typeof t,c=e.nodeType,l=c?ye.cache:e,u=c?e[a]:e[a]&&a;if(u&&l[u]&&(r||l[u].data)||!s||n!==w)return u||(c?e[a]=u=d.pop()||ye.guid++:u=a),l[u]||(l[u]={},c||(l[u].toJSON=ye.noop)),"object"!=typeof t&&"function"!=typeof t||(r?l[u]=ye.extend(l[u],t):l[u].data=ye.extend(l[u].data,t)),i=l[u],r||(i.data||(i.data={}),i=i.data),n!==w&&(i[ye.camelCase(t)]=n),s?null==(o=i[t])&&(o=i[ye.camelCase(t)]):o=i,o}}function B(e,t,n){if(ye.acceptData(e)){var r,i,o,a=e.nodeType,s=a?ye.cache:e,c=a?e[ye.expando]:ye.expando;if(s[c]){if(t&&(o=n?s[c]:s[c].data)){for((r=0,i=(t=ye.isArray(t)?t.concat(ye.map(t,ye.camelCase)):t in o?[t]:(t=ye.camelCase(t))in o?[t]:t.split(" ")).length);r+~])"+L+"*"),R=new RegExp(B),z=new RegExp("^"+O+"$"),V={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/[\x20\t\r\n\f]*[+~]/,W=/^[^{]+\{\s*\[native code/,U=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,J=/'|\\/g,G=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,K=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,Z=function(e,t){var n="0x"+t-65536;return n!=n?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)};try{I.call(b.documentElement.childNodes,0)[0].nodeType}catch(e){I=function(e){for(var t,n=[];t=this[e++];)n.push(t);return n}}function ee(e){return W.test(e+"")}function te(){var n,r=[];return n=function(e,t){return r.push(e+=" ")>H.cacheLength&&delete n[r.shift()],n[e]=t}}function ne(e){return e[T]=!0,e}function re(e){var t=C.createElement("div");try{return e(t)}catch(e){return!1}finally{t=null}}function ie(e,t,n,r){var i,o,a,s,c,l,u,d,f,p;if((t?t.ownerDocument||t:b)!==C&&g(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=(t=t||C).nodeType)&&9!==s)return[];if(!m&&!r){if(i=U.exec(e))if(a=i[1]){if(9===s){if(!(o=t.getElementById(a))||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&v(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return D.apply(n,I.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&x.getByClassName&&t.getElementsByClassName)return D.apply(n,I.call(t.getElementsByClassName(a),0)),n}if(x.qsa&&!y.test(e)){if(u=!0,d=T,f=t,p=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(l=le(e),(u=t.getAttribute("id"))?d=u.replace(J,"\\$&"):t.setAttribute("id",d),d="[id='"+d+"'] ",c=l.length;c--;)l[c]=d+ue(l[c]);f=X.test(e)&&t.parentNode||t,p=l.join(",")}if(p)try{return D.apply(n,I.call(f.querySelectorAll(p),0)),n}catch(e){}finally{u||t.removeAttribute("id")}}}return function(e,t,n,r){var i,o,a,s,c,l=le(e);if(!r&&1===l.length){if(2<(o=l[0]=l[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&!m&&H.relative[o[1].type]){if(!(t=H.find.ID(a.matches[0].replace(K,Z),t)[0]))return n;e=e.slice(o.shift().value.length)}for(i=V.needsContext.test(e)?0:o.length;i--&&(a=o[i],!H.relative[s=a.type]);)if((c=H.find[s])&&(r=c(a.matches[0].replace(K,Z),X.test(o[0].type)&&t.parentNode||t))){if(o.splice(i,1),!(e=r.length&&ue(o)))return D.apply(n,I.call(r,0)),n;break}}return h(e,l)(r,t,m,n,X.test(e)),n}(e.replace(q,"$1"),t,n,r)}function oe(e,t){var n=t&&e,r=n&&(~t.sourceIndex||N)-(~e.sourceIndex||N);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ae(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function se(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ce(a){return ne(function(o){return o=+o,ne(function(e,t){for(var n,r=a([],e.length,o),i=r.length;i--;)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}for(t in r=ie.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},g=ie.setDocument=function(e){var c=e?e.ownerDocument||e:b;return c!==C&&9===c.nodeType&&c.documentElement&&(i=(C=c).documentElement,m=r(c),x.tagNameNoComments=re(function(e){return e.appendChild(c.createComment("")),!e.getElementsByTagName("*").length}),x.attributes=re(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),x.getByClassName=re(function(e){return e.innerHTML="",!(!e.getElementsByClassName||!e.getElementsByClassName("e").length)&&(e.lastChild.className="e",2===e.getElementsByClassName("e").length)}),x.getByName=re(function(e){e.id=T+0,e.innerHTML="
",i.insertBefore(e,i.firstChild);var t=c.getElementsByName&&c.getElementsByName(T).length===2+c.getElementsByName(T+0).length;return x.getIdNotName=!c.getElementById(T),i.removeChild(e),t}),H.attrHandle=re(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==E&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},x.getIdNotName?(H.find.ID=function(e,t){if(typeof t.getElementById!==E&&!m){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},H.filter.ID=function(e){var t=e.replace(K,Z);return function(e){return e.getAttribute("id")===t}}):(H.find.ID=function(e,t){if(typeof t.getElementById!==E&&!m){var n=t.getElementById(e);return n?n.id===e||typeof n.getAttributeNode!==E&&n.getAttributeNode("id").value===e?[n]:void 0:[]}},H.filter.ID=function(e){var n=e.replace(K,Z);return function(e){var t=typeof e.getAttributeNode!==E&&e.getAttributeNode("id");return t&&t.value===n}}),H.find.TAG=x.tagNameNoComments?function(e,t){if(typeof t.getElementsByTagName!==E)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},H.find.NAME=x.getByName&&function(e,t){if(typeof t.getElementsByName!==E)return t.getElementsByName(name)},H.find.CLASS=x.getByClassName&&function(e,t){if(typeof t.getElementsByClassName!==E&&!m)return t.getElementsByClassName(e)},a=[],y=[":focus"],(x.qsa=ee(c.querySelectorAll))&&(re(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||y.push("\\["+L+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||y.push(":checked")}),re(function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&y.push("[*^$]="+L+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(x.matchesSelector=ee(s=i.matchesSelector||i.mozMatchesSelector||i.webkitMatchesSelector||i.oMatchesSelector||i.msMatchesSelector))&&re(function(e){x.disconnectedMatch=s.call(e,"div"),s.call(e,"[s!='']:x"),a.push("!=",B)}),y=new RegExp(y.join("|")),a=new RegExp(a.join("|")),v=ee(i.contains)||i.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},u=i.compareDocumentPosition?function(e,t){var n;return e===t?(l=!0,0):(n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&n||e.parentNode&&11===e.parentNode.nodeType?e===c||v(b,e)?-1:t===c||v(b,t)?1:0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(e===t)return l=!0,0;if(!i||!o)return e===c?-1:t===c?1:i?-1:o?1:0;if(i===o)return oe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?oe(a[r],s[r]):a[r]===b?-1:s[r]===b?1:0},l=!1,[0,0].sort(u),x.detectDuplicates=l),C},ie.matches=function(e,t){return ie(e,null,null,t)},ie.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&g(e),t=t.replace(G,"='$1']"),x.matchesSelector&&!m&&(!a||!a.test(t))&&!y.test(t))try{var n=s.call(e,t);if(n||x.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(K,Z),e[3]=(e[4]||e[5]||"").replace(K,Z),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ie.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ie.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return V.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&R.test(n)&&(t=le(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(t){return"*"===t?function(){return!0}:(t=t.replace(K,Z).toLowerCase(),function(e){return e.nodeName&&e.nodeName.toLowerCase()===t})},CLASS:function(e){var t=c[e+" "];return t||(t=new RegExp("(^|"+L+")"+e+"("+L+"|$)"))&&c(e,function(e){return t.test(e.className||typeof e.getAttribute!==E&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=ie.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1]","i"),ge=/^\s+/,me=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ve=/<([\w:]+)/,be=/\s*$/g,Ee={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:ye.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},Ne=de(g).appendChild(g.createElement("div"));function ke(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function Ae(e){var t=Te.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function De(e,t){for(var n,r=0;null!=(n=e[r]);r++)ye._data(n,"globalEval",!t||ye._data(t[r],"globalEval"))}function Ie(e,t){if(1===t.nodeType&&ye.hasData(e)){var n,r,i,o=ye._data(e),a=ye._data(t,o),s=o.events;if(s)for(n in delete a.handle,a.events={},s)for(r=0,i=s[n].length;r");try{for(;n")?o=e.cloneNode(!0):(Ne.innerHTML=e.outerHTML,Ne.removeChild(o=Ne.firstChild)),!(ye.support.noCloneEvent&&ye.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ye.isXMLDoc(e)))for(r=Le(o),s=Le(e),a=0;null!=(i=s[a]);++a)r[a]&&je(i,r[a]);if(t)if(n)for(s=s||Le(e),r=r||Le(o),a=0;null!=(i=s[a]);a++)Ie(i,r[a]);else Ie(e,o);return 0<(r=Le(o,"script")).length&&De(r,!c&&Le(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){for(var i,o,a,s,c,l,u,d=e.length,f=de(t),p=[],h=0;h")+u[2],i=u[0];i--;)s=s.lastChild;if(!ye.support.leadingWhitespace&&ge.test(o)&&p.push(t.createTextNode(ge.exec(o)[0])),!ye.support.tbody)for(i=(o="table"!==c||be.test(o)?""!==u[1]||be.test(o)?0:s:s.firstChild)&&o.childNodes.length;i--;)ye.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l);for(ye.merge(p,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=f.lastChild}else p.push(t.createTextNode(o));for(s&&f.removeChild(s),ye.support.appendChecked||ye.grep(Le(p,"input"),Fe),h=0;o=p[h++];)if((!r||-1===ye.inArray(o,r))&&(a=ye.contains(o.ownerDocument,o),s=Le(f.appendChild(o),"script"),a&&De(s),n))for(i=0;o=s[i++];)Ce.test(o.type||"")&&n.push(o);return s=null,f},cleanData:function(e,t){for(var n,r,i,o,a=0,s=ye.expando,c=ye.cache,l=ye.support.deleteExpando,u=ye.event.special;null!=(n=e[a]);a++)if((t||ye.acceptData(n))&&(o=(i=n[s])&&c[i])){if(o.events)for(r in o.events)u[r]?ye.event.remove(n,r):ye.removeEvent(n,r,o.handle);c[i]&&(delete c[i],l?delete n[s]:typeof n.removeAttribute!==y?n.removeAttribute(s):n[s]=null,d.push(i))}}});var Oe,Me,Be,qe=/alpha\([^)]*\)/i,_e=/opacity\s*=\s*([^)]*)/,$e=/^(top|right|bottom|left)$/,Re=/^(none|table(?!-c[ea]).+)/,ze=/^margin/,Ve=new RegExp("^("+p+")(.*)$","i"),Xe=new RegExp("^("+p+")(?!px)[a-z%]+$","i"),We=new RegExp("^([+-])=("+p+")","i"),Ue={BODY:"block"},Qe={position:"absolute",visibility:"hidden",display:"block"},Ye={letterSpacing:0,fontWeight:400},Je=["Top","Right","Bottom","Left"],Ge=["Webkit","O","Moz","ms"];function Ke(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Ge.length;i--;)if((t=Ge[i]+n)in e)return t;return r}function Ze(e,t){return e=t||e,"none"===ye.css(e,"display")||!ye.contains(e.ownerDocument,e)}function et(e,t){for(var n,r,i,o=[],a=0,s=e.length;a").css("cssText","display:block !important")).appendTo(t.documentElement))[0].contentWindow||Oe[0].contentDocument).document).write(""),t.close(),n=ot(e,t),Oe.detach()),Ue[e]=n),n}function ot(e,t){var n=ye(t.createElement(e)).appendTo(t.body),r=ye.css(n[0],"display");return n.remove(),r}ye.fn.extend({css:function(e,t){return ye.access(this,function(e,t,n){var r,i,o={},a=0;if(ye.isArray(t)){for(i=Me(e),r=t.length;a").append(ye.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,i||[e.responseText,t,e])}),this},ye.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ye.fn[t]=function(e){return this.on(t,e)}}),ye.each(["get","post"],function(e,i){ye[i]=function(e,t,n,r){return ye.isFunction(t)&&(r=r||n,n=t,t=w),ye.ajax({url:e,type:i,dataType:r,data:t,success:n})}}),ye.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:pt,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ft[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Tt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":h.String,"text html":!0,"text json":ye.parseJSON,"text xml":ye.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Nt(Nt(e,ye.ajaxSettings),t):Nt(ye.ajaxSettings,e)},ajaxPrefilter:St(wt),ajaxTransport:St(Ct),ajax:function(e,t){"object"==typeof e&&(t=e,e=w),t=t||{};var n,r,u,d,f,p,h,i,g=ye.ajaxSetup({},t),m=g.context||g,y=g.context&&(m.nodeType||m.jquery)?ye(m):ye.event,v=ye.Deferred(),b=ye.Callbacks("once memory"),x=g.statusCode||{},o={},a={},P=0,s="canceled",H={readyState:0,getResponseHeader:function(e){var t;if(2===P){if(!i)for(i={};t=vt.exec(d);)i[t[1].toLowerCase()]=t[2];t=i[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===P?d:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return P||(e=a[n]=a[n]||e,o[e]=t),this},overrideMimeType:function(e){return P||(g.mimeType=e),this},statusCode:function(e){var t;if(e)if(P<2)for(t in e)x[t]=[x[t],e[t]];else H.always(e[H.status]);return this},abort:function(e){var t=e||s;return h&&h.abort(t),c(0,t),this}};if(v.promise(H).complete=b.add,H.success=H.done,H.error=H.fail,g.url=((e||g.url||pt)+"").replace(mt,"").replace(xt,ft[1]+"//"),g.type=t.method||t.type||g.method||g.type,g.dataTypes=ye.trim(g.dataType||"*").toLowerCase().match(C)||[""],null==g.crossDomain&&(n=Pt.exec(g.url.toLowerCase()),g.crossDomain=!(!n||n[1]===ft[1]&&n[2]===ft[2]&&(n[3]||("http:"===n[1]?80:443))==(ft[3]||("http:"===ft[1]?80:443)))),g.data&&g.processData&&"string"!=typeof g.data&&(g.data=ye.param(g.data,g.traditional)),Et(wt,g,t,H),2===P)return H;for(r in(p=g.global)&&0==ye.active++&&ye.event.trigger("ajaxStart"),g.type=g.type.toUpperCase(),g.hasContent=!bt.test(g.type),u=g.url,g.hasContent||(g.data&&(u=g.url+=(gt.test(u)?"&":"?")+g.data,delete g.data),!1===g.cache&&(g.url=yt.test(u)?u.replace(yt,"$1_="+ht++):u+(gt.test(u)?"&":"?")+"_="+ht++)),g.ifModified&&(ye.lastModified[u]&&H.setRequestHeader("If-Modified-Since",ye.lastModified[u]),ye.etag[u]&&H.setRequestHeader("If-None-Match",ye.etag[u])),(g.data&&g.hasContent&&!1!==g.contentType||t.contentType)&&H.setRequestHeader("Content-Type",g.contentType),H.setRequestHeader("Accept",g.dataTypes[0]&&g.accepts[g.dataTypes[0]]?g.accepts[g.dataTypes[0]]+("*"!==g.dataTypes[0]?", "+Tt+"; q=0.01":""):g.accepts["*"]),g.headers)H.setRequestHeader(r,g.headers[r]);if(g.beforeSend&&(!1===g.beforeSend.call(m,H,g)||2===P))return H.abort();for(r in s="abort",{success:1,error:1,complete:1})H[r](g[r]);if(h=Et(Ct,g,t,H)){H.readyState=1,p&&y.trigger("ajaxSend",[H,g]),g.async&&0\n \n '),e.frameJs=e.frameJs||"dist/h5p-standalone-frame.min.js",e.frameCss=e.frameCss||"dist/css/h5p.css",e.h5pContent=e.h5pContent||"workspace";var t=e.displayOptions||{};t.export=t.export||!0,t.frame=t.frame||!0,t.copyright=t.copyright||!0,t.embed=t.embed||!0,t.icon=t.icon||!0,H5PIntegration.core={styles:[e.frameCss],scripts:[e.frameJs]},H5PIntegration.init(e.id,e.h5pContent,t)}}(H5P.jQuery),H5P.ContentType=function(e,t){function n(){}return(n.prototype=new H5P.EventDispatcher).isRoot=function(){return e},n.prototype.getLibraryFilePath=function(e){return H5P.getLibraryPath(this.libraryInfo.versionedNameNoSpaces)+"/"+e},n},(H5P=H5P||{}).Event=function(e,t,n){this.type=e,this.data=t;var r=!1,i=!1,o=!1;void 0===n&&(n={}),!0===n.bubbles&&(r=!0),!0===n.external&&(i=!0),this.preventBubbling=function(){r=!1},this.getBubbles=function(){return r},this.scheduleForExternal=function(){return!(!i||o)&&(o=!0)}},H5P.EventDispatcher=function(){var i=this,a={};this.on=function(e,t,n){if("function"!=typeof t)throw TypeError("listener must be a function");i.trigger("newListener",{type:e,listener:t});var r={listener:t,thisArg:n};a[e]?a[e].push(r):a[e]=[r]},this.once=function(e,t,n){if(!(t instanceof Function))throw TypeError("listener must be a function");var r=function(e){i.off(e.type,r),t.call(this,e)};i.on(e,r,n)},this.off=function(e,t){if(void 0!==t&&!(t instanceof Function))throw TypeError("listener must be a function");if(void 0!==a[e]){if(void 0===t)return delete a[e],void i.trigger("removeListener",e);for(var n=0;n').appendTo(e),i=e.data("content-id"),o=H5PIntegration.contents["cid-"+i];if(void 0===o)return H5P.error("No data for content id "+i+". Perhaps the library is gone?");var a={library:o.library,params:JSON.parse(o.jsonContent)};H5P.getUserData(i,"state",function(e,t){if(t)a.userDatas={state:t};else if(null===t&&H5PIntegration.saveFreq){delete o.contentUserData;var r=new H5P.Dialog("content-user-data-reset","Data Reset","

"+H5P.t("contentChanged")+"

"+H5P.t("startingOver")+'

OK
',n);H5P.jQuery(r).on("dialog-opened",function(e,t){var n=function(e){"click"!==e.type&&32!==e.which||(r.close(),H5P.deleteUserData(i,"state",0))};t.find(".h5p-dialog-ok-button").click(n).keypress(n)}),r.open()}});var t=H5P.newRunnable(a,i,n,!0,{standalone:!0});1==o.fullScreen&&H5P.fullscreenSupported&&H5P.jQuery('
').prependTo(n).children().click(function(){H5P.fullScreen(n,t)}).keydown(function(e){if(32===e.which||13===e.which)return H5P.fullScreen(n,t),!1});var r,s=o.displayOptions,c=!1;if(s.frame){if(s.copyright){var l=H5P.getCopyrights(t,a.params,i);l||(s.copyright=!1)}var u=new H5P.ActionBar(s),d=u.getDOMElement();u.on("download",function(){window.location.href=o.exportUrl,t.triggerXAPI("downloaded")}),u.on("copyrights",function(){new H5P.Dialog("copyrights",H5P.t("copyrightInformation"),l,n).open(),t.triggerXAPI("accessed-copyright")}),u.on("embed",function(){H5P.openEmbedDialog(d,o.embedCode,o.resizeCode,{width:e.width(),height:e.height()}),t.triggerXAPI("accessed-embed")}),u.hasActions()&&(c=!0,d.insertAfter(n))}if(e.addClass(c?"h5p-frame":"h5p-no-frame"),H5P.opened[i]=new Date,H5P.on(t,"finish",function(e){void 0!==e.data&&H5P.setFinished(i,e.data.score,e.data.maxScore,e.data.time)}),H5P.on(t,"xAPI",H5P.xAPICompletedListener),!1!==H5PIntegration.saveFreq&&(t.getCurrentState instanceof Function||"function"==typeof t.getCurrentState)){var f,p=function(){var e=t.getCurrentState();void 0!==e&&H5P.setUserData(i,"state",e,{deleteOnChange:!0}),H5PIntegration.saveFreq&&(f=setTimeout(p,1e3*H5PIntegration.saveFreq))};H5PIntegration.saveFreq&&(f=setTimeout(p,1e3*H5PIntegration.saveFreq)),H5P.on(t,"xAPI",function(e){var t=e.getVerb();"completed"!==t&&"progressed"!==t||(clearTimeout(f),f=setTimeout(p,3e3))})}if(H5P.isFramed)if(!1===H5P.externalEmbed){var h=window.frameElement;H5P.on(t,"resize",function(){clearTimeout(r),r=setTimeout(function(){!function(){if(!window.parent.H5P.isFullscreen){var e=h.parentElement.style.height;h.parentElement.style.height=h.parentElement.clientHeight+"px",h.style.height="1px",h.style.height=h.contentDocument.body.scrollHeight+"px",h.parentElement.style.height=e}}()},1)})}else if(H5P.communicator){var g=!1;H5P.communicator.on("ready",function(){H5P.communicator.send("hello")}),H5P.communicator.on("hello",function(){g=!0,document.body.style.height="auto",document.body.style.overflow="hidden",H5P.trigger(t,"resize")}),H5P.communicator.on("resizePrepared",function(e){H5P.communicator.send("resize",{scrollHeight:document.body.scrollHeight})}),H5P.communicator.on("resize",function(){H5P.trigger(t,"resize")}),H5P.on(t,"resize",function(){H5P.isFullscreen||(clearTimeout(r),r=setTimeout(function(){g?H5P.communicator.send("prepareResize",{scrollHeight:document.body.scrollHeight,clientHeight:document.body.clientHeight}):H5P.communicator.send("hello")},0))})}H5P.isFramed&&!1!==H5P.externalEmbed||H5P.jQuery(window.parent).resize(function(){window.parent.H5P.isFullscreen,H5P.trigger(t,"resize")}),H5P.instances.push(t),H5P.trigger(t,"resize")});H5P.jQuery("iframe.h5p-iframe:not(.h5p-initialized)",e).each(function(){var e=H5P.jQuery(this).addClass("h5p-initialized").data("content-id");this.contentDocument.open(),this.contentDocument.write(''+H5P.getHeadTags(e)+'
'),this.contentDocument.close()})},H5P.getHeadTags=function(e){var t=function(e){for(var t="",n=0;n';return t},n=function(e){for(var t="",n=0;n<\/script>';return t};return''+t(H5PIntegration.core.styles)+t(H5PIntegration.contents["cid-"+e].styles)+n(H5PIntegration.core.scripts)+n(H5PIntegration.contents["cid-"+e].scripts)+"