Merge branch 'release' of github.com:h5p/h5p-php-library into release
commit
e15f6d6678
|
@ -28,7 +28,8 @@
|
||||||
"h5p-development.class.php",
|
"h5p-development.class.php",
|
||||||
"h5p-file-storage.interface.php",
|
"h5p-file-storage.interface.php",
|
||||||
"h5p-default-storage.class.php",
|
"h5p-default-storage.class.php",
|
||||||
"h5p-event-base.class.php"
|
"h5p-event-base.class.php",
|
||||||
|
"h5p-metadata.class.php"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
|
@ -1,52 +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="h5p" horiz-adv-x="1024">
|
|
||||||
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
|
||||||
<missing-glyph horiz-adv-x="1024" />
|
|
||||||
<glyph unicode=" " horiz-adv-x="512" d="" />
|
|
||||||
<glyph unicode="" glyph-name="arrow-down" data-tags="arrow-down" d="M234 453.668h556l-278-278z" />
|
|
||||||
<glyph unicode="" glyph-name="arrow-left" data-tags="arrow-left" d="M381 52.668v524l262-262z" />
|
|
||||||
<glyph unicode="" glyph-name="colapse" data-tags="colapse" d="M512 511.335l256-256-60-60-196 196-196-196-60 60z" />
|
|
||||||
<glyph unicode="" glyph-name="expand" data-tags="expand" d="M708 487.335l60-60-256-256-256 256 60 60 196-196z" />
|
|
||||||
<glyph unicode="" glyph-name="move" data-tags="move" d="M386.662 789.062h71.27v-71.27h-71.27v71.27zM566.067 789.062h71.27v-71.27h-71.27v71.27zM386.662 632.799h71.27v-71.27h-71.27v71.27zM566.067 632.799h71.27v-71.27h-71.27v71.27zM386.662 476.434h71.27v-71.27h-71.27v71.27zM566.067 476.434h71.27v-71.27h-71.27v71.27zM386.662 320.172h71.27v-71.27h-71.27v71.27zM566.067 320.172h71.27v-71.27h-71.27v71.27zM386.662 163.807h71.27v-71.27h-71.27v71.27zM566.067 163.807h71.27v-71.27h-71.27v71.27zM386.662 7.545h71.27v-71.27h-71.27v71.27zM566.067 7.545h71.27v-71.27h-71.27v71.27z" />
|
|
||||||
<glyph unicode="" glyph-name="check-mark" data-tags="check-mark" d="M454.299 309.923l-116.917 116.917-84.781-84.707 201.696-201.697 317.097 317.097-84.781 84.706z" />
|
|
||||||
<glyph unicode="" glyph-name="arrow-up-circle" data-tags="arrow-up-circle" d="M512 670.056c-148.616 0-264.722-120.75-260.077-269.367 0-125.395 88.241-232.212 208.991-255.434v213.636h-92.885c-13.933 0-13.933 9.288-9.288 18.577l139.327 171.838c4.645 9.288 13.933 9.288 23.221 4.645 0 0 4.645-4.645 4.645-4.645l139.327-171.838c9.288-9.288 4.645-18.577-9.288-18.577h-92.885v-213.636c143.972 32.51 232.212 171.838 199.703 315.808-23.221 120.75-130.039 204.347-250.789 208.991z" />
|
|
||||||
<glyph unicode="" glyph-name="info-circle" data-tags="info-circle" d="M512 665.6c-144.077 0-260.266-116.191-260.266-260.266s116.191-260.266 260.266-260.266 260.266 116.191 260.266 260.266v0c0 139.429-116.191 255.619-260.266 260.266zM470.171 614.477h88.305v-69.714h-88.305v69.714zM600.305 224.077h-181.257v51.123h51.123v162.666h-51.123v51.123h139.429v-218.438h46.477l-4.648-46.477z" />
|
|
||||||
<glyph unicode="" glyph-name="search" data-tags="search" d="M772.098 189.509l-110.68 110.68c71.943 99.612 49.806 243.494-49.806 315.437s-243.494 44.27-315.437-55.339c-71.943-99.612-49.806-243.494 49.806-315.437 77.475-55.339 182.623-55.339 260.098 0l110.68-110.68c5.533-5.533 11.068-5.533 16.601 0 0 0 0 0 0 0l33.205 33.205c11.068 5.533 11.068 16.601 5.533 22.137 0 0 0 0 0 0zM478.795 266.984c-88.544 0-160.486 71.943-160.486 160.486s71.943 160.486 160.486 160.486 160.486-71.943 160.486-160.486-71.943-160.486-160.486-160.486v0z" />
|
|
||||||
<glyph unicode="" glyph-name="fullscreen" data-tags="fullscreen" d="M368.55 554.52c5.737 5.737 0 5.737-5.737 5.737l-103.284 11.476c-5.737 5.737-11.476 0-11.476-5.737l11.476-109.021c0-5.737 5.737-5.737 5.737-5.737l103.284 103.284zM293.959 491.402l63.118-63.118c5.737-5.737 11.476-5.737 17.213 0l22.953 22.953c5.737 5.737 5.737 11.476 0 17.213l-63.118 57.379-40.166-34.429zM787.42 451.236c5.737-5.737 5.737 0 5.737 5.737l11.476 109.021c0 5.737-5.737 11.476-11.476 11.476l-109.021-11.476c-5.737 0-5.737-5.737-5.737-5.737l109.021-109.021zM724.305 525.831l-63.118-63.118c-5.737-5.737-5.737-11.476 0-17.213l22.953-22.953c5.737-5.737 11.476-5.737 17.213 0l63.118 63.118-40.166 40.166zM689.876 244.671c-5.737-5.737 0-5.737 5.737-5.737l109.021-11.476c5.737 0 11.476 5.737 11.476 11.476l-17.213 103.284c0 5.737-5.737 5.737-5.737 5.737l-103.284-103.284zM758.731 313.526l-63.118 63.118c-5.737 5.737-11.476 5.737-17.213 0l-22.953-22.953c-5.737-5.737-5.737-11.476 0-17.213l63.118-63.118 40.166 40.166zM265.269 347.955c-5.737 5.737-5.737 0-5.737-5.737l-11.476-109.021c0-5.737 5.737-11.476 11.476-11.476l109.021 11.476c5.737 0 5.737 5.737 5.737 5.737l-109.021 109.021zM334.124 273.361l63.118 63.118c5.737 5.737 5.737 11.476 0 17.213l-22.953 22.953c-5.737 5.737-11.476 5.737-17.213 0l-63.118-63.118 40.166-40.166zM161.985 657.804v-499.201h722.979v499.201h-722.979zM844.799 198.769h-636.911v413.13h636.911v-413.13z" />
|
|
||||||
<glyph unicode="" glyph-name="h5p" data-tags="h5p" d="M934.072 553.191c-22.319 16.738-50.216 27.897-89.273 27.897h-139.487v-66.954h-156.225l-11.159-55.795c11.159 5.579 27.897 11.159 39.057 11.159s22.319 0 33.476 0c33.476 0 66.954-11.159 89.273-33.476s33.476-50.216 33.476-83.692c0-22.319-5.579-44.635-16.738-66.954s-27.897-39.057-50.216-50.216c-5.579-5.579-16.738 0-22.319-11.159h117.17v133.908h66.954c44.635 0 78.113 11.159 100.43 27.897 22.319 22.319 33.476 50.216 33.476 83.692 0 39.057-11.159 66.954-27.897 83.692v0zM839.221 441.602c-11.159-5.579-22.319-11.159-44.635-11.159h-33.476v83.692h39.057c22.319 0 33.476-5.579 44.635-11.159 5.579-5.579 11.159-16.738 11.159-27.897 0-16.738-5.579-27.897-16.738-33.476v0zM565.826 402.545c-16.738 0-33.476-11.159-44.635-27.897l-94.851 16.738 44.635 195.281h-94.851v-150.646h-117.17v150.646h-111.589v-362.667h111.589v133.908h117.17v-133.908h139.487c-16.738 11.159-33.476 11.159-44.635 22.319s-22.319 22.319-27.897 33.476c-5.579 11.159-11.159 22.319-16.738 39.057l94.851 16.738c5.579-16.738 22.319-27.897 44.635-27.897 27.897 0 50.216 22.319 50.216 50.216 0 22.319-22.319 44.635-50.216 44.635v0z" />
|
|
||||||
<glyph unicode="" glyph-name="rights-of-use" data-tags="rights-of-use" d="M899.611 393.518c0-5.907 0-5.907 0-5.907-23.631-23.631-47.261-35.448-76.799-41.355-11.813 0-23.631-5.907-35.448-5.907s-17.724 0-29.537 0c0 0-5.907 0-5.907 5.907-64.985 59.079-135.877 118.153-200.863 183.139 0 0-5.907 0-5.907 0-23.631-5.907-47.261-11.813-70.892-17.724s-53.168 0-76.799 11.813c-17.724 11.813-23.631 17.724-29.537 35.448-5.907 5.907 0 23.631 11.813 23.631 41.355 11.813 88.616 29.537 129.971 47.261 11.813 5.907 29.537 5.907 41.355 5.907 5.907 0 11.813-5.907 11.813-5.907 41.355-17.724 82.709-29.537 124.060-47.261 0 0 5.907 0 5.907 0 29.537 5.907 64.985 17.724 94.523 23.631 5.907 0 5.907 0 5.907 0l106.34-212.676zM291.12 399.428c17.724 11.813 35.448 5.907 53.168-11.813 11.813-11.813 11.813-29.537 5.907-47.261 17.724 5.907 35.448-5.907 41.355-17.724 11.813-17.724 5.907-35.448-5.907-47.261 5.907 0 11.813 0 17.724 0 11.813-5.907 23.631-11.813 29.537-29.537s0-29.537-5.907-35.448c-5.907-5.907-11.813-11.813-17.724-17.724s-11.813-11.813-17.724-17.724-35.448-17.724-53.168 0c-29.537 29.537-53.168 64.985-82.709 94.523-17.724 23.631-35.448 41.355-47.261 64.985-5.907 11.813-11.813 17.724-11.813 29.537 0 5.907 0 17.724 5.907 23.631 11.813 11.813 17.724 17.724 29.537 29.537 17.724 17.724 47.261 11.813 64.985-5.907-5.907 0-5.907-5.907-5.907-11.813v0zM438.811 192.659l29.537-29.537c17.724-17.724 47.261-11.813 59.079 5.907l-5.907 5.907c-23.631 23.631-47.261 47.261-70.892 70.892-5.907 5.907-5.907 5.907-5.907 11.813s5.907 5.907 11.813 11.813c5.907 0 11.813 0 11.813-5.907 11.813-11.813 29.537-29.537 47.261-47.261 11.813-11.813 29.537-29.537 47.261-47.261 5.907-11.813 17.724-11.813 29.537-11.813 11.813 5.907 23.631 11.813 29.537 23.631 0 5.907 0 5.907 0 5.907-41.355 41.355-88.616 82.709-129.971 129.971-5.907 5.907-5.907 5.907-5.907 11.813 0 11.813 11.813 11.813 23.631 5.907 0 0 5.907 0 5.907-5.907 41.355-41.355 88.616-88.616 129.971-129.971 5.907-5.907 5.907-5.907 5.907-5.907 17.724 0 35.448 17.724 35.448 35.448 0 5.907 0 5.907 0 5.907-47.261 47.261-100.429 100.429-147.691 147.691-5.907 5.907-5.907 5.907-5.907 11.813s5.907 11.813 5.907 11.813c5.907 0 11.813 0 11.813-5.907 5.907-5.907 5.907-5.907 11.813-11.813 35.448-35.448 70.892-70.892 106.34-106.34 11.813-11.813 23.631-23.631 29.537-29.537 0 0 5.907-5.907 5.907 0 23.631 5.907 35.448 29.537 29.537 53.168h35.448c0 0 0 0 0 0 0-5.907 0-17.724 0-23.631-5.907-29.537-23.631-47.261-53.168-59.079 0 0-5.907 0-5.907-5.907-11.813-29.537-35.448-53.168-64.985-53.168-5.907 0-5.907 0-5.907-5.907-17.724-35.448-59.079-47.261-88.616-35.448-5.907 0-11.813 5.907-11.813 5.907-5.907-5.907-11.813-11.813-23.631-17.724-29.537-11.813-59.079-5.907-76.799 11.813-11.813 11.813-17.724 17.724-29.537 29.537 17.724 23.631 23.631 29.537 29.537 41.355v0 0zM273.396 706.627c29.537-11.813 64.985-23.631 94.523-29.537 35.448-11.813 64.985-23.631 100.429-29.537 0 0 0 0 5.907 0-17.724-5.907-35.448-11.813-47.261-17.724 0 0-5.907 0-5.907 0-47.261 11.813-94.523 23.631-135.877 41.355-5.907 0-5.907 0-5.907 0l-76.799-183.139c0-11.813 5.907-17.724 11.813-23.631s5.907-5.907 5.907-11.813c-5.907-5.907-11.813-17.724-23.631-23.631-17.724 17.724-29.537 35.448-29.537 64.985l88.616 212.676c-5.907-11.813 5.907 5.907 17.724 0v0z" />
|
|
||||||
<glyph unicode="" glyph-name="delete-circle" data-tags="delete-circle" d="M512 665.6c-147.107 0-260.266-118.817-260.266-260.266s118.817-260.266 260.266-260.266 260.266 118.817 260.266 260.266-113.158 260.266-260.266 260.266zM653.449 326.122c5.659-5.659 5.659-16.973 0-28.29l-33.949-33.949c-5.659-5.659-16.973-5.659-28.29 0l-79.212 79.212-79.212-79.212c-5.659-5.659-16.973-5.659-28.29 0l-33.949 33.949c-5.659 5.659-5.659 16.973 0 28.29l84.871 79.212-79.212 79.212c-5.659 5.659-5.659 16.973 0 28.29l33.949 33.949c5.659 5.659 16.973 5.659 28.29 0l73.554-84.871 79.212 79.212c5.659 5.659 16.973 5.659 28.29 0l33.949-33.949c5.659-5.659 5.659-16.973 0-28.29l-79.212-73.554 79.212-79.212z" />
|
|
||||||
<glyph unicode="" glyph-name="window" data-tags="window" d="M203.936 525.135c-5.704-5.704 0-5.704 5.704-5.704l108.394-11.41c5.704 0 11.41 5.704 11.41 11.41l-17.114 102.687c0 5.704-5.704 5.704-5.704 5.704l-102.687-102.687zM272.395 587.89l-62.752 62.752c-5.704 5.704-11.41 5.704-17.114 0l-17.114-22.821c-5.704-5.704-5.704-11.41 0-17.114l62.752-62.752 34.228 39.935zM751.605 622.118c-5.704 5.704-5.704 0-5.704-5.704l-11.41-108.394c0-5.704 5.704-11.41 11.41-11.41l108.394 11.41c5.704 0 5.704 5.704 5.704 5.704l-108.394 108.394zM814.357 547.956l62.752 62.752c5.704 5.704 5.704 11.41 0 17.114l-22.821 22.821c-5.704 5.704-11.41 5.704-17.114 0l-62.752-62.752 39.935-39.935zM848.588 285.533c5.704 5.704 0 5.704-5.704 5.704l-102.687 17.114c-5.704 0-11.41-5.704-11.41-11.41l11.41-108.394c0-5.704 5.704-5.704 5.704-5.704l102.687 102.687zM780.129 222.778l62.752-62.752c5.704-5.704 11.41-5.704 17.114 0l22.821 22.821c5.704 5.704 5.704 11.41 0 17.114l-62.752 62.752-39.935-39.935zM300.919 188.55c5.704-5.704 5.704 0 5.704 5.704l11.41 108.394c0 5.704-5.704 11.41-11.41 11.41l-108.394-11.41c-5.704 0-5.704-5.704-5.704-5.704l108.394-108.394zM238.167 257.009l-62.752-62.752c-5.704-5.704-5.704-11.41 0-17.114l22.821-22.821c5.704-5.704 11.41-5.704 17.114 0l62.752 62.752-39.935 39.935zM352.264 530.842v-239.605h347.998v239.605h-347.998zM654.622 331.171h-262.424v154.032h262.424v-154.032z" />
|
|
||||||
<glyph unicode="" glyph-name="code" data-tags="code" d="M449.641 299.324c6.235-6.235 6.235-12.472 6.235-18.707v-62.359c0-6.235-6.235-6.235-6.235-6.235l-230.728 155.897c-6.235 6.235-6.235 12.472-6.235 18.707v49.886c0 6.235 6.235 12.472 6.235 18.707l230.728 155.897c6.235 6.235 6.235 0 6.235-6.235v-62.359c0-6.235-6.235-12.472-6.235-18.707l-162.134-112.245c-6.235-6.235-6.235-6.235 0-12.472l162.134-99.776zM736.493 405.334c6.235 6.235 6.235 6.235 0 12.472l-155.897 112.245c-6.235 6.235-6.235 12.472-6.235 18.707v62.359c0 6.235 6.235 6.235 6.235 6.235l230.728-155.897c6.235-6.235 6.235-12.472 6.235-18.707v-49.886c0-6.235-6.235-12.472-6.235-18.707l-230.728-155.897c-6.235-6.235-6.235 0-6.235 6.235v62.359c0 6.235 6.235 12.472 6.235 18.707l155.897 99.776z" />
|
|
||||||
<glyph unicode="" glyph-name="download" data-tags="download" d="M358.941 499.524c-11.773 0-17.66-5.887-5.887-17.66l153.059-188.382c5.887-11.773 23.547-11.773 29.433 0l153.059 188.382c5.887 11.773 5.887 17.66-5.887 17.66h-323.782zM576.756 487.75v135.399c0 11.773-11.773 23.547-23.547 23.547h-70.643c-11.773 0-23.547-11.773-23.547-23.547v-141.286h117.739zM653.286 352.351c-5.887 0-17.66-5.887-23.547-11.773l-76.53-94.19c-5.887-5.887-17.66-17.66-23.547-23.547 0 0-5.887-5.887-11.773-5.887s-17.66 11.773-17.66 11.773c-5.887 5.887-17.66 17.66-23.547 23.547l-76.53 94.19c-5.887 5.887-17.66 11.773-23.547 11.773h-123.626c-5.887 0-17.66-5.887-17.66-17.66v-141.286c0-5.887 5.887-17.66 17.66-17.66h529.824c5.887 0 17.66 5.887 17.66 17.66v141.286c0 5.887-5.887 17.66-17.66 17.66l-129.513-5.887zM305.958 240.501c-17.66 0-29.433 11.773-29.433 29.433s11.773 29.433 29.433 29.433c17.66 0 29.433-11.773 29.433-29.433s-11.773-29.433-29.433-29.433v0z" />
|
|
||||||
<glyph unicode="" glyph-name="delete" data-tags="delete" d="M620.266 405.334l134.045 134.045c10.311 10.311 10.311 30.934 0 41.245l-61.866 61.866c-10.311 10.311-30.934 10.311-41.245 0l-134.045-134.045-134.045 134.045c-10.311 10.311-30.934 10.311-41.245 0l-61.866-61.866c-10.311-10.311-10.311-30.934 0-41.245l134.045-134.045-134.045-134.045c-10.311-10.311-10.311-30.934 0-41.245l61.866-61.866c10.311-10.311 30.934-10.311 41.245 0l134.045 134.045 134.045-134.045c10.311-10.311 30.934-10.311 41.245 0l61.866 61.866c10.311 10.311 10.311 30.934 0 41.245l-134.045 134.045z" />
|
|
||||||
<glyph unicode="" glyph-name="edit-image" data-tags="edit-image" d="M300.237 685.638c69.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 127.558c-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="" glyph-name="hourglass" data-tags="hourglass" d="M733.286 53.42c-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 96.633c0 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 515.961c68.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="" glyph-name="plus-icon" data-tags="plus-icon" d="M768 349.014c0-19.323-15.664-34.987-34.987-34.987h-151.040v-151.467c0-19.323-15.664-34.987-34.987-34.987h-69.547c-19.323 0-34.987 15.664-34.987 34.987v151.467h-151.467c-19.323 0-34.987 15.664-34.987 34.987v69.547c0 19.323 15.664 34.987 34.987 34.987h151.467v151.467c0 19.323 15.664 34.987 34.987 34.987h69.547c19.323 0 34.987-15.664 34.987-34.987v-151.467h151.467c19.323 0 34.987-15.664 34.987-34.987z" />
|
|
||||||
<glyph unicode="" glyph-name="video-upload-icon" data-tags="video-upload-icon" d="M384 392.534v-128c0-21.333 21.333-42.667 42.667-42.667h128c21.333 0 42.667 17.067 42.667 42.667v128c0 21.333-17.067 42.667-42.667 42.667h-128c-21.333 0-42.667-17.067-42.667-42.667zM785.067 563.2l-102.4 106.667c-12.8 12.8-38.4 21.333-55.467 21.333h-140.8l21.333-42.667h89.6v-136.533c0-17.067 12.8-29.867 29.867-29.867h140.8v-341.333h-426.667v328.533h-42.667v-341.333c0-17.067 12.8-29.867 29.867-29.867h448c17.067 0 29.867 12.8 29.867 29.867v384c4.267 17.067-8.533 38.4-21.333 51.2zM640 520.534v123.733c4.267 0 12.8-4.267 12.8-8.533l102.4-102.4c4.267-4.267 4.267-8.533 8.533-12.8h-123.733zM725.333 230.4v196.267c0 4.267-4.267 8.533-8.533 8.533s-8.533 0-12.8-4.267l-89.6-89.6v-29.867l89.6-89.6c8.533-4.267 8.533 0 12.8 0 4.267 4.267 8.533 4.267 8.533 8.533zM349.867 537.6v136.533l59.733-59.733c8.533-8.533 17.067-4.267 25.6 0l12.8 12.8c8.533 8.533 8.533 17.067 0 25.6l-115.2 106.667c-8.533 8.533-17.067 8.533-21.333 0l-115.2-110.933c-4.267-8.533-4.267-17.067 0-25.6l12.8-12.8c8.533-8.533 17.067-8.533 21.333 0l59.733 59.733v-136.533c0-8.533 8.533-17.067 17.067-17.067h25.6c0 0 17.067 8.533 17.067 21.333z" />
|
|
||||||
<glyph unicode="" glyph-name="play-icon" data-tags="play-icon" d="M392.533 661.334c81.067 46.933 187.733 46.933 273.067 0 42.667-25.6 72.533-55.467 98.133-98.133 72.533-128 29.867-294.4-98.133-371.2-128-72.533-294.4-29.867-371.2 98.133-46.933 81.067-46.933 187.733 0 273.067 21.333 42.667 55.467 72.533 98.133 98.133zM661.333 409.6c12.8 8.533 12.8 29.867 0 38.4l-192 110.933c-8.533 4.267-12.8 4.267-21.333 0s-12.8-12.8-12.8-21.333v-226.133c0-8.533 4.267-17.067 12.8-21.333s17.067-4.267 21.333 0l192 119.467z" />
|
|
||||||
<glyph unicode="" glyph-name="examples-icon" data-tags="examples-icon" d="M213.333 230.401c89.6 38.4 183.467 68.267 273.067 17.067v281.6c-68.267 46.933-157.867 55.467-234.667 12.8l-38.4-311.467zM810.667 230.401l-42.667 315.733c-72.533 38.4-166.4 34.133-234.667-17.067v-285.867c93.867 51.2 187.733 21.333 277.333-12.8zM832 584.534c-51.2 29.867-110.933 46.933-170.667 55.467-51.2 0-102.4-8.533-149.333-29.867-46.933 21.333-98.133 29.867-149.333 29.867-59.733-4.267-119.467-25.6-170.667-55.467l-64-452.267c0 0 29.867-17.067 110.933 21.333 46.933 25.6 102.4 34.133 157.867 25.6 42.667-4.267 85.333-21.333 115.2-55.467v0c29.867 34.133 72.533 51.2 115.2 55.467 55.467 4.267 106.667-4.267 157.867-29.867 81.067-38.4 110.933-21.333 110.933-21.333l-64 456.533zM793.6 179.201c-42.667 21.333-89.6 34.133-140.8 34.133-8.533 0-21.333 0-29.867 0-42.667-4.267-81.067-17.067-115.2-42.667-34.133 25.6-72.533 38.4-115.2 42.667-12.8 0-21.333 0-34.133 0-46.933 0-93.867-8.533-136.533-29.867-21.333-12.8-46.933-21.333-72.533-25.6l64 413.867c46.933 25.6 98.133 38.4 149.333 42.667 46.933 0 93.867-8.533 136.533-25.6l12.8-8.533 12.8 4.267c42.667 17.067 89.6 25.6 136.533 25.6 51.2-4.267 102.4-17.067 149.333-42.667l59.733-418.133c-29.867 8.533-51.2 17.067-76.8 29.867z" />
|
|
||||||
<glyph unicode="" glyph-name="tutorials-icon" data-tags="tutorials-icon" d="M887.467 494.934l-375.467-110.933h-4.267l-217.6 68.267c-21.333-25.6-34.133-59.733-34.133-98.133 21.333-12.8 25.6-38.4 12.8-59.733-4.267-4.267-8.533-8.533-12.8-12.8l17.067-145.067c0-4.267 0-4.267-4.267-8.533 0 0 0 0-4.267 0h-64c-4.267 0-4.267 0-8.533 4.267 0 4.267-4.267 4.267-4.267 8.533l17.067 145.067c-12.8 8.533-17.067 21.333-17.067 34.133 0 17.067 8.533 29.867 21.333 38.4 0 38.4 12.8 76.8 34.133 110.933l-106.667 29.867c-8.533 4.267-8.533 8.533-8.533 17.067 0 4.267 4.267 4.267 4.267 4.267l375.467 119.467h4.267l375.467-123.733c4.267 0 8.533-4.267 8.533-8.533s-4.267-8.533-8.533-12.8zM725.333 298.668c4.267-46.933-93.867-85.333-213.333-85.333s-213.333 38.4-213.333 85.333l4.267 106.667 192-64c4.267 0 12.8 0 17.067 0s12.8 0 17.067 4.267l192 59.733 4.267-106.667z" />
|
|
||||||
<glyph unicode="" glyph-name="info-important-description" data-tags="info-important-description" d="M512 761.367c-188.5 0-341.3-152.8-341.3-341.3s152.8-341.4 341.3-341.4 341.3 152.8 341.3 341.3-152.8 341.4-341.3 341.4v0zM512 107.267c-172.7 0-312.7 140-312.7 312.7s140 312.7 312.7 312.7c172.7 0 312.7-140 312.7-312.7-0.2-172.6-140.1-312.5-312.7-312.7v0zM512 669.567c-137.9 0-249.6-111.8-249.6-249.6s111.7-249.6 249.6-249.6 249.6 111.8 249.6 249.6-111.8 249.6-249.6 249.6v0z" />
|
|
||||||
<glyph unicode="" glyph-name="icon-info" data-tags="icon-info" d="M467.2 523.521h87.467c0.028 0 0.062 0 0.095 0 6.056 0 11.499 2.629 15.248 6.808 3.979 4.15 6.419 9.769 6.419 15.957 0 0.097-0.001 0.194-0.002 0.29v70.385c0.001 0.082 0.002 0.179 0.002 0.276 0 6.188-2.44 11.806-6.409 15.946-3.759 4.19-9.201 6.819-15.257 6.819-0.033 0-0.067 0-0.1 0h-87.462c-0.028 0-0.062 0-0.095 0-6.056 0-11.499-2.629-15.248-6.808-3.979-4.15-6.419-9.769-6.419-15.957 0-0.097 0.001-0.194 0.002-0.29v-69.959c-0.001-0.082-0.002-0.179-0.002-0.276 0-6.188 2.44-11.806 6.409-15.946 3.715-4.373 9.2-7.159 15.338-7.245zM597.333 220.588h-22.187v209.92c0.001 0.082 0.002 0.179 0.002 0.276 0 6.188-2.44 11.806-6.409 15.946-3.759 4.19-9.201 6.819-15.257 6.819-0.033 0-0.067 0-0.1 0h-130.128c-0.028 0-0.062 0-0.095 0-6.056 0-11.499-2.629-15.248-6.808-3.979-4.15-6.419-9.769-6.419-15.957 0-0.097 0.001-0.194 0.002-0.29v-46.492c-0.001-0.082-0.002-0.179-0.002-0.276 0-6.188 2.44-11.806 6.409-15.946 3.759-4.19 9.201-6.819 15.257-6.819 0.033 0 0.067 0 0.1 0h22.182v-139.947h-22.187c-0.028 0-0.062 0-0.095 0-6.056 0-11.499-2.629-15.248-6.808-3.979-4.15-6.419-9.769-6.419-15.957 0-0.097 0.001-0.194 0.002-0.29v-46.492c-0.001-0.082-0.002-0.179-0.002-0.276 0-6.188 2.44-11.806 6.409-15.946 3.759-4.19 9.201-6.819 15.257-6.819 0.033 0 0.067 0 0.1 0h174.075c0.028 0 0.062 0 0.095 0 6.056 0 11.499 2.629 15.248 6.808 3.979 4.15 6.419 9.769 6.419 15.957 0 0.097-0.001 0.194-0.002 0.29v46.065c0.043 0.527 0.067 1.141 0.067 1.761 0 5.302-1.791 10.185-4.8 14.079-3.742 4.424-9.36 7.247-15.636 7.247-0.489 0-0.975-0.017-1.456-0.051z" />
|
|
||||||
</font></defs></svg>
|
|
Before Width: | Height: | Size: 23 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,54 @@
|
||||||
|
<?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-core-18",
|
||||||
|
"description": "Font generated by IcoMoon.",
|
||||||
|
"majorVersion": 1,
|
||||||
|
"minorVersion": 1,
|
||||||
|
"version": "Version 1.1",
|
||||||
|
"fontId": "h5p-core-18",
|
||||||
|
"psName": "h5p-core-18",
|
||||||
|
"subFamily": "Regular",
|
||||||
|
"fullName": "h5p-core-18"
|
||||||
|
}
|
||||||
|
]]>
|
||||||
|
</json>
|
||||||
|
</metadata>
|
||||||
|
<defs>
|
||||||
|
<font id="h5p-core-18" horiz-adv-x="1024">
|
||||||
|
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
||||||
|
<missing-glyph horiz-adv-x="1024" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="512" d="" />
|
||||||
|
<glyph unicode="" glyph-name="arrow-down" data-tags="arrow-down" d="M234 432.335h556l-278-278z" />
|
||||||
|
<glyph unicode="" glyph-name="arrow-left" data-tags="arrow-left" d="M381 31.335v524l262-262z" />
|
||||||
|
<glyph unicode="" glyph-name="colapse" data-tags="colapse" d="M512 490.002l256-256-60-60-196 196-196-196-60 60z" />
|
||||||
|
<glyph unicode="" glyph-name="expand" data-tags="expand" d="M708 466.002l60-60-256-256-256 256 60 60 196-196z" />
|
||||||
|
<glyph unicode="" glyph-name="move" data-tags="move" d="M386.662 767.729h71.27v-71.27h-71.27v71.27zM566.067 767.729h71.27v-71.27h-71.27v71.27zM386.662 611.466h71.27v-71.27h-71.27v71.27zM566.067 611.466h71.27v-71.27h-71.27v71.27zM386.662 455.101h71.27v-71.27h-71.27v71.27zM566.067 455.101h71.27v-71.27h-71.27v71.27zM386.662 298.839h71.27v-71.27h-71.27v71.27zM566.067 298.839h71.27v-71.27h-71.27v71.27zM386.662 142.474h71.27v-71.27h-71.27v71.27zM566.067 142.474h71.27v-71.27h-71.27v71.27zM386.662-13.788h71.27v-71.27h-71.27v71.27zM566.067-13.788h71.27v-71.27h-71.27v71.27z" />
|
||||||
|
<glyph unicode="" glyph-name="check-mark" data-tags="check-mark" d="M454.299 288.59l-116.917 116.917-84.781-84.707 201.696-201.697 317.097 317.097-84.781 84.706z" />
|
||||||
|
<glyph unicode="" glyph-name="arrow-up-circle" data-tags="arrow-up-circle" d="M512 648.723c-148.616 0-264.722-120.75-260.077-269.367 0-125.395 88.241-232.212 208.991-255.434v213.636h-92.885c-13.933 0-13.933 9.288-9.288 18.577l139.327 171.838c4.645 9.288 13.933 9.288 23.221 4.645 0 0 4.645-4.645 4.645-4.645l139.327-171.838c9.288-9.288 4.645-18.577-9.288-18.577h-92.885v-213.636c143.972 32.51 232.212 171.838 199.703 315.808-23.221 120.75-130.039 204.347-250.789 208.991z" />
|
||||||
|
<glyph unicode="" glyph-name="info-circle" data-tags="info-circle" d="M512 644.267c-144.077 0-260.266-116.191-260.266-260.266s116.191-260.266 260.266-260.266 260.266 116.191 260.266 260.266v0c0 139.429-116.191 255.619-260.266 260.266zM470.171 593.144h88.305v-69.714h-88.305v69.714zM600.305 202.744h-181.257v51.123h51.123v162.666h-51.123v51.123h139.429v-218.438h46.477l-4.648-46.477z" />
|
||||||
|
<glyph unicode="" glyph-name="search" data-tags="search" d="M772.098 168.176l-110.68 110.68c71.943 99.612 49.806 243.494-49.806 315.437s-243.494 44.27-315.437-55.339c-71.943-99.612-49.806-243.494 49.806-315.437 77.475-55.339 182.623-55.339 260.098 0l110.68-110.68c5.533-5.533 11.068-5.533 16.601 0 0 0 0 0 0 0l33.205 33.205c11.068 5.533 11.068 16.601 5.533 22.137 0 0 0 0 0 0zM478.795 245.651c-88.544 0-160.486 71.943-160.486 160.486s71.943 160.486 160.486 160.486 160.486-71.943 160.486-160.486-71.943-160.486-160.486-160.486v0z" />
|
||||||
|
<glyph unicode="" glyph-name="fullscreen" data-tags="fullscreen" d="M368.55 533.187c5.737 5.737 0 5.737-5.737 5.737l-103.284 11.476c-5.737 5.737-11.476 0-11.476-5.737l11.476-109.021c0-5.737 5.737-5.737 5.737-5.737l103.284 103.284zM293.959 470.069l63.118-63.118c5.737-5.737 11.476-5.737 17.213 0l22.953 22.953c5.737 5.737 5.737 11.476 0 17.213l-63.118 57.379-40.166-34.429zM787.42 429.903c5.737-5.737 5.737 0 5.737 5.737l11.476 109.021c0 5.737-5.737 11.476-11.476 11.476l-109.021-11.476c-5.737 0-5.737-5.737-5.737-5.737l109.021-109.021zM724.305 504.498l-63.118-63.118c-5.737-5.737-5.737-11.476 0-17.213l22.953-22.953c5.737-5.737 11.476-5.737 17.213 0l63.118 63.118-40.166 40.166zM689.876 223.338c-5.737-5.737 0-5.737 5.737-5.737l109.021-11.476c5.737 0 11.476 5.737 11.476 11.476l-17.213 103.284c0 5.737-5.737 5.737-5.737 5.737l-103.284-103.284zM758.731 292.193l-63.118 63.118c-5.737 5.737-11.476 5.737-17.213 0l-22.953-22.953c-5.737-5.737-5.737-11.476 0-17.213l63.118-63.118 40.166 40.166zM265.269 326.622c-5.737 5.737-5.737 0-5.737-5.737l-11.476-109.021c0-5.737 5.737-11.476 11.476-11.476l109.021 11.476c5.737 0 5.737 5.737 5.737 5.737l-109.021 109.021zM334.124 252.028l63.118 63.118c5.737 5.737 5.737 11.476 0 17.213l-22.953 22.953c-5.737 5.737-11.476 5.737-17.213 0l-63.118-63.118 40.166-40.166zM161.985 636.471v-499.201h722.979v499.201h-722.979zM844.799 177.436h-636.911v413.13h636.911v-413.13z" />
|
||||||
|
<glyph unicode="" glyph-name="h5p" data-tags="h5p" d="M934.072 531.858c-22.319 16.738-50.216 27.897-89.273 27.897h-139.487v-66.954h-156.225l-11.159-55.795c11.159 5.579 27.897 11.159 39.057 11.159s22.319 0 33.476 0c33.476 0 66.954-11.159 89.273-33.476s33.476-50.216 33.476-83.692c0-22.319-5.579-44.635-16.738-66.954s-27.897-39.057-50.216-50.216c-5.579-5.579-16.738 0-22.319-11.159h117.17v133.908h66.954c44.635 0 78.113 11.159 100.43 27.897 22.319 22.319 33.476 50.216 33.476 83.692 0 39.057-11.159 66.954-27.897 83.692v0zM839.221 420.269c-11.159-5.579-22.319-11.159-44.635-11.159h-33.476v83.692h39.057c22.319 0 33.476-5.579 44.635-11.159 5.579-5.579 11.159-16.738 11.159-27.897 0-16.738-5.579-27.897-16.738-33.476v0zM565.826 381.212c-16.738 0-33.476-11.159-44.635-27.897l-94.851 16.738 44.635 195.281h-94.851v-150.646h-117.17v150.646h-111.589v-362.667h111.589v133.908h117.17v-133.908h139.487c-16.738 11.159-33.476 11.159-44.635 22.319s-22.319 22.319-27.897 33.476c-5.579 11.159-11.159 22.319-16.738 39.057l94.851 16.738c5.579-16.738 22.319-27.897 44.635-27.897 27.897 0 50.216 22.319 50.216 50.216 0 22.319-22.319 44.635-50.216 44.635v0z" />
|
||||||
|
<glyph unicode="" glyph-name="rights-of-use" data-tags="rights-of-use" d="M899.611 372.185c0-5.907 0-5.907 0-5.907-23.631-23.631-47.261-35.448-76.799-41.355-11.813 0-23.631-5.907-35.448-5.907s-17.724 0-29.537 0c0 0-5.907 0-5.907 5.907-64.985 59.079-135.877 118.153-200.863 183.139 0 0-5.907 0-5.907 0-23.631-5.907-47.261-11.813-70.892-17.724s-53.168 0-76.799 11.813c-17.724 11.813-23.631 17.724-29.537 35.448-5.907 5.907 0 23.631 11.813 23.631 41.355 11.813 88.616 29.537 129.971 47.261 11.813 5.907 29.537 5.907 41.355 5.907 5.907 0 11.813-5.907 11.813-5.907 41.355-17.724 82.709-29.537 124.060-47.261 0 0 5.907 0 5.907 0 29.537 5.907 64.985 17.724 94.523 23.631 5.907 0 5.907 0 5.907 0l106.34-212.676zM291.12 378.095c17.724 11.813 35.448 5.907 53.168-11.813 11.813-11.813 11.813-29.537 5.907-47.261 17.724 5.907 35.448-5.907 41.355-17.724 11.813-17.724 5.907-35.448-5.907-47.261 5.907 0 11.813 0 17.724 0 11.813-5.907 23.631-11.813 29.537-29.537s0-29.537-5.907-35.448c-5.907-5.907-11.813-11.813-17.724-17.724s-11.813-11.813-17.724-17.724-35.448-17.724-53.168 0c-29.537 29.537-53.168 64.985-82.709 94.523-17.724 23.631-35.448 41.355-47.261 64.985-5.907 11.813-11.813 17.724-11.813 29.537 0 5.907 0 17.724 5.907 23.631 11.813 11.813 17.724 17.724 29.537 29.537 17.724 17.724 47.261 11.813 64.985-5.907-5.907 0-5.907-5.907-5.907-11.813v0zM438.811 171.326l29.537-29.537c17.724-17.724 47.261-11.813 59.079 5.907l-5.907 5.907c-23.631 23.631-47.261 47.261-70.892 70.892-5.907 5.907-5.907 5.907-5.907 11.813s5.907 5.907 11.813 11.813c5.907 0 11.813 0 11.813-5.907 11.813-11.813 29.537-29.537 47.261-47.261 11.813-11.813 29.537-29.537 47.261-47.261 5.907-11.813 17.724-11.813 29.537-11.813 11.813 5.907 23.631 11.813 29.537 23.631 0 5.907 0 5.907 0 5.907-41.355 41.355-88.616 82.709-129.971 129.971-5.907 5.907-5.907 5.907-5.907 11.813 0 11.813 11.813 11.813 23.631 5.907 0 0 5.907 0 5.907-5.907 41.355-41.355 88.616-88.616 129.971-129.971 5.907-5.907 5.907-5.907 5.907-5.907 17.724 0 35.448 17.724 35.448 35.448 0 5.907 0 5.907 0 5.907-47.261 47.261-100.429 100.429-147.691 147.691-5.907 5.907-5.907 5.907-5.907 11.813s5.907 11.813 5.907 11.813c5.907 0 11.813 0 11.813-5.907 5.907-5.907 5.907-5.907 11.813-11.813 35.448-35.448 70.892-70.892 106.34-106.34 11.813-11.813 23.631-23.631 29.537-29.537 0 0 5.907-5.907 5.907 0 23.631 5.907 35.448 29.537 29.537 53.168h35.448c0 0 0 0 0 0 0-5.907 0-17.724 0-23.631-5.907-29.537-23.631-47.261-53.168-59.079 0 0-5.907 0-5.907-5.907-11.813-29.537-35.448-53.168-64.985-53.168-5.907 0-5.907 0-5.907-5.907-17.724-35.448-59.079-47.261-88.616-35.448-5.907 0-11.813 5.907-11.813 5.907-5.907-5.907-11.813-11.813-23.631-17.724-29.537-11.813-59.079-5.907-76.799 11.813-11.813 11.813-17.724 17.724-29.537 29.537 17.724 23.631 23.631 29.537 29.537 41.355v0 0zM273.396 685.294c29.537-11.813 64.985-23.631 94.523-29.537 35.448-11.813 64.985-23.631 100.429-29.537 0 0 0 0 5.907 0-17.724-5.907-35.448-11.813-47.261-17.724 0 0-5.907 0-5.907 0-47.261 11.813-94.523 23.631-135.877 41.355-5.907 0-5.907 0-5.907 0l-76.799-183.139c0-11.813 5.907-17.724 11.813-23.631s5.907-5.907 5.907-11.813c-5.907-5.907-11.813-17.724-23.631-23.631-17.724 17.724-29.537 35.448-29.537 64.985l88.616 212.676c-5.907-11.813 5.907 5.907 17.724 0v0z" />
|
||||||
|
<glyph unicode="" glyph-name="delete-circle" data-tags="delete-circle" d="M512 644.267c-147.107 0-260.266-118.817-260.266-260.266s118.817-260.266 260.266-260.266 260.266 118.817 260.266 260.266-113.158 260.266-260.266 260.266zM653.449 304.789c5.659-5.659 5.659-16.973 0-28.29l-33.949-33.949c-5.659-5.659-16.973-5.659-28.29 0l-79.212 79.212-79.212-79.212c-5.659-5.659-16.973-5.659-28.29 0l-33.949 33.949c-5.659 5.659-5.659 16.973 0 28.29l84.871 79.212-79.212 79.212c-5.659 5.659-5.659 16.973 0 28.29l33.949 33.949c5.659 5.659 16.973 5.659 28.29 0l73.554-84.871 79.212 79.212c5.659 5.659 16.973 5.659 28.29 0l33.949-33.949c5.659-5.659 5.659-16.973 0-28.29l-79.212-73.554 79.212-79.212z" />
|
||||||
|
<glyph unicode="" glyph-name="window" data-tags="window" d="M203.936 503.802c-5.704-5.704 0-5.704 5.704-5.704l108.394-11.41c5.704 0 11.41 5.704 11.41 11.41l-17.114 102.687c0 5.704-5.704 5.704-5.704 5.704l-102.687-102.687zM272.395 566.557l-62.752 62.752c-5.704 5.704-11.41 5.704-17.114 0l-17.114-22.821c-5.704-5.704-5.704-11.41 0-17.114l62.752-62.752 34.228 39.935zM751.605 600.785c-5.704 5.704-5.704 0-5.704-5.704l-11.41-108.394c0-5.704 5.704-11.41 11.41-11.41l108.394 11.41c5.704 0 5.704 5.704 5.704 5.704l-108.394 108.394zM814.357 526.623l62.752 62.752c5.704 5.704 5.704 11.41 0 17.114l-22.821 22.821c-5.704 5.704-11.41 5.704-17.114 0l-62.752-62.752 39.935-39.935zM848.588 264.2c5.704 5.704 0 5.704-5.704 5.704l-102.687 17.114c-5.704 0-11.41-5.704-11.41-11.41l11.41-108.394c0-5.704 5.704-5.704 5.704-5.704l102.687 102.687zM780.129 201.445l62.752-62.752c5.704-5.704 11.41-5.704 17.114 0l22.821 22.821c5.704 5.704 5.704 11.41 0 17.114l-62.752 62.752-39.935-39.935zM300.919 167.217c5.704-5.704 5.704 0 5.704 5.704l11.41 108.394c0 5.704-5.704 11.41-11.41 11.41l-108.394-11.41c-5.704 0-5.704-5.704-5.704-5.704l108.394-108.394zM238.167 235.676l-62.752-62.752c-5.704-5.704-5.704-11.41 0-17.114l22.821-22.821c5.704-5.704 11.41-5.704 17.114 0l62.752 62.752-39.935 39.935zM352.264 509.509v-239.605h347.998v239.605h-347.998zM654.622 309.838h-262.424v154.032h262.424v-154.032z" />
|
||||||
|
<glyph unicode="" glyph-name="code" data-tags="code" d="M449.641 277.991c6.235-6.235 6.235-12.472 6.235-18.707v-62.359c0-6.235-6.235-6.235-6.235-6.235l-230.728 155.897c-6.235 6.235-6.235 12.472-6.235 18.707v49.886c0 6.235 6.235 12.472 6.235 18.707l230.728 155.897c6.235 6.235 6.235 0 6.235-6.235v-62.359c0-6.235-6.235-12.472-6.235-18.707l-162.134-112.245c-6.235-6.235-6.235-6.235 0-12.472l162.134-99.776zM736.493 384.001c6.235 6.235 6.235 6.235 0 12.472l-155.897 112.245c-6.235 6.235-6.235 12.472-6.235 18.707v62.359c0 6.235 6.235 6.235 6.235 6.235l230.728-155.897c6.235-6.235 6.235-12.472 6.235-18.707v-49.886c0-6.235-6.235-12.472-6.235-18.707l-230.728-155.897c-6.235-6.235-6.235 0-6.235 6.235v62.359c0 6.235 6.235 12.472 6.235 18.707l155.897 99.776z" />
|
||||||
|
<glyph unicode="" glyph-name="download" data-tags="download" d="M358.941 478.191c-11.773 0-17.66-5.887-5.887-17.66l153.059-188.382c5.887-11.773 23.547-11.773 29.433 0l153.059 188.382c5.887 11.773 5.887 17.66-5.887 17.66h-323.782zM576.756 466.417v135.399c0 11.773-11.773 23.547-23.547 23.547h-70.643c-11.773 0-23.547-11.773-23.547-23.547v-141.286h117.739zM653.286 331.018c-5.887 0-17.66-5.887-23.547-11.773l-76.53-94.19c-5.887-5.887-17.66-17.66-23.547-23.547 0 0-5.887-5.887-11.773-5.887s-17.66 11.773-17.66 11.773c-5.887 5.887-17.66 17.66-23.547 23.547l-76.53 94.19c-5.887 5.887-17.66 11.773-23.547 11.773h-123.626c-5.887 0-17.66-5.887-17.66-17.66v-141.286c0-5.887 5.887-17.66 17.66-17.66h529.824c5.887 0 17.66 5.887 17.66 17.66v141.286c0 5.887-5.887 17.66-17.66 17.66l-129.513-5.887zM305.958 219.168c-17.66 0-29.433 11.773-29.433 29.433s11.773 29.433 29.433 29.433c17.66 0 29.433-11.773 29.433-29.433s-11.773-29.433-29.433-29.433v0z" />
|
||||||
|
<glyph unicode="" glyph-name="delete" data-tags="delete" d="M620.266 384.001l134.045 134.045c10.311 10.311 10.311 30.934 0 41.245l-61.866 61.866c-10.311 10.311-30.934 10.311-41.245 0l-134.045-134.045-134.045 134.045c-10.311 10.311-30.934 10.311-41.245 0l-61.866-61.866c-10.311-10.311-10.311-30.934 0-41.245l134.045-134.045-134.045-134.045c-10.311-10.311-10.311-30.934 0-41.245l61.866-61.866c10.311-10.311 30.934-10.311 41.245 0l134.045 134.045 134.045-134.045c10.311-10.311 30.934-10.311 41.245 0l61.866 61.866c10.311 10.311 10.311 30.934 0 41.245l-134.045 134.045z" />
|
||||||
|
<glyph unicode="" glyph-name="edit-image" data-tags="edit-image" d="M300.237 664.305c69.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 106.225c-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="" glyph-name="hourglass" data-tags="hourglass" d="M733.286 32.087c-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 75.3c0 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 494.628c68.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="" glyph-name="plus-icon" data-tags="plus-icon" d="M768 327.681c0-19.323-15.664-34.987-34.987-34.987h-151.040v-151.467c0-19.323-15.664-34.987-34.987-34.987h-69.547c-19.323 0-34.987 15.664-34.987 34.987v151.467h-151.467c-19.323 0-34.987 15.664-34.987 34.987v69.547c0 19.323 15.664 34.987 34.987 34.987h151.467v151.467c0 19.323 15.664 34.987 34.987 34.987h69.547c19.323 0 34.987-15.664 34.987-34.987v-151.467h151.467c19.323 0 34.987-15.664 34.987-34.987z" />
|
||||||
|
<glyph unicode="" glyph-name="video-upload-icon" data-tags="video-upload-icon" d="M384 371.201v-128c0-21.333 21.333-42.667 42.667-42.667h128c21.333 0 42.667 17.067 42.667 42.667v128c0 21.333-17.067 42.667-42.667 42.667h-128c-21.333 0-42.667-17.067-42.667-42.667zM785.067 541.867l-102.4 106.667c-12.8 12.8-38.4 21.333-55.467 21.333h-140.8l21.333-42.667h89.6v-136.533c0-17.067 12.8-29.867 29.867-29.867h140.8v-341.333h-426.667v328.533h-42.667v-341.333c0-17.067 12.8-29.867 29.867-29.867h448c17.067 0 29.867 12.8 29.867 29.867v384c4.267 17.067-8.533 38.4-21.333 51.2zM640 499.201v123.733c4.267 0 12.8-4.267 12.8-8.533l102.4-102.4c4.267-4.267 4.267-8.533 8.533-12.8h-123.733zM725.333 209.067v196.267c0 4.267-4.267 8.533-8.533 8.533s-8.533 0-12.8-4.267l-89.6-89.6v-29.867l89.6-89.6c8.533-4.267 8.533 0 12.8 0 4.267 4.267 8.533 4.267 8.533 8.533zM349.867 516.267v136.533l59.733-59.733c8.533-8.533 17.067-4.267 25.6 0l12.8 12.8c8.533 8.533 8.533 17.067 0 25.6l-115.2 106.667c-8.533 8.533-17.067 8.533-21.333 0l-115.2-110.933c-4.267-8.533-4.267-17.067 0-25.6l12.8-12.8c8.533-8.533 17.067-8.533 21.333 0l59.733 59.733v-136.533c0-8.533 8.533-17.067 17.067-17.067h25.6c0 0 17.067 8.533 17.067 21.333z" />
|
||||||
|
<glyph unicode="" glyph-name="play-icon" data-tags="play-icon" d="M392.533 640.001c81.067 46.933 187.733 46.933 273.067 0 42.667-25.6 72.533-55.467 98.133-98.133 72.533-128 29.867-294.4-98.133-371.2-128-72.533-294.4-29.867-371.2 98.133-46.933 81.067-46.933 187.733 0 273.067 21.333 42.667 55.467 72.533 98.133 98.133zM661.333 388.267c12.8 8.533 12.8 29.867 0 38.4l-192 110.933c-8.533 4.267-12.8 4.267-21.333 0s-12.8-12.8-12.8-21.333v-226.133c0-8.533 4.267-17.067 12.8-21.333s17.067-4.267 21.333 0l192 119.467z" />
|
||||||
|
<glyph unicode="" glyph-name="copy" data-tags="copy" d="M722.133 603.867h-247.733c-65.867 0-119.2-53.333-119.2-119.2v-288.533c0-65.867 53.333-119.2 119.2-119.2h247.867c65.867 0 119.2 53.333 119.2 119.2v288.533c-0.267 65.867-53.467 119.2-119.333 119.2zM778.533 199.2c0-31.333-25.067-56.4-56.4-56.4h-247.867c-31.333 0-56.4 25.067-56.4 56.4v285.467c0 31.333 25.067 56.4 56.4 56.4h247.733c31.333 0 56.4-25.067 56.4-56.4v-285.467zM245.2 368.667v288.533c0 31.333 25.067 56.4 56.4 56.4h247.733c31.333 0 56.4-25.067 56.4-56.4v-18.8h62.667v18.8c0 65.867-53.333 119.2-119.2 119.2h-247.467c-65.867 0-119.2-53.333-119.2-119.2v-288.533c0-65.867 53.333-119.2 119.2-119.2h18.8v62.667h-18.8c-31.467-3.067-56.533 22-56.533 56.533zM681.2 403.2h-163.067c-18.8 0-31.333 12.533-31.333 31.333s12.533 31.333 31.333 31.333h163.067c18.8 0 31.333-12.533 31.333-31.333s-15.6-31.333-31.333-31.333zM681.2 309.067h-163.067c-18.8 0-31.333 12.533-31.333 31.333s12.533 31.333 31.333 31.333h163.067c18.8 0 31.333-12.533 31.333-31.333s-15.6-31.333-31.333-31.333zM681.2 214.934h-163.067c-18.8 0-31.333 12.533-31.333 31.333s12.533 31.333 31.333 31.333h163.067c18.8 0 31.333-12.533 31.333-31.333s-15.6-31.333-31.333-31.333z" />
|
||||||
|
<glyph unicode="" glyph-name="examples-icon" data-tags="examples-icon" d="M213.333 209.068c89.6 38.4 183.467 68.267 273.067 17.067v281.6c-68.267 46.933-157.867 55.467-234.667 12.8l-38.4-311.467zM810.667 209.068l-42.667 315.733c-72.533 38.4-166.4 34.133-234.667-17.067v-285.867c93.867 51.2 187.733 21.333 277.333-12.8zM832 563.201c-51.2 29.867-110.933 46.933-170.667 55.467-51.2 0-102.4-8.533-149.333-29.867-46.933 21.333-98.133 29.867-149.333 29.867-59.733-4.267-119.467-25.6-170.667-55.467l-64-452.267c0 0 29.867-17.067 110.933 21.333 46.933 25.6 102.4 34.133 157.867 25.6 42.667-4.267 85.333-21.333 115.2-55.467v0c29.867 34.133 72.533 51.2 115.2 55.467 55.467 4.267 106.667-4.267 157.867-29.867 81.067-38.4 110.933-21.333 110.933-21.333l-64 456.533zM793.6 157.868c-42.667 21.333-89.6 34.133-140.8 34.133-8.533 0-21.333 0-29.867 0-42.667-4.267-81.067-17.067-115.2-42.667-34.133 25.6-72.533 38.4-115.2 42.667-12.8 0-21.333 0-34.133 0-46.933 0-93.867-8.533-136.533-29.867-21.333-12.8-46.933-21.333-72.533-25.6l64 413.867c46.933 25.6 98.133 38.4 149.333 42.667 46.933 0 93.867-8.533 136.533-25.6l12.8-8.533 12.8 4.267c42.667 17.067 89.6 25.6 136.533 25.6 51.2-4.267 102.4-17.067 149.333-42.667l59.733-418.133c-29.867 8.533-51.2 17.067-76.8 29.867z" />
|
||||||
|
<glyph unicode="" glyph-name="tutorials-icon" data-tags="tutorials-icon" d="M887.467 473.601l-375.467-110.933h-4.267l-217.6 68.267c-21.333-25.6-34.133-59.733-34.133-98.133 21.333-12.8 25.6-38.4 12.8-59.733-4.267-4.267-8.533-8.533-12.8-12.8l17.067-145.067c0-4.267 0-4.267-4.267-8.533 0 0 0 0-4.267 0h-64c-4.267 0-4.267 0-8.533 4.267 0 4.267-4.267 4.267-4.267 8.533l17.067 145.067c-12.8 8.533-17.067 21.333-17.067 34.133 0 17.067 8.533 29.867 21.333 38.4 0 38.4 12.8 76.8 34.133 110.933l-106.667 29.867c-8.533 4.267-8.533 8.533-8.533 17.067 0 4.267 4.267 4.267 4.267 4.267l375.467 119.467h4.267l375.467-123.733c4.267 0 8.533-4.267 8.533-8.533s-4.267-8.533-8.533-12.8zM725.333 277.335c4.267-46.933-93.867-85.333-213.333-85.333s-213.333 38.4-213.333 85.333l4.267 106.667 192-64c4.267 0 12.8 0 17.067 0s12.8 0 17.067 4.267l192 59.733 4.267-106.667z" />
|
||||||
|
<glyph unicode="" glyph-name="info-important-description" data-tags="info-important-description" d="M512 740.034c-188.5 0-341.3-152.8-341.3-341.3s152.8-341.4 341.3-341.4 341.3 152.8 341.3 341.3-152.8 341.4-341.3 341.4v0zM512 85.934c-172.7 0-312.7 140-312.7 312.7s140 312.7 312.7 312.7c172.7 0 312.7-140 312.7-312.7-0.2-172.6-140.1-312.5-312.7-312.7v0zM512 648.234c-137.9 0-249.6-111.8-249.6-249.6s111.7-249.6 249.6-249.6 249.6 111.8 249.6 249.6-111.8 249.6-249.6 249.6v0z" />
|
||||||
|
<glyph unicode="" glyph-name="icon-info" data-tags="icon-info" d="M467.2 502.188h87.467c0.028 0 0.062 0 0.095 0 6.056 0 11.499 2.629 15.248 6.808 3.979 4.15 6.419 9.769 6.419 15.957 0 0.097-0.001 0.194-0.002 0.29v70.385c0.001 0.082 0.002 0.179 0.002 0.276 0 6.188-2.44 11.806-6.409 15.946-3.759 4.19-9.201 6.819-15.257 6.819-0.033 0-0.067 0-0.1 0h-87.462c-0.028 0-0.062 0-0.095 0-6.056 0-11.499-2.629-15.248-6.808-3.979-4.15-6.419-9.769-6.419-15.957 0-0.097 0.001-0.194 0.002-0.29v-69.959c-0.001-0.082-0.002-0.179-0.002-0.276 0-6.188 2.44-11.806 6.409-15.946 3.715-4.373 9.2-7.159 15.338-7.245zM597.333 199.255h-22.187v209.92c0.001 0.082 0.002 0.179 0.002 0.276 0 6.188-2.44 11.806-6.409 15.946-3.759 4.19-9.201 6.819-15.257 6.819-0.033 0-0.067 0-0.1 0h-130.128c-0.028 0-0.062 0-0.095 0-6.056 0-11.499-2.629-15.248-6.808-3.979-4.15-6.419-9.769-6.419-15.957 0-0.097 0.001-0.194 0.002-0.29v-46.492c-0.001-0.082-0.002-0.179-0.002-0.276 0-6.188 2.44-11.806 6.409-15.946 3.759-4.19 9.201-6.819 15.257-6.819 0.033 0 0.067 0 0.1 0h22.182v-139.947h-22.187c-0.028 0-0.062 0-0.095 0-6.056 0-11.499-2.629-15.248-6.808-3.979-4.15-6.419-9.769-6.419-15.957 0-0.097 0.001-0.194 0.002-0.29v-46.492c-0.001-0.082-0.002-0.179-0.002-0.276 0-6.188 2.44-11.806 6.409-15.946 3.759-4.19 9.201-6.819 15.257-6.819 0.033 0 0.067 0 0.1 0h174.075c0.028 0 0.062 0 0.095 0 6.056 0 11.499 2.629 15.248 6.808 3.979 4.15 6.419 9.769 6.419 15.957 0 0.097-0.001 0.194-0.002 0.29v46.065c0.043 0.527 0.067 1.141 0.067 1.761 0 5.302-1.791 10.185-4.8 14.079-3.742 4.424-9.36 7.247-15.636 7.247-0.489 0-0.975-0.017-1.456-0.051z" />
|
||||||
|
<glyph unicode="" glyph-name="paste" data-tags="paste" d="M394.402 745.066h-75.333c-65.867 0-119.2-53.333-119.2-119.2v-288.533c0-56.4 37.6-100.4 87.867-116v69.067c-15.733 9.467-25.067 25.067-25.067 47.067v288.4c0 31.333 25.067 56.4 56.4 56.4h131.733c0 0 0 0 3.2 3.2v0c0 31.333-28.267 59.6-59.6 59.6zM704.802 635.199c0 0-28.267 0-40.8 0-12.533 34.533-43.867 59.6-84.667 59.6s-69.067-25.067-81.6-59.6c-12.533 0-40.8 0-40.8 0-65.867 0-119.2-53.333-119.2-119.2v-288.533c0-65.867 53.333-119.2 119.2-119.2h247.867c65.867 0 119.2 53.333 119.2 119.2v285.467c3.2 65.867-53.2 122.267-119.2 122.267zM582.535 647.866c22 0 40.8-18.8 40.8-40.8s-18.8-40.8-40.8-40.8c-22 0-40.8 18.8-40.8 40.8s15.733 40.8 40.8 40.8zM764.402 224.399c0-31.333-25.067-56.4-56.4-56.4h-250.933c-31.333 0-56.4 25.067-56.4 56.4v288.533c0 18.8 9.467 37.6 25.067 47.067v0c0-43.867 34.533-78.4 78.4-78.4h160c43.867 0 78.4 34.533 78.4 78.4v0c12.533-9.467 22-28.267 22-47.067v-288.533z" />
|
||||||
|
</font></defs></svg>
|
After Width: | Height: | Size: 25 KiB |
Binary file not shown.
Binary file not shown.
|
@ -451,6 +451,19 @@ class H5PDefaultStorage implements \H5PFileStorage {
|
||||||
return self::dirReady($this->path);
|
return self::dirReady($this->path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the file presave.js exists in the root of the library
|
||||||
|
*
|
||||||
|
* @param string $libraryFolder
|
||||||
|
* @param string $developmentPath
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function hasPresave($libraryFolder, $developmentPath = null) {
|
||||||
|
$path = is_null($developmentPath) ? 'libraries' . DIRECTORY_SEPARATOR . $libraryFolder : $developmentPath;
|
||||||
|
$filePath = realpath($this->path . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . 'presave.js');
|
||||||
|
return file_exists($filePath);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recursive function for copying directories.
|
* Recursive function for copying directories.
|
||||||
*
|
*
|
||||||
|
|
|
@ -84,10 +84,19 @@ class H5PDevelopment {
|
||||||
|
|
||||||
// TODO: Validate props? Not really needed, is it? this is a dev site.
|
// TODO: Validate props? Not really needed, is it? this is a dev site.
|
||||||
|
|
||||||
// Save/update library.
|
|
||||||
$library['libraryId'] = $this->h5pF->getLibraryId($library['machineName'], $library['majorVersion'], $library['minorVersion']);
|
$library['libraryId'] = $this->h5pF->getLibraryId($library['machineName'], $library['majorVersion'], $library['minorVersion']);
|
||||||
|
|
||||||
|
// Convert metadataSettings values to boolean & json_encode it before saving
|
||||||
|
$library['metadataSettings'] = isset($library['metadataSettings']) ?
|
||||||
|
H5PMetadata::boolifyAndEncodeSettings($library['metadataSettings']) :
|
||||||
|
NULL;
|
||||||
|
|
||||||
|
// Save/update library.
|
||||||
$this->h5pF->saveLibraryData($library, $library['libraryId'] === FALSE);
|
$this->h5pF->saveLibraryData($library, $library['libraryId'] === FALSE);
|
||||||
|
|
||||||
|
// Need to decode it again, since it is served from here.
|
||||||
|
$library['metadataSettings'] = json_decode($library['metadataSettings']);
|
||||||
|
|
||||||
$library['path'] = 'development/' . $contents[$i];
|
$library['path'] = 'development/' . $contents[$i];
|
||||||
$this->libraries[H5PDevelopment::libraryToString($library['machineName'], $library['majorVersion'], $library['minorVersion'])] = $library;
|
$this->libraries[H5PDevelopment::libraryToString($library['machineName'], $library['majorVersion'], $library['minorVersion'])] = $library;
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,4 +190,13 @@ interface H5PFileStorage {
|
||||||
* @return bool True if server has the proper write access
|
* @return bool True if server has the proper write access
|
||||||
*/
|
*/
|
||||||
public function hasWriteAccess();
|
public function hasWriteAccess();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the library has a presave.js in the root folder
|
||||||
|
*
|
||||||
|
* @param string $libraryName
|
||||||
|
* @param string $developmentPath
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function hasPresave($libraryName, $developmentPath = null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,137 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Utility class for handling metadata
|
||||||
|
*/
|
||||||
|
abstract class H5PMetadata {
|
||||||
|
|
||||||
|
private static $fields = array(
|
||||||
|
'title' => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'maxLength' => 255
|
||||||
|
),
|
||||||
|
'authors' => array(
|
||||||
|
'type' => 'json'
|
||||||
|
),
|
||||||
|
'changes' => array(
|
||||||
|
'type' => 'json'
|
||||||
|
),
|
||||||
|
'source' => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'maxLength' => 255
|
||||||
|
),
|
||||||
|
'license' => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'maxLength' => 32
|
||||||
|
),
|
||||||
|
'licenseVersion' => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'maxLength' => 10
|
||||||
|
),
|
||||||
|
'licenseExtras' => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'maxLength' => 5000
|
||||||
|
),
|
||||||
|
'authorComments' => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'maxLength' => 5000
|
||||||
|
),
|
||||||
|
'yearFrom' => array(
|
||||||
|
'type' => 'int'
|
||||||
|
),
|
||||||
|
'yearTo' => array(
|
||||||
|
'type' => 'int'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JSON encode metadata
|
||||||
|
*
|
||||||
|
* @param object $content
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function toJSON($content) {
|
||||||
|
// Note: deliberatly creating JSON string "manually" to improve performance
|
||||||
|
return
|
||||||
|
'{"title":' . (isset($content->title) ? json_encode($content->title) : 'null') .
|
||||||
|
',"authors":' . (isset($content->authors) ? $content->authors : 'null') .
|
||||||
|
',"source":' . (isset($content->source) ? '"' . $content->source . '"' : 'null') .
|
||||||
|
',"license":' . (isset($content->license) ? '"' . $content->license . '"' : 'null') .
|
||||||
|
',"licenseVersion":' . (isset($content->license_version) ? '"' . $content->license_version . '"' : 'null') .
|
||||||
|
',"licenseExtras":' . (isset($content->license_extras) ? json_encode($content->license_extras) : 'null') .
|
||||||
|
',"yearFrom":' . (isset($content->year_from) ? $content->year_from : 'null') .
|
||||||
|
',"yearTo":' . (isset($content->year_to) ? $content->year_to : 'null') .
|
||||||
|
',"changes":' . (isset($content->changes) ? $content->changes : 'null') .
|
||||||
|
',"authorComments":' . (isset($content->author_comments) ? json_encode($content->author_comments) : 'null') . '}';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make the metadata into an associative array keyed by the property names
|
||||||
|
* @param mixed $metadata Array or object containing metadata
|
||||||
|
* @param bool $include_title
|
||||||
|
* @param array $types
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function toDBArray($metadata, $include_title = true, &$types = array()) {
|
||||||
|
$fields = array();
|
||||||
|
|
||||||
|
if (!is_array($metadata)) {
|
||||||
|
$metadata = (array) $metadata;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (self::$fields as $key => $config) {
|
||||||
|
|
||||||
|
if ($key === 'title' && !$include_title) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($key, $metadata)) {
|
||||||
|
$value = $metadata[$key];
|
||||||
|
$db_field_name = strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $key));
|
||||||
|
|
||||||
|
switch ($config['type']) {
|
||||||
|
case 'text':
|
||||||
|
if ($value !== null && strlen($value) > $config['maxLength']) {
|
||||||
|
$value = mb_substr($value, 0, $config['maxLength']);
|
||||||
|
}
|
||||||
|
$types[] = '%s';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'int':
|
||||||
|
$value = ($value !== null) ? intval($value): null;
|
||||||
|
$types[] = '%d';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'json':
|
||||||
|
$value = ($value !== null) ? json_encode($value) : null;
|
||||||
|
$types[] = '%s';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$fields[$db_field_name] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The metadataSettings field in libraryJson uses 1 for true and 0 for false.
|
||||||
|
* Here we are converting these to booleans, and also doing JSON encoding.
|
||||||
|
* This is invoked before the library data is beeing inserted/updated to DB.
|
||||||
|
*
|
||||||
|
* @param array $metadataSettings
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function boolifyAndEncodeSettings($metadataSettings) {
|
||||||
|
// Convert metadataSettings values to boolean
|
||||||
|
if (isset($metadataSettings['disable'])) {
|
||||||
|
$metadataSettings['disable'] = $metadataSettings['disable'] === 1;
|
||||||
|
}
|
||||||
|
if (isset($metadataSettings['disableExtraTitleField'])) {
|
||||||
|
$metadataSettings['disableExtraTitleField'] = $metadataSettings['disableExtraTitleField'] === 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return json_encode($metadataSettings);
|
||||||
|
}
|
||||||
|
}
|
492
h5p.classes.php
492
h5p.classes.php
|
@ -101,6 +101,21 @@ interface H5PFrameworkInterface {
|
||||||
*/
|
*/
|
||||||
public function getUploadedH5pPath();
|
public function getUploadedH5pPath();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load addon libraries
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function loadAddons();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load config for libraries
|
||||||
|
*
|
||||||
|
* @param array $libraries
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getLibraryConfig($libraries = NULL);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of the current installed libraries
|
* Get a list of the current installed libraries
|
||||||
*
|
*
|
||||||
|
@ -195,6 +210,9 @@ interface H5PFrameworkInterface {
|
||||||
* - minorVersion: The library's minorVersion
|
* - minorVersion: The library's minorVersion
|
||||||
* - patchVersion: The library's patchVersion
|
* - patchVersion: The library's patchVersion
|
||||||
* - runnable: 1 if the library is a content type, 0 otherwise
|
* - runnable: 1 if the library is a content type, 0 otherwise
|
||||||
|
* - metadataSettings: Associative array containing:
|
||||||
|
* - disable: 1 if the library should not support setting metadata (copyright etc)
|
||||||
|
* - disableExtraTitleField: 1 if the library don't need the extra title field
|
||||||
* - fullscreen(optional): 1 if the library supports fullscreen, 0 otherwise
|
* - fullscreen(optional): 1 if the library supports fullscreen, 0 otherwise
|
||||||
* - embedTypes(optional): list of supported embed types
|
* - embedTypes(optional): list of supported embed types
|
||||||
* - preloadedJs(optional): list of associative arrays containing:
|
* - preloadedJs(optional): list of associative arrays containing:
|
||||||
|
@ -620,16 +638,34 @@ class H5PValidator {
|
||||||
|
|
||||||
private $h5pOptional = array(
|
private $h5pOptional = array(
|
||||||
'contentType' => '/^.{1,255}$/',
|
'contentType' => '/^.{1,255}$/',
|
||||||
'author' => '/^.{1,255}$/',
|
|
||||||
'license' => '/^(cc-by|cc-by-sa|cc-by-nd|cc-by-nc|cc-by-nc-sa|cc-by-nc-nd|pd|cr|MIT|GPL1|GPL2|GPL3|MPL|MPL2)$/',
|
|
||||||
'dynamicDependencies' => array(
|
'dynamicDependencies' => array(
|
||||||
'machineName' => '/^[\w0-9\-\.]{1,255}$/i',
|
'machineName' => '/^[\w0-9\-\.]{1,255}$/i',
|
||||||
'majorVersion' => '/^[0-9]{1,5}$/',
|
'majorVersion' => '/^[0-9]{1,5}$/',
|
||||||
'minorVersion' => '/^[0-9]{1,5}$/',
|
'minorVersion' => '/^[0-9]{1,5}$/',
|
||||||
),
|
),
|
||||||
|
// deprecated
|
||||||
|
'author' => '/^.{1,255}$/',
|
||||||
|
'authors' => array(
|
||||||
|
'name' => '/^.{1,255}$/',
|
||||||
|
'role' => '/^\w+$/',
|
||||||
|
),
|
||||||
|
'source' => '/^(http[s]?:\/\/.+)$/',
|
||||||
|
'license' => '/^(CC BY|CC BY-SA|CC BY-ND|CC BY-NC|CC BY-NC-SA|CC BY-NC-ND|CC0 1\.0|GNU GPL|PD|ODC PDDL|CC PDM|U|C)$/',
|
||||||
|
'licenseVersion' => '/^(1\.0|2\.0|2\.5|3\.0|4\.0)$/',
|
||||||
|
'licenseExtras' => '/^.{1,5000}$/',
|
||||||
|
'yearsFrom' => '/^([0-9]{1,4})$/',
|
||||||
|
'yearsTo' => '/^([0-9]{1,4})$/',
|
||||||
|
'changes' => array(
|
||||||
|
'date' => '/^[0-9]{2}-[0-9]{2}-[0-9]{2} [0-9]{1,2}:[0-9]{2}:[0-9]{2}$/',
|
||||||
|
'author' => '/^.{1,255}$/',
|
||||||
|
'log' => '/^.{1,5000}$/'
|
||||||
|
),
|
||||||
|
'authorComments' => '/^.{1,5000}$/',
|
||||||
'w' => '/^[0-9]{1,4}$/',
|
'w' => '/^[0-9]{1,4}$/',
|
||||||
'h' => '/^[0-9]{1,4}$/',
|
'h' => '/^[0-9]{1,4}$/',
|
||||||
|
// deprecated
|
||||||
'metaKeywords' => '/^.{1,}$/',
|
'metaKeywords' => '/^.{1,}$/',
|
||||||
|
// deprecated
|
||||||
'metaDescription' => '/^.{1,}$/',
|
'metaDescription' => '/^.{1,}$/',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -647,6 +683,10 @@ class H5PValidator {
|
||||||
'author' => '/^.{1,255}$/',
|
'author' => '/^.{1,255}$/',
|
||||||
'license' => '/^(cc-by|cc-by-sa|cc-by-nd|cc-by-nc|cc-by-nc-sa|cc-by-nc-nd|pd|cr|MIT|GPL1|GPL2|GPL3|MPL|MPL2)$/',
|
'license' => '/^(cc-by|cc-by-sa|cc-by-nd|cc-by-nc|cc-by-nc-sa|cc-by-nc-nd|pd|cr|MIT|GPL1|GPL2|GPL3|MPL|MPL2)$/',
|
||||||
'description' => '/^.{1,}$/',
|
'description' => '/^.{1,}$/',
|
||||||
|
'metadataSettings' => array(
|
||||||
|
'disable' => '/^(0|1)$/',
|
||||||
|
'disableExtraTitleField' => '/^(0|1)$/'
|
||||||
|
),
|
||||||
'dynamicDependencies' => array(
|
'dynamicDependencies' => array(
|
||||||
'machineName' => '/^[\w0-9\-\.]{1,255}$/i',
|
'machineName' => '/^[\w0-9\-\.]{1,255}$/i',
|
||||||
'majorVersion' => '/^[0-9]{1,5}$/',
|
'majorVersion' => '/^[0-9]{1,5}$/',
|
||||||
|
@ -1405,7 +1445,11 @@ class H5PStorage {
|
||||||
// Indicate that the dependencies of this library should be saved.
|
// Indicate that the dependencies of this library should be saved.
|
||||||
$library['saveDependencies'] = TRUE;
|
$library['saveDependencies'] = TRUE;
|
||||||
|
|
||||||
// Save library meta data
|
// Convert metadataSettings values to boolean & json_encode it before saving
|
||||||
|
$library['metadataSettings'] = isset($library['metadataSettings']) ?
|
||||||
|
H5PMetadata::boolifyAndEncodeSettings($library['metadataSettings']) :
|
||||||
|
NULL;
|
||||||
|
|
||||||
$this->h5pF->saveLibraryData($library, $new);
|
$this->h5pF->saveLibraryData($library, $new);
|
||||||
|
|
||||||
// Save library folder
|
// Save library folder
|
||||||
|
@ -1554,6 +1598,16 @@ Class H5PExport {
|
||||||
$this->h5pC = $H5PCore;
|
$this->h5pC = $H5PCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverts the replace pattern used by the text editor
|
||||||
|
*
|
||||||
|
* @param string $value
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private static function revertH5PEditorTextEscape($value) {
|
||||||
|
return str_replace('<', '<', str_replace('>', '>', str_replace(''', "'", str_replace('"', '"', $value))));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return path to h5p package.
|
* Return path to h5p package.
|
||||||
*
|
*
|
||||||
|
@ -1584,14 +1638,29 @@ Class H5PExport {
|
||||||
// Make embedType into an array
|
// Make embedType into an array
|
||||||
$embedTypes = explode(', ', $content['embedType']);
|
$embedTypes = explode(', ', $content['embedType']);
|
||||||
|
|
||||||
// Build h5p.json
|
// Build h5p.json, the en-/de-coding will ensure proper escaping
|
||||||
$h5pJson = array (
|
$h5pJson = array (
|
||||||
'title' => $content['title'],
|
'title' => self::revertH5PEditorTextEscape($content['title']),
|
||||||
'language' => (isset($content['language']) && strlen(trim($content['language'])) !== 0) ? $content['language'] : 'und',
|
'language' => (isset($content['language']) && strlen(trim($content['language'])) !== 0) ? $content['language'] : 'und',
|
||||||
'mainLibrary' => $content['library']['name'],
|
'mainLibrary' => $content['library']['name'],
|
||||||
'embedTypes' => $embedTypes,
|
'embedTypes' => $embedTypes
|
||||||
);
|
);
|
||||||
|
|
||||||
|
foreach(array('authors', 'source', 'license', 'licenseVersion', 'licenseExtras' ,'yearFrom', 'yearTo', 'changes', 'authorComments') as $field) {
|
||||||
|
if (isset($content['metadata'][$field]) && $content['metadata'][$field] !== '') {
|
||||||
|
if (($field !== 'authors' && $field !== 'changes') || (count($content['metadata'][$field]) > 0)) {
|
||||||
|
$h5pJson[$field] = json_decode(json_encode($content['metadata'][$field], TRUE));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove all values that are not set
|
||||||
|
foreach ($h5pJson as $key => $value) {
|
||||||
|
if (!isset($value)) {
|
||||||
|
unset($h5pJson[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Add dependencies to h5p
|
// Add dependencies to h5p
|
||||||
foreach ($content['dependencies'] as $dependency) {
|
foreach ($content['dependencies'] as $dependency) {
|
||||||
$library = $dependency['library'];
|
$library = $dependency['library'];
|
||||||
|
@ -1609,7 +1678,7 @@ Class H5PExport {
|
||||||
$library['minorVersion']
|
$library['minorVersion']
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($isDevLibrary !== NULL) {
|
if ($isDevLibrary !== NULL && isset($library['path'])) {
|
||||||
$exportFolder = "/" . $library['path'];
|
$exportFolder = "/" . $library['path'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1770,10 +1839,10 @@ abstract class H5PHubEndpoints {
|
||||||
* Functions and storage shared by the other H5P classes
|
* Functions and storage shared by the other H5P classes
|
||||||
*/
|
*/
|
||||||
class H5PCore {
|
class H5PCore {
|
||||||
|
|
||||||
public static $coreApi = array(
|
public static $coreApi = array(
|
||||||
'majorVersion' => 1,
|
'majorVersion' => 1,
|
||||||
'minorVersion' => 16
|
'minorVersion' => 19
|
||||||
);
|
);
|
||||||
public static $styles = array(
|
public static $styles = array(
|
||||||
'styles/h5p.css',
|
'styles/h5p.css',
|
||||||
|
@ -1886,6 +1955,10 @@ class H5PCore {
|
||||||
$content = $this->h5pF->loadContent($id);
|
$content = $this->h5pF->loadContent($id);
|
||||||
|
|
||||||
if ($content !== NULL) {
|
if ($content !== NULL) {
|
||||||
|
// Validate main content's metadata
|
||||||
|
$validator = new H5PContentValidator($this->h5pF, $this);
|
||||||
|
$content['metadata'] = $validator->validateMetadata($content['metadata']);
|
||||||
|
|
||||||
$content['library'] = array(
|
$content['library'] = array(
|
||||||
'id' => $content['libraryId'],
|
'id' => $content['libraryId'],
|
||||||
'name' => $content['libraryName'],
|
'name' => $content['libraryName'],
|
||||||
|
@ -1927,6 +2000,10 @@ class H5PCore {
|
||||||
return $content['filtered'];
|
return $content['filtered'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(isset($content['library']) && isset($content['params']))) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// Validate and filter against main library semantics.
|
// Validate and filter against main library semantics.
|
||||||
$validator = new H5PContentValidator($this->h5pF, $this);
|
$validator = new H5PContentValidator($this->h5pF, $this);
|
||||||
$params = (object) array(
|
$params = (object) array(
|
||||||
|
@ -1938,6 +2015,25 @@ class H5PCore {
|
||||||
}
|
}
|
||||||
$validator->validateLibrary($params, (object) array('options' => array($params->library)));
|
$validator->validateLibrary($params, (object) array('options' => array($params->library)));
|
||||||
|
|
||||||
|
// Handle addons:
|
||||||
|
$addons = $this->h5pF->loadAddons();
|
||||||
|
foreach ($addons as $addon) {
|
||||||
|
$add_to = json_decode($addon['addTo']);
|
||||||
|
|
||||||
|
if (isset($add_to->content->types)) {
|
||||||
|
foreach($add_to->content->types as $type) {
|
||||||
|
|
||||||
|
if (isset($type->text->regex) &&
|
||||||
|
$this->textAddonMatches($params->params, $type->text->regex)) {
|
||||||
|
$validator->addon($addon);
|
||||||
|
|
||||||
|
// An addon shall only be added once
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$params = json_encode($params->params);
|
$params = json_encode($params->params);
|
||||||
|
|
||||||
// Update content dependencies.
|
// Update content dependencies.
|
||||||
|
@ -1970,6 +2066,75 @@ class H5PCore {
|
||||||
return $params;
|
return $params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve a value from a nested mixed array structure.
|
||||||
|
*
|
||||||
|
* @param Array $params Array to be looked in.
|
||||||
|
* @param String $path Supposed path to the value.
|
||||||
|
* @param String [$delimiter='.'] Property delimiter within the path.
|
||||||
|
* @return Object|NULL The object found or NULL.
|
||||||
|
*/
|
||||||
|
private function retrieveValue ($params, $path, $delimiter='.') {
|
||||||
|
$path = explode($delimiter, $path);
|
||||||
|
|
||||||
|
// Property not found
|
||||||
|
if (!isset($params[$path[0]])) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
$first = $params[$path[0]];
|
||||||
|
|
||||||
|
// End of path, done
|
||||||
|
if (sizeof($path) === 1) {
|
||||||
|
return $first;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We cannot go deeper
|
||||||
|
if (!is_array($first)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Regular Array
|
||||||
|
if (isset($first[0])) {
|
||||||
|
foreach($first as $number => $object) {
|
||||||
|
$found = $this->retrieveValue($object, implode($delimiter, array_slice($path, 1)));
|
||||||
|
if (isset($found)) {
|
||||||
|
return $found;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Associative Array
|
||||||
|
return $this->retrieveValue($first, implode('.', array_slice($path, 1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if params contain any match.
|
||||||
|
*
|
||||||
|
* @param {object} params - Parameters.
|
||||||
|
* @param {string} [pattern] - Regular expression to identify pattern.
|
||||||
|
* @param {boolean} [found] - Used for recursion.
|
||||||
|
* @return {boolean} True, if params matches pattern.
|
||||||
|
*/
|
||||||
|
private function textAddonMatches($params, $pattern, $found = false) {
|
||||||
|
$type = gettype($params);
|
||||||
|
if ($type === 'string') {
|
||||||
|
if (preg_match($pattern, $params) === 1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ($type === 'array' || $type === 'object') {
|
||||||
|
foreach ($params as $value) {
|
||||||
|
$found = $this->textAddonMatches($value, $pattern, $found);
|
||||||
|
if ($found === true) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate content slug
|
* Generate content slug
|
||||||
*
|
*
|
||||||
|
@ -2848,7 +3013,7 @@ class H5PCore {
|
||||||
*/
|
*/
|
||||||
private static function printJson($data, $status_code = NULL) {
|
private static function printJson($data, $status_code = NULL) {
|
||||||
header('Cache-Control: no-cache');
|
header('Cache-Control: no-cache');
|
||||||
header('Content-type: application/json; charset=utf-8');
|
header('Content-Type: application/json; charset=utf-8');
|
||||||
print json_encode($data);
|
print json_encode($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3156,7 +3321,10 @@ class H5PCore {
|
||||||
'licensePD' => $this->h5pF->t('Public Domain'),
|
'licensePD' => $this->h5pF->t('Public Domain'),
|
||||||
'licenseCC010' => $this->h5pF->t('CC0 1.0 Universal (CC0 1.0) Public Domain Dedication'),
|
'licenseCC010' => $this->h5pF->t('CC0 1.0 Universal (CC0 1.0) Public Domain Dedication'),
|
||||||
'licensePDM' => $this->h5pF->t('Public Domain Mark'),
|
'licensePDM' => $this->h5pF->t('Public Domain Mark'),
|
||||||
'licenseC' => $this->h5pF->t('Copyright')
|
'licenseC' => $this->h5pF->t('Copyright'),
|
||||||
|
'contentType' => $this->h5pF->t('Content Type'),
|
||||||
|
'licenseExtras' => $this->h5pF->t('License Extras'),
|
||||||
|
'changes' => $this->h5pF->t('Changelog'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3204,6 +3372,19 @@ class H5PContentValidator {
|
||||||
$this->dependencies = array();
|
$this->dependencies = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Addon library.
|
||||||
|
*/
|
||||||
|
public function addon($library) {
|
||||||
|
$depKey = 'preloaded-' . $library['machineName'];
|
||||||
|
$this->dependencies[$depKey] = array(
|
||||||
|
'library' => $library,
|
||||||
|
'type' => 'preloaded'
|
||||||
|
);
|
||||||
|
$this->nextWeight = $this->h5pC->findLibraryDependencies($this->dependencies, $library, $this->nextWeight);
|
||||||
|
$this->dependencies[$depKey]['weight'] = $this->nextWeight++;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the flat dependency tree.
|
* Get the flat dependency tree.
|
||||||
*
|
*
|
||||||
|
@ -3213,6 +3394,24 @@ class H5PContentValidator {
|
||||||
return $this->dependencies;
|
return $this->dependencies;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate metadata
|
||||||
|
*
|
||||||
|
* @param array $metadata
|
||||||
|
* @return array Validated & filtered
|
||||||
|
*/
|
||||||
|
public function validateMetadata($metadata) {
|
||||||
|
$semantics = $this->getMetadataSemantics();
|
||||||
|
|
||||||
|
$group = (object)$metadata;
|
||||||
|
$this->validateGroup($group, (object) array(
|
||||||
|
'type' => 'group',
|
||||||
|
'fields' => $semantics,
|
||||||
|
), FALSE);
|
||||||
|
|
||||||
|
return (array)$group;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate given text value against text semantics.
|
* Validate given text value against text semantics.
|
||||||
* @param $text
|
* @param $text
|
||||||
|
@ -3401,8 +3600,17 @@ class H5PContentValidator {
|
||||||
// We have a strict set of options to choose from.
|
// We have a strict set of options to choose from.
|
||||||
$strict = TRUE;
|
$strict = TRUE;
|
||||||
$options = array();
|
$options = array();
|
||||||
|
|
||||||
foreach ($semantics->options as $option) {
|
foreach ($semantics->options as $option) {
|
||||||
$options[$option->value] = TRUE;
|
// Support optgroup - just flatten options into one
|
||||||
|
if (isset($option->type) && $option->type === 'optgroup') {
|
||||||
|
foreach ($option->options as $suboption) {
|
||||||
|
$options[$suboption->value] = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($option->value)) {
|
||||||
|
$options[$option->value] = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3667,12 +3875,24 @@ class H5PContentValidator {
|
||||||
$value = NULL;
|
$value = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!in_array($value->library, $semantics->options)) {
|
|
||||||
|
// Check for array of objects or array of strings
|
||||||
|
if (is_object($semantics->options[0])) {
|
||||||
|
$getLibraryNames = function ($item) {
|
||||||
|
return $item->name;
|
||||||
|
};
|
||||||
|
$libraryNames = array_map($getLibraryNames, $semantics->options);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$libraryNames = $semantics->options;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!in_array($value->library, $libraryNames)) {
|
||||||
$message = NULL;
|
$message = NULL;
|
||||||
// Create an understandable error message:
|
// Create an understandable error message:
|
||||||
$machineNameArray = explode(' ', $value->library);
|
$machineNameArray = explode(' ', $value->library);
|
||||||
$machineName = $machineNameArray[0];
|
$machineName = $machineNameArray[0];
|
||||||
foreach ($semantics->options as $semanticsLibrary) {
|
foreach ($libraryNames as $semanticsLibrary) {
|
||||||
$semanticsMachineNameArray = explode(' ', $semanticsLibrary);
|
$semanticsMachineNameArray = explode(' ', $semanticsLibrary);
|
||||||
$semanticsMachineName = $semanticsMachineNameArray[0];
|
$semanticsMachineName = $semanticsMachineNameArray[0];
|
||||||
if ($machineName === $semanticsMachineName) {
|
if ($machineName === $semanticsMachineName) {
|
||||||
|
@ -3708,14 +3928,22 @@ class H5PContentValidator {
|
||||||
$library = $this->libraries[$value->library];
|
$library = $this->libraries[$value->library];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate parameters
|
||||||
$this->validateGroup($value->params, (object) array(
|
$this->validateGroup($value->params, (object) array(
|
||||||
'type' => 'group',
|
'type' => 'group',
|
||||||
'fields' => $library['semantics'],
|
'fields' => $library['semantics'],
|
||||||
), FALSE);
|
), FALSE);
|
||||||
$validKeys = array('library', 'params', 'subContentId');
|
|
||||||
|
// Validate subcontent's metadata
|
||||||
|
if (isset($value->metadata)) {
|
||||||
|
$value->metadata = $this->validateMetadata($value->metadata);
|
||||||
|
}
|
||||||
|
|
||||||
|
$validKeys = array('library', 'params', 'subContentId', 'metadata');
|
||||||
if (isset($semantics->extraAttributes)) {
|
if (isset($semantics->extraAttributes)) {
|
||||||
$validKeys = array_merge($validKeys, $semantics->extraAttributes);
|
$validKeys = array_merge($validKeys, $semantics->extraAttributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->filterParams($value, $validKeys);
|
$this->filterParams($value, $validKeys);
|
||||||
if (isset($value->subContentId) && ! preg_match('/^\{?[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\}?$/', $value->subContentId)) {
|
if (isset($value->subContentId) && ! preg_match('/^\{?[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\}?$/', $value->subContentId)) {
|
||||||
unset($value->subContentId);
|
unset($value->subContentId);
|
||||||
|
@ -4082,6 +4310,240 @@ class H5PContentValidator {
|
||||||
return $uri;
|
return $uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMetadataSemantics() {
|
||||||
|
static $semantics;
|
||||||
|
|
||||||
|
$cc_versions = array(
|
||||||
|
(object) array(
|
||||||
|
'value' => '4.0',
|
||||||
|
'label' => $this->h5pF->t('4.0 International')
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => '3.0',
|
||||||
|
'label' => $this->h5pF->t('3.0 Unported')
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => '2.5',
|
||||||
|
'label' => $this->h5pF->t('2.5 Generic')
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => '2.0',
|
||||||
|
'label' => $this->h5pF->t('2.0 Generic')
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => '1.0',
|
||||||
|
'label' => $this->h5pF->t('1.0 Generic')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$semantics = array(
|
||||||
|
(object) array(
|
||||||
|
'name' => 'title',
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->h5pF->t('Title'),
|
||||||
|
'placeholder' => 'La Gioconda'
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'name' => 'license',
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => $this->h5pF->t('License'),
|
||||||
|
'default' => 'U',
|
||||||
|
'options' => array(
|
||||||
|
(object) array(
|
||||||
|
'value' => 'U',
|
||||||
|
'label' => $this->h5pF->t('Undisclosed')
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'type' => 'optgroup',
|
||||||
|
'label' => $this->h5pF->t('Creative Commons'),
|
||||||
|
'options' => [
|
||||||
|
(object) array(
|
||||||
|
'value' => 'CC BY',
|
||||||
|
'label' => $this->h5pF->t('Attribution (CC BY)'),
|
||||||
|
'versions' => $cc_versions
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => 'CC BY-SA',
|
||||||
|
'label' => $this->h5pF->t('Attribution-ShareAlike (CC BY-SA)'),
|
||||||
|
'versions' => $cc_versions
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => 'CC BY-ND',
|
||||||
|
'label' => $this->h5pF->t('Attribution-NoDerivs (CC BY-ND)'),
|
||||||
|
'versions' => $cc_versions
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => 'CC BY-NC',
|
||||||
|
'label' => $this->h5pF->t('Attribution-NonCommercial (CC BY-NC)'),
|
||||||
|
'versions' => $cc_versions
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => 'CC BY-NC-SA',
|
||||||
|
'label' => $this->h5pF->t('Attribution-NonCommercial-ShareAlike (CC BY-NC-SA)'),
|
||||||
|
'versions' => $cc_versions
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => 'CC BY-NC-ND',
|
||||||
|
'label' => $this->h5pF->t('Attribution-NonCommercial-NoDerivs (CC BY-NC-ND)'),
|
||||||
|
'versions' => $cc_versions
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => 'CC0 1.0',
|
||||||
|
'label' => $this->h5pF->t('Public Domain Dedication (CC0)')
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => 'CC PDM',
|
||||||
|
'label' => $this->h5pF->t('Public Domain Mark (PDM)')
|
||||||
|
),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => 'GNU GPL',
|
||||||
|
'label' => $this->h5pF->t('General Public License v3')
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => 'PD',
|
||||||
|
'label' => $this->h5pF->t('Public Domain')
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => 'ODC PDDL',
|
||||||
|
'label' => $this->h5pF->t('Public Domain Dedication and Licence')
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => 'C',
|
||||||
|
'label' => $this->h5pF->t('Copyright')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'name' => 'licenseVersion',
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => $this->h5pF->t('License Version'),
|
||||||
|
'options' => $cc_versions,
|
||||||
|
'optional' => TRUE
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'name' => 'yearFrom',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => $this->h5pF->t('Years (from)'),
|
||||||
|
'placeholder' => '1991',
|
||||||
|
'min' => '-9999',
|
||||||
|
'max' => '9999',
|
||||||
|
'optional' => TRUE
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'name' => 'yearTo',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => $this->h5pF->t('Years (to)'),
|
||||||
|
'placeholder' => '1992',
|
||||||
|
'min' => '-9999',
|
||||||
|
'max' => '9999',
|
||||||
|
'optional' => TRUE
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'name' => 'source',
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->h5pF->t('Source'),
|
||||||
|
'placeholder' => 'https://',
|
||||||
|
'optional' => TRUE
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'name' => 'authors',
|
||||||
|
'type' => 'list',
|
||||||
|
'field' => (object) array (
|
||||||
|
'name' => 'author',
|
||||||
|
'type' => 'group',
|
||||||
|
'fields'=> array(
|
||||||
|
(object) array(
|
||||||
|
'label' => $this->h5pF->t("Author's name"),
|
||||||
|
'name' => 'name',
|
||||||
|
'optional' => TRUE,
|
||||||
|
'type' => 'text'
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'name' => 'role',
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => $this->h5pF->t("Author's role"),
|
||||||
|
'default' => 'Author',
|
||||||
|
'options' => array(
|
||||||
|
(object) array(
|
||||||
|
'value' => 'Author',
|
||||||
|
'label' => $this->h5pF->t('Author')
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => 'Editor',
|
||||||
|
'label' => $this->h5pF->t('Editor')
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => 'Licensee',
|
||||||
|
'label' => $this->h5pF->t('Licensee')
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'value' => 'Originator',
|
||||||
|
'label' => $this->h5pF->t('Originator')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'name' => 'licenseExtras',
|
||||||
|
'type' => 'text',
|
||||||
|
'widget' => 'textarea',
|
||||||
|
'label' => $this->h5pF->t('License Extras'),
|
||||||
|
'optional' => TRUE,
|
||||||
|
'description' => $this->h5pF->t('Any additional information about the license')
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'name' => 'changes',
|
||||||
|
'type' => 'list',
|
||||||
|
'field' => (object) array(
|
||||||
|
'name' => 'change',
|
||||||
|
'type' => 'group',
|
||||||
|
'label' => $this->h5pF->t('Changelog'),
|
||||||
|
'fields' => array(
|
||||||
|
(object) array(
|
||||||
|
'name' => 'date',
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->h5pF->t('Date'),
|
||||||
|
'optional' => TRUE
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'name' => 'author',
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->h5pF->t('Changed by'),
|
||||||
|
'optional' => TRUE
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'name' => 'log',
|
||||||
|
'type' => 'text',
|
||||||
|
'widget' => 'textarea',
|
||||||
|
'label' => $this->h5pF->t('Description of change'),
|
||||||
|
'placeholder' => $this->h5pF->t('Photo cropped, text changed, etc.'),
|
||||||
|
'optional' => TRUE
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(object) array (
|
||||||
|
'name' => 'authorComments',
|
||||||
|
'type' => 'text',
|
||||||
|
'widget' => 'textarea',
|
||||||
|
'label' => $this->h5pF->t('Author comments'),
|
||||||
|
'description' => $this->h5pF->t('Comments for the editor of the content (This text will not be published as a part of copyright info)'),
|
||||||
|
'optional' => TRUE
|
||||||
|
),
|
||||||
|
(object) array(
|
||||||
|
'name' => 'contentType',
|
||||||
|
'type' => 'text',
|
||||||
|
'widget' => 'none'
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
return $semantics;
|
||||||
|
}
|
||||||
|
|
||||||
public function getCopyrightSemantics() {
|
public function getCopyrightSemantics() {
|
||||||
static $semantics;
|
static $semantics;
|
||||||
|
|
||||||
|
|
|
@ -351,7 +351,7 @@ H5P.ConfirmationDialog = (function (EventDispatcher) {
|
||||||
*
|
*
|
||||||
* @param {number|null} minHeight
|
* @param {number|null} minHeight
|
||||||
*/
|
*/
|
||||||
this.setViewPortMinimumHeight = function(minHeight) {
|
this.setViewPortMinimumHeight = function (minHeight) {
|
||||||
var container = document.querySelector('.h5p-container') || document.body;
|
var container = document.querySelector('.h5p-container') || document.body;
|
||||||
container.style.minHeight = (typeof minHeight === 'number') ? (minHeight + 'px') : minHeight;
|
container.style.minHeight = (typeof minHeight === 'number') ? (minHeight + 'px') : minHeight;
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
* @class
|
* @class
|
||||||
* @augments H5P.EventDispatcher
|
* @augments H5P.EventDispatcher
|
||||||
*/
|
*/
|
||||||
H5P.ContentType = function (isRootLibrary, library) {
|
H5P.ContentType = function (isRootLibrary) {
|
||||||
|
|
||||||
function ContentType() {}
|
function ContentType() {}
|
||||||
|
|
||||||
|
|
|
@ -25,19 +25,27 @@ H5P.ContentUpgradeProcess = (function (Version) {
|
||||||
}
|
}
|
||||||
|
|
||||||
self.loadLibrary = loadLibrary;
|
self.loadLibrary = loadLibrary;
|
||||||
self.upgrade(name, oldVersion, newVersion, params, function (err, result) {
|
self.upgrade(name, oldVersion, newVersion, params.params, params.metadata, function (err, upgradedParams, upgradedMetadata) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return done(err);
|
return done(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
done(null, JSON.stringify(params));
|
done(null, JSON.stringify({params: upgradedParams, metadata: upgradedMetadata}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Run content upgrade.
|
||||||
*
|
*
|
||||||
|
* @public
|
||||||
|
* @param {string} name
|
||||||
|
* @param {Version} oldVersion
|
||||||
|
* @param {Version} newVersion
|
||||||
|
* @param {Object} params
|
||||||
|
* @param {Object} metadata
|
||||||
|
* @param {Function} done
|
||||||
*/
|
*/
|
||||||
ContentUpgradeProcess.prototype.upgrade = function (name, oldVersion, newVersion, params, done) {
|
ContentUpgradeProcess.prototype.upgrade = function (name, oldVersion, newVersion, params, metadata, done) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
// Load library details and upgrade routines
|
// Load library details and upgrade routines
|
||||||
|
@ -47,7 +55,7 @@ H5P.ContentUpgradeProcess = (function (Version) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run upgrade routines on params
|
// Run upgrade routines on params
|
||||||
self.processParams(library, oldVersion, newVersion, params, function (err, params) {
|
self.processParams(library, oldVersion, newVersion, params, metadata, function (err, params, metadata) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return done(err);
|
return done(err);
|
||||||
}
|
}
|
||||||
|
@ -61,7 +69,7 @@ H5P.ContentUpgradeProcess = (function (Version) {
|
||||||
next(err);
|
next(err);
|
||||||
});
|
});
|
||||||
}, function (err) {
|
}, function (err) {
|
||||||
done(err, params);
|
done(err, params, metadata);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -77,7 +85,7 @@ H5P.ContentUpgradeProcess = (function (Version) {
|
||||||
* @param {Object} params
|
* @param {Object} params
|
||||||
* @param {Function} next
|
* @param {Function} next
|
||||||
*/
|
*/
|
||||||
ContentUpgradeProcess.prototype.processParams = function (library, oldVersion, newVersion, params, next) {
|
ContentUpgradeProcess.prototype.processParams = function (library, oldVersion, newVersion, params, metadata, next) {
|
||||||
if (H5PUpgrades[library.name] === undefined) {
|
if (H5PUpgrades[library.name] === undefined) {
|
||||||
if (library.upgradesScript) {
|
if (library.upgradesScript) {
|
||||||
// Upgrades script should be loaded so the upgrades should be here.
|
// Upgrades script should be loaded so the upgrades should be here.
|
||||||
|
@ -110,16 +118,19 @@ H5P.ContentUpgradeProcess = (function (Version) {
|
||||||
var unnecessaryWrapper = (upgrade.contentUpgrade !== undefined ? upgrade.contentUpgrade : upgrade);
|
var unnecessaryWrapper = (upgrade.contentUpgrade !== undefined ? upgrade.contentUpgrade : upgrade);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
unnecessaryWrapper(params, function (err, upgradedParams) {
|
unnecessaryWrapper(params, function (err, upgradedParams, upgradedExtras) {
|
||||||
params = upgradedParams;
|
params = upgradedParams;
|
||||||
|
if (upgradedExtras && upgradedExtras.metadata) { // Optional
|
||||||
|
metadata = upgradedExtras.metadata;
|
||||||
|
}
|
||||||
nextMinor(err);
|
nextMinor(err);
|
||||||
});
|
}, {metadata: metadata});
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
if (console && console.log) {
|
if (console && console.error) {
|
||||||
console.log("Error", err.stack);
|
console.error("Error", err.stack);
|
||||||
console.log("Error", err.name);
|
console.error("Error", err.name);
|
||||||
console.log("Error", err.message);
|
console.error("Error", err.message);
|
||||||
}
|
}
|
||||||
next(err);
|
next(err);
|
||||||
}
|
}
|
||||||
|
@ -127,7 +138,7 @@ H5P.ContentUpgradeProcess = (function (Version) {
|
||||||
}, nextMajor);
|
}, nextMajor);
|
||||||
}
|
}
|
||||||
}, function (err) {
|
}, function (err) {
|
||||||
next(err, params);
|
next(err, params, metadata);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -155,7 +166,7 @@ H5P.ContentUpgradeProcess = (function (Version) {
|
||||||
// Look for available upgrades
|
// Look for available upgrades
|
||||||
var usedLib = params.library.split(' ', 2);
|
var usedLib = params.library.split(' ', 2);
|
||||||
for (var i = 0; i < field.options.length; i++) {
|
for (var i = 0; i < field.options.length; i++) {
|
||||||
var availableLib = field.options[i].split(' ', 2);
|
var availableLib = (typeof field.options[i] === 'string') ? field.options[i].split(' ', 2) : field.options[i].name.split(' ', 2);
|
||||||
if (availableLib[0] === usedLib[0]) {
|
if (availableLib[0] === usedLib[0]) {
|
||||||
if (availableLib[1] === usedLib[1]) {
|
if (availableLib[1] === usedLib[1]) {
|
||||||
return done(); // Same version
|
return done(); // Same version
|
||||||
|
@ -169,10 +180,13 @@ H5P.ContentUpgradeProcess = (function (Version) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// A newer version is available, upgrade params
|
// A newer version is available, upgrade params
|
||||||
return self.upgrade(availableLib[0], usedVer, availableVer, params.params, function (err, upgraded) {
|
return self.upgrade(availableLib[0], usedVer, availableVer, params.params, params.metadata, function (err, upgradedParams, upgradedMetadata) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
params.library = availableLib[0] + ' ' + availableVer.major + '.' + availableVer.minor;
|
params.library = availableLib[0] + ' ' + availableVer.major + '.' + availableVer.minor;
|
||||||
params.params = upgraded;
|
params.params = upgradedParams;
|
||||||
|
if (upgradedMetadata) {
|
||||||
|
params.metadata = upgradedMetadata;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
done(err, params);
|
done(err, params);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* global importScripts */
|
||||||
var H5P = H5P || {};
|
var H5P = H5P || {};
|
||||||
importScripts('h5p-version.js', 'h5p-content-upgrade-process.js');
|
importScripts('h5p-version.js', 'h5p-content-upgrade-process.js');
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*jshint -W083 */
|
/* global H5PAdminIntegration H5PUtils */
|
||||||
|
|
||||||
(function ($, Version) {
|
(function ($, Version) {
|
||||||
var info, $container, librariesCache = {}, scriptsCache = {};
|
var info, $container, librariesCache = {}, scriptsCache = {};
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* global H5PUtils */
|
||||||
var H5PDataView = (function ($) {
|
var H5PDataView = (function ($) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -198,7 +199,6 @@ var H5PDataView = (function ($) {
|
||||||
* @param number col ID of column
|
* @param number col ID of column
|
||||||
*/
|
*/
|
||||||
H5PDataView.prototype.createFacets = function (input, col) {
|
H5PDataView.prototype.createFacets = function (input, col) {
|
||||||
var self = this;
|
|
||||||
var facets = '';
|
var facets = '';
|
||||||
|
|
||||||
if (input instanceof Array) {
|
if (input instanceof Array) {
|
||||||
|
|
|
@ -10,7 +10,7 @@ var H5P = window.H5P = window.H5P || {};
|
||||||
* @param {boolean} [extras.bubbles]
|
* @param {boolean} [extras.bubbles]
|
||||||
* @param {boolean} [extras.external]
|
* @param {boolean} [extras.external]
|
||||||
*/
|
*/
|
||||||
H5P.Event = function(type, data, extras) {
|
H5P.Event = function (type, data, extras) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.data = data;
|
this.data = data;
|
||||||
var bubbles = false;
|
var bubbles = false;
|
||||||
|
@ -34,7 +34,7 @@ H5P.Event = function(type, data, extras) {
|
||||||
/**
|
/**
|
||||||
* Prevent this event from bubbling up to parent
|
* Prevent this event from bubbling up to parent
|
||||||
*/
|
*/
|
||||||
this.preventBubbling = function() {
|
this.preventBubbling = function () {
|
||||||
bubbles = false;
|
bubbles = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ H5P.Event = function(type, data, extras) {
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
* true if bubbling false otherwise
|
* true if bubbling false otherwise
|
||||||
*/
|
*/
|
||||||
this.getBubbles = function() {
|
this.getBubbles = function () {
|
||||||
return bubbles;
|
return bubbles;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ H5P.Event = function(type, data, extras) {
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
* true if external and not already scheduled, otherwise false
|
* true if external and not already scheduled, otherwise false
|
||||||
*/
|
*/
|
||||||
this.scheduleForExternal = function() {
|
this.scheduleForExternal = function () {
|
||||||
if (external && !scheduledForExternal) {
|
if (external && !scheduledForExternal) {
|
||||||
scheduledForExternal = true;
|
scheduledForExternal = true;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
var H5PLibraryDetails= H5PLibraryDetails || {};
|
/* global H5PAdminIntegration H5PUtils */
|
||||||
|
var H5PLibraryDetails = H5PLibraryDetails || {};
|
||||||
|
|
||||||
(function ($) {
|
(function ($) {
|
||||||
|
|
||||||
|
@ -68,7 +69,7 @@ var H5PLibraryDetails= H5PLibraryDetails || {};
|
||||||
*/
|
*/
|
||||||
H5PLibraryDetails.createContentTable = function () {
|
H5PLibraryDetails.createContentTable = function () {
|
||||||
// Remove it if it exists:
|
// Remove it if it exists:
|
||||||
if(H5PLibraryDetails.$contentTable) {
|
if (H5PLibraryDetails.$contentTable) {
|
||||||
H5PLibraryDetails.$contentTable.remove();
|
H5PLibraryDetails.$contentTable.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,10 +78,10 @@ var H5PLibraryDetails= H5PLibraryDetails || {};
|
||||||
var i = (H5PLibraryDetails.currentPage*H5PLibraryDetails.PAGER_SIZE);
|
var i = (H5PLibraryDetails.currentPage*H5PLibraryDetails.PAGER_SIZE);
|
||||||
var lastIndex = (i+H5PLibraryDetails.PAGER_SIZE);
|
var lastIndex = (i+H5PLibraryDetails.PAGER_SIZE);
|
||||||
|
|
||||||
if(lastIndex > H5PLibraryDetails.currentContent.length) {
|
if (lastIndex > H5PLibraryDetails.currentContent.length) {
|
||||||
lastIndex = H5PLibraryDetails.currentContent.length;
|
lastIndex = H5PLibraryDetails.currentContent.length;
|
||||||
}
|
}
|
||||||
for(; i<lastIndex; i++) {
|
for (; i<lastIndex; i++) {
|
||||||
var content = H5PLibraryDetails.currentContent[i];
|
var content = H5PLibraryDetails.currentContent[i];
|
||||||
H5PLibraryDetails.$contentTable.append(H5PUtils.createTableRow(['<a href="' + content.url + '">' + content.title + '</a>']));
|
H5PLibraryDetails.$contentTable.append(H5PUtils.createTableRow(['<a href="' + content.url + '">' + content.title + '</a>']));
|
||||||
}
|
}
|
||||||
|
@ -97,7 +98,7 @@ var H5PLibraryDetails= H5PLibraryDetails || {};
|
||||||
H5PLibraryDetails.$next = $('<button type="button" class="next h5p-admin">></button>');
|
H5PLibraryDetails.$next = $('<button type="button" class="next h5p-admin">></button>');
|
||||||
|
|
||||||
H5PLibraryDetails.$previous.on('click', function () {
|
H5PLibraryDetails.$previous.on('click', function () {
|
||||||
if(H5PLibraryDetails.$previous.hasClass('disabled')) {
|
if (H5PLibraryDetails.$previous.hasClass('disabled')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +108,7 @@ var H5PLibraryDetails= H5PLibraryDetails || {};
|
||||||
});
|
});
|
||||||
|
|
||||||
H5PLibraryDetails.$next.on('click', function () {
|
H5PLibraryDetails.$next.on('click', function () {
|
||||||
if(H5PLibraryDetails.$next.hasClass('disabled')) {
|
if (H5PLibraryDetails.$next.hasClass('disabled')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +128,7 @@ var H5PLibraryDetails= H5PLibraryDetails || {};
|
||||||
H5PLibraryDetails.$pagerInfo.hide();
|
H5PLibraryDetails.$pagerInfo.hide();
|
||||||
|
|
||||||
// User has updated the pageNumber
|
// User has updated the pageNumber
|
||||||
var pageNumerUpdated = function() {
|
var pageNumerUpdated = function () {
|
||||||
var newPageNum = $gotoInput.val()-1;
|
var newPageNum = $gotoInput.val()-1;
|
||||||
var intRegex = /^\d+$/;
|
var intRegex = /^\d+$/;
|
||||||
|
|
||||||
|
@ -135,7 +136,7 @@ var H5PLibraryDetails= H5PLibraryDetails || {};
|
||||||
H5PLibraryDetails.$pagerInfo.css({display: 'inline-block'});
|
H5PLibraryDetails.$pagerInfo.css({display: 'inline-block'});
|
||||||
|
|
||||||
// Check if input value is valid, and that it has actually changed
|
// Check if input value is valid, and that it has actually changed
|
||||||
if(!(intRegex.test(newPageNum) && newPageNum >= 0 && newPageNum < H5PLibraryDetails.getNumPages() && newPageNum != H5PLibraryDetails.currentPage)) {
|
if (!(intRegex.test(newPageNum) && newPageNum >= 0 && newPageNum < H5PLibraryDetails.getNumPages() && newPageNum != H5PLibraryDetails.currentPage)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +186,7 @@ var H5PLibraryDetails= H5PLibraryDetails || {};
|
||||||
H5PLibraryDetails.updatePager = function () {
|
H5PLibraryDetails.updatePager = function () {
|
||||||
H5PLibraryDetails.$pagerInfo.css({display: 'inline-block'});
|
H5PLibraryDetails.$pagerInfo.css({display: 'inline-block'});
|
||||||
|
|
||||||
if(H5PLibraryDetails.getNumPages() > 0) {
|
if (H5PLibraryDetails.getNumPages() > 0) {
|
||||||
var message = H5PUtils.translateReplace(H5PLibraryDetails.library.translations.pageXOfY, {
|
var message = H5PUtils.translateReplace(H5PLibraryDetails.library.translations.pageXOfY, {
|
||||||
'$x': (H5PLibraryDetails.currentPage+1),
|
'$x': (H5PLibraryDetails.currentPage+1),
|
||||||
'$y': H5PLibraryDetails.getNumPages()
|
'$y': H5PLibraryDetails.getNumPages()
|
||||||
|
@ -211,7 +212,7 @@ var H5PLibraryDetails= H5PLibraryDetails || {};
|
||||||
var searchString = $('.h5p-content-search > input').val();
|
var searchString = $('.h5p-content-search > input').val();
|
||||||
|
|
||||||
// If search string same as previous, just do nothing
|
// If search string same as previous, just do nothing
|
||||||
if(H5PLibraryDetails.currentFilter === searchString) {
|
if (H5PLibraryDetails.currentFilter === searchString) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,7 +220,7 @@ var H5PLibraryDetails= H5PLibraryDetails || {};
|
||||||
// If empty search, use the complete list
|
// If empty search, use the complete list
|
||||||
H5PLibraryDetails.currentContent = H5PLibraryDetails.library.content;
|
H5PLibraryDetails.currentContent = H5PLibraryDetails.library.content;
|
||||||
}
|
}
|
||||||
else if(H5PLibraryDetails.filterCache[searchString]) {
|
else if (H5PLibraryDetails.filterCache[searchString]) {
|
||||||
// If search is cached, no need to filter
|
// If search is cached, no need to filter
|
||||||
H5PLibraryDetails.currentContent = H5PLibraryDetails.filterCache[searchString];
|
H5PLibraryDetails.currentContent = H5PLibraryDetails.filterCache[searchString];
|
||||||
}
|
}
|
||||||
|
@ -227,10 +228,10 @@ var H5PLibraryDetails= H5PLibraryDetails || {};
|
||||||
var listToFilter = H5PLibraryDetails.library.content;
|
var listToFilter = H5PLibraryDetails.library.content;
|
||||||
|
|
||||||
// Check if we can filter the already filtered results (for performance)
|
// Check if we can filter the already filtered results (for performance)
|
||||||
if(searchString.length > 1 && H5PLibraryDetails.currentFilter === searchString.substr(0, H5PLibraryDetails.currentFilter.length)) {
|
if (searchString.length > 1 && H5PLibraryDetails.currentFilter === searchString.substr(0, H5PLibraryDetails.currentFilter.length)) {
|
||||||
listToFilter = H5PLibraryDetails.currentContent;
|
listToFilter = H5PLibraryDetails.currentContent;
|
||||||
}
|
}
|
||||||
H5PLibraryDetails.currentContent = $.grep(listToFilter, function(content) {
|
H5PLibraryDetails.currentContent = $.grep(listToFilter, function (content) {
|
||||||
return content.title && content.title.match(new RegExp(searchString, 'i'));
|
return content.title && content.title.match(new RegExp(searchString, 'i'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -256,7 +257,7 @@ var H5PLibraryDetails= H5PLibraryDetails || {};
|
||||||
$('input', H5PLibraryDetails.$search).on('change keypress paste input', function () {
|
$('input', H5PLibraryDetails.$search).on('change keypress paste input', function () {
|
||||||
// Here we start the filtering
|
// Here we start the filtering
|
||||||
// We wait at least 500 ms after last input to perform search
|
// We wait at least 500 ms after last input to perform search
|
||||||
if(inputTimer) {
|
if (inputTimer) {
|
||||||
clearTimeout(inputTimer);
|
clearTimeout(inputTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*jshint multistr: true */
|
/* global H5PAdminIntegration H5PUtils */
|
||||||
var H5PLibraryList = H5PLibraryList || {};
|
var H5PLibraryList = H5PLibraryList || {};
|
||||||
|
|
||||||
(function ($) {
|
(function ($) {
|
||||||
|
@ -25,7 +25,7 @@ var H5PLibraryList = H5PLibraryList || {};
|
||||||
*/
|
*/
|
||||||
H5PLibraryList.createLibraryList = function (libraries) {
|
H5PLibraryList.createLibraryList = function (libraries) {
|
||||||
var t = H5PAdminIntegration.l10n;
|
var t = H5PAdminIntegration.l10n;
|
||||||
if(libraries.listData === undefined || libraries.listData.length === 0) {
|
if (libraries.listData === undefined || libraries.listData.length === 0) {
|
||||||
return $('<div>' + t.NA + '</div>');
|
return $('<div>' + t.NA + '</div>');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
iframe.style.width = '100%';
|
iframe.style.width = '100%';
|
||||||
|
|
||||||
// Tell iframe that it needs to resize when our window resizes
|
// Tell iframe that it needs to resize when our window resizes
|
||||||
var resize = function (event) {
|
var resize = function () {
|
||||||
if (iframe.contentWindow) {
|
if (iframe.contentWindow) {
|
||||||
// Limit resize calls to avoid flickering
|
// Limit resize calls to avoid flickering
|
||||||
respond('resize');
|
respond('resize');
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
* @param {Object} data Payload
|
* @param {Object} data Payload
|
||||||
* @param {Function} respond Send a response to the iframe
|
* @param {Function} respond Send a response to the iframe
|
||||||
*/
|
*/
|
||||||
actionHandlers.resize = function (iframe, data, respond) {
|
actionHandlers.resize = function (iframe, data) {
|
||||||
// Resize iframe so all content is visible. Use scrollHeight to make sure we get everything
|
// Resize iframe so all content is visible. Use scrollHeight to make sure we get everything
|
||||||
iframe.style.height = data.scrollHeight + 'px';
|
iframe.style.height = data.scrollHeight + 'px';
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* global H5PAdminIntegration*/
|
||||||
var H5PUtils = H5PUtils || {};
|
var H5PUtils = H5PUtils || {};
|
||||||
|
|
||||||
(function ($) {
|
(function ($) {
|
||||||
|
@ -9,7 +10,7 @@ var H5PUtils = H5PUtils || {};
|
||||||
H5PUtils.createTable = function (headers) {
|
H5PUtils.createTable = function (headers) {
|
||||||
var $table = $('<table class="h5p-admin-table' + (H5PAdminIntegration.extraTableClasses !== undefined ? ' ' + H5PAdminIntegration.extraTableClasses : '') + '"></table>');
|
var $table = $('<table class="h5p-admin-table' + (H5PAdminIntegration.extraTableClasses !== undefined ? ' ' + H5PAdminIntegration.extraTableClasses : '') + '"></table>');
|
||||||
|
|
||||||
if(headers) {
|
if (headers) {
|
||||||
var $thead = $('<thead></thead>');
|
var $thead = $('<thead></thead>');
|
||||||
var $tr = $('<tr></tr>');
|
var $tr = $('<tr></tr>');
|
||||||
|
|
||||||
|
@ -44,7 +45,7 @@ var H5PUtils = H5PUtils || {};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
$('<td/>', value).appendTo($tr);
|
$('<td/>', value).appendTo($tr);
|
||||||
});
|
});
|
||||||
|
|
||||||
return $tr;
|
return $tr;
|
||||||
|
|
|
@ -133,9 +133,10 @@ H5P.XAPIEvent.prototype.setObject = function (instance) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (H5PIntegration && H5PIntegration.contents && H5PIntegration.contents['cid-' + instance.contentId].title) {
|
var content = H5P.getContentForInstance(instance.contentId);
|
||||||
|
if (content && content.metadata && content.metadata.title) {
|
||||||
this.data.statement.object.definition.name = {
|
this.data.statement.object.definition.name = {
|
||||||
"en-US": H5P.createTitle(H5PIntegration.contents['cid-' + instance.contentId].title)
|
"en-US": H5P.createTitle(content.metadata.title)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,7 +151,6 @@ H5P.XAPIEvent.prototype.setObject = function (instance) {
|
||||||
*/
|
*/
|
||||||
H5P.XAPIEvent.prototype.setContext = function (instance) {
|
H5P.XAPIEvent.prototype.setContext = function (instance) {
|
||||||
if (instance.parent && (instance.parent.contentId || instance.parent.subContentId)) {
|
if (instance.parent && (instance.parent.contentId || instance.parent.subContentId)) {
|
||||||
var parentId = instance.parent.subContentId === undefined ? instance.parent.contentId : instance.parent.subContentId;
|
|
||||||
this.data.statement.context = {
|
this.data.statement.context = {
|
||||||
"contextActivities": {
|
"contextActivities": {
|
||||||
"parent": [
|
"parent": [
|
||||||
|
@ -217,7 +217,7 @@ H5P.XAPIEvent.prototype.setActor = function () {
|
||||||
* @returns {number}
|
* @returns {number}
|
||||||
* The max score, or null if not defined
|
* The max score, or null if not defined
|
||||||
*/
|
*/
|
||||||
H5P.XAPIEvent.prototype.getMaxScore = function() {
|
H5P.XAPIEvent.prototype.getMaxScore = function () {
|
||||||
return this.getVerifiedStatementValue(['result', 'score', 'max']);
|
return this.getVerifiedStatementValue(['result', 'score', 'max']);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ H5P.XAPIEvent.prototype.getMaxScore = function() {
|
||||||
* @returns {number}
|
* @returns {number}
|
||||||
* The score, or null if not defined
|
* The score, or null if not defined
|
||||||
*/
|
*/
|
||||||
H5P.XAPIEvent.prototype.getScore = function() {
|
H5P.XAPIEvent.prototype.getScore = function () {
|
||||||
return this.getVerifiedStatementValue(['result', 'score', 'raw']);
|
return this.getVerifiedStatementValue(['result', 'score', 'raw']);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ H5P.XAPIEvent.prototype.getContentXAPIId = function (instance) {
|
||||||
H5P.XAPIEvent.prototype.isFromChild = function () {
|
H5P.XAPIEvent.prototype.isFromChild = function () {
|
||||||
var parentId = this.getVerifiedStatementValue(['context', 'contextActivities', 'parent', 0, 'id']);
|
var parentId = this.getVerifiedStatementValue(['context', 'contextActivities', 'parent', 0, 'id']);
|
||||||
return !parentId || parentId.indexOf('subContentId') === -1;
|
return !parentId || parentId.indexOf('subContentId') === -1;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Figure out if a property exists in the statement and return it
|
* Figure out if a property exists in the statement and return it
|
||||||
|
@ -267,7 +267,7 @@ H5P.XAPIEvent.prototype.isFromChild = function () {
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
* The value of the property if it is set, null otherwise.
|
* The value of the property if it is set, null otherwise.
|
||||||
*/
|
*/
|
||||||
H5P.XAPIEvent.prototype.getVerifiedStatementValue = function(keys) {
|
H5P.XAPIEvent.prototype.getVerifiedStatementValue = function (keys) {
|
||||||
var val = this.data.statement;
|
var val = this.data.statement;
|
||||||
for (var i = 0; i < keys.length; i++) {
|
for (var i = 0; i < keys.length; i++) {
|
||||||
if (val[keys[i]] === undefined) {
|
if (val[keys[i]] === undefined) {
|
||||||
|
|
|
@ -92,7 +92,7 @@ H5P.EventDispatcher.prototype.triggerXAPIScored = function (score, maxScore, ver
|
||||||
this.trigger(event);
|
this.trigger(event);
|
||||||
};
|
};
|
||||||
|
|
||||||
H5P.EventDispatcher.prototype.setActivityStarted = function() {
|
H5P.EventDispatcher.prototype.setActivityStarted = function () {
|
||||||
if (this.activityStartTime === undefined) {
|
if (this.activityStartTime === undefined) {
|
||||||
// Don't trigger xAPI events in the editor
|
// Don't trigger xAPI events in the editor
|
||||||
if (this.contentId !== undefined &&
|
if (this.contentId !== undefined &&
|
||||||
|
|
367
js/h5p.js
367
js/h5p.js
|
@ -89,7 +89,7 @@ H5P.init = function (target) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// H5Ps added in normal DIV.
|
// H5Ps added in normal DIV.
|
||||||
var $containers = H5P.jQuery('.h5p-content:not(.h5p-initialized)', target).each(function () {
|
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');
|
||||||
var $container = H5P.jQuery('<div class="h5p-container"></div>').appendTo($element);
|
var $container = H5P.jQuery('<div class="h5p-container"></div>').appendTo($element);
|
||||||
var contentId = $element.data('content-id');
|
var contentId = $element.data('content-id');
|
||||||
|
@ -99,7 +99,8 @@ H5P.init = function (target) {
|
||||||
}
|
}
|
||||||
var library = {
|
var library = {
|
||||||
library: contentData.library,
|
library: contentData.library,
|
||||||
params: JSON.parse(contentData.jsonContent)
|
params: JSON.parse(contentData.jsonContent),
|
||||||
|
metadata: contentData.metadata
|
||||||
};
|
};
|
||||||
|
|
||||||
H5P.getUserData(contentId, 'state', function (err, previousState) {
|
H5P.getUserData(contentId, 'state', function (err, previousState) {
|
||||||
|
@ -163,7 +164,7 @@ H5P.init = function (target) {
|
||||||
if (displayOptions.frame) {
|
if (displayOptions.frame) {
|
||||||
// Special handling of copyrights
|
// Special handling of copyrights
|
||||||
if (displayOptions.copyright) {
|
if (displayOptions.copyright) {
|
||||||
var copyrights = H5P.getCopyrights(instance, library.params, contentId);
|
var copyrights = H5P.getCopyrights(instance, library.params, contentId, library.metadata);
|
||||||
if (!copyrights) {
|
if (!copyrights) {
|
||||||
displayOptions.copyright = false;
|
displayOptions.copyright = false;
|
||||||
}
|
}
|
||||||
|
@ -300,7 +301,7 @@ H5P.init = function (target) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// When resize has been prepared tell parent window to resize
|
// When resize has been prepared tell parent window to resize
|
||||||
H5P.communicator.on('resizePrepared', function (data) {
|
H5P.communicator.on('resizePrepared', function () {
|
||||||
H5P.communicator.send('resize', {
|
H5P.communicator.send('resize', {
|
||||||
scrollHeight: document.body.scrollHeight
|
scrollHeight: document.body.scrollHeight
|
||||||
});
|
});
|
||||||
|
@ -493,7 +494,7 @@ H5P.fullScreen = function ($element, instance, exitCallback, body, forceSemiFull
|
||||||
}
|
}
|
||||||
|
|
||||||
var $container = $element;
|
var $container = $element;
|
||||||
var $classes, $iframe;
|
var $classes, $iframe, $body;
|
||||||
if (body === undefined) {
|
if (body === undefined) {
|
||||||
$body = H5P.$body;
|
$body = H5P.$body;
|
||||||
}
|
}
|
||||||
|
@ -795,6 +796,10 @@ H5P.newRunnable = function (library, contentId, $attachTo, skipResize, extras) {
|
||||||
extras.previousState = library.userDatas.state;
|
extras.previousState = library.userDatas.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (library.metadata) {
|
||||||
|
extras.metadata = library.metadata;
|
||||||
|
}
|
||||||
|
|
||||||
// Makes all H5P libraries extend H5P.ContentType:
|
// Makes all H5P libraries extend H5P.ContentType:
|
||||||
var standalone = extras.standalone || false;
|
var standalone = extras.standalone || false;
|
||||||
// This order makes it possible for an H5P library to override H5P.ContentType functions!
|
// This order makes it possible for an H5P library to override H5P.ContentType functions!
|
||||||
|
@ -973,9 +978,11 @@ H5P.Dialog = function (name, title, content, $element) {
|
||||||
* Parameters of the content instance.
|
* Parameters of the content instance.
|
||||||
* @param {number} contentId
|
* @param {number} contentId
|
||||||
* Identifies the H5P content
|
* Identifies the H5P content
|
||||||
|
* @param {Object} metadata
|
||||||
|
* Metadata of the content instance.
|
||||||
* @returns {string} Copyright information.
|
* @returns {string} Copyright information.
|
||||||
*/
|
*/
|
||||||
H5P.getCopyrights = function (instance, parameters, contentId) {
|
H5P.getCopyrights = function (instance, parameters, contentId, metadata) {
|
||||||
var copyrights;
|
var copyrights;
|
||||||
|
|
||||||
if (instance.getCopyrights !== undefined) {
|
if (instance.getCopyrights !== undefined) {
|
||||||
|
@ -994,6 +1001,11 @@ H5P.getCopyrights = function (instance, parameters, contentId) {
|
||||||
H5P.findCopyrights(copyrights, parameters, contentId);
|
H5P.findCopyrights(copyrights, parameters, contentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var metadataCopyrights = H5P.buildMetadataCopyrights(metadata, instance.libraryInfo.machineName);
|
||||||
|
if (metadataCopyrights !== undefined) {
|
||||||
|
copyrights.addMediaInFront(metadataCopyrights);
|
||||||
|
}
|
||||||
|
|
||||||
if (copyrights !== undefined) {
|
if (copyrights !== undefined) {
|
||||||
// Convert to string
|
// Convert to string
|
||||||
copyrights = copyrights.toString();
|
copyrights = copyrights.toString();
|
||||||
|
@ -1010,8 +1022,19 @@ H5P.getCopyrights = function (instance, parameters, contentId) {
|
||||||
* To search for file objects in.
|
* To search for file objects in.
|
||||||
* @param {number} contentId
|
* @param {number} contentId
|
||||||
* Used to insert thumbnails for images.
|
* Used to insert thumbnails for images.
|
||||||
|
* @param {Object} extras - Extras.
|
||||||
|
* @param {object} extras.metadata - Metadata
|
||||||
|
* @param {object} extras.machineName - Library name of some kind.
|
||||||
|
* Metadata of the content instance.
|
||||||
*/
|
*/
|
||||||
H5P.findCopyrights = function (info, parameters, contentId) {
|
H5P.findCopyrights = function (info, parameters, contentId, extras) {
|
||||||
|
// If extras are
|
||||||
|
if (extras) {
|
||||||
|
extras.params = parameters;
|
||||||
|
buildFromMetadata(extras, extras.machineName, contentId);
|
||||||
|
}
|
||||||
|
|
||||||
|
var lastContentTypeName;
|
||||||
// Cycle through parameters
|
// Cycle through parameters
|
||||||
for (var field in parameters) {
|
for (var field in parameters) {
|
||||||
if (!parameters.hasOwnProperty(field)) {
|
if (!parameters.hasOwnProperty(field)) {
|
||||||
|
@ -1021,6 +1044,8 @@ H5P.findCopyrights = function (info, parameters, contentId) {
|
||||||
/**
|
/**
|
||||||
* @deprecated This hack should be removed after 2017-11-01
|
* @deprecated This hack should be removed after 2017-11-01
|
||||||
* The code that was using this was removed by HFP-574
|
* The code that was using this was removed by HFP-574
|
||||||
|
* This note was seen on 2018-04-04, and consultation with
|
||||||
|
* higher authorities lead to keeping the code for now ;-)
|
||||||
*/
|
*/
|
||||||
if (field === 'overrideSettings') {
|
if (field === 'overrideSettings') {
|
||||||
console.warn("The semantics field 'overrideSettings' is DEPRECATED and should not be used.");
|
console.warn("The semantics field 'overrideSettings' is DEPRECATED and should not be used.");
|
||||||
|
@ -1030,12 +1055,21 @@ H5P.findCopyrights = function (info, parameters, contentId) {
|
||||||
|
|
||||||
var value = parameters[field];
|
var value = parameters[field];
|
||||||
|
|
||||||
|
if (value && value.library && typeof value.library === 'string') {
|
||||||
|
lastContentTypeName = value.library.split(' ')[0];
|
||||||
|
}
|
||||||
|
else if (value && value.library && typeof value.library === 'object') {
|
||||||
|
lastContentTypeName = (value.library.library && typeof value.library.library === 'string') ? value.library.library.split(' ')[0] : lastContentTypeName;
|
||||||
|
}
|
||||||
|
|
||||||
if (value instanceof Array) {
|
if (value instanceof Array) {
|
||||||
// Cycle through array
|
// Cycle through array
|
||||||
H5P.findCopyrights(info, value, contentId);
|
H5P.findCopyrights(info, value, contentId);
|
||||||
}
|
}
|
||||||
else if (value instanceof Object) {
|
else if (value instanceof Object) {
|
||||||
// Check if object is a file with copyrights
|
buildFromMetadata(value, lastContentTypeName, contentId);
|
||||||
|
|
||||||
|
// Check if object is a file with copyrights (old core)
|
||||||
if (value.copyright === undefined ||
|
if (value.copyright === undefined ||
|
||||||
value.copyright.license === undefined ||
|
value.copyright.license === undefined ||
|
||||||
value.path === undefined ||
|
value.path === undefined ||
|
||||||
|
@ -1054,6 +1088,43 @@ H5P.findCopyrights = function (info, parameters, contentId) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buildFromMetadata(data, name, contentId) {
|
||||||
|
if (data.metadata) {
|
||||||
|
const metadataCopyrights = H5P.buildMetadataCopyrights(data.metadata, name);
|
||||||
|
if (metadataCopyrights !== undefined) {
|
||||||
|
if (data.params && data.params.contentName === 'Image' && data.params.file) {
|
||||||
|
const path = data.params.file.path;
|
||||||
|
const width = data.params.file.width;
|
||||||
|
const height = data.params.file.height;
|
||||||
|
metadataCopyrights.setThumbnail(new H5P.Thumbnail(H5P.getPath(path, contentId), width, height));
|
||||||
|
}
|
||||||
|
info.addMedia(metadataCopyrights);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
H5P.buildMetadataCopyrights = function (metadata) {
|
||||||
|
if (metadata && metadata.license !== undefined && metadata.license !== 'U') {
|
||||||
|
var dataset = {
|
||||||
|
contentType: metadata.contentType,
|
||||||
|
title: metadata.title,
|
||||||
|
author: (metadata.authors && metadata.authors.length > 0) ? metadata.authors.map(function (author) {
|
||||||
|
return (author.role) ? author.name + ' (' + author.role + ')' : author.name;
|
||||||
|
}).join(', ') : undefined,
|
||||||
|
source: metadata.source,
|
||||||
|
year: (metadata.yearFrom) ? (metadata.yearFrom + ((metadata.yearTo) ? '-' + metadata.yearTo: '')) : undefined,
|
||||||
|
license: metadata.license,
|
||||||
|
version: metadata.licenseVersion,
|
||||||
|
licenseExtras: metadata.licenseExtras,
|
||||||
|
changes: (metadata.changes && metadata.changes.length > 0) ? metadata.changes.map(function (change) {
|
||||||
|
return change.log + (change.author ? ', ' + change.author : '') + (change.date ? ', ' + change.date : '');
|
||||||
|
}).join(' / ') : undefined
|
||||||
|
};
|
||||||
|
|
||||||
|
return new H5P.MediaCopyright(dataset);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1110,10 +1181,10 @@ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) {
|
||||||
updateEmbed();
|
updateEmbed();
|
||||||
|
|
||||||
// Select text and expand textareas
|
// Select text and expand textareas
|
||||||
$dialog.find('.h5p-embed-code-container').each(function(index, value) {
|
$dialog.find('.h5p-embed-code-container').each(function () {
|
||||||
H5P.jQuery(this).css('height', this.scrollHeight + 'px').focus(function() {
|
H5P.jQuery(this).css('height', this.scrollHeight + 'px').focus(function () {
|
||||||
H5P.jQuery(this).select();
|
H5P.jQuery(this).select();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$dialog.find('.h5p-embed-code-container').eq(0).select();
|
$dialog.find('.h5p-embed-code-container').eq(0).select();
|
||||||
positionInner();
|
positionInner();
|
||||||
|
@ -1130,7 +1201,7 @@ H5P.openEmbedDialog = function ($element, embedCode, resizeCode, size) {
|
||||||
$expander.addClass('h5p-open').text(H5P.t('hideAdvanced'));
|
$expander.addClass('h5p-open').text(H5P.t('hideAdvanced'));
|
||||||
$content.show();
|
$content.show();
|
||||||
}
|
}
|
||||||
$dialog.find('.h5p-embed-code-container').each(function(index, value) {
|
$dialog.find('.h5p-embed-code-container').each(function () {
|
||||||
H5P.jQuery(this).css('height', this.scrollHeight + 'px');
|
H5P.jQuery(this).css('height', this.scrollHeight + 'px');
|
||||||
});
|
});
|
||||||
positionInner();
|
positionInner();
|
||||||
|
@ -1175,6 +1246,17 @@ H5P.ContentCopyrights = function () {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add sub content in front.
|
||||||
|
*
|
||||||
|
* @param {H5P.MediaCopyright} newMedia
|
||||||
|
*/
|
||||||
|
this.addMediaInFront = function (newMedia) {
|
||||||
|
if (newMedia !== undefined) {
|
||||||
|
media.unshift(newMedia);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add sub content.
|
* Add sub content.
|
||||||
*
|
*
|
||||||
|
@ -1294,7 +1376,7 @@ H5P.MediaCopyright = function (copyright, labels, order, extraFields) {
|
||||||
link = copyrightLicense.link.replace(':version', copyrightLicense.linkVersions ? copyrightLicense.linkVersions[version] : version);
|
link = copyrightLicense.link.replace(':version', copyrightLicense.linkVersions ? copyrightLicense.linkVersions[version] : version);
|
||||||
}
|
}
|
||||||
else if (versionInfo && copyrightLicense.hasOwnProperty('link')) {
|
else if (versionInfo && copyrightLicense.hasOwnProperty('link')) {
|
||||||
link = versionInfo.link
|
link = versionInfo.link;
|
||||||
}
|
}
|
||||||
if (link) {
|
if (link) {
|
||||||
value = '<a href="' + link + '" target="_blank">' + value + '</a>';
|
value = '<a href="' + link + '" target="_blank">' + value + '</a>';
|
||||||
|
@ -1331,16 +1413,19 @@ H5P.MediaCopyright = function (copyright, labels, order, extraFields) {
|
||||||
|
|
||||||
if (order === undefined) {
|
if (order === undefined) {
|
||||||
// Set default order
|
// Set default order
|
||||||
order = ['title', 'author', 'year', 'source', 'license'];
|
order = ['contentType', 'title', 'license', 'author', 'year', 'source', 'licenseExtras', 'changes'];
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = 0; i < order.length; i++) {
|
for (var i = 0; i < order.length; i++) {
|
||||||
var fieldName = order[i];
|
var fieldName = order[i];
|
||||||
if (copyright[fieldName] !== undefined) {
|
if (copyright[fieldName] !== undefined && copyright[fieldName] !== '') {
|
||||||
var humanValue = copyright[fieldName];
|
var humanValue = copyright[fieldName];
|
||||||
if (fieldName === 'license') {
|
if (fieldName === 'license') {
|
||||||
humanValue = humanizeLicense(copyright.license, copyright.version);
|
humanValue = humanizeLicense(copyright.license, copyright.version);
|
||||||
}
|
}
|
||||||
|
if (fieldName === 'source') {
|
||||||
|
humanValue = (humanValue) ? '<a href="' + humanValue + '" target="_blank">' + humanValue + '</a>' : undefined;
|
||||||
|
}
|
||||||
list.add(new H5P.Field(getLabel(fieldName), humanValue));
|
list.add(new H5P.Field(getLabel(fieldName), humanValue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1529,7 +1614,8 @@ H5P.Coords = function (x, y, w, h) {
|
||||||
this.y = x.y;
|
this.y = x.y;
|
||||||
this.w = x.w;
|
this.w = x.w;
|
||||||
this.h = x.h;
|
this.h = x.h;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if (x !== undefined) {
|
if (x !== undefined) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
}
|
}
|
||||||
|
@ -1561,8 +1647,8 @@ H5P.libraryFromString = function (library) {
|
||||||
if (res !== null) {
|
if (res !== null) {
|
||||||
return {
|
return {
|
||||||
'machineName': res[1],
|
'machineName': res[1],
|
||||||
'majorVersion': res[2],
|
'majorVersion': parseInt(res[2]),
|
||||||
'minorVersion': res[3]
|
'minorVersion': parseInt(res[3])
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1785,7 +1871,7 @@ H5P.on = function (instance, eventType, handler) {
|
||||||
* @returns {string} UUID
|
* @returns {string} UUID
|
||||||
*/
|
*/
|
||||||
H5P.createUUID = function () {
|
H5P.createUUID = function () {
|
||||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(char) {
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (char) {
|
||||||
var random = Math.random()*16|0, newChar = char === 'x' ? random : (random&0x3|0x8);
|
var random = Math.random()*16|0, newChar = char === 'x' ? random : (random&0x3|0x8);
|
||||||
return newChar.toString(16);
|
return newChar.toString(16);
|
||||||
});
|
});
|
||||||
|
@ -1944,8 +2030,11 @@ H5P.createTitle = function (rawTitle, maxLength) {
|
||||||
* @returns {string|null} Returns the string that should be set as crossorigin policy for elements or null if
|
* @returns {string|null} Returns the string that should be set as crossorigin policy for elements or null if
|
||||||
* no policy is set.
|
* no policy is set.
|
||||||
*/
|
*/
|
||||||
H5P.getCrossOrigin = function () {
|
H5P.getCrossOrigin = function (url) {
|
||||||
return H5PIntegration.crossorigin ? H5PIntegration.crossorigin : null;
|
var crossorigin = H5PIntegration.crossorigin;
|
||||||
|
var urlRegex = H5PIntegration.crossoriginRegex;
|
||||||
|
|
||||||
|
return crossorigin && urlRegex && url.match(urlRegex) ? crossorigin : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2010,7 +2099,7 @@ H5P.createTitle = function (rawTitle, maxLength) {
|
||||||
}
|
}
|
||||||
|
|
||||||
preloadedData[options.subContentId][dataId] = data;
|
preloadedData[options.subContentId][dataId] = data;
|
||||||
contentUserDataAjax(contentId, dataId, options.subContentId, function (error, data) {
|
contentUserDataAjax(contentId, dataId, options.subContentId, function (error) {
|
||||||
if (options.errorCallback && error) {
|
if (options.errorCallback && error) {
|
||||||
options.errorCallback(error);
|
options.errorCallback(error);
|
||||||
}
|
}
|
||||||
|
@ -2041,9 +2130,220 @@ H5P.createTitle = function (rawTitle, maxLength) {
|
||||||
contentUserDataAjax(contentId, dataId, subContentId, undefined, null);
|
contentUserDataAjax(contentId, dataId, subContentId, undefined, null);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function for getting content for a certain ID
|
||||||
|
*
|
||||||
|
* @param {number} contentId
|
||||||
|
* @return {Object}
|
||||||
|
*/
|
||||||
|
H5P.getContentForInstance = function (contentId) {
|
||||||
|
var key = 'cid-' + contentId;
|
||||||
|
var exists = H5PIntegration && H5PIntegration.contents &&
|
||||||
|
H5PIntegration.contents[key];
|
||||||
|
|
||||||
|
return exists ? H5PIntegration.contents[key] : undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepares the content parameters for storing in the clipboard.
|
||||||
|
*
|
||||||
|
* @class
|
||||||
|
* @param {Object} parameters The parameters for the content to store
|
||||||
|
* @param {string} [genericProperty] If only part of the parameters are generic, which part
|
||||||
|
* @param {string} [specificKey] If the parameters are specific, what content type does it fit
|
||||||
|
* @returns {Object} Ready for the clipboard
|
||||||
|
*/
|
||||||
|
H5P.ClipboardItem = function (parameters, genericProperty, specificKey) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set relative dimensions when params contains a file with a width and a height.
|
||||||
|
* Very useful to be compatible with wysiwyg editors.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
var setDimensionsFromFile = function () {
|
||||||
|
if (!self.generic) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var params = self.specific[self.generic];
|
||||||
|
if (!params.params.file || !params.params.file.width || !params.params.file.height) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.width = 20; // %
|
||||||
|
self.height = (params.params.file.height / params.params.file.width) * self.width;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!genericProperty) {
|
||||||
|
genericProperty = 'action';
|
||||||
|
parameters = {
|
||||||
|
action: parameters
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
self.specific = parameters;
|
||||||
|
|
||||||
|
if (genericProperty && parameters[genericProperty]) {
|
||||||
|
self.generic = genericProperty;
|
||||||
|
}
|
||||||
|
if (specificKey) {
|
||||||
|
self.from = specificKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window.H5PEditor && H5PEditor.contentId) {
|
||||||
|
self.contentId = H5PEditor.contentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!self.specific.width && !self.specific.height) {
|
||||||
|
setDimensionsFromFile();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store item in the H5P Clipboard.
|
||||||
|
*
|
||||||
|
* @param {H5P.ClipboardItem|*} clipboardItem
|
||||||
|
*/
|
||||||
|
H5P.clipboardify = function (clipboardItem) {
|
||||||
|
if (!(clipboardItem instanceof H5P.ClipboardItem)) {
|
||||||
|
clipboardItem = new H5P.ClipboardItem(clipboardItem);
|
||||||
|
}
|
||||||
|
H5P.setClipboard(clipboardItem);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a cache for pasted data to prevent parsing multiple times.
|
||||||
|
* @type {Object}
|
||||||
|
*/
|
||||||
|
var parsedClipboard = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve parsed clipboard data.
|
||||||
|
*
|
||||||
|
* @return {Object}
|
||||||
|
*/
|
||||||
|
H5P.getClipboard = function () {
|
||||||
|
if (!parsedClipboard) {
|
||||||
|
parsedClipboard = parseClipboard();
|
||||||
|
}
|
||||||
|
|
||||||
|
return parsedClipboard;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set item in the H5P Clipboard.
|
||||||
|
*
|
||||||
|
* @param {H5P.ClipboardItem|object} clipboardItem - Data to be set.
|
||||||
|
*/
|
||||||
|
H5P.setClipboard = function (clipboardItem) {
|
||||||
|
localStorage.setItem('h5pClipboard', JSON.stringify(clipboardItem));
|
||||||
|
|
||||||
|
// Clear cache
|
||||||
|
parsedClipboard = null;
|
||||||
|
|
||||||
|
// Trigger an event so all 'Paste' buttons may be enabled.
|
||||||
|
H5P.externalDispatcher.trigger('datainclipboard', {reset: false});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get config for a library
|
||||||
|
*
|
||||||
|
* @param string machineName
|
||||||
|
* @return Object
|
||||||
|
*/
|
||||||
|
H5P.getLibraryConfig = function (machineName) {
|
||||||
|
var hasConfig = H5PIntegration.libraryConfig && H5PIntegration.libraryConfig[machineName];
|
||||||
|
return hasConfig ? H5PIntegration.libraryConfig[machineName] : {};
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get item from the H5P Clipboard.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {boolean} [skipUpdateFileUrls]
|
||||||
|
* @return {Object}
|
||||||
|
*/
|
||||||
|
var parseClipboard = function () {
|
||||||
|
var clipboardData = localStorage.getItem('h5pClipboard');
|
||||||
|
if (!clipboardData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try to parse clipboard dat
|
||||||
|
try {
|
||||||
|
clipboardData = JSON.parse(clipboardData);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error('Unable to parse JSON from clipboard.', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update file URLs
|
||||||
|
updateFileUrls(clipboardData.specific, function (path) {
|
||||||
|
var isTmpFile = (path.substr(-4, 4) === '#tmp');
|
||||||
|
if (!isTmpFile && clipboardData.contentId) {
|
||||||
|
// Comes from existing content
|
||||||
|
|
||||||
|
if (H5PEditor.contentId) {
|
||||||
|
// .. to existing content
|
||||||
|
return '../' + clipboardData.contentId + '/' + path;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// .. to new content
|
||||||
|
return (H5PEditor.contentRelUrl ? H5PEditor.contentRelUrl : '../content/') + clipboardData.contentId + '/' + path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return path; // Will automatically be looked for in tmp folder
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
if (clipboardData.generic) {
|
||||||
|
// Use reference instead of key
|
||||||
|
clipboardData.generic = clipboardData.specific[clipboardData.generic];
|
||||||
|
|
||||||
|
// Avoid multiple content with same ID
|
||||||
|
delete clipboardData.generic.subContentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
return clipboardData;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update file URLs. Useful when copying content.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {object} params Reference
|
||||||
|
* @param {function} handler Modifies the path to work when pasted
|
||||||
|
*/
|
||||||
|
var updateFileUrls = function (params, handler) {
|
||||||
|
for (var prop in params) {
|
||||||
|
if (params.hasOwnProperty(prop) && params[prop] instanceof Object) {
|
||||||
|
var obj = params[prop];
|
||||||
|
if (obj.path !== undefined && obj.mime !== undefined) {
|
||||||
|
obj.path = handler(obj.path);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
updateFileUrls(obj, handler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Init H5P when page is fully loadded
|
// Init H5P when page is fully loadded
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
window.addEventListener('storage', function (event) {
|
||||||
|
// Pick up clipboard changes from other tabs
|
||||||
|
if (event.key === 'h5pClipboard') {
|
||||||
|
// Clear cache
|
||||||
|
parsedClipboard = null;
|
||||||
|
|
||||||
|
// Trigger an event so all 'Paste' buttons may be enabled.
|
||||||
|
H5P.externalDispatcher.trigger('datainclipboard', {reset: event.newValue === null});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var ccVersions = {
|
var ccVersions = {
|
||||||
'default': '4.0',
|
'default': '4.0',
|
||||||
'4.0': H5P.t('licenseCC40'),
|
'4.0': H5P.t('licenseCC40'),
|
||||||
|
@ -2062,34 +2362,38 @@ H5P.createTitle = function (rawTitle, maxLength) {
|
||||||
'U': H5P.t('licenseU'),
|
'U': H5P.t('licenseU'),
|
||||||
'CC BY': {
|
'CC BY': {
|
||||||
label: H5P.t('licenseCCBY'),
|
label: H5P.t('licenseCCBY'),
|
||||||
link: 'http://creativecommons.org/licenses/by/:version/legalcode',
|
link: 'http://creativecommons.org/licenses/by/:version',
|
||||||
versions: ccVersions
|
versions: ccVersions
|
||||||
},
|
},
|
||||||
'CC BY-SA': {
|
'CC BY-SA': {
|
||||||
label: H5P.t('licenseCCBYSA'),
|
label: H5P.t('licenseCCBYSA'),
|
||||||
link: 'http://creativecommons.org/licenses/by-sa/:version/legalcode',
|
link: 'http://creativecommons.org/licenses/by-sa/:version',
|
||||||
versions: ccVersions
|
versions: ccVersions
|
||||||
},
|
},
|
||||||
'CC BY-ND': {
|
'CC BY-ND': {
|
||||||
label: H5P.t('licenseCCBYND'),
|
label: H5P.t('licenseCCBYND'),
|
||||||
link: 'http://creativecommons.org/licenses/by-nd/:version/legalcode',
|
link: 'http://creativecommons.org/licenses/by-nd/:version',
|
||||||
versions: ccVersions
|
versions: ccVersions
|
||||||
},
|
},
|
||||||
'CC BY-NC': {
|
'CC BY-NC': {
|
||||||
label: H5P.t('licenseCCBYNC'),
|
label: H5P.t('licenseCCBYNC'),
|
||||||
link: 'http://creativecommons.org/licenses/by-nc/:version/legalcode',
|
link: 'http://creativecommons.org/licenses/by-nc/:version',
|
||||||
versions: ccVersions
|
versions: ccVersions
|
||||||
},
|
},
|
||||||
'CC BY-NC-SA': {
|
'CC BY-NC-SA': {
|
||||||
label: H5P.t('licenseCCBYNCSA'),
|
label: H5P.t('licenseCCBYNCSA'),
|
||||||
link: 'http://creativecommons.org/licenses/by-nc-sa/:version/legalcode',
|
link: 'http://creativecommons.org/licenses/by-nc-sa/:version',
|
||||||
versions: ccVersions
|
versions: ccVersions
|
||||||
},
|
},
|
||||||
'CC BY-NC-ND': {
|
'CC BY-NC-ND': {
|
||||||
label: H5P.t('licenseCCBYNCND'),
|
label: H5P.t('licenseCCBYNCND'),
|
||||||
link: 'http://creativecommons.org/licenses/by-nc-nd/:version/legalcode',
|
link: 'http://creativecommons.org/licenses/by-nc-nd/:version',
|
||||||
versions: ccVersions
|
versions: ccVersions
|
||||||
},
|
},
|
||||||
|
'CC0 1.0': {
|
||||||
|
label: H5P.t('licenseCC010'),
|
||||||
|
link: 'https://creativecommons.org/publicdomain/zero/1.0/'
|
||||||
|
},
|
||||||
'GNU GPL': {
|
'GNU GPL': {
|
||||||
label: H5P.t('licenseGPL'),
|
label: H5P.t('licenseGPL'),
|
||||||
link: 'http://www.gnu.org/licenses/gpl-:version-standalone.html',
|
link: 'http://www.gnu.org/licenses/gpl-:version-standalone.html',
|
||||||
|
@ -2119,7 +2423,10 @@ H5P.createTitle = function (rawTitle, maxLength) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'ODC PDDL': '<a href="http://opendatacommons.org/licenses/pddl/1.0/" target="_blank">Public Domain Dedication and Licence</a>',
|
'ODC PDDL': '<a href="http://opendatacommons.org/licenses/pddl/1.0/" target="_blank">Public Domain Dedication and Licence</a>',
|
||||||
'CC PDM': H5P.t('licensePDM'),
|
'CC PDM': {
|
||||||
|
label: H5P.t('licensePDM'),
|
||||||
|
link: 'https://creativecommons.org/publicdomain/mark/1.0/'
|
||||||
|
},
|
||||||
'C': H5P.t('licenseC'),
|
'C': H5P.t('licenseC'),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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-18.eot?cb8kvi');
|
src: url('../fonts/h5p-core-19.eot?cb8kvi');
|
||||||
src: url('../fonts/h5p-core-18.eot?cb8kvi#iefix') format('embedded-opentype'),
|
src: url('../fonts/h5p-core-19.eot?cb8kvi#iefix') format('embedded-opentype'),
|
||||||
url('../fonts/h5p-core-18.ttf?cb8kvi') format('truetype'),
|
url('../fonts/h5p-core-19.ttf?cb8kvi') format('truetype'),
|
||||||
url('../fonts/h5p-core-18.woff?cb8kvi') format('woff'),
|
url('../fonts/h5p-core-19.woff?cb8kvi') format('woff'),
|
||||||
url('../fonts/h5p-core-18.svg?cb8kvi#h5p') format('svg');
|
url('../fonts/h5p-core-19.svg?cb8kvi#h5p') format('svg');
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue