From 152b51f02a380e3caaa544cc41d3bdbf8255998d Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Fri, 20 Feb 2015 13:00:50 +0100 Subject: [PATCH 01/16] Added new font --- fonts/h5p.eot | Bin 5956 -> 4396 bytes fonts/h5p.svg | 26 ++++---------------------- fonts/h5p.ttf | Bin 5764 -> 4248 bytes fonts/h5p.woff | Bin 0 -> 4324 bytes styles/h5p.css | 12 ++++++------ 5 files changed, 10 insertions(+), 28 deletions(-) create mode 100644 fonts/h5p.woff diff --git a/fonts/h5p.eot b/fonts/h5p.eot index 9680263b5d3282bcb9f66238f410cba90a4604ec..b71c1c89c2063e98f8fed4cfe33539915dd2c74a 100644 GIT binary patch literal 4396 zcmeHLdu$xV8K3vuKJKyh-L0M2KKstTb4YT&+{*=$*ba$X5?j0+Xa%U45OT!{vEm>l zsI)1Fw?w0oKrEF|3RJXeQU7TxwJC}KAyHar5f!Bpl~607s!&m-7F6m>f3tgb>;SFQ zzq{I*`QG2mH#;-m>^hH-6A3~nVPxe)$x&)36PK=}8`tkq)1BOoYewi9600%;iPoQ6+`8Cn|ub8 zQz+N%+BZG>?kjKK4xujKQ+uZ8jH?82(?<5}J$&N_dv}ZjKSYT8eq;Ca4f3|TF}PR* z{CWd~NJRV#__u)fH})MobaATv1n}p9e{S#oUDN*eQV~MpF7W)m=|i)mo5p}wf%o1# zy>IuLn{xL9pMsCR+5K||(N8=H_``s>AoM7ags^$`OHjTZw)8KgLM^Q7qJ%;=9#{*hh}ZD>f$OvW{~K+Ae84%o*NmMOv`-84gLlhQ2H==kw3^zlN@BSF_ud9Fu#_|=0|9~oS|v8mZmoITD8b>>{#{MZH1ot_H|cT zLf$3g>P{)FtJZC=X9l-jTVtnDSBqC{S#P~;t0%R7QrRzC>$hA{gxVkm!RZO|EI-Dc zL3}z%|5<;P@@5uz(3MoK)}E_XYAC5nialghjoI2YroE;%I5qXvr_1HL2H7(PT_l@! z!bC2z-)72t2fDZBOH(8L{UcK)v;%%> zPC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=i1@oDg%jclUF7 - - -{ - "fontFamily": "h5p-core-fonts", - "majorVersion": 1, - "minorVersion": 0, - "fontURL": "http://h5p.org", - "license": "MIT license", - "licenseURL": "http://opensource.org/licenses/MIT", - "designer": "Magnus Vik Magnussen", - "designerURL": "", - "version": "Version 1.0", - "fontId": "h5p-core-fonts", - "psName": "h5p-core-fonts", - "subFamily": "Regular", - "fullName": "h5p-core-fonts", - "description": "Generated by IcoMoon" -} - - +Generated by IcoMoon - + + @@ -37,6 +19,6 @@ - + \ No newline at end of file diff --git a/fonts/h5p.ttf b/fonts/h5p.ttf index c0ffaf53e54a700855bfb88cab9c7a6c48155c71..a9bc2fd7d17905a79d61db7f73637000b054d644 100644 GIT binary patch literal 4248 zcmeHKdyHIF89(oHU-P)TGjn&_-JRW;-I*%L`xNklgm~{ZZ|lSe=qPE*ch1Kzi>lGgE$V<4>2tTtJWn^x&_{0B`AfQKC!zE~@;twvohEtkSIAY zpDT>hMkPx#YAsEV@p`Sq^6Y5snytmY#owAXLGyacgfc*W^)@-#ono4|fs+BPoTF}*WzTTOySL>+h zYMMP@M2*_|)uz9?K0Gt?l_x8euMM-O47xOI`VE^mx9+SyTz$C;Ta4aCe##$Wzb1WT zEg?h2F&bKEdswYBMuSWRKGupuxkA0xs8%xRl*;pmZcYV*<2y&nJI98G#&(v6w)QLt zSLB3fy}b3h>$aNu&dt4B3gwyc!NKvFGWww)y&%BiiOXiE48zo{Swx2plT$*npA(N{ z5a0FW0mAz3M$cks z>)P>gW?Rp3)i%qUTPE7NwlA?NzC6PTI`RJdFPuCX#j%(CLU`<%Pl#iqFar0}K_5LQ zGFaY1UdQRm$RM=YFtjE5k*KFK)zLA!GV0tP@CPWWPv7NC%u9qqMzcg5_#}OeOX^Z3 z<^_XCVIUno36C(MKv~J$D#Cjymsz_^An#^>TlCq}i*xK4y9&y@PtbL?-4D*;3{|zQ zp3O;jE&hwCR+0Xoh0~D;wwipE$Jv?XSduUr;oq0JkQUP^w3Wst%FQ1YZj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aSH%9CjRX zUNn{FJSYX2O1qM+G%G23mNjz95@6ha}8{Hsf%^69`X7gf_mG1K;|gB#>%>53@4&Prk2Uou!l-s*NU|gR@DflW(ZDfUTvu(1cTvl z?^ri0LNEE2ID@W4WGOT<}?6Ct`6#bvP3f zkANg617C?CWjr4pj+BNJjMGLQm53)~Jd;gFbr6j!8%4m7fcarPVNzWQ&H2N5P%ag8S85i zvkr>)F6fOz79N}mVp^ih$1>Vz5ltteZnLp;!YYy|miBFI#1AXMvV@Fa2gXS3z+l1y z86!hlZpV;V6xk>}BLM&#hpH{4NhDMLZ@{d(25{u~&xr?Ij=cf?C(QCsXV_`D5G09k z6ocgag-suk&mntsNr<}yw9niH63A~lw}A5ctvwJ@uJwc8taVS|E~peMtxxLiU@ zq8}oZeB(w$b1wUZ#<9En3IKRivU-+dW1q~_XMe&Cq*Jt#1SZO&H3GDq)QXU=KpSPz z4Q$-_|J)dI6FgNBjgCp}({x!CoA>AT)e3J_Zc`sr~rG;>V8wVni9pzb{+ZH*&8+3Wdm~?!5;>;oBTV z>o(!->`L2^2tz_z+&4$nHpEPas8Su`_PYnY3F%(Nzsefuz%w;YUt;HOyp%x-4r{Sh zcso6Pm9@b9ohj?ehlG!OZO@dehV01Hyz!|$^Tz4K6f#&}4#Ks|sVQ3yx&gF5eH^S= zUK#t-uG$@6NL=`L7L^!a?9~@Sw>(!PGq>M*?AM?00gnBK#F)Z28JNd? z_Z_smJNM470__QKum`*x_>Yj6I$kU%9)Ur;*+_-WO@ E0f&Tg>;M1& diff --git a/fonts/h5p.woff b/fonts/h5p.woff new file mode 100644 index 0000000000000000000000000000000000000000..66394c10c29d618c76bc5a15fffdc7f78a306179 GIT binary patch literal 4324 zcmeHKdyHIF89(27&b{-zyEAil+wRWp%)1B3)oP=Y~BFd-7aD3O>bMBJ&rbMNf3TOcO> z?alqp`QG0--?`_U?|$K;$w@{GPwI6R4f^9DZSm#LMVAg%7^4WdpR(Yxkk+!F!sq*gF>9-MwwHaox-f96b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CVbxAFnLm;YTJmcLhDR4?fb8h^FHT-qqc+`wXCq)Ug9 zV2`){@QCS_12OR4zDU z9{LRN&}WE;K0{o?w!dW?`fRWo+s`h;pUaJGj(wi(V|!T-ThGeKLLh6@_J;_&1WLQu wO>8%tfpTa#85kUZ$u3Cu25x590rb~`cMUs)_CmH3T2lb)yd2KowjcZa2h12PrvLx| literal 0 HcmV?d00001 diff --git a/styles/h5p.css b/styles/h5p.css index fff975b..dfb92db 100644 --- a/styles/h5p.css +++ b/styles/h5p.css @@ -2,12 +2,12 @@ /* Custom H5P font to use for icons. */ @font-face { - font-family: 'H5P'; - src: url('../fonts/h5p.eot?ver=1.2.1'); - src: url('../fonts/h5p.eot?#iefix&ver=1.2.1') format('embedded-opentype'), - url('data:application/font-woff;base64,d09GRk9UVE8AABCAAAoAAAAAEDgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAAA9AAAC5UAAAuVXPOdF09TLzIAAAyMAAAAYAAAAGAOkgW+Y21hcAAADOwAAABMAAAATBfN0XNnYXNwAAANOAAAAAgAAAAIAAAAEGhlYWQAAA1AAAAANgAAADYC8En+aGhlYQAADXgAAAAkAAAAJAgIBPtobXR4AAANnAAAAEQAAABERRUSm21heHAAAA3gAAAABgAAAAYAEVAAbmFtZQAADegAAAJ2AAACdoHSvKxwb3N0AAAQYAAAACAAAAAgAAMAAAEABAQAAQEBD2g1cC1jb3JlLWZvbnRzAAECAAEAO/gcAvgbA/gYBB4KAAl3/4uLHgoACXf/i4sMB4tLHAUp+lQFHQAAANQPHQAAANkRHQAAAAkdAAALjBIAEgEBDx0fISQpLjM4PUJHTFFWW2BlaDVwLWNvcmUtZm9udHNoNXAtY29yZS1mb250c3UwdTF1MjB1RTg4OHVFODg5dUU4OEF1RTg4QnVFODhDdUU4OER1RTg4RXVFODhGdUU4OTB1RTg5MXVFODkydUU4OTN1RTg5NAAAAgGJAA8AEQIAAQAEAAcACgANAGYAwQEmAkUDZQPyBNIHEQefCL4JYgoq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ARYAAwABBAkAAwAcANAAAwABBAkABAAcASQAAwABBAkABQAWALoAAwABBAkABgAcAPoAAwABBAkACQAoAJIAAwABBAkACgAoAUAAAwABBAkACwAcABwAAwABBAkADQAWADgAAwABBAkADgBEAE4AaAA1AHAALQBjAG8AcgBlAC0AZgBvAG4AdABzAGgAdAB0AHAAOgAvAC8AaAA1AHAALgBvAHIAZwBNAEkAVAAgAGwAaQBjAGUAbgBzAGUAaAB0AHQAcAA6AC8ALwBvAHAAZQBuAHMAbwB1AHIAYwBlAC4AbwByAGcALwBsAGkAYwBlAG4AcwBlAHMALwBNAEkAVABNAGEAZwBuAHUAcwAgAFYAaQBrACAATQBhAGcAbgB1AHMAcwBlAG4AVgBlAHIAcwBpAG8AbgAgADEALgAwAGgANQBwAC0AYwBvAHIAZQAtAGYAbwBuAHQAc2g1cC1jb3JlLWZvbnRzAGgANQBwAC0AYwBvAHIAZQAtAGYAbwBuAHQAcwBSAGUAZwB1AGwAYQByAGgANQBwAC0AYwBvAHIAZQAtAGYAbwBuAHQAcwBHAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4AAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA') format('woff'), - url('../fonts/h5p.ttf?ver=1.2.1') format('truetype'), - url('../fonts/h5p.svg?ver=1.2.1#h5pregular') format('svg'); + font-family: 'h5p'; + src:url('../fonts/h5p.eot?-9qymee'); + src:url('../fonts/h5p.eot?#iefix-9qymee') format('embedded-opentype'), + url('../fonts/h5p.woff?-9qymee') format('woff'), + url('../fonts/h5p.ttf?-9qymee') format('truetype'), + url('../fonts/h5p.svg?-9qymee#h5p') format('svg'); font-weight: normal; font-style: normal; } From d6e69e63ee69fcaef0fd2712e0d263d9d641d5b4 Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Fri, 20 Feb 2015 15:34:38 +0100 Subject: [PATCH 02/16] Use this instead of self so that we're compatible with jsdoc --- js/h5p-event-dispatcher.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/h5p-event-dispatcher.js b/js/h5p-event-dispatcher.js index 204fda9..f403ea2 100644 --- a/js/h5p-event-dispatcher.js +++ b/js/h5p-event-dispatcher.js @@ -36,7 +36,7 @@ H5P.EventDispatcher = (function () { * @param {Function} listener - Event listener * @param {Function} thisArg - Optionally specify the this value when calling listener. */ - self.on = function (type, listener, thisArg) { + this.on = function (type, listener, thisArg) { if (thisArg === undefined) { thisArg = self; } @@ -66,7 +66,7 @@ H5P.EventDispatcher = (function () { * @param {Function} listener - Event listener * @param {Function} thisArg - Optionally specify the this value when calling listener. */ - self.once = function (type, listener, thisArg) { + this.once = function (type, listener, thisArg) { if (thisArg === undefined) { thisArg = self; } @@ -91,7 +91,7 @@ H5P.EventDispatcher = (function () { * @param {String} type - Event type * @param {Function} listener - Event listener */ - self.off = function (type, listener) { + this.off = function (type, listener) { if (listener !== undefined && !(listener instanceof Function)) { throw TypeError('listener must be a function'); } @@ -131,7 +131,7 @@ H5P.EventDispatcher = (function () { * Custom event data(used when event type as string is used as first * argument */ - self.trigger = function (event, eventData) { + this.trigger = function (event, eventData) { if (event === undefined) { return; } From 037e26f42ba8dc3c2c99565125fbfd55164dd403 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 27 Feb 2015 08:57:02 +0100 Subject: [PATCH 03/16] Space support. --- js/h5p.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/h5p.js b/js/h5p.js index c44a55b..15a9f97 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -766,7 +766,7 @@ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) { }).select(); // Expand advanced embed - $dialog.find('.h5p-expander').click(function () { + var expand = function () { var $expander = H5P.jQuery(this); var $content = $expander.next(); if ($content.is(':visible')) { @@ -778,6 +778,11 @@ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) { $content.show(); } positionInner(); + }; + $dialog.find('.h5p-expander').click(expand).keypress(function (event) { + if (event.keyCode === 32) { + expand(); + } }); }); From 4e594dd57345b0aec5402052f9c4cdb089862b43 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 27 Feb 2015 10:26:57 +0100 Subject: [PATCH 04/16] Fixed dialog pos and expand. --- js/h5p.js | 20 ++++++++++++-------- styles/h5p.css | 1 - 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/js/h5p.js b/js/h5p.js index 15a9f97..4183e1c 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -159,8 +159,7 @@ H5P.init = function () { // When resize has been prepared tell parent window to resize H5P.communicator.on('resizePrepared', function (data) { H5P.communicator.send('resize', { - height: document.body.scrollHeight, - parentHeight: data.parentHeight + height: document.body.scrollHeight }); }); @@ -722,13 +721,18 @@ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) { // Selecting embed code when dialog is opened H5P.jQuery(dialog).on('dialog-opened', function (event, $dialog) { var $inner = $dialog.find('.h5p-inner'); + var $scroll = $inner.find('.h5p-scroll-content'); + var diff = $scroll.outerHeight() - $scroll.innerHeight(); var positionInner = function () { - $inner.css('height', ''); - var h = $inner.height(); - if (Math.floor($dialog.height()) === h) { - $inner.css('height', '100%'); + var height = $inner.height(); + if ($scroll[0].scrollHeight + diff > height) { + $inner.css('height', ''); // 100% } - $inner.css('marginTop', '-' + (h / 2) + 'px'); + else { + $inner.css('height', 'auto'); + height = $inner.height(); + } + $inner.css('marginTop', '-' + (height / 2) + 'px'); }; // Handle changing of width/height @@ -781,7 +785,7 @@ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) { }; $dialog.find('.h5p-expander').click(expand).keypress(function (event) { if (event.keyCode === 32) { - expand(); + expand.apply(this); } }); }); diff --git a/styles/h5p.css b/styles/h5p.css index 1925892..b4478b9 100644 --- a/styles/h5p.css +++ b/styles/h5p.css @@ -252,7 +252,6 @@ div.h5p-fullscreen { width: 300px; left: 50%; top: 50%; - height: auto; margin: 0 0 0 -150px; } .h5p-embed-dialog .h5p-embed-code-container, From 1e4a7ff26f418fde8164053b865369638bfb0a0f Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 27 Feb 2015 10:29:43 +0100 Subject: [PATCH 05/16] Removed unused code. --- js/h5p-resizer.js | 48 ++--------------------------------------------- 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/js/h5p-resizer.js b/js/h5p-resizer.js index 54ec5d8..d1a1905 100644 --- a/js/h5p-resizer.js +++ b/js/h5p-resizer.js @@ -47,14 +47,10 @@ actionHandlers.prepareResize = function (iframe, data, respond) { responseData = {}; - // Retain parent size to avoid jumping/scrolling - responseData.parentHeight = iframe.parentElement.style.height; - //iframe.parentElement.style.height = iframe.parentElement.clientHeight + 'px'; - // Reset iframe height, in case content has shrinked. iframe.style.height = '1px'; - respond('resizePrepared', responseData); + respond('resizePrepared'); }; /** @@ -68,9 +64,6 @@ actionHandlers.resize = function (iframe, data, respond) { // Resize iframe so all content is visible. iframe.style.height = data.height + 'px'; - - // Free parent - //iframe.parentElement.style.height = data.parentHeight; }; /** @@ -84,43 +77,6 @@ } }; - // /** - // * Enter semi full screen. - // * Expands the iframe so that it covers the whole page. - // * - // * @private - // * @param {Object} iframe Element - // * @param {Object} data Payload - // * @param {Function} respond Send a response to the iframe - // */ - // actionHandlers.fullScreen = function (iframe, data, respond) { - // iframe.style.position = 'fixed'; - // iframe.style.top = iframe.style.left = 0; - // iframe.style.zIndex = 101; - // iframe.style.width = iframe.style.height = '100%'; - // document.body.addEventListener('keyup', escape, false); - // respond('fullScreen'); - // }; - // - // /** - // * Exit semi full screen. - // * - // * @private - // * @param {Object} iframe Element - // * @param {Object} data Payload - // * @param {Function} respond Send a response to the iframe - // */ - // actionHandlers.exitFullScreen = function (iframe, data, respond) { - // iframe.style.position = ''; - // iframe.style.top = iframe.style.left = ''; - // iframe.style.zIndex = ''; - // iframe.style.width = '100%'; - // iframe.style.height = ''; - // document.body.removeEventListener('keyup', escape, false); - // respond('exitFullScreen'); - // }; - - // Listen for messages from iframes window.addEventListener('message', function receiveMessage(event) { if (event.data.context !== 'h5p') { @@ -142,7 +98,7 @@ // Find action handler handler if (actionHandlers[event.data.action]) { - actionHandlers[event.data.action](iframe, event.data, function (action, data) { + actionHandlers[event.data.action](iframe, event.data, function respond(action, data) { if (data === undefined) { data = {}; } From 77d589ec6868d834aa3b91ece1cf0c124dbada71 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 27 Feb 2015 10:55:47 +0100 Subject: [PATCH 06/16] Fixed absolute URLs violating its parent. --- js/h5p.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/h5p.js b/js/h5p.js index 4183e1c..932477e 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -459,7 +459,8 @@ H5P.getPath = function (path, contentId) { } if (!hasProtocol(prefix)) { - prefix = window.parent.location.protocol + "//" + window.parent.location.host + prefix; + // Use absolute urls + prefix = window.location.protocol + "//" + window.location.host + prefix; } return prefix + '/' + path; From d1cc8bcb71c054b4dbfcca583d988b96b6105072 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 27 Feb 2015 11:05:22 +0100 Subject: [PATCH 07/16] Moved embed template to core. --- embed.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 embed.php diff --git a/embed.php b/embed.php new file mode 100644 index 0000000..25b37f4 --- /dev/null +++ b/embed.php @@ -0,0 +1,27 @@ + + + + + <?php print $content['title']; ?> + + + + + + + + +
+ + + From f2595b2bce932eb5832effb4186f5a9cbee0b617 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 27 Feb 2015 13:59:42 +0100 Subject: [PATCH 08/16] Change how H5Ps are integrated. --- embed.php | 7 +---- js/h5p-content-upgrade.js | 2 +- js/h5p-library-details.js | 4 +-- js/h5p-library-list.js | 10 +++--- js/h5p-utils.js | 2 +- js/h5p-x-api-event.js | 4 +-- js/h5p.js | 65 +++++++++++++++++++++++++++++++-------- 7 files changed, 65 insertions(+), 29 deletions(-) diff --git a/embed.php b/embed.php index 25b37f4..7e6250b 100644 --- a/embed.php +++ b/embed.php @@ -13,13 +13,8 @@
diff --git a/js/h5p-content-upgrade.js b/js/h5p-content-upgrade.js index ff3756f..6828fdc 100644 --- a/js/h5p-content-upgrade.js +++ b/js/h5p-content-upgrade.js @@ -7,7 +7,7 @@ var H5PUpgrades = H5PUpgrades || {}; // Initialize $(document).ready(function () { // Get library info - info = H5PIntegration.getLibraryInfo(); + info = H5PAdminIntegration.libraryInfo; // Get and reset container $container = $('#h5p-admin-container').html('

' + info.message + '

'); diff --git a/js/h5p-library-details.js b/js/h5p-library-details.js index 8605b3d..9d22167 100644 --- a/js/h5p-library-details.js +++ b/js/h5p-library-details.js @@ -7,8 +7,8 @@ var H5PLibraryDetails= H5PLibraryDetails || {}; * Initializing */ H5PLibraryDetails.init = function () { - H5PLibraryDetails.$adminContainer = H5PIntegration.getAdminContainer(); - H5PLibraryDetails.library = H5PIntegration.getLibraryInfo(); + H5PLibraryDetails.$adminContainer = H5P.jQuery(H5PAdminIntegration.containerSelector); + H5PLibraryDetails.library = H5PAdminIntegration.libraryInfo; // currentContent holds the current list if data (relevant for filtering) H5PLibraryDetails.currentContent = H5PLibraryDetails.library.content; diff --git a/js/h5p-library-list.js b/js/h5p-library-list.js index 4382b28..5f419d6 100644 --- a/js/h5p-library-list.js +++ b/js/h5p-library-list.js @@ -7,15 +7,15 @@ var H5PLibraryList = H5PLibraryList || {}; * Initializing */ H5PLibraryList.init = function () { - var $adminContainer = H5PIntegration.getAdminContainer(); + var $adminContainer = H5P.jQuery(H5PAdminIntegration.containerSelector); - var libraryList = H5PIntegration.getLibraryList(); + var libraryList = H5PAdminIntegration.libraryList; if (libraryList.notCached) { $adminContainer.append(H5PUtils.getRebuildCache(libraryList.notCached)); } // Create library list - $adminContainer.append(H5PLibraryList.createLibraryList(H5PIntegration.getLibraryList())); + $adminContainer.append(H5PLibraryList.createLibraryList(H5PAdminIntegration.libraryList)); }; /** @@ -24,7 +24,7 @@ var H5PLibraryList = H5PLibraryList || {}; * @param {object} libraries List of libraries and headers */ H5PLibraryList.createLibraryList = function (libraries) { - var t = H5PIntegration.i18n.H5P; + var t = H5PAdminIntegration.l10n; if(libraries.listData === undefined || libraries.listData.length === 0) { return $('
' + t.NA + '
'); } @@ -123,7 +123,7 @@ var H5PLibraryList = H5PLibraryList || {}; } } }; - + // Initialize me: $(document).ready(function () { if (!H5PLibraryList.initialized) { diff --git a/js/h5p-utils.js b/js/h5p-utils.js index 00af7bc..d90ca58 100644 --- a/js/h5p-utils.js +++ b/js/h5p-utils.js @@ -7,7 +7,7 @@ var H5PUtils = H5PUtils || {}; * @param {array} headers List of headers */ H5PUtils.createTable = function (headers) { - var $table = $('
'); + var $table = $('
'); if(headers) { var $thead = $(''); diff --git a/js/h5p-x-api-event.js b/js/h5p-x-api-event.js index 5e1a025..e199c28 100644 --- a/js/h5p-x-api-event.js +++ b/js/h5p-x-api-event.js @@ -99,8 +99,8 @@ H5P.XAPIEvent.prototype.setObject = function(instance) { */ H5P.XAPIEvent.prototype.setActor = function() { this.data.statement.actor = { - 'name': H5P.user.name, - 'mbox': 'mailto:' + H5P.user.mail, + 'name': H5PIntegration.user.name, + 'mbox': 'mailto:' + H5PIntegration.user.mail, 'objectType': 'Agent' }; }; diff --git a/js/h5p.js b/js/h5p.js index 932477e..d193881 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -48,7 +48,7 @@ H5P.init = function () { var $element = H5P.jQuery(this); var $container = H5P.jQuery('
').appendTo($element); var contentId = $element.data('content-id'); - var contentData = H5P.contentDatas['cid-' + contentId]; + var contentData = H5PIntegration.contents['cid-' + contentId]; if (contentData === undefined) { return H5P.error('No data for content id ' + contentId + '. Perhaps the library is gone?'); } @@ -217,6 +217,47 @@ H5P.init = function () { }); }; +/** + * Loop through assets for iframe content and create a set of tags for head. + * + * @private + * @param {number} contentId + * @returns {string} HTML + */ +H5P.getHeadTags = function (contentId) { + var basePath = window.location.protocol + '//' + window.location.host + H5PIntegration.basePath; + + var createUrl = function (path) { + if (path.substring(0,7) !== 'http://' && path.substring(0,8) !== 'https://') { + // Not external, add base path. + path = basePath + path; + } + return path; + }; + + var createStyleTags = function (styles) { + var tags = ''; + for (var i = 0; i < styles.length; i++) { + tags += ''; + } + return tags; + }; + + var createScriptTags = function (scripts) { + var tags = ''; + for (var i = 0; i < scripts.length; i++) { + tags += ''; + } + return tags; + }; + + return createStyleTags(H5PIntegration.core.styles) + + createStyleTags(H5PIntegration.contents['cid-' + contentId].styles) + + createScriptTags(H5PIntegration.core.scripts) + + createScriptTags(H5PIntegration.contents['cid-' + contentId].scripts) + + ''; +}; + H5P.communicator = (function () { /** * @class @@ -449,7 +490,7 @@ H5P.getPath = function (path, contentId) { } if (contentId !== undefined) { - prefix = H5P.url + '/content/' + contentId; + prefix = H5PIntegration.url + '/content/' + contentId; } else if (window.H5PEditor !== undefined) { prefix = H5PEditor.filesPath; @@ -571,15 +612,15 @@ H5P.t = function (key, vars, ns) { ns = 'H5P'; } - if (H5P.l10n[ns] === undefined) { + if (H5PIntegration.l10n[ns] === undefined) { return '[Missing translation namespace "' + ns + '"]'; } - if (H5P.l10n[ns][key] === undefined) { + if (H5PIntegration.l10n[ns][key] === undefined) { return '[Missing translation "' + key + '" in "' + ns + '"]'; } - var translation = H5P.l10n[ns][key]; + var translation = H5PIntegration.l10n[ns][key]; if (vars !== undefined) { // Replace placeholder with variables. @@ -1156,7 +1197,7 @@ H5P.libraryFromString = function (library) { * @returns {String} The full path to the library. */ H5P.getLibraryPath = function (library) { - return H5P.url + '/libraries/' + library; + return H5PIntegration.url + '/libraries/' + library; }; /** @@ -1204,8 +1245,8 @@ H5P.trim = function (value) { * @returns {Boolean} */ H5P.jsLoaded = function (path) { - H5P.loadedJs = H5P.loadedJs || []; - return H5P.jQuery.inArray(path, H5P.loadedJs) !== -1; + H5PIntegration.loadedJs = H5PIntegration.loadedJs || []; + return H5P.jQuery.inArray(path, H5PIntegration.loadedJs) !== -1; }; /** @@ -1215,8 +1256,8 @@ H5P.jsLoaded = function (path) { * @returns {Boolean} */ H5P.cssLoaded = function (path) { - H5P.loadedCss = H5P.loadedCss || []; - return H5P.jQuery.inArray(path, H5P.loadedCss) !== -1; + H5PIntegration.loadedCss = H5PIntegration.loadedCss || []; + return H5P.jQuery.inArray(path, H5PIntegration.loadedCss) !== -1; }; /** @@ -1255,7 +1296,7 @@ H5P.shuffleArray = function (array) { * @param {Number} time optional reported time usage */ H5P.setFinished = function (contentId, score, maxScore, time) { - if (H5P.postUserStatistics === true) { + if (H5PIntegration.postUserStatistics === true) { /** * Return unix timestamp for the given JS Date. * @@ -1268,7 +1309,7 @@ H5P.setFinished = function (contentId, score, maxScore, time) { // Post the results // TODO: Should we use a variable with the complete path? - H5P.jQuery.post(H5P.ajaxPath + 'setFinished', { + H5P.jQuery.post(H5PIntegration.ajaxPath + 'setFinished', { contentId: contentId, score: score, maxScore: maxScore, From aac10b86fa3a42d2679af3bc5a71da946d1c0a2d Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 27 Feb 2015 14:53:26 +0100 Subject: [PATCH 09/16] Make old embed code insert new. --- js/h5p-embed.js | 250 +++++++----------------------------------------- 1 file changed, 35 insertions(+), 215 deletions(-) diff --git a/js/h5p-embed.js b/js/h5p-embed.js index deeab96..3196fa1 100644 --- a/js/h5p-embed.js +++ b/js/h5p-embed.js @@ -1,69 +1,27 @@ /*jshint multistr: true */ /** - * + * Converts old script tag embed to iframe */ -var H5P = H5P || (function () { +var H5POldEmbed = H5POldEmbed || (function () { var head = document.getElementsByTagName('head')[0]; - var contentId = 0; - var contents = {}; + var resizer = false; /** - * Wraps multiple content between a prefix and a suffix. + * Loads the resizing script */ - var wrap = function (prefix, content, suffix) { - var result = ''; - for (var i = 0; i < content.length; i++) { - result += prefix + content[i] + suffix; - } - return result; - }; - - /** - * - */ - var loadContent = function (id, script) { - var url = script.getAttribute('data-h5p'); - var data, callback = 'H5P' + id; - - // Prevent duplicate loading. - script.removeAttribute('data-h5p'); + var loadResizer = function (url) { + var data, callback = 'H5POldEmbed'; + resizer = true; // Callback for when content data is loaded. window[callback] = function (content) { - contents[id] = content; - - var iframe = document.createElement('iframe'); - var parent = script.parentNode; - parent.insertBefore(iframe, script); - - iframe.id = 'h5p-iframe-' + id; - iframe.style.display = 'block'; - iframe.style.width = '100%'; - iframe.style.height = '1px'; - iframe.style.border = 'none'; - iframe.style.zIndex = 101; - iframe.style.top = 0; - iframe.style.left = 0; - iframe.className = 'h5p-iframe'; - iframe.setAttribute('frameBorder', '0'); - iframe.contentDocument.open(); - iframe.contentDocument.write('\ - \ - \ - \ - ' + wrap('') + '\ - ' + wrap('') + '\ - \ -
\ - '); - iframe.contentDocument.close(); - iframe.contentDocument.documentElement.style.overflow = 'hidden'; + // Add resizing script to head + var resizer = document.createElement('script'); + resizer.src = content; + head.appendChild(resizer); // Clean up - parent.removeChild(script); head.removeChild(data); delete window[callback]; }; @@ -74,183 +32,45 @@ var H5P = H5P || (function () { head.appendChild(data); }; + /** + * Replaced script tag with iframe + */ + var addIframe = function (script) { + // Add iframe + var iframe = document.createElement('iframe'); + iframe.src = script.getAttribute('data-h5p'); + iframe.frameBorder = false; + iframe.allowFullscreen = true; + var parent = script.parentNode; + parent.insertBefore(iframe, script); + parent.removeChild(script); + }; + /** * Go throught all script tags with the data-h5p attribute and load content. */ - function H5P() { + function H5POldEmbed() { var scripts = document.getElementsByTagName('script'); var h5ps = []; // Use seperate array since scripts grow in size. for (var i = 0; i < scripts.length; i++) { var script = scripts[i]; - if (script.hasAttribute('data-h5p')) { + if (script.src.indexOf('/h5p-resizer.js') !== -1) { + resizer = true; + } + else if (script.hasAttribute('data-h5p')) { h5ps.push(script); } } for (i = 0; i < h5ps.length; i++) { - loadContent(contentId, h5ps[i]); - contentId++; - } - } - - /** - * Return integration object - */ - H5P.getIntegration = function (id) { - var content = contents[id]; - return { - getJsonContent: function () { - return content.params; - }, - getContentPath: function () { - return content.path + 'content/' + content.id + '/'; - }, - getFullscreen: function () { - return content.fullscreen; - }, - getLibraryPath: function (library) { - return content.path + 'libraries/' + library; - }, - getContentData: function () { - return { - library: content.library, - jsonContent: content.params, - fullScreen: content.fullscreen, - exportUrl: content.exportUrl, - embedCode: content.embedCode - }; - }, - i18n: content.i18n, - showH5PIconInActionBar: function () { - // Always show H5P-icon when embedding - return true; + if (!resizer) { + loadResizer(h5ps[i].getAttribute('data-h5p')); } - }; - }; + addIframe(h5ps[i]); - // Detect if we support fullscreen, and what prefix to use. - var fullScreenBrowserPrefix, safariBrowser; - if (document.documentElement.requestFullScreen) { - fullScreenBrowserPrefix = ''; - } - else if (document.documentElement.webkitRequestFullScreen && - navigator.userAgent.indexOf('Android') === -1 // Skip Android - ) { - safariBrowser = navigator.userAgent.match(/Version\/(\d)/); - safariBrowser = (safariBrowser === null ? 0 : parseInt(safariBrowser[1])); - - // Do not allow fullscreen for safari < 7. - if (safariBrowser === 0 || safariBrowser > 6) { - fullScreenBrowserPrefix = 'webkit'; } } - else if (document.documentElement.mozRequestFullScreen) { - fullScreenBrowserPrefix = 'moz'; - } - else if (document.documentElement.msRequestFullscreen) { - fullScreenBrowserPrefix = 'ms'; - } - /** - * Enter fullscreen mode. - */ - H5P.fullScreen = function ($element, instance, exitCallback, body) { - var iframe = document.getElementById('h5p-iframe-' + $element.parent().data('content-id')); - var $classes = $element.add(body); - var $body = $classes.eq(1); - - /** - * Prepare for resize by setting the correct styles. - * - * @param {String} classes CSS - */ - var before = function (classes) { - $classes.addClass(classes); - iframe.style.height = '100%'; - }; - - /** - * Gets called when fullscreen mode has been entered. - * Resizes and sets focus on content. - */ - var entered = function () { - // Do not rely on window resize events. - instance.$.trigger('resize'); - instance.$.trigger('focus'); - }; - - /** - * Gets called when fullscreen mode has been exited. - * Resizes and sets focus on content. - * - * @param {String} classes CSS - */ - var done = function (classes) { - H5P.isFullscreen = false; - $classes.removeClass(classes); - - // Do not rely on window resize events. - instance.$.trigger('resize'); - instance.$.trigger('focus'); - - if (exitCallback !== undefined) { - exitCallback(); - } - }; - - H5P.isFullscreen = true; - if (fullScreenBrowserPrefix === undefined) { - // Create semi fullscreen. - - before('h5p-semi-fullscreen'); - iframe.style.position = 'fixed'; - - var $disable = $element.prepend('').children(':first'); - var keyup, disableSemiFullscreen = function () { - $disable.remove(); - $body.unbind('keyup', keyup); - iframe.style.position = 'static'; - done('h5p-semi-fullscreen'); - return false; - }; - keyup = function (event) { - if (event.keyCode === 27) { - disableSemiFullscreen(); - } - }; - $disable.click(disableSemiFullscreen); - $body.keyup(keyup); // TODO: Does not work with iframe's $! - entered(); - } - else { - // Create real fullscreen. - - before('h5p-fullscreen'); - var first, eventName = (fullScreenBrowserPrefix === 'ms' ? 'MSFullscreenChange' : fullScreenBrowserPrefix + 'fullscreenchange'); - document.addEventListener(eventName, function () { - if (first === undefined) { - // We are entering fullscreen mode - first = false; - entered(); - return; - } - - // We are exiting fullscreen - done('h5p-fullscreen'); - document.removeEventListener(eventName, arguments.callee, false); - }); - - if (fullScreenBrowserPrefix === '') { - iframe.requestFullScreen(); - } - else { - var method = (fullScreenBrowserPrefix === 'ms' ? 'msRequestFullscreen' : fullScreenBrowserPrefix + 'RequestFullScreen'); - var params = (fullScreenBrowserPrefix === 'webkit' && safariBrowser === 0 ? Element.ALLOW_KEYBOARD_INPUT : undefined); - iframe[method](params); - } - } - }; - - return H5P; + return H5POldEmbed; })(); -new H5P(); +new H5POldEmbed(); From 1c1829b13b351327294f07306334e880508692d3 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 27 Feb 2015 14:53:38 +0100 Subject: [PATCH 10/16] Fixed integration bug. --- js/h5p-x-api-event.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/h5p-x-api-event.js b/js/h5p-x-api-event.js index e199c28..940a5cb 100644 --- a/js/h5p-x-api-event.js +++ b/js/h5p-x-api-event.js @@ -79,7 +79,7 @@ H5P.XAPIEvent.prototype.getVerb = function(full) { H5P.XAPIEvent.prototype.setObject = function(instance) { if (instance.contentId) { this.data.statement.object = { - 'id': H5P.contentDatas['cid-' + instance.contentId].url, + 'id': H5PIntegration.contents['cid-' + instance.contentId].url, 'objectType': 'Activity', 'extensions': { 'http://h5p.org/x-api/h5p-local-content-id': instance.contentId From 07cd5c0d426b6532fb7c8d04a00011c96111554e Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 27 Feb 2015 15:37:16 +0100 Subject: [PATCH 11/16] Added a floating touch. --- js/h5p.js | 7 +++++-- styles/h5p.css | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/js/h5p.js b/js/h5p.js index d193881..1a3aecc 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -807,8 +807,11 @@ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) { H5P.jQuery(this).select().css('height', this.scrollHeight + 'px'); positionInner(); }).blur(function () { - H5P.jQuery(this).css('height', ''); - positionInner(); + var $area = H5P.jQuery(this); + setTimeout(function () { + $area.css('height', ''); + positionInner(); + }, 100); }).select(); // Expand advanced embed diff --git a/styles/h5p.css b/styles/h5p.css index b4478b9..37a6b62 100644 --- a/styles/h5p.css +++ b/styles/h5p.css @@ -253,6 +253,7 @@ div.h5p-fullscreen { left: 50%; top: 50%; margin: 0 0 0 -150px; + transition: margin 250ms linear 100ms; } .h5p-embed-dialog .h5p-embed-code-container, .h5p-embed-size { @@ -353,6 +354,7 @@ div.h5p-fullscreen { font-size: 1.125em; outline: none; margin: 0.5em 0 0; + display: inline-block; } .h5p-expander:before { content: "+"; From 8e53f626791494ebd0848d06ab676380f1175626 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Mon, 2 Mar 2015 13:42:15 +0100 Subject: [PATCH 12/16] Make sure admin container is empty. --- js/h5p-library-list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/h5p-library-list.js b/js/h5p-library-list.js index 5f419d6..dcb0cc8 100644 --- a/js/h5p-library-list.js +++ b/js/h5p-library-list.js @@ -7,7 +7,7 @@ var H5PLibraryList = H5PLibraryList || {}; * Initializing */ H5PLibraryList.init = function () { - var $adminContainer = H5P.jQuery(H5PAdminIntegration.containerSelector); + var $adminContainer = H5P.jQuery(H5PAdminIntegration.containerSelector).html(''); var libraryList = H5PAdminIntegration.libraryList; if (libraryList.notCached) { From 553ae243d2e1fd648aada5a58d3064f9713537cc Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Mon, 2 Mar 2015 15:01:05 +0100 Subject: [PATCH 13/16] UX improvements to embed code system --- js/h5p.js | 35 +++++++++++++++-------------------- styles/h5p.css | 2 +- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/js/h5p.js b/js/h5p.js index 1a3aecc..8ade0e6 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -198,8 +198,9 @@ H5P.init = function () { H5P.trigger(instance, 'resize'); } }); - H5P.instances.push(instance); } + + H5P.instances.push(instance); // Resize content. H5P.trigger(instance, 'resize'); @@ -758,6 +759,7 @@ H5P.findCopyrights = function (info, parameters, contentId) { * @returns {undefined} */ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) { + var fullEmbedCode = embedCode + resizeCode; var dialog = new H5P.Dialog('embed', H5P.t('embed'), '' + H5P.t('size') + ': × px
' + H5P.t('showAdvanced') + '

' + H5P.t('advancedHelp') + '

', $element); // Selecting embed code when dialog is opened @@ -788,31 +790,21 @@ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) { return Math.ceil(num); }; var updateEmbed = function () { - $dialog.find('.h5p-embed-code-container:first').val(embedCode.replace(':w', getNum($w, size.width)).replace(':h', getNum($h, size.height))); + $dialog.find('.h5p-embed-code-container:first').val(fullEmbedCode.replace(':w', getNum($w, size.width)).replace(':h', getNum($h, size.height))); }; - var w = size.width; - $w.change(function () { - // Keep aspect ratio when changing width - var newW = getNum($w, size.width); - $h.val(Math.ceil(newW * (getNum($h, size.height) / w))); - w = newW; - updateEmbed(); - }); + $w.change(updateEmbed); $h.change(updateEmbed); updateEmbed(); // Select text and expand textareas - $dialog.find('.h5p-embed-code-container').focus(function () { - H5P.jQuery(this).select().css('height', this.scrollHeight + 'px'); - positionInner(); - }).blur(function () { - var $area = H5P.jQuery(this); - setTimeout(function () { - $area.css('height', ''); - positionInner(); - }, 100); - }).select(); + $dialog.find('.h5p-embed-code-container').each(function(index, value) { + H5P.jQuery(this).css('height', this.scrollHeight + 'px').focus(function() { + H5P.jQuery(this).select(); + }); + }); + $dialog.find('.h5p-embed-code-container').eq(0).select(); + positionInner(); // Expand advanced embed var expand = function () { @@ -826,6 +818,9 @@ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) { $expander.addClass('h5p-open').text(H5P.t('hideAdvanced')); $content.show(); } + $dialog.find('.h5p-embed-code-container').each(function(index, value) { + H5P.jQuery(this).css('height', this.scrollHeight + 'px'); + }); positionInner(); }; $dialog.find('.h5p-expander').click(expand).keypress(function (event) { diff --git a/styles/h5p.css b/styles/h5p.css index 37a6b62..e3ef889 100644 --- a/styles/h5p.css +++ b/styles/h5p.css @@ -350,7 +350,7 @@ div.h5p-fullscreen { margin: 0; } .h5p-expander { - cursor: default; + cursor: pointer; font-size: 1.125em; outline: none; margin: 0.5em 0 0; From 99db5699fb39d5b5a040d9325eb94fb1ec9d3278 Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Mon, 2 Mar 2015 15:49:27 +0100 Subject: [PATCH 14/16] Handle anonymous users --- js/h5p-x-api-event.js | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/js/h5p-x-api-event.js b/js/h5p-x-api-event.js index 940a5cb..141e232 100644 --- a/js/h5p-x-api-event.js +++ b/js/h5p-x-api-event.js @@ -98,11 +98,33 @@ H5P.XAPIEvent.prototype.setObject = function(instance) { * Helper function to set the actor, email and name will be added automatically */ H5P.XAPIEvent.prototype.setActor = function() { - this.data.statement.actor = { - 'name': H5PIntegration.user.name, - 'mbox': 'mailto:' + H5PIntegration.user.mail, - 'objectType': 'Agent' - }; + if (H5PIntegration.user !== undefined) { + this.data.statement.actor = { + 'name': H5PIntegration.user.name, + 'mbox': 'mailto:' + H5PIntegration.user.mail, + 'objectType': 'Agent' + }; + } + else { + var uuid; + if (localStorage.H5PUserUUID) { + uuid = localStorage.H5PUserUUID; + } + else { + uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(char) { + var random = Math.random()*16|0, newChar = char === 'x' ? random : (random&0x3|0x8); + return newChar.toString(16); + }); + localStorage.H5PUserUUID = uuid; + } + this.data.statement.actor = { + 'account': { + 'name': uuid, + 'homePage': window.location.origin + H5PIntegration.basePath + }, + 'objectType': 'Agent' + }; + } }; /** From e961f614a427d19597d2928411d8d69e24c9e3ea Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Mon, 2 Mar 2015 15:53:29 +0100 Subject: [PATCH 15/16] Fixed so that iframes can be loaded before resizer script. --- js/h5p-embed.js | 1 - js/h5p-resizer.js | 13 +++++++++++++ js/h5p.js | 12 +++++++++--- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/js/h5p-embed.js b/js/h5p-embed.js index 3196fa1..c141456 100644 --- a/js/h5p-embed.js +++ b/js/h5p-embed.js @@ -66,7 +66,6 @@ var H5POldEmbed = H5POldEmbed || (function () { loadResizer(h5ps[i].getAttribute('data-h5p')); } addIframe(h5ps[i]); - } } diff --git a/js/h5p-resizer.js b/js/h5p-resizer.js index d1a1905..6318fc8 100644 --- a/js/h5p-resizer.js +++ b/js/h5p-resizer.js @@ -108,4 +108,17 @@ }); } }, false); + + // Let h5p iframes know we're ready! + var iframes = document.getElementsByTagName('iframe'); + var ready = { + context: 'h5p', + action: 'ready' + }; + for (var i = 0; i < iframes.length; i++) { + if (iframes[i].src.indexOf('h5p') !== -1) { + iframes[i].contentWindow.postMessage(ready, '*'); + } + } + })(); diff --git a/js/h5p.js b/js/h5p.js index 8ade0e6..1937f43 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -145,6 +145,11 @@ H5P.init = function () { // External embed var parentIsFriendly = false; + // Handle that the resizer is loaded after the iframe + H5P.communicator.on('ready', function () { + H5P.communicator.send('hello'); + }); + // Handle hello message from our parent window H5P.communicator.on('hello', function () { // Initial setup/handshake is done @@ -153,7 +158,8 @@ H5P.init = function () { // Hide scrollbars for correct size document.body.style.overflow = 'hidden'; - H5P.communicator.send('prepareResize'); + // Content need to be resized to fit the new iframe size + H5P.trigger(instance, 'resize'); }); // When resize has been prepared tell parent window to resize @@ -192,14 +198,14 @@ H5P.init = function () { H5P.jQuery(window.top).resize(function () { if (window.parent.H5P.isFullscreen) { // Use timeout to avoid bug in certain browsers when exiting fullscreen. Some browser will trigger resize before the fullscreenchange event. - H5P.trigger(instance, 'resize'); + H5P.trigger(instance, 'resize'); } else { H5P.trigger(instance, 'resize'); } }); } - + H5P.instances.push(instance); // Resize content. From acca9627755f2f6780330c64c433e1c2887ea01e Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Tue, 3 Mar 2015 11:03:10 +0100 Subject: [PATCH 16/16] Fixed misplaced stash (after merge). --- js/h5p.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/h5p.js b/js/h5p.js index 1937f43..b93d9a7 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -108,8 +108,8 @@ H5P.init = function () { H5P.on(instance, 'xAPI', H5P.xAPICompletedListener); H5P.on(instance, 'xAPI', H5P.externalDispatcher.trigger); - if (H5P.isFramed) - var resizeDelay;{ + if (H5P.isFramed) { + var resizeDelay; if (H5P.externalEmbed === false) { // Internal embed // Make it possible to resize the iframe when the content changes size. This way we get no scrollbars.