Merge branch 'master' into improved-file-handling

JI-92-path-fix
Paal Joergensen 2016-12-21 13:34:06 +01:00
commit 20042fba85
17 changed files with 469 additions and 187 deletions

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
vendor
*~
.idea

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
fonts/h5p-core-16.eot Normal file

Binary file not shown.

View File

@ -1,14 +1,34 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<metadata>
<json>
<![CDATA[
{
"fontFamily": "h5p",
"description": "Font generated by IcoMoon.",
"majorVersion": 1,
"minorVersion": 1,
"version": "Version 1.1",
"fontId": "h5p",
"psName": "h5p",
"subFamily": "Regular",
"fullName": "h5p"
}
]]>
</json>
</metadata>
<defs>
<font id="h5p-core-14" horiz-adv-x="1024">
<font id="icomoon" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xe565;" glyph-name="uniE565" d="M234 539h556l-278-278z" />
<glyph unicode="&#xe566;" glyph-name="uniE566" d="M381 138v524l262-262z" />
<glyph unicode="&#xe58e;" glyph-name="uniE58E" d="M512 596.667l256-256-60-60-196 196-196-196-60 60z" />
<glyph unicode="&#xe58f;" glyph-name="uniE58F" d="M708 572.667l60-60-256-256-256 256 60 60 196-196z" />
<glyph unicode="&#xe600;" glyph-name="uniE88D" d="M386.662 874.394h71.27v-71.27h-71.27v71.27zM566.067 874.394h71.27v-71.27h-71.27v71.27zM386.662 718.131h71.27v-71.27h-71.27v71.27zM566.067 718.131h71.27v-71.27h-71.27v71.27zM386.662 561.766h71.27v-71.27h-71.27v71.27zM566.067 561.766h71.27v-71.27h-71.27v71.27zM386.662 405.504h71.27v-71.27h-71.27v71.27zM566.067 405.504h71.27v-71.27h-71.27v71.27zM386.662 249.139h71.27v-71.27h-71.27v71.27zM566.067 249.139h71.27v-71.27h-71.27v71.27zM386.662 92.877h71.27v-71.27h-71.27v71.27zM566.067 92.877h71.27v-71.27h-71.27v71.27z" />
<glyph unicode="&#xe601;" glyph-name="uniE601" d="M454.299 416.588l-116.917 116.917-84.781-84.707 201.696-201.697 317.097 317.097-84.781 84.706z" />
<glyph unicode="&#xe601;" glyph-name="uniE601" d="M454.299 395.255l-116.917 116.917-84.781-84.707 201.696-201.697 317.097 317.097-84.781 84.706z" />
<glyph unicode="&#xe888;" glyph-name="uniE888" horiz-adv-x="1321" d="M660.48 703.59c-140.288 0-253.952-113.664-253.952-253.952 0-122.47 86.63-224.666 202.138-248.627v206.234h-86.835c-11.264 0-14.541 7.168-7.373 16.179l133.12 164.659c7.168 9.011 18.842 9.011 26.010 0l133.12-164.659c7.373-8.602 3.686-16.179-7.373-16.179h-86.835v-206.234c115.507 23.962 202.138 126.157 202.138 248.627-0.205 140.288-113.869 253.952-254.157 253.952z" />
<glyph unicode="&#xe889;" glyph-name="uniE889" horiz-adv-x="1321" d="M662.118 701.952c-140.288 0-253.952-113.664-253.952-253.952s113.664-253.952 253.952-253.952 253.952 113.664 253.952 253.952-113.664 253.952-253.952 253.952zM621.773 652.8h83.763v-65.946h-83.763v65.946zM748.749 273.92h-173.67v50.995h49.562v159.13h-49.562v50.995h133.53v-210.125h40.346v-50.995z" />
<glyph unicode="&#xe88a;" glyph-name="uniE88A" horiz-adv-x="1321" d="M925.491 236.646l-114.688 114.688c27.238 37.888 43.213 84.378 43.213 134.554 0 127.59-103.834 231.424-231.424 231.424s-231.424-103.834-231.424-231.424c0-127.59 103.834-231.424 231.424-231.424 50.176 0 96.666 15.974 134.554 43.213l114.688-114.688c5.325-5.325 13.926-5.325 19.251 0l34.406 34.406c5.325 5.12 5.325 13.926 0 19.251zM622.797 318.566c-92.365 0-167.117 74.752-167.117 167.117s74.752 167.117 167.117 167.117c92.365 0 167.117-74.752 167.117-167.117s-74.752-167.117-167.117-167.117z" />
@ -22,4 +42,17 @@
<glyph unicode="&#xe894;" glyph-name="uniE894" horiz-adv-x="1321" d="M742.605 448l107.11 107.11c9.626 9.626 9.626 25.19 0 34.816l-47.309 47.309c-9.626 9.626-25.19 9.626-34.816 0l-107.11-107.11-107.11 107.11c-9.626 9.626-25.19 9.626-34.816 0l-47.309-47.309c-9.626-9.626-9.626-25.19 0-34.816l107.11-107.11-107.11-107.11c-9.626-9.626-9.626-25.19 0-34.816l47.309-47.309c9.626-9.626 25.19-9.626 34.816 0l107.11 107.11 107.11-107.11c9.626-9.626 25.19-9.626 34.816 0l47.309 47.309c9.626 9.626 9.626 25.19 0 34.816l-107.11 107.11z" />
<glyph unicode="&#xe900;" glyph-name="edit-image" d="M300.237 770.97c69.018 23.142 133.325 14.234 189.133-33.28 56.627-48.128 77.619-110.592 63.181-183.808-2.355-12.186 0.307-19.456 8.704-27.853 93.901-93.389 156.774-156.467 250.47-250.163 5.427-5.427 10.957-10.854 15.667-16.896 39.424-50.278 16.794-124.006-44.237-142.029-36.966-10.957-68.403 0-95.334 27.034-95.642 96.051-160.973 160.973-256.614 257.024-6.963 6.963-12.8 8.909-22.63 6.758-117.76-26.317-229.171 60.826-231.731 181.453-0.614 26.419 3.584 52.326 15.974 77.926 34.816-34.816 68.506-67.789 101.274-101.786 10.445-10.752 20.992-15.36 36.045-15.36 14.643 0 25.19 3.891 34.816 14.848 10.752 12.39 23.040 23.347 34.611 35.021 14.336 14.438 14.336 46.080-0.205 60.518-35.123 35.226-70.349 70.349-106.598 106.496 3.891 2.253 5.632 3.482 7.475 4.096zM703.386 212.89c-0.41-24.269 20.685-45.466 44.851-45.158 23.757 0.41 44.032 20.992 43.93 44.544-0.102 23.757-20.275 44.032-44.237 44.134-23.859 0.307-44.237-19.661-44.544-43.52z" />
<glyph unicode="&#xe901;" glyph-name="hourglass" d="M733.286 138.752c-147.763 0-295.526 0-443.29 0 0 2.048 0.102 4.096 0 6.144-0.307 13.824-1.024 32.666-0.922 46.49 0.41 39.731 6.861 78.131 19.046 115.2 17.203 52.224 43.725 96.256 81.306 130.355 4.506 4.096 9.216 7.885 13.722 11.776-0.205 0.717-0.307 1.126-0.41 1.229-1.331 1.229-2.765 2.355-4.198 3.584-28.058 22.63-50.688 51.405-68.403 85.606-30.618 59.085-43.52 123.597-41.165 192.614 0.205 7.168 0.614 18.33 0.922 25.498 147.763 0 295.526 0 443.29 0 0.205-1.331 0.512-2.662 0.614-3.994 2.662-36.966 1.229-77.722-5.939-113.869-14.336-72.909-44.544-133.837-95.027-179.405-4.096-3.686-8.294-7.066-12.39-10.547 0.205-0.717 0.307-1.126 0.512-1.331 0.819-0.717 1.638-1.434 2.458-2.15 42.189-33.894 71.68-79.872 90.931-135.782 11.776-34.202 18.637-69.837 20.070-106.701 0.819-19.763-0.614-44.851-1.126-64.717zM687.309 181.965c0 6.554 0.205 12.493 0 18.432-1.331 37.581-7.27 74.138-19.866 108.749-17.92 49.562-45.568 88.269-88.678 108.646-2.458 1.126-2.97 3.072-2.97 5.837 0.102 16.691 0.102 33.485 0 50.176 0 3.994 1.331 5.427 4.096 6.963 9.114 5.325 18.432 10.24 26.829 16.896 29.696 23.552 49.152 56.934 62.362 95.744 10.342 30.413 15.77 62.259 17.818 94.822 0.614 9.114 0.102 18.227 0.102 27.546-116.634 0-233.574 0-351.027 0 0.307-8.704 0.614-16.998 1.024-25.395 1.946-37.274 8.499-73.216 21.504-107.213 18.125-47.104 45.261-83.558 86.528-103.117 2.253-1.024 2.867-2.662 2.867-5.427-0.102-17.203-0.102-34.509 0-51.712 0-3.072-1.024-4.506-3.277-5.632-5.632-2.867-11.366-5.734-16.691-9.216-34.304-22.733-56.832-57.754-71.987-100.147-12.493-35.123-18.125-71.987-19.661-109.875-0.205-5.325 0-10.752 0-16.282 117.35 0.205 234.189 0.205 351.027 0.205zM410.214 601.293c68.096 0 135.373 0 203.674 0-3.789-6.554-7.168-12.595-10.752-18.227-10.957-16.998-24.269-30.618-39.731-41.472s-27.75-25.293-32.768-46.592c-1.638-6.963-2.765-14.336-2.867-21.606-0.307-17.203-0.205-34.406 0.307-51.712 0.717-28.058 12.493-48.947 32.154-62.566 43.008-30.003 65.843-75.878 75.776-132.506 0.307-1.638 0.307-3.379 0.614-5.53-83.149 0-166.093 0-249.242 0 2.662 20.685 7.885 40.346 15.462 59.085 13.312 32.973 32.768 59.187 59.494 77.722 16.589 11.469 28.365 27.955 32.358 50.995 0.819 4.813 1.331 9.83 1.434 14.746 0.102 18.637 0.614 37.274-0.205 55.808-1.126 24.678-11.981 43.213-28.57 57.139-9.216 7.782-18.944 14.746-27.648 23.142-11.981 11.162-21.197 25.395-29.491 41.574z" />
</font></defs></svg>
<glyph unicode="&#xe902;" glyph-name="plus-icon1" d="M1024 378.248c0-38.751-31.485-69.752-69.752-69.752h-302.744v-302.744c0-38.751-31.485-69.752-69.752-69.752h-139.504c-38.751 0-69.752 31.485-69.752 69.752v302.744h-302.744c-38.751 0-69.752 31.485-69.752 69.752v139.504c0 38.751 31.485 69.752 69.752 69.752h302.744v302.744c0 38.751 31.485 69.752 69.752 69.752h139.504c38.751 0 69.752-31.485 69.752-69.752v-302.744h302.744c38.751 0 69.752-31.485 69.752-69.752v-139.504z" />
<glyph unicode="&#xe903;" glyph-name="background" d="M1010.557 764.785v-632.986c0-22.795-8.183-42.667-24.548-59.032s-35.653-24.548-59.032-24.548h-832.292c-22.795 0-42.667 8.183-59.032 24.548s-24.548 35.653-24.548 59.032v632.986c0 22.795 8.183 42.667 24.548 59.032s35.653 24.548 59.032 24.548h832.877c22.795 0 42.667-8.183 59.032-24.548 15.781-16.365 23.963-36.237 23.963-59.032zM926.977 781.735h-832.292c-4.676 0-8.183-1.753-11.689-4.676-3.507-3.507-4.676-7.014-4.676-11.689v-632.986c0-4.676 1.753-8.183 4.676-11.689 3.507-3.507 7.014-4.676 11.689-4.676h832.877c4.676 0 8.183 1.753 11.689 4.676 3.507 3.507 4.676 7.014 4.676 11.689v632.402c0 4.676-1.753 8.183-4.676 11.689-3.507 3.507-7.598 5.26-12.274 5.26zM315.032 685.881c19.288-19.288 29.224-43.251 29.224-70.721s-9.936-51.434-29.224-70.721c-19.288-19.288-43.251-29.224-70.721-29.224-28.055 0-51.434 9.936-70.721 29.224s-29.224 43.251-29.224 70.721 9.936 51.434 29.224 70.721c19.288 19.288 43.251 29.224 70.721 29.224 28.055 0 51.434-9.936 70.721-29.224zM877.297 415.269v-233.205h-732.932v99.945l166.575 166.575 82.995-82.995 266.521 265.936 216.84-216.256z" />
<glyph unicode="&#xe904;" glyph-name="dnd" d="M665.717 261.553h-541.224c-61.954 0-112.219 50.265-112.219 112.219v399.781c0 61.954 50.265 112.219 112.219 112.219h541.224c61.954 0 112.219-50.265 112.219-112.219v-399.781c-0.584-61.954-50.849-112.219-112.219-112.219zM124.493 818.557c-25.132 0-45.005-20.457-45.005-45.005v-399.781c0-25.132 20.457-45.005 45.005-45.005h541.224c25.132 0 45.005 20.457 45.005 45.005v399.781c0 25.132-20.457 45.005-45.005 45.005h-541.224zM825.863-6.721h-98.776v66.63h98.776v-66.63zM627.726-6.721h-98.776v66.63h98.776v-66.63zM429.589-6.721h-70.721c-13.443 0-26.886 2.338-39.16 7.014l23.379 62.539c5.26-1.753 10.521-2.922 15.781-2.922h70.721v-66.63zM934.575-0.877l-20.457 63.708c18.703 5.845 31.562 23.963 31.562 43.251v0.584h66.63v-0.584c0-49.096-31.562-92.347-77.735-106.959zM313.863 109.005h-66.63v98.776h66.63v-98.776zM1012.311 204.858h-66.63v98.776h66.63v-98.776zM1012.311 402.995h-66.63v98.776h66.63v-98.776zM915.872 547.361c-5.26 1.753-10.521 2.922-15.781 2.922h-70.721v67.215h70.721c13.443 0 26.886-2.338 39.16-7.014l-23.379-63.123z" />
<glyph unicode="&#xe905;" glyph-name="interactions" d="M773.26 276.749c-5.26 0-10.521-0.584-15.781-1.753-12.858 15.781-32.146 24.548-52.603 24.548-9.936 0-19.288-1.753-28.055-5.845-13.443 12.274-30.977 19.872-49.096 19.872-2.922 0-5.845 0-9.352-0.584v62.539c0 40.329-32.146 74.813-73.059 74.813-40.329 0-73.059-32.731-73.059-73.059v-156.055c-11.105 6.429-23.963 9.936-36.822 9.936-39.744 0-72.475-33.315-72.475-73.059 0-15.781 5.26-31.562 14.612-43.836l109.297-146.119c13.443-18.119 35.653-29.224 58.447-29.224h205.151c25.132 0 47.342 16.95 53.187 41.498l26.301 105.205c5.26 21.041 8.183 42.667 8.183 64.292v61.954c-1.169 35.068-29.224 64.877-64.877 64.877zM174.174 581.845c0 178.849 145.534 323.799 323.799 323.799 178.849 0 323.799-145.534 323.799-323.799 0-82.995-31.562-158.977-82.995-216.256 16.365-2.338 31.562-8.183 44.42-17.534 52.018 63.708 83.58 144.95 83.58 233.79 0 203.982-165.991 369.388-369.388 369.388-202.813 0-368.804-165.406-368.804-369.388 0-142.027 80.658-265.936 198.721-327.306 13.443 12.858 29.808 22.795 48.511 27.47-118.064 47.927-201.644 164.237-201.644 299.836zM740.53 581.845c0 133.845-108.712 242.557-242.557 242.557s-242.557-108.712-242.557-242.557c0-108.128 71.306-199.89 168.913-230.868v47.927c-72.475 29.224-123.909 99.945-123.909 182.941 0.584 108.712 88.84 196.968 197.553 196.968s196.968-88.256 196.968-196.968c0-51.434-19.872-98.192-52.018-133.26 0.584-4.676 1.169-9.352 1.169-14.027v-46.174c58.447 44.42 96.438 114.557 96.438 193.461z" />
<glyph unicode="&#xe906;" glyph-name="iv" d="M1016.402 125.954c0-14.612-8.767-27.47-21.626-33.315-4.676-1.753-9.352-2.922-14.027-2.922-9.352 0-18.703 3.507-25.132 10.521l-226.192 226.192v-92.932c0-89.425-72.475-161.9-161.9-161.9h-395.105c-89.425 0-161.9 72.475-161.9 161.9v395.689c0.584 88.84 72.475 161.315 161.9 161.315h395.105c89.425 0 161.9-72.475 161.9-161.9v-92.347l226.192 225.607c7.014 7.014 15.781 10.521 25.132 10.521 4.676 0 9.352-1.169 14.027-2.922 12.858-5.845 21.626-18.703 21.626-33.315v-610.192z" />
<glyph unicode="&#xe907;" glyph-name="settings" d="M988.932 539.178l-119.233 18.119c-6.429 21.626-15.781 42.667-26.886 63.708 22.21 30.393 45.589 59.032 67.799 88.84 3.507 4.676 5.26 9.352 5.26 14.612s-1.169 10.521-4.676 14.027c-27.47 37.991-72.475 78.32-106.959 109.881-4.676 4.091-10.521 6.429-16.365 6.429s-11.689-1.753-15.781-5.845l-91.763-68.968c-18.703 9.936-37.991 17.534-58.447 23.963l-18.119 122.74c-1.169 11.105-11.689 22.795-23.379 22.795h-142.612c-11.689 0-20.457-11.105-23.379-21.626-10.521-38.575-14.027-82.411-18.703-122.155-19.872-6.429-40.329-15.781-59.032-25.717l-89.425 69.553c-5.26 4.091-11.105 6.429-16.95 6.429-22.21 0-109.297-94.685-125.078-115.726-3.507-4.676-5.845-9.352-5.845-15.196s2.338-11.105 6.429-15.781c23.963-29.224 47.342-58.447 68.968-89.425-10.521-19.288-18.703-38.575-25.132-59.616l-120.986-18.119c-9.936-1.753-18.703-13.443-18.703-23.379v-143.781c0-11.105 9.352-21.626 20.457-23.379l119.233-17.534c6.429-22.21 15.781-43.251 26.886-64.292-22.21-30.393-45.589-59.032-67.799-88.84-3.507-4.676-5.26-9.352-5.26-14.612s1.169-10.521 4.676-14.612c27.47-37.406 72.475-77.735 106.959-108.712 4.676-4.676 10.521-7.014 16.365-7.014s11.689 1.753 16.365 5.845l91.178 68.968c18.703-9.936 37.991-17.534 58.447-23.963l18.119-121.571c1.169-11.105 11.689-21.626 23.379-21.626h143.781c11.689 0 20.457 9.936 23.379 20.457 10.521 38.575 14.027 81.826 18.703 121.571 19.872 6.429 40.329 15.196 59.032 25.132l89.425-69.553c5.26-3.507 11.105-5.845 16.95-5.845 22.21 0 109.297 95.269 125.078 115.726 4.091 4.676 5.845 9.352 5.845 15.196s-2.338 11.689-6.429 16.365c-23.963 29.224-47.342 57.863-68.968 89.425 10.521 18.703 18.119 37.991 25.132 59.032l120.986 18.119c10.521 1.753 19.288 13.443 19.288 23.379v143.781c-2.338 10.521-11.105 21.041-22.21 22.795zM508.493 216.548c-123.909 0-224.438 100.53-224.438 224.438s99.945 224.438 224.438 224.438 224.438-100.53 224.438-224.438-100.53-224.438-224.438-224.438z" />
<glyph unicode="&#xe908;" glyph-name="summary" d="M510.247 954.74c-278.21 0-503.817-225.607-503.817-503.817s225.607-503.817 503.817-503.817 503.817 225.607 503.817 503.817c0 278.21-225.607 503.817-503.817 503.817zM510.247 44.128c-224.438 0-406.795 182.356-406.795 406.795s182.356 406.795 406.795 406.795 406.795-182.356 406.795-406.795c0-224.438-182.356-406.795-406.795-406.795zM652.274 574.831c-11.689 11.689-30.393 11.689-42.667 0l-129.753-129.753-69.553 69.553c-11.689 11.689-30.393 11.689-42.667 0l-47.927-47.927c-11.689-11.689-11.689-30.393 0-42.667l138.521-138.521c11.689-11.689 30.393-11.689 42.667 0l199.306 199.306c5.26 5.26 8.183 12.274 8.767 19.288-2.338 7.598-4.676 15.196-8.183 22.21 0 0.584-0.584 0.584-0.584 1.169l-47.927 47.342z" />
<glyph unicode="&#xe909;" glyph-name="hotspot" d="M512 960c-282.301 0-512-229.699-512-512s229.699-512 512-512 512 229.699 512 512-229.699 512-512 512zM961.461 448c0-247.817-201.644-449.461-449.461-449.461s-450.046 201.644-450.046 449.461 201.644 449.461 449.461 449.461 450.046-201.644 450.046-449.461zM512 795.178c-191.708 0-347.178-156.055-347.178-347.178s155.47-347.178 347.178-347.178 347.178 156.055 347.178 347.178-156.055 347.178-347.178 347.178zM793.132 448c0-154.886-126.247-281.132-281.132-281.132s-281.132 126.247-281.132 281.132c0 154.886 126.247 281.132 281.132 281.132s281.132-126.247 281.132-281.132z" />
<glyph unicode="&#xe90a;" glyph-name="tutorial" d="M1005.736 538.764l-482.84-152.472c-3.632 0-3.632 0-3.632 0s-3.632 0-3.632 0l-279.538 87.132c-25.406-18.16-43.566-65.34-43.566-123.434 18.16-10.896 29.038-25.406 29.038-47.198 0-18.16-10.896-36.302-25.406-47.198l25.406-185.149c0-3.632 0-7.264-3.632-10.896s-7.264-3.632-10.896-3.632h-83.5c-3.632 0-7.264 3.632-10.896 3.632-3.632 3.632-3.632 7.264-3.632 10.896l25.406 185.149c-14.528 10.896-25.406 25.406-25.406 47.198s10.896 39.934 29.038 47.198c3.632 50.83 14.528 105.274 43.566 141.594l-141.594 43.566c-7.264 3.632-10.896 7.264-10.896 14.528s3.632 10.896 10.896 14.528l479.208 152.472c3.632 0 3.632 0 3.632 0s3.632 0 3.632 0l482.84-152.472c7.264-3.632 10.896-7.264 10.896-14.528-3.632-3.632-7.264-10.896-14.528-10.896zM795.17 277.368c3.632-61.726-123.434-108.906-275.906-108.906s-279.538 50.83-275.906 108.906l7.264 134.33 246.868-76.236c7.264-3.632 14.528-3.632 21.774-3.632s14.528 0 21.774 3.632l246.868 76.236 7.264-134.33z" />
<glyph unicode="&#xe90b;" glyph-name="example" d="M658.811 693.628c-42.347 0-81.876-11.294-115.758-33.882v-364.215c36.7 16.941 73.411 28.235 115.758 28.235 70.582 0 121.405-19.759 186.34-47.994l-47.994 386.792c-42.347 19.759-93.17 31.053-138.346 31.053zM373.654 693.628c-47.994 0-95.988-8.465-141.164-28.235l-47.994-386.792c64.935 28.235 115.758 47.994 186.34 47.994 45.176 0 81.876-8.465 121.405-28.235v358.568c-33.882 25.406-76.229 36.7-118.576 36.7zM161.908 710.569l-67.764-533.614c70.582-22.588 135.517 56.47 268.216 53.641 107.282-2.818 155.287-64.935 155.287-64.935s62.117 70.582 172.228 67.764c76.229-2.818 197.634-101.635 248.457-59.288l-67.764 533.614c0 0-112.929 62.117-175.046 59.288-90.352-2.818-172.228-36.7-172.228-36.7s-98.817 42.347-160.934 39.529c-112.929-5.647-200.452-59.288-200.452-59.288zM805.622 233.425c-47.994 22.588-95.988 33.882-149.64 33.882s-104.464-16.941-141.164-56.47c-39.529 39.529-87.523 56.47-141.164 56.47-50.823 0-101.635-11.294-149.64-33.882-31.053-14.112-62.117-22.588-95.988-22.588h-2.818l59.288 482.791c53.641 31.053 121.405 47.994 183.511 47.994 50.823 0 104.464-11.294 146.811-39.529 42.347 28.235 95.988 39.529 146.811 39.529 62.117 0 127.052-16.941 183.511-47.994l62.117-479.962c-36.7-2.818-67.764 5.647-101.635 19.759z" />
<glyph unicode="&#xe90c;" d="M885.459 448c0-206.256-167.203-373.459-373.459-373.459s-373.459 167.203-373.459 373.459c0 206.256 167.203 373.459 373.459 373.459s373.459-167.203 373.459-373.459z" />
<glyph unicode="&#xe90d;" d="M512-64c-283.106 0-512 228.894-512 512s228.894 512 512 512 512-228.894 512-512-228.894-512-512-512zM512 929.882c-265.035 0-481.882-216.847-481.882-481.882s216.847-481.882 481.882-481.882 481.882 216.847 481.882 481.882-216.847 481.882-481.882 481.882z" />
<glyph unicode="&#xe90e;" d="M617.412 300.424v-39.153c0-6.024-3.012-9.035-6.024-15.059-3.012-3.012-9.035-6.024-15.059-6.024h-159.624c-6.024 0-9.035 3.012-15.059 6.024s-6.024 9.035-6.024 15.059v39.153c0 6.024 3.012 9.035 6.024 15.059 3.012 3.012 9.035 6.024 15.059 6.024h21.082v120.471h-21.082c-6.024 0-9.035 3.012-15.059 6.024-3.012 3.012-6.024 9.035-6.024 15.059v39.153c0 6.024 3.012 9.035 6.024 15.059s9.035 6.024 15.059 6.024h120.471c6.024 0 9.035-3.012 15.059-6.024 3.012-3.012 6.024-9.035 6.024-15.059v-180.706h21.082c6.024 0 9.035-3.012 15.059-6.024 3.012-6.024 3.012-9.035 3.012-15.059zM578.259 661.835v-60.235c0-6.024-3.012-9.035-6.024-15.059-3.012-3.012-9.035-6.024-15.059-6.024h-81.318c-6.024 0-9.035 3.012-15.059 6.024-3.012 3.012-6.024 9.035-6.024 15.059v60.235c0 6.024 3.012 9.035 6.024 15.059 3.012 3.012 9.035 6.024 15.059 6.024h81.318c6.024 0 9.035-3.012 15.059-6.024 3.012-3.012 6.024-9.035 6.024-15.059z" />
</font></defs></svg>

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 28 KiB

BIN
fonts/h5p-core-16.ttf Normal file

Binary file not shown.

BIN
fonts/h5p-core-16.woff Normal file

Binary file not shown.

View File

@ -399,6 +399,8 @@ class H5PDefaultStorage implements \H5PFileStorage {
throw new \Exception('unabletocopy');
}
$ignoredFiles = self::getIgnoredFiles("{$source}/.h5pignore");
$dir = opendir($source);
if ($dir === FALSE) {
trigger_error('Unable to open directory ' . $source, E_USER_WARNING);
@ -406,7 +408,7 @@ class H5PDefaultStorage implements \H5PFileStorage {
}
while (false !== ($file = readdir($dir))) {
if (($file != '.') && ($file != '..') && $file != '.git' && $file != '.gitignore') {
if (($file != '.') && ($file != '..') && $file != '.git' && $file != '.gitignore' && !in_array($file, $ignoredFiles)) {
if (is_dir("{$source}/{$file}")) {
self::copyFileTree("{$source}/{$file}", "{$destination}/{$file}");
}
@ -418,6 +420,25 @@ class H5PDefaultStorage implements \H5PFileStorage {
closedir($dir);
}
/**
* Retrieve array of file names from file.
*
* @param string $file
* @return array Array with files that should be ignored
*/
private static function getIgnoredFiles($file) {
if (file_exists($file) === FALSE) {
return array();
}
$contents = file_get_contents($file);
if ($contents === FALSE) {
return array();
}
return preg_split('/\s+/', $contents);
}
/**
* Recursive function that makes sure the specified directory exists and
* is writable.

View File

@ -558,6 +558,16 @@ interface H5PFrameworkInterface {
* Will trigger after the export file is created.
*/
public function afterExportCreated();
/**
* Check if user has permissions to an action
*
* @method hasPermission
* @param [H5PPermission] $permission Permission type, ref H5PPermission
* @param [int] $id Id need by platform to determine permission
* @return boolean
*/
public function hasPermission($permission, $id = NULL);
}
/**
@ -1669,6 +1679,20 @@ Class H5PExport {
}
}
abstract class H5PPermission {
const DOWNLOAD_H5P = 0;
const EMBED_H5P = 1;
}
abstract class H5PDisplayOptionBehaviour {
const NEVER_SHOW = 0;
const CONTROLLED_BY_AUTHOR_DEFAULT_ON = 1;
const CONTROLLED_BY_AUTHOR_DEFAULT_OFF = 2;
const ALWAYS_SHOW = 3;
const CONTROLLED_BY_PERMISSIONS = 4;
}
/**
* Functions and storage shared by the other H5P classes
*/
@ -1676,7 +1700,7 @@ class H5PCore {
public static $coreApi = array(
'majorVersion' => 1,
'minorVersion' => 11
'minorVersion' => 12
);
public static $styles = array(
'styles/h5p.css',
@ -1690,7 +1714,8 @@ class H5PCore {
'js/h5p-x-api-event.js',
'js/h5p-x-api.js',
'js/h5p-content-type.js',
'js/h5p-confirmation-dialog.js'
'js/h5p-confirmation-dialog.js',
'js/h5p-action-bar.js'
);
public static $adminScripts = array(
'js/jquery.js',
@ -1713,12 +1738,18 @@ class H5PCore {
const DISABLE_COPYRIGHT = 8;
const DISABLE_ABOUT = 16;
const DISPLAY_OPTION_FRAME = 'frame';
const DISPLAY_OPTION_DOWNLOAD = 'export';
const DISPLAY_OPTION_EMBED = 'embed';
const DISPLAY_OPTION_COPYRIGHT = 'copyright';
const DISPLAY_OPTION_ABOUT = 'icon';
// Map flags to string
public static $disable = array(
self::DISABLE_FRAME => 'frame',
self::DISABLE_DOWNLOAD => 'download',
self::DISABLE_EMBED => 'embed',
self::DISABLE_COPYRIGHT => 'copyright'
self::DISABLE_FRAME => self::DISPLAY_OPTION_FRAME,
self::DISABLE_DOWNLOAD => self::DISPLAY_OPTION_DOWNLOAD,
self::DISABLE_EMBED => self::DISPLAY_OPTION_EMBED,
self::DISABLE_COPYRIGHT => self::DISPLAY_OPTION_COPYRIGHT
);
/**
@ -2423,7 +2454,9 @@ class H5PCore {
// Handle libraries metadata
if (isset($json->libraries)) {
foreach ($json->libraries as $machineName => $libInfo) {
$this->h5pF->setLibraryTutorialUrl($machineName, $libInfo->tutorialUrl);
if (isset($libInfo->tutorialUrl)) {
$this->h5pF->setLibraryTutorialUrl($machineName, $libInfo->tutorialUrl);
}
}
}
@ -2440,54 +2473,152 @@ class H5PCore {
}
/**
*
*/
public function getGlobalDisable() {
$disable = self::DISABLE_NONE;
// Allow global settings to override and disable options
if (!$this->h5pF->getOption('frame', TRUE)) {
$disable |= self::DISABLE_FRAME;
}
else {
if (!$this->h5pF->getOption('export', TRUE)) {
$disable |= self::DISABLE_DOWNLOAD;
}
if (!$this->h5pF->getOption('embed', TRUE)) {
$disable |= self::DISABLE_EMBED;
}
if (!$this->h5pF->getOption('copyright', TRUE)) {
$disable |= self::DISABLE_COPYRIGHT;
}
if (!$this->h5pF->getOption('icon', TRUE)) {
$disable |= self::DISABLE_ABOUT;
}
}
return $disable;
}
/**
* Determine disable state from sources.
* Create representation of display options as int
*
* @param array $sources
* @param int $current
* @return int
*/
public function getDisable(&$sources, $current) {
public function getStorableDisplayOptions(&$sources, $current) {
// Download - force setting it if always on or always off
$download = $this->h5pF->getOption(self::DISPLAY_OPTION_DOWNLOAD, H5PDisplayOptionBehaviour::ALWAYS_SHOW);
if ($download == H5PDisplayOptionBehaviour::ALWAYS_SHOW ||
$download == H5PDisplayOptionBehaviour::NEVER_SHOW) {
$sources[self::DISPLAY_OPTION_DOWNLOAD] = ($download == H5PDisplayOptionBehaviour::ALWAYS_SHOW);
}
// Embed - force setting it if always on or always off
$embed = $this->h5pF->getOption(self::DISPLAY_OPTION_EMBED, H5PDisplayOptionBehaviour::ALWAYS_SHOW);
if ($embed == H5PDisplayOptionBehaviour::ALWAYS_SHOW ||
$embed == H5PDisplayOptionBehaviour::NEVER_SHOW) {
$sources[self::DISPLAY_OPTION_EMBED] = ($embed == H5PDisplayOptionBehaviour::ALWAYS_SHOW);
}
foreach (H5PCore::$disable as $bit => $option) {
if ($this->h5pF->getOption(($bit & H5PCore::DISABLE_DOWNLOAD ? 'export' : $option), TRUE)) {
if (!isset($sources[$option]) || !$sources[$option]) {
$current |= $bit; // Disable
}
else {
$current &= ~$bit; // Enable
}
if (!isset($sources[$option]) || !$sources[$option]) {
$current |= $bit; // Disable
}
else {
$current &= ~$bit; // Enable
}
}
return $current;
}
/**
* Determine display options visibility and value on edit
*
* @param int $disable
* @return array
*/
public function getDisplayOptionsForEdit($disable = NULL) {
$display_options = [];
$current_display_options = $disable === NULL ? [] : $this->getDisplayOptionsAsArray($disable);
if ($this->h5pF->getOption(self::DISPLAY_OPTION_FRAME, TRUE)) {
$display_options[self::DISPLAY_OPTION_FRAME] =
isset($current_display_options[self::DISPLAY_OPTION_FRAME]) ?
$current_display_options[self::DISPLAY_OPTION_FRAME] :
TRUE;
// Download
$export = $this->h5pF->getOption(self::DISPLAY_OPTION_DOWNLOAD, H5PDisplayOptionBehaviour::ALWAYS_SHOW);
if ($export == H5PDisplayOptionBehaviour::CONTROLLED_BY_AUTHOR_DEFAULT_ON ||
$export == H5PDisplayOptionBehaviour::CONTROLLED_BY_AUTHOR_DEFAULT_OFF) {
$display_options[self::DISPLAY_OPTION_DOWNLOAD] =
isset($current_display_options[self::DISPLAY_OPTION_DOWNLOAD]) ?
$current_display_options[self::DISPLAY_OPTION_DOWNLOAD] :
($export == H5PDisplayOptionBehaviour::CONTROLLED_BY_AUTHOR_DEFAULT_ON);
}
// Embed
$embed = $this->h5pF->getOption(self::DISPLAY_OPTION_EMBED, H5PDisplayOptionBehaviour::ALWAYS_SHOW);
if ($embed == H5PDisplayOptionBehaviour::CONTROLLED_BY_AUTHOR_DEFAULT_ON ||
$embed == H5PDisplayOptionBehaviour::CONTROLLED_BY_AUTHOR_DEFAULT_OFF) {
$display_options[self::DISPLAY_OPTION_EMBED] =
isset($current_display_options[self::DISPLAY_OPTION_EMBED]) ?
$current_display_options[self::DISPLAY_OPTION_EMBED] :
($embed == H5PDisplayOptionBehaviour::CONTROLLED_BY_AUTHOR_DEFAULT_ON);
}
// Copyright
if ($this->h5pF->getOption(self::DISPLAY_OPTION_COPYRIGHT, TRUE)) {
$display_options[self::DISPLAY_OPTION_COPYRIGHT] =
isset($current_display_options[self::DISPLAY_OPTION_COPYRIGHT]) ?
$current_display_options[self::DISPLAY_OPTION_COPYRIGHT] :
TRUE;
}
}
return $display_options;
}
/**
* Helper function used to figure out embed & download behaviour
*
* @param string $option_name
* @param H5PPermission $permission
* @param int $id
* @param bool &$value
*/
private function setDisplayOptionOverrides($option_name, $permission, $id, &$value) {
$behaviour = $this->h5pF->getOption($option_name, H5PDisplayOptionBehaviour::ALWAYS_SHOW);
// If never show globally, force hide
if ($behaviour == H5PDisplayOptionBehaviour::NEVER_SHOW) {
$value = false;
}
elseif ($behaviour == H5PDisplayOptionBehaviour::ALWAYS_SHOW) {
// If always show or permissions say so, force show
$value = true;
}
elseif ($behaviour == H5PDisplayOptionBehaviour::CONTROLLED_BY_PERMISSIONS) {
$value = $this->h5pF->hasPermission($permission, $id);
}
}
/**
* Determine display option visibility when viewing H5P
*
* @param int $display_options
* @param int $id Might be content id or user id.
* Depends on what the platform needs to be able to determine permissions.
* @return array
*/
public function getDisplayOptionsForView($disable, $id) {
$display_options = $this->getDisplayOptionsAsArray($disable);
if ($this->h5pF->getOption(self::DISPLAY_OPTION_FRAME, TRUE) == FALSE) {
$display_options[self::DISPLAY_OPTION_FRAME] = false;
}
else {
$this->setDisplayOptionOverrides(self::DISPLAY_OPTION_DOWNLOAD, H5PPermission::DOWNLOAD_H5P, $id, $display_options[self::DISPLAY_OPTION_DOWNLOAD]);
$this->setDisplayOptionOverrides(self::DISPLAY_OPTION_EMBED, H5PPermission::EMBED_H5P, $id, $display_options[self::DISPLAY_OPTION_EMBED]);
if ($this->h5pF->getOption(self::DISPLAY_OPTION_COPYRIGHT, TRUE) == FALSE) {
$display_options[self::DISPLAY_OPTION_COPYRIGHT] = false;
}
}
return $display_options;
}
/**
* Convert display options as single byte to array
*
* @param int $disable
* @return array
*/
private function getDisplayOptionsAsArray($disable) {
return array(
self::DISPLAY_OPTION_FRAME => !($disable & H5PCore::DISABLE_FRAME),
self::DISPLAY_OPTION_DOWNLOAD => !($disable & H5PCore::DISABLE_DOWNLOAD),
self::DISPLAY_OPTION_EMBED => !($disable & H5PCore::DISABLE_EMBED),
self::DISPLAY_OPTION_COPYRIGHT => !($disable & H5PCore::DISABLE_COPYRIGHT),
self::DISPLAY_OPTION_ABOUT => $this->h5pF->getOption(self::DISPLAY_OPTION_ABOUT, TRUE),
);
}
/**
* Small helper for getting the library's ID.
*
@ -3134,7 +3265,29 @@ class H5PContentValidator {
return;
}
if (!in_array($value->library, $semantics->options)) {
$this->h5pF->setErrorMessage($this->h5pF->t('Library used in content is not a valid library according to semantics'));
$message = NULL;
// Create an understandable error message:
$machineName = explode(' ', $value->library)[0];
foreach ($semantics->options as $semanticsLibrary) {
$semanticsMachineName = explode(' ', $semanticsLibrary)[0];
if ($machineName === $semanticsMachineName) {
// Using the wrong version of the library in the content
$message = $this->h5pF->t('The version of the H5P library %machineName used in this content is not valid. Content contains %contentLibrary, but it should be %semanticsLibrary.', array(
'%machineName' => $machineName,
'%contentLibrary' => $value->library,
'%semanticsLibrary' => $semanticsLibrary
));
break;
}
}
// Using a library in content that is not present at all in semantics
if ($message === NULL) {
$message = $this->h5pF->t('The H5P library %library used in the content is not valid', array(
'%library' => $value->library
));
}
$this->h5pF->setErrorMessage($message);
$value = NULL;
return;
}

View File

@ -1,19 +0,0 @@
(function ($) {
$(document).ready(function () {
var $inputs = $('.h5p-action-bar-settings input');
var $frame = $inputs.filter('input[name="frame"], input[name="h5p_frame"]');
var $others = $inputs.filter(':not(input[name="frame"], input[name="h5p_frame"])');
var toggle = function () {
if ($frame.is(':checked')) {
$others.attr('disabled', false);
}
else {
$others.attr('disabled', true);
}
};
$frame.change(toggle);
toggle();
});
})(H5P.jQuery);

89
js/h5p-action-bar.js Normal file
View File

@ -0,0 +1,89 @@
H5P.ActionBar = (function ($, EventDispatcher) {
"use strict";
function ActionBar(displayOptions) {
EventDispatcher.call(this);
var self = this;
var hasActions = false;
// Create action bar
var $actions = H5P.jQuery('<ul class="h5p-actions"></ul>');
/**
* Helper for creating action bar buttons.
*
* @private
* @param {string} type
* @param {string} customClass Instead of type class
*/
var addActionButton = function (type, customClass) {
var handler = function () {
self.trigger(type);
};
H5P.jQuery('<li/>', {
'class': 'h5p-button h5p-' + (customClass ? customClass : type),
role: 'button',
tabindex: 0,
title: H5P.t(type + 'Description'),
html: H5P.t(type),
on: {
click: handler,
keypress: function (e) {
if (e.which === 32) {
handler();
e.preventDefault(); // (since return false will block other inputs)
}
}
},
appendTo: $actions
});
hasActions = true;
};
// Register action bar buttons
if (displayOptions.export) {
// Add export button
addActionButton('download', 'export');
}
if (displayOptions.copyright) {
addActionButton('copyrights');
}
if (displayOptions.embed) {
addActionButton('embed');
}
if (displayOptions.icon) {
// Add about H5P button icon
H5P.jQuery('<li><a class="h5p-link" href="http://h5p.org" target="_blank" title="' + H5P.t('h5pDescription') + '"></a></li>').appendTo($actions);
hasActions = true;
}
/**
* Returns a reference to the dom element
*
* @method getDOMElement
* @return {H5P.jQuery}
*/
self.getDOMElement = function () {
return $actions;
};
/**
* Does the actionbar contain actions?
*
* @method hasActions
* @return {Boolean}
*/
self.hasActions = function () {
return hasActions;
}
};
ActionBar.prototype = Object.create(EventDispatcher.prototype);
ActionBar.prototype.constructor = ActionBar;
return ActionBar;
})(H5P.jQuery, H5P.EventDispatcher);

23
js/h5p-display-options.js Normal file
View File

@ -0,0 +1,23 @@
/**
* Utility that makes it possible to hide fields when a checkbox is unchecked
*/
(function ($) {
function setupHiding () {
var $toggler = $(this);
// Getting the field which should be hidden:
var $subject = $($toggler.data('h5p-visibility-subject-selector'));
var toggle = function () {
$subject.toggle($toggler.is(':checked'));
};
$toggler.change(toggle);
toggle();
}
$(document).ready(function () {
// Get the checkboxes making other fields being hidden:
$('.h5p-visibility-toggler').each(setupHiding);
});
})(H5P.jQuery);

184
js/h5p.js
View File

@ -32,7 +32,7 @@ if (document.documentElement.requestFullScreen) {
H5P.fullScreenBrowserPrefix = '';
}
else if (document.documentElement.webkitRequestFullScreen) {
H5P.safariBrowser = navigator.userAgent.match(/Version\/(\d)/);
H5P.safariBrowser = navigator.userAgent.match(/version\/([.\d]+)/i);
H5P.safariBrowser = (H5P.safariBrowser === null ? 0 : parseInt(H5P.safariBrowser[1]));
// Do not allow fullscreen for safari < 7.
@ -47,24 +47,6 @@ else if (document.documentElement.msRequestFullscreen) {
H5P.fullScreenBrowserPrefix = 'ms';
}
/** @const {number} */
H5P.DISABLE_NONE = 0;
/** @const {number} */
H5P.DISABLE_FRAME = 1;
/** @const {number} */
H5P.DISABLE_DOWNLOAD = 2;
/** @const {number} */
H5P.DISABLE_EMBED = 4;
/** @const {number} */
H5P.DISABLE_COPYRIGHT = 8;
/** @const {number} */
H5P.DISABLE_ABOUT = 16;
/**
* Keep track of when the H5Ps where started.
*
@ -85,18 +67,27 @@ H5P.init = function (target) {
}
// Determine if we can use full screen
if (H5P.canHasFullScreen === undefined) {
if (H5P.fullscreenSupported === undefined) {
/**
* Use this variable to check if fullscreen is supported. Fullscreen can be
* restricted when embedding since not all browsers support the native
* fullscreen, and the semi-fullscreen solution doesn't work when embedded.
* @type {boolean}
*/
H5P.canHasFullScreen = (H5P.isFramed && H5P.externalEmbed !== false) ? ((document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled) ? true : false) : true;
H5P.fullscreenSupported = !(H5P.isFramed && H5P.externalEmbed !== false) || !!(document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled);
// We should consider document.msFullscreenEnabled when they get their
// element sizing corrected. Ref. https://connect.microsoft.com/IE/feedback/details/838286/ie-11-incorrectly-reports-dom-element-sizes-in-fullscreen-mode-when-fullscreened-element-is-within-an-iframe
}
// Deprecated variable, kept to maintain backwards compatability
if (H5P.canHasFullScreen === undefined) {
/**
* @deprecated since version 1.11
* @type {boolean}
*/
H5P.canHasFullScreen = H5P.fullscreenSupported;
}
// H5Ps added in normal DIV.
var $containers = H5P.jQuery('.h5p-content:not(.h5p-initialized)', target).each(function () {
var $element = H5P.jQuery(this).addClass('h5p-initialized');
@ -141,87 +132,51 @@ H5P.init = function (target) {
var instance = H5P.newRunnable(library, contentId, $container, true, {standalone: true});
// Check if we should add and display a fullscreen button for this H5P.
if (contentData.fullScreen == 1 && H5P.canHasFullScreen) {
if (contentData.fullScreen == 1 && H5P.fullscreenSupported) {
H5P.jQuery('<div class="h5p-content-controls"><div role="button" tabindex="0" class="h5p-enable-fullscreen" title="' + H5P.t('fullscreen') + '"></div></div>').prependTo($container).children().click(function () {
H5P.fullScreen($container, instance);
});
}
// Create action bar
var $actions = H5P.jQuery('<ul class="h5p-actions"></ul>');
/**
* Helper for creating action bar buttons.
*
* @private
* @param {string} type
* @param {function} handler
* @param {string} customClass Instead of type class
* Create action bar
*/
var addActionButton = function (type, handler, customClass) {
H5P.jQuery('<li/>', {
'class': 'h5p-button h5p-' + (customClass ? customClass : type),
role: 'button',
tabindex: 0,
title: H5P.t(type + 'Description'),
html: H5P.t(type),
on: {
click: handler,
keypress: function (e) {
if (e.which === 32) {
handler();
e.preventDefault(); // (since return false will block other inputs)
}
}
},
appendTo: $actions
});
};
// Register action bar buttons
if (!(contentData.disable & H5P.DISABLE_DOWNLOAD)) {
// Add export button
addActionButton('download', function () {
// Use button for download to avoid people linking directly to the .h5p
window.location.href = contentData.exportUrl;
}, 'export');
}
if (!(contentData.disable & H5P.DISABLE_COPYRIGHT)) {
var copyright = H5P.getCopyrights(instance, library.params, contentId);
if (copyright) {
// Add copyright dialog button
addActionButton('copyrights', function () {
// Open dialog with copyright information
var dialog = new H5P.Dialog('copyrights', H5P.t('copyrightInformation'), copyright, $container);
dialog.open();
});
var displayOptions = contentData.displayOptions;
var displayFrame = false;
if (displayOptions.frame) {
// Special handling of copyrights
if (displayOptions.copyright) {
var copyrights = H5P.getCopyrights(instance, library.params, contentId);
if (!copyrights) {
displayOptions.copyright = false;
}
}
}
if (!(contentData.disable & H5P.DISABLE_EMBED)) {
// Add embed button
addActionButton('embed', function () {
// Open dialog with embed information
// Create action bar
var actionBar = new H5P.ActionBar(displayOptions);
var $actions = actionBar.getDOMElement();
actionBar.on('download', function () {
window.location.href = contentData.exportUrl;
});
actionBar.on('copyrights', function () {
var dialog = new H5P.Dialog('copyrights', H5P.t('copyrightInformation'), copyrights, $container);
dialog.open();
});
actionBar.on('embed', function () {
H5P.openEmbedDialog($actions, contentData.embedCode, contentData.resizeCode, {
width: $element.width(),
height: $element.height()
});
});
if (actionBar.hasActions()) {
displayFrame = true;
$actions.insertAfter($container);
}
}
if (!(contentData.disable & H5P.DISABLE_ABOUT)) {
// Add about H5P button icon
H5P.jQuery('<li><a class="h5p-link" href="http://h5p.org" target="_blank" title="' + H5P.t('h5pDescription') + '"></a></li>').appendTo($actions);
}
// Insert action bar if it has any content
if (!(contentData.disable & H5P.DISABLE_FRAME) && $actions.children().length) {
$actions.insertAfter($container);
$element.addClass('h5p-frame');
}
else {
$element.addClass('h5p-no-frame');
}
$element.addClass(displayFrame ? 'h5p-frame' : 'h5p-no-frame');
// Keep track of when we started
H5P.opened[contentId] = new Date();
@ -497,7 +452,7 @@ H5P.semiFullScreen = function ($element, instance, exitCallback, body) {
* @param {Object} instance
* @param {function} exitCallback Callback function called when user exits fullscreen.
* @param {H5P.jQuery} $body For internal use. Gives the body of the iframe.
* @param {Boolean} forceSemiFullScreen
* @param {Boolean} forceSemiFullScreen
*/
H5P.fullScreen = function ($element, instance, exitCallback, body, forceSemiFullScreen) {
if (H5P.exitFullScreen !== undefined) {
@ -1034,6 +989,28 @@ H5P.findCopyrights = function (info, parameters, contentId) {
if (!parameters.hasOwnProperty(field)) {
continue; // Do not check
}
/*
* TODO: Make parameters clean again
* Some content types adds jQuery or other objects to parameters
* in order to determine override settings for sub-content-types.
* For instance Question Set tells Multiple Choice that it should
* attach Multi Choice's confirmation dialog to a Question Set
* jQuery element, so that the confirmation dialog will not be restricted
* to the space confined by Multi Choice.
* Ideally this should not be added to parameters, we must make a better
* solution. We should likely be adding these to sub-content through
* functions/setters instead of passing them down as params.
*
* This solution is implemented as a hack that will ignore all parameters
* inside a "overrideSettings" field, this should suffice for now since
* all overridden objects are added to this field, however this is not very
* robust solution and will very likely lead to problems in the future.
*/
if (field === 'overrideSettings') {
continue;
}
var value = parameters[field];
if (value instanceof Array) {
@ -1059,8 +1036,6 @@ H5P.findCopyrights = function (info, parameters, contentId) {
info.addMedia(copyrights);
}
}
else {
}
}
};
@ -1657,7 +1632,8 @@ H5P.shuffleArray = function (array) {
* Reported time consumption/usage
*/
H5P.setFinished = function (contentId, score, maxScore, time) {
if (typeof score === 'number' && H5PIntegration.postUserStatistics === true) {
var validScore = typeof score === 'number' || score instanceof Number;
if (validScore && H5PIntegration.postUserStatistics === true) {
/**
* Return unix timestamp for the given JS Date.
*
@ -2002,6 +1978,20 @@ H5P.createTitle = function (rawTitle, maxLength) {
// Init H5P when page is fully loadded
$(document).ready(function () {
/**
* Indicates if H5P is embedded on an external page using iframe.
* @member {boolean} H5P.externalEmbed
*/
// Relay events to top window. This must be done before H5P.init
// since events may be fired on initialization.
if (H5P.isFramed && H5P.externalEmbed === false) {
H5P.externalDispatcher.on('*', function (event) {
window.parent.H5P.externalDispatcher.trigger.call(this, event);
});
}
/**
* Prevent H5P Core from initializing. Must be overriden before document ready.
* @member {boolean} H5P.preventInit
@ -2043,18 +2033,6 @@ H5P.createTitle = function (rawTitle, maxLength) {
// pagehide is used on iPad when tabs are switched
H5P.$window.on('pagehide', storeCurrentState);
}
/**
* Indicates if H5P is embedded on an external page using iframe.
* @member {boolean} H5P.externalEmbed
*/
// Relay events to top window.
if (H5P.isFramed && H5P.externalEmbed === false) {
H5P.externalDispatcher.on('*', function (event) {
window.parent.H5P.externalDispatcher.trigger.call(this, event);
});
}
});
})(H5P.jQuery);

View File

@ -5,7 +5,7 @@
left: 0;
top: 0;
background: rgba(255, 255, 255, 0.85);
background: rgba(28, 34, 41, 0.9);
opacity: 1;
visibility: visible;
-webkit-transition: opacity 0.1s, linear 0s, visibility 0s linear 0s;
@ -46,7 +46,7 @@
transform: translate(-50%, 0%);
color: #555;
box-shadow: 0 0 6px 1px #ddd;
box-shadow: 0 0 6px 6px rgba(10,10,10,0.3);
-webkit-transition: transform 0.1s ease-in;
transition: transform 0.1s ease-in;
@ -61,7 +61,7 @@
.h5p-confirmation-dialog-header {
padding: 1.5em;
background: #fff;
color: #1a73d9;
color: #356593;
}
.h5p-confirmation-dialog-header-text {
@ -69,8 +69,9 @@
}
.h5p-confirmation-dialog-body {
background: #fafbfc;
border-top: solid 1px #dde0e9;
padding: 1.25em 1.5em;
background: #fafafa;
}
.h5p-confirmation-dialog-text {
@ -90,14 +91,14 @@ button.h5p-confirmation-dialog-exit {
font-size: 2.5em;
top: -0.9em;
right: -1.15em;
color: #777;
color: #fff;
cursor: pointer;
text-decoration: none;
}
button.h5p-confirmation-dialog-exit:focus,
button.h5p-confirmation-dialog-exit:hover {
color: #555;
color: #E4ECF5;
}
.h5p-confirmation-dialog-exit:before {

View File

@ -1,13 +1,15 @@
button.h5p-core-button:visited,
button.h5p-core-button:link,
button.h5p-core-button {
font-family: "Open Sans", sans-serif;
font-weight: 600;
font-size: 1em;
line-height: 1.2;
padding: 0.5em 1.25em;
border-radius: 2em;
background: #1a73d9;
color: #ffffff;
background: #488ac9;
color: #fff;
cursor: pointer;
border: none;
@ -22,7 +24,7 @@ button.h5p-core-button {
}
button.h5p-core-button:hover,
button.h5p-core-button:focus {
background: #1356a3;
background: #3b71a5;
color: #fff;
text-decoration: none;
-webkit-transition: initial;

View File

@ -3,11 +3,11 @@
/* Custom H5P font to use for icons. */
@font-face {
font-family: 'h5p';
src: url('../fonts/h5p-core-14.eot?inh2er');
src: url('../fonts/h5p-core-14.eot?inh2er#iefix') format('embedded-opentype'),
url('../fonts/h5p-core-14.ttf?inh2er') format('truetype'),
url('../fonts/h5p-core-14.woff?inh2er') format('woff'),
url('../fonts/h5p-core-14.svg?inh2er#h5p-core-14') format('svg');
src: url('../fonts/h5p-core-16.eot?80e76o');
src: url('../fonts/h5p-core-16.eot?80e76o#iefix') format('embedded-opentype'),
url('../fonts/h5p-core-16.ttf?80e76o') format('truetype'),
url('../fonts/h5p-core-16.woff?80e76o') format('woff'),
url('../fonts/h5p-core-16.svg?80e76o#h5p-core-15') format('svg');
font-weight: normal;
font-style: normal;
}
@ -235,6 +235,7 @@ div.h5p-fullscreen {
}
.h5p-actions > li {
margin: 0;
list-style: none;
}
.h5p-popup-dialog {
position: absolute;