Merge branch 'master' into HFP-186-tutorial-example-links

Conflicts:
	fonts/h5p-core-16.eot
	fonts/h5p-core-16.svg
	fonts/h5p-core-16.ttf
	fonts/h5p-core-16.woff
	styles/h5p.css
pull/38/head
Andreas Nergaard 2016-12-22 12:50:56 +01:00
commit 893f610861
13 changed files with 392 additions and 223 deletions

Binary file not shown.

View File

@ -1,55 +0,0 @@
<?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>
<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="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 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" />
<glyph unicode="&#xe88c;" glyph-name="uniE88C" horiz-adv-x="1321" d="M495.845 602.867c4.186 4.186 2.79 8.372-3.255 8.835l-111.615 11.86c-6.046 0.697-10.464-3.721-9.766-9.766l11.86-111.615c0.697-6.046 4.65-7.441 8.835-3.255l103.942 103.942zM421.202 534.968l64.876-64.876c4.186-4.186 11.161-4.186 15.581 0l23.254 23.254c4.186 4.186 4.186 11.161 0 15.581l-64.876 64.876zM932.774 498.924c4.186-4.186 8.372-2.79 8.835 3.255l11.86 111.615c0.697 6.046-3.721 10.464-9.766 9.766l-111.615-11.86c-6.046-0.697-7.441-4.65-3.255-8.835l103.942-103.942zM864.873 573.799l-64.876-64.876c-4.186-4.186-4.186-11.161 0-15.581l23.254-23.254c4.186-4.186 11.161-4.186 15.581 0l64.876 64.876zM828.83 284.064c-4.186-4.186-2.79-8.372 3.255-8.835l111.615-11.86c6.046-0.697 10.464 3.721 9.766 9.766l-11.86 111.615c-0.697 6.046-4.65 7.441-8.835 3.255l-103.942-103.942zM903.707 351.733l-64.876 64.876c-4.186 4.186-11.161 4.186-15.581 0l-23.254-23.254c-4.186-4.186-4.186-11.161 0-15.581l64.876-64.876zM391.903 388.008c-4.186 4.186-8.372 2.79-8.835-3.255l-11.86-111.615c-0.697-6.046 3.721-10.464 9.766-9.766l111.615 11.86c6.046 0.697 7.441 4.65 3.255 8.835l-103.942 103.942zM459.802 313.131l64.876 64.876c4.186 4.186 4.186 11.161 0 15.581l-23.254 23.254c-4.186 4.186-11.161 4.186-15.581 0l-64.876-64.876zM284.938 707.273v-518.547h751.079v518.547h-751.079zM990.906 233.837h-660.857v428.325h660.623v-428.325z" />
<glyph unicode="&#xe88e;" glyph-name="uniE88E" horiz-adv-x="1321" d="M1062.773 608.822c-21.364 20.404-53.527 31.205-96.254 31.205h-148.821v-76.81h-168.504l-14.162-60.968c11.762 5.521 28.565 9.602 40.087 12.483 11.521 2.88 23.044 1.681 34.325 1.681 38.405 0 69.369-12.001 93.131-35.285 23.763-23.044 35.765-52.567 35.765-87.611 0-24.722-6.241-48.488-18.484-71.529-12.243-22.804-29.764-41.766-52.327-53.768-8.161-4.321-17.043-2.4-26.644-12.001h141.62v144.021h70.811c47.767 0 83.292 9.843 106.335 31.684 23.285 21.844 34.806 51.848 34.806 90.494 0.241 37.205-10.321 66.009-31.684 86.411zM965.8 488.087c-9.12-7.921-25.204-11.284-48.006-11.284h-35.285v86.411h39.846c22.084 0 37.205-5.281 45.125-13.683 7.921-8.401 12.001-18.722 12.001-30.724 0-12.483-4.562-22.804-13.683-30.724zM671.518 446.559c-20.642 0-38.646-12.001-47.287-29.285l-103.694 15.122 46.807 207.629h-100.095v-163.222h-122.417v163.222h-120.017v-384.053h120.017v144.021h122.417v-144.021h148.579c-17.522 9.602-32.643 13.202-45.125 22.563-12.721 9.602-22.804 20.883-30.724 32.885s-13.921 25.685-19.203 43.686l103.694 15.122c8.642-17.283 26.403-29.044 47.047-29.044 29.044 0 52.567 23.522 52.567 52.567s-23.522 52.807-52.567 52.807z" />
<glyph unicode="&#xe88f;" glyph-name="uniE88F" horiz-adv-x="1321" d="M1030.554 429.363c1.638-3.277 0-3.277-1.638-6.349-20.89-22.323-46.49-35.226-76.8-41.574-12.902-1.638-25.6-3.277-36.864-3.277-12.493 0-18.637 0-27.238 1.638-1.638 0.205-3.277 1.638-4.71 3.277-67.174 60.826-135.987 121.651-203.162 182.477-1.638 1.638-4.71 1.638-6.349 1.638-23.962-6.349-47.923-12.902-73.523-19.251-25.6-4.71-51.2-1.638-75.162 12.902-12.902 7.987-22.323 19.251-28.877 33.587-4.71 9.626 1.638 22.323 12.902 25.6 43.213 12.902 86.426 28.877 128 44.851 12.902 4.71 27.238 7.987 41.574 6.349 4.71 0 9.626-3.277 14.336-4.71 41.574-15.974 83.149-30.31 124.723-46.49 1.638-1.638 4.71-1.638 7.987 0 30.31 7.987 62.464 17.613 92.774 25.6 3.277 1.638 4.71 0 6.349-1.638zM420.864 437.35c19.251 9.626 36.864 6.349 51.2-9.626 12.902-12.902 12.902-28.877 3.277-49.562 19.251 3.277 33.587-3.277 43.213-19.251 11.264-17.613 7.987-33.587-6.349-49.562 4.71 0 11.264 0 15.974-1.638 14.336-3.277 25.6-12.902 30.31-27.238s1.638-27.238-7.987-36.864c-4.71-6.349-11.264-11.264-15.974-17.613s-11.264-11.264-15.974-17.613c-14.336-14.336-38.502-15.974-52.838-1.638-30.31 30.31-55.91 64.102-83.149 97.69-17.613 22.323-33.587 43.213-49.562 65.536-7.987 9.626-12.902 19.251-14.336 31.949 0 7.987 1.638 15.974 7.987 22.323 9.626 9.626 17.613 19.251 27.238 28.877 17.613 17.613 47.923 12.698 62.464-7.987 1.434-1.434 3.072-4.506 4.506-7.782zM571.392 224.563l27.238-28.877c17.613-15.974 46.49-12.902 57.549 7.987l-3.277 3.277c-22.323 22.323-46.49 46.49-68.813 68.813-3.277 3.277-4.71 7.987-3.277 12.902 1.638 4.71 4.71 7.987 9.626 9.626 4.71 1.638 9.626 0 12.902-4.71 14.336-14.336 30.31-30.31 44.851-44.851 14.336-14.336 30.31-28.877 44.851-44.851 7.987-9.626 19.251-11.264 30.31-9.626 14.336 3.277 23.962 11.264 30.31 25.6 1.638 3.277 0 4.71-1.638 6.349-43.213 43.213-86.426 84.787-128 128-3.277 3.277-6.349 7.987-4.71 14.336 1.638 9.626 12.902 14.336 22.323 7.987 1.638-1.638 3.277-1.638 3.277-3.277 43.213-43.213 88.064-88.064 131.277-131.277 3.277-3.277 4.71-3.277 7.987-3.277 17.613 1.638 33.587 15.974 36.864 33.587 0 3.277 0 4.71-1.638 6.349-49.562 49.562-99.123 99.123-148.89 148.89-3.277 3.277-4.71 6.349-4.71 11.264 0 4.71 3.277 11.264 7.987 12.698 4.71 1.638 9.626 1.638 14.336-3.277 3.277-3.277 7.987-7.987 11.264-11.264 35.226-35.226 70.451-70.451 105.677-105.677 11.264-11.264 22.323-20.89 31.949-31.949 1.638-1.638 4.71-3.277 6.349-1.638 23.962 4.71 38.502 30.31 28.877 54.477l38.298-1.638c0-0.205 0-0.41 0.205-0.614 1.434-7.987 1.434-17.203-0.205-24.986-6.349-30.31-23.962-49.562-52.838-59.187-1.638 0-3.277-1.638-3.277-3.277-9.626-31.949-33.587-52.838-67.174-55.91-3.277 0-3.277-1.638-4.71-3.277-17.613-33.587-57.549-49.562-91.136-36.864-4.71 1.638-9.626 4.71-14.336 6.349-6.349-6.349-14.336-12.698-22.323-15.974-27.238-12.698-57.549-6.349-78.438 14.336-9.626 9.626-19.251 19.251-30.31 28.877 7.987 7.987 14.336 15.974 23.962 25.6l1.434-1.024zM404.89 744.55c31.949-9.626 62.464-20.89 94.413-30.31 33.587-11.264 65.536-20.89 99.123-31.949 1.638 0 1.638 0 3.277-1.638-17.613-6.349-33.587-11.264-49.562-17.613-1.638 0-3.277 0-4.71 0-44.851 14.336-91.136 28.877-135.987 43.213-3.277 1.638-4.71 0-7.987-1.638l-80.077-185.549c0-9.626 4.71-17.613 11.264-25.6 3.277-4.71 6.349-7.987 7.987-9.626-7.987-7.987-14.336-15.974-22.323-25.6-15.974 19.251-28.877 38.502-30.31 64.102l89.498 212.787c-0.41-0.205 12.902 13.312 25.395 9.421z" />
<glyph unicode="&#xe890;" glyph-name="uniE890" horiz-adv-x="1321" d="M660.48 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.952zM796.058 371.2c6.963-6.963 6.963-18.022 0-24.986l-33.997-33.997c-6.963-6.963-18.022-6.963-24.986 0l-76.8 76.8-76.595-76.595c-6.963-6.963-18.022-6.963-24.986 0l-33.997 33.997c-6.963 6.963-6.963 18.022 0 24.986l76.8 76.8-76.8 76.8c-6.963 6.963-6.963 18.022 0 24.986l33.997 33.997c6.963 6.963 18.022 6.963 24.986 0l76.8-76.8 76.8 76.8c6.963 6.963 18.022 6.963 24.986 0l33.997-33.997c6.963-6.963 6.963-18.022 0-24.986l-77.005-77.005 76.8-76.8z" />
<glyph unicode="&#xe891;" glyph-name="uniE891" horiz-adv-x="1321" d="M324.468 566.591c-4.186-4.186-2.79-8.372 3.255-8.835l111.615-11.86c6.046-0.697 10.464 3.721 9.766 9.766l-11.86 111.615c-0.697 6.046-4.65 7.441-8.835 3.255l-103.942-103.942zM399.112 634.259l-64.644 64.876c-4.186 4.186-11.161 4.186-15.581 0l-23.254-23.254c-4.186-4.186-4.186-11.161 0-15.581l64.876-64.876zM896.497 670.533c-4.186 4.186-8.372 2.79-8.835-3.255l-11.86-111.615c-0.697-6.046 3.721-10.464 9.766-9.766l111.615 11.86c6.046 0.697 7.441 4.65 3.255 8.835l-103.942 103.942zM964.165 595.657l64.876 64.876c4.186 4.186 4.186 11.161 0 15.581l-23.254 23.254c-4.186 4.186-11.161 4.186-15.581 0l-64.876-64.876zM1000.44 320.34c4.186 4.186 2.79 8.372-3.255 8.835l-111.615 11.86c-6.046 0.697-10.464-3.721-9.766-9.766l11.86-111.615c0.697-6.046 4.65-7.441 8.835-3.255l103.942 103.942zM925.564 252.441l64.876-64.876c4.186-4.186 11.161-4.186 15.581 0l23.254 23.254c4.186 4.186 4.186 11.161 0 15.581l-64.876 64.876zM428.41 216.398c4.186-4.186 8.372-2.79 8.835 3.255l11.86 111.615c0.697 6.046-3.721 10.464-9.766 9.766l-111.615-11.86c-6.046-0.697-7.441-4.65-3.255-8.835l103.942-103.942zM360.51 291.273l-64.876-64.876c-4.186-4.186-4.186-11.161 0-15.581l23.254-23.254c4.186-4.186 11.161-4.186 15.581 0l64.876 64.876zM477.939 572.404v-248.809h365.076v248.809h-365.076zM797.905 368.707h-274.854v158.355h274.621v-158.355z" />
<glyph unicode="&#xe892;" glyph-name="uniE892" horiz-adv-x="1321" d="M599.553 337.314c4.419-3.023 8.138-9.998 8.138-15.581v-58.599c0-5.348-3.721-7.441-8.138-4.419l-220.906 148.123c-4.419 3.023-8.138 9.998-8.138 15.348v50.228c0 5.348 3.721 12.323 8.138 15.581l220.906 149.517c4.419 3.023 8.138 1.162 8.138-4.419v-58.599c0-5.348-3.721-12.556-8.138-15.581l-152.773-106.731c-4.419-3.023-4.419-8.138 0-11.161l152.773-103.71zM874.175 440.559c4.419 3.023 4.65 8.138 0 11.161l-152.773 106.731c-4.419 3.023-8.138 10.232-8.138 15.581v58.599c0 5.348 3.721 7.441 8.138 4.419l220.906-149.517c4.419-3.023 8.138-9.998 8.138-15.581v-50.228c0-5.348-3.721-12.323-8.138-15.348l-220.906-148.123c-4.419-3.023-8.138-1.162-8.138 4.419v58.599c0 5.348 3.721 12.323 8.138 15.581l152.773 103.71z" />
<glyph unicode="&#xe893;" glyph-name="uniE893" horiz-adv-x="1321" d="M502.17 522.957c-12.902 0-16.998-8.192-8.806-18.227l152.166-188.006c8.192-10.035 21.504-10.035 29.696 0l152.166 188.006c8.192 10.035 4.301 18.227-8.806 18.227h-316.416zM719.462 512.512v139.878c0 12.902-10.65 23.552-23.552 23.552h-70.656c-12.902 0-23.552-10.65-23.552-23.552v-139.878zM798.106 375.91c-8.602 0-20.070-5.53-25.6-12.288l-75.162-92.979c-5.325-6.758-15.36-16.589-22.118-21.914 0 0-4.506-3.686-14.746-3.686s-14.746 3.686-14.746 3.686c-6.758 5.325-16.589 15.36-22.118 21.914l-75.162 92.979c-5.325 6.758-16.998 12.288-25.6 12.288h-130.253c-8.602 0-15.77-6.963-15.77-15.77v-141.722c0-8.602 6.963-15.77 15.77-15.77h535.962c8.602 0 15.77 6.963 15.77 15.77v141.722c0 8.602-6.963 15.77-15.77 15.77h-130.458zM448.102 261.018c-15.565 0-28.262 12.698-28.262 28.262s12.698 28.262 28.262 28.262 28.262-12.698 28.262-28.262c-0.205-15.565-12.698-28.262-28.262-28.262z" />
<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" />
<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" />
</font></defs></svg>

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Binary file not shown.

View File

@ -282,6 +282,8 @@ class H5PDefaultStorage implements \H5PFileStorage {
throw new \Exception('unabletocopy'); throw new \Exception('unabletocopy');
} }
$ignoredFiles = self::getIgnoredFiles("{$source}/.h5pignore");
$dir = opendir($source); $dir = opendir($source);
if ($dir === FALSE) { if ($dir === FALSE) {
trigger_error('Unable to open directory ' . $source, E_USER_WARNING); trigger_error('Unable to open directory ' . $source, E_USER_WARNING);
@ -289,7 +291,7 @@ class H5PDefaultStorage implements \H5PFileStorage {
} }
while (false !== ($file = readdir($dir))) { 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}")) { if (is_dir("{$source}/{$file}")) {
self::copyFileTree("{$source}/{$file}", "{$destination}/{$file}"); self::copyFileTree("{$source}/{$file}", "{$destination}/{$file}");
} }
@ -301,6 +303,25 @@ class H5PDefaultStorage implements \H5PFileStorage {
closedir($dir); 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 * Recursive function that makes sure the specified directory exists and
* is writable. * is writable.

View File

@ -558,6 +558,16 @@ interface H5PFrameworkInterface {
* Will trigger after the export file is created. * Will trigger after the export file is created.
*/ */
public function afterExportCreated(); 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 * Functions and storage shared by the other H5P classes
*/ */
@ -1676,7 +1700,7 @@ class H5PCore {
public static $coreApi = array( public static $coreApi = array(
'majorVersion' => 1, 'majorVersion' => 1,
'minorVersion' => 11 'minorVersion' => 12
); );
public static $styles = array( public static $styles = array(
'styles/h5p.css', 'styles/h5p.css',
@ -1690,7 +1714,8 @@ class H5PCore {
'js/h5p-x-api-event.js', 'js/h5p-x-api-event.js',
'js/h5p-x-api.js', 'js/h5p-x-api.js',
'js/h5p-content-type.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( public static $adminScripts = array(
'js/jquery.js', 'js/jquery.js',
@ -1713,12 +1738,18 @@ class H5PCore {
const DISABLE_COPYRIGHT = 8; const DISABLE_COPYRIGHT = 8;
const DISABLE_ABOUT = 16; 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 // Map flags to string
public static $disable = array( public static $disable = array(
self::DISABLE_FRAME => 'frame', self::DISABLE_FRAME => self::DISPLAY_OPTION_FRAME,
self::DISABLE_DOWNLOAD => 'download', self::DISABLE_DOWNLOAD => self::DISPLAY_OPTION_DOWNLOAD,
self::DISABLE_EMBED => 'embed', self::DISABLE_EMBED => self::DISPLAY_OPTION_EMBED,
self::DISABLE_COPYRIGHT => 'copyright' self::DISABLE_COPYRIGHT => self::DISPLAY_OPTION_COPYRIGHT
); );
/** /**
@ -2423,7 +2454,9 @@ class H5PCore {
// Handle libraries metadata // Handle libraries metadata
if (isset($json->libraries)) { if (isset($json->libraries)) {
foreach ($json->libraries as $machineName => $libInfo) { 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 {
} }
/** /**
* * Create representation of display options as int
*/
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.
* *
* @param array $sources * @param array $sources
* @param int $current * @param int $current
* @return int * @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) { foreach (H5PCore::$disable as $bit => $option) {
if ($this->h5pF->getOption(($bit & H5PCore::DISABLE_DOWNLOAD ? 'export' : $option), TRUE)) { if (!isset($sources[$option]) || !$sources[$option]) {
if (!isset($sources[$option]) || !$sources[$option]) { $current |= $bit; // Disable
$current |= $bit; // Disable }
} else {
else { $current &= ~$bit; // Enable
$current &= ~$bit; // Enable
}
} }
} }
return $current; 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. * Small helper for getting the library's ID.
* *
@ -3149,7 +3280,6 @@ class H5PContentValidator {
break; break;
} }
} }
// Using a library in content that is not present at all in semantics // Using a library in content that is not present at all in semantics
if ($message === NULL) { if ($message === NULL) {
$message = $this->h5pF->t('The H5P library %library used in the content is not valid', array( $message = $this->h5pF->t('The H5P library %library used in the content is not valid', array(

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);

154
js/h5p.js
View File

@ -32,7 +32,7 @@ if (document.documentElement.requestFullScreen) {
H5P.fullScreenBrowserPrefix = ''; H5P.fullScreenBrowserPrefix = '';
} }
else if (document.documentElement.webkitRequestFullScreen) { 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])); H5P.safariBrowser = (H5P.safariBrowser === null ? 0 : parseInt(H5P.safariBrowser[1]));
// Do not allow fullscreen for safari < 7. // Do not allow fullscreen for safari < 7.
@ -47,24 +47,6 @@ else if (document.documentElement.msRequestFullscreen) {
H5P.fullScreenBrowserPrefix = 'ms'; 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. * Keep track of when the H5Ps where started.
* *
@ -92,11 +74,20 @@ H5P.init = function (target) {
* fullscreen, and the semi-fullscreen solution doesn't work when embedded. * fullscreen, and the semi-fullscreen solution doesn't work when embedded.
* @type {boolean} * @type {boolean}
*/ */
H5P.fullscreenSupported = (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 // 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 // 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. // H5Ps added in normal DIV.
var $containers = H5P.jQuery('.h5p-content:not(.h5p-initialized)', target).each(function () { var $containers = H5P.jQuery('.h5p-content:not(.h5p-initialized)', target).each(function () {
var $element = H5P.jQuery(this).addClass('h5p-initialized'); var $element = H5P.jQuery(this).addClass('h5p-initialized');
@ -147,81 +138,45 @@ H5P.init = function (target) {
}); });
} }
// Create action bar
var $actions = H5P.jQuery('<ul class="h5p-actions"></ul>');
/** /**
* Helper for creating action bar buttons. * Create action bar
*
* @private
* @param {string} type
* @param {function} handler
* @param {string} customClass Instead of type class
*/ */
var addActionButton = function (type, handler, customClass) { var displayOptions = contentData.displayOptions;
H5P.jQuery('<li/>', { var displayFrame = false;
'class': 'h5p-button h5p-' + (customClass ? customClass : type), if (displayOptions.frame) {
role: 'button', // Special handling of copyrights
tabindex: 0, if (displayOptions.copyright) {
title: H5P.t(type + 'Description'), var copyrights = H5P.getCopyrights(instance, library.params, contentId);
html: H5P.t(type), if (!copyrights) {
on: { displayOptions.copyright = false;
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();
});
} }
}
if (!(contentData.disable & H5P.DISABLE_EMBED)) { // Create action bar
// Add embed button var actionBar = new H5P.ActionBar(displayOptions);
addActionButton('embed', function () { var $actions = actionBar.getDOMElement();
// Open dialog with embed information
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, { H5P.openEmbedDialog($actions, contentData.embedCode, contentData.resizeCode, {
width: $element.width(), width: $element.width(),
height: $element.height() height: $element.height()
}); });
}); });
if (actionBar.hasActions()) {
displayFrame = true;
$actions.insertAfter($container);
}
} }
if (!(contentData.disable & H5P.DISABLE_ABOUT)) { $element.addClass(displayFrame ? 'h5p-frame' : 'h5p-no-frame');
// 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');
}
// Keep track of when we started // Keep track of when we started
H5P.opened[contentId] = new Date(); H5P.opened[contentId] = new Date();
@ -497,7 +452,7 @@ H5P.semiFullScreen = function ($element, instance, exitCallback, body) {
* @param {Object} instance * @param {Object} instance
* @param {function} exitCallback Callback function called when user exits fullscreen. * @param {function} exitCallback Callback function called when user exits fullscreen.
* @param {H5P.jQuery} $body For internal use. Gives the body of the iframe. * @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) { H5P.fullScreen = function ($element, instance, exitCallback, body, forceSemiFullScreen) {
if (H5P.exitFullScreen !== undefined) { if (H5P.exitFullScreen !== undefined) {
@ -1028,6 +983,28 @@ H5P.findCopyrights = function (info, parameters, contentId) {
if (!parameters.hasOwnProperty(field)) { if (!parameters.hasOwnProperty(field)) {
continue; // Do not check 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]; var value = parameters[field];
if (value instanceof Array) { if (value instanceof Array) {
@ -1053,8 +1030,6 @@ H5P.findCopyrights = function (info, parameters, contentId) {
info.addMedia(copyrights); info.addMedia(copyrights);
} }
} }
else {
}
} }
}; };
@ -1651,7 +1626,8 @@ H5P.shuffleArray = function (array) {
* Reported time consumption/usage * Reported time consumption/usage
*/ */
H5P.setFinished = function (contentId, score, maxScore, time) { 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. * Return unix timestamp for the given JS Date.
* *

View File

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

View File

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

View File

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