]> _ Git - hf-scorm-package.git/commitdiff
wip #4907 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 14 Dec 2021 11:08:53 +0000 (12:08 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 14 Dec 2021 11:08:53 +0000 (12:08 +0100)
14 files changed:
.idea/deployment.xml
.idea/laravel-query-settings.xml [new file with mode: 0644]
.idea/watcherTasks.xml [new file with mode: 0644]
index.html
js/scormpackage.js
style/open-sans-v27-latin-300.woff2 [new file with mode: 0644]
style/open-sans-v27-latin-500.woff2 [new file with mode: 0644]
style/open-sans-v27-latin-600.woff2 [new file with mode: 0644]
style/open-sans-v27-latin-700.woff2 [new file with mode: 0644]
style/open-sans-v27-latin-800.woff2 [new file with mode: 0644]
style/open-sans-v27-latin-regular.woff2 [new file with mode: 0644]
style/style.css [new file with mode: 0644]
style/style.css.map [new file with mode: 0644]
style/style.sass [new file with mode: 0644]

index 4921b1274dfc1ba1590194354b90a9c2fa7e857f..44ca711899c58542f9b7533d68e41854e9a533c4 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
-  <component name="PublishConfigData" remoteFilesAllowedToDisappearOnAutoupload="false">
+  <component name="PublishConfigData" autoUpload="Always" serverName="demo1.cubedesigners.com" remoteFilesAllowedToDisappearOnAutoupload="false" autoUploadExternalChanges="true">
     <serverData>
       <paths name="apps.fluidbook.com">
         <serverdata>
@@ -12,7 +12,7 @@
       <paths name="demo1.cubedesigners.com">
         <serverdata>
           <mappings>
-            <mapping local="$PROJECT_DIR$" web="/" />
+            <mapping deploy="/hf_scorm_package" local="$PROJECT_DIR$" web="/hf_scorm_package/index.html" />
           </mappings>
         </serverdata>
       </paths>
         </serverdata>
       </paths>
     </serverData>
+    <option name="myAutoUpload" value="ALWAYS" />
   </component>
 </project>
\ No newline at end of file
diff --git a/.idea/laravel-query-settings.xml b/.idea/laravel-query-settings.xml
new file mode 100644 (file)
index 0000000..7d5ef0a
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="LaravelQuerySettings">
+    <option name="ignoreSettings" value="true" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/watcherTasks.xml b/.idea/watcherTasks.xml
new file mode 100644 (file)
index 0000000..560ddd1
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectTasksOptions">
+    <TaskOptions isEnabled="true">
+      <option name="arguments" value="$FileName$:$FileNameWithoutExtension$.css" />
+      <option name="checkSyntaxErrors" value="true" />
+      <option name="description" />
+      <option name="exitCodeBehavior" value="ERROR" />
+      <option name="fileExtension" value="sass" />
+      <option name="immediateSync" value="true" />
+      <option name="name" value="Sass" />
+      <option name="output" value="$FileNameWithoutExtension$.css:$FileNameWithoutExtension$.css.map" />
+      <option name="outputFilters">
+        <array />
+      </option>
+      <option name="outputFromStdout" value="false" />
+      <option name="program" value="sass" />
+      <option name="runOnExternalChanges" value="true" />
+      <option name="scopeName" value="Project Files" />
+      <option name="trackOnlyRoot" value="true" />
+      <option name="workingDir" value="$FileDir$" />
+      <envs />
+    </TaskOptions>
+  </component>
+</project>
\ No newline at end of file
index dddc6e353de02259d0569f8bfa8bd1ad184d0086..4c9c6313e859d26a304d5b2aae9d18e48b0d21d0 100644 (file)
@@ -3,14 +3,77 @@
 <head>
        <meta charset="UTF-8">
        <title></title>
+       <link href="style/style.css" rel="stylesheet">
 </head>
 <body>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none;">
+       <symbol id="interface-close" viewBox="0 0 512 512">
+               <path fill="currentColor" d="m512 63l-66-63-190 193-193-193-63 63 193 193-193 190 63 66 193-193 190 193 66-66-193-190z"/>
+       </symbol>
+       <symbol id="icon-QZ" viewBox="0 0 36 36">
+               <path stroke="currentColor" fill="transparent" d="M23.1,9.6c5.3,0,9.5,3.8,9.5,8.5c0,4.7-4.3,8.5-9.5,8.5c-1.1,0-2.1-0.2-3-0.4c-1.1,1-1.7,1.4-3.6,2.3
+                M16.5,28.5l0-4.3c-1.8-1.5-2.9-3.7-2.9-6.1 M23.7,22.2c0,0.1,0,0.2,0,0.3 M24.5,14.4l-0.6,5.4 M12.9,13.3c0,0.1,0,0.2,0,0.3
+                M11.2,6.8c1-1.8,3.9-1.9,3.9,0.6c0,1.7-2.2,1.6-2.2,3.6 M12.9,1.1c-5.3,0-9.5,3.8-9.5,8.5c0,4.7,4.3,8.5,9.5,8.5
+               c1.1,0,2.1-0.2,3-0.4c1.1,1,1.7,1.4,3.6,2.3l0-4.3c1.8-1.5,2.9-3.7,2.9-6.1C22.4,4.9,18.1,1.1,12.9,1.1z"/>
+       </symbol>
+       <symbol id="icon-FB" viewBox="0 0 36 36">
+               <g>
+                       <path stroke="currentColor" fill="transparent" d="M27.5,28.3v2.2 M27.5,26.8v-0.7c0-1.2-1-2.2-2.2-2.2H8.5c-1.2,0-2.2-1-2.2-2.2v-2.2 M30,34.9h-4.9
+                       c-0.3,0-0.5-0.2-0.5-0.5v-7.1c0-0.3,0.2-0.5,0.5-0.5H30c0.3,0,0.5,0.2,0.5,0.5v7.1C30.5,34.6,30.2,34.9,30,34.9z M29.7,16.5h-7.3
+                       c-1.4,0-2.4,0.4-2.9,1.5H18V5.5c0-2.4,1.4-4.4,4.4-4.4h7.3V16.5z M6.3,16.5h7.3c1.4,0,2.4,0.4,2.9,1.5H18V5.5
+                       c0-2.4-1.4-4.4-4.4-4.4H6.3V16.5z M31.2,4.1h1.5v15.4H22.4l-1.5,1.5h-5.9l-1.5-1.5H3.3V4.1h1.5"/>
+               </g>
+       </symbol>
+       <symbol id="icon-IN" viewBox="0 0 36 36">
+               <path stroke="currentColor" fill="transparent" d="M7.3,18.9h7.8v-7.6H7.3V18.9z M28.1,7.5H7.3V5h20.8V7.5z M17,18.9h11.7 M17,16.4h11.7 M17,13.8h11.7 M17,11.3
+               h11.7"/>
+               <path stroke="currentColor" fill="transparent" d="M33,26.6H4.6c-0.7,0-1.3-0.6-1.3-1.3V1.1h28.4v24.2C31.7,26,32.3,26.6,33,26.6"/>
+       </symbol>
+       <symbol id="icon-AN" viewBox="0 0 36 36">
+               <path stroke="currentColor" fill="transparent" d="M14.4,16.7V8.5c0-0.7,0.7-1.2,1.3-0.8l7.2,4.1c0.6,0.4,0.6,1.3,0,1.7l-7.2,4.1C15.2,17.9,14.4,17.4,14.4,16.7z
+               "/>
+               <path stroke="currentColor" fill="transparent" d="M32.2,24.1H3.8c-0.3,0-0.5-0.2-0.5-0.5V1.6c0-0.3,0.2-0.5,0.5-0.5h28.3c0.3,0,0.5,0.2,0.5,0.5v21.9
+               C32.6,23.9,32.4,24.1,32.2,24.1z"/>
+       </symbol>
+       <symbol id="icon-VI" viewBox="0 0 36 36">
+               <path stroke="currentColor" fill="transparent" d="M14.4,16.7V8.5c0-0.7,0.7-1.2,1.3-0.8l7.2,4.1c0.6,0.4,0.6,1.3,0,1.7l-7.2,4.1C15.2,17.9,14.4,17.4,14.4,16.7z
+               "/>
+               <path stroke="currentColor" fill="transparent" d="M32.2,24.1H3.8c-0.3,0-0.5-0.2-0.5-0.5V1.6c0-0.3,0.2-0.5,0.5-0.5h28.3c0.3,0,0.5,0.2,0.5,0.5v21.9
+               C32.6,23.9,32.4,24.1,32.2,24.1z"/>
+       </symbol>
+       <symbol id="icon-PC" viewBox="0 0 36 36">
+               <path stroke="currentColor" fill="transparent" d="M27.5,28.7c3.2-3.3,5.1-7.9,5.1-12.9s-2-9.6-5.1-12.9"/>
+               <path stroke="currentColor" fill="transparent" d="M10.6,21.9H5.2c-1,0-1.8-0.8-1.8-1.8v-8.5c0-1,0.8-1.8,1.8-1.8h5.5l8.5-8.5v29.3L10.6,21.9z"/>
+               <path stroke="currentColor" fill="transparent" d="M25.2,25.2c2.3-2.4,3.8-5.8,3.8-9.4c0-3.7-1.5-7-3.8-9.4 M23,21.8c1.5-1.5,2.4-3.7,2.4-6c0-2.3-0.9-4.5-2.4-6"
+               />
+       </symbol>
+</svg>
 <header>
        <h1></h1>
 </header>
 <main>
+       <table>
+               <thead>
+               <tr>
+                       <th></th>
+                       <th></th>
+                       <th>Type</th>
+                       <th>Mandatory</th>
+                       <th>Validated</th>
+                       <th>Score</th>
+               </tr>
+               </thead>
+               <tbody>
 
+               </tbody>
+       </table>
 </main>
+
+<div id="scowin">
+       <div id="scobar"><div id="scoicon"></div><h2></h2><a href="#" class="close"></a></div>
+       <iframe id="sco" frameborder="0"></iframe>
+</div>
+
 <script src="data.js"></script>
 <script src="js/libs/jquery.min.js"></script>
 <script src="js/libs/scorm/apiwrapper.js"></script>
index a6ddeff0e78be2234fd60f7195a002786112adeb..549f3654aa72613288db63a8b75bec2b5c7e1fe8 100644 (file)
@@ -1,11 +1,75 @@
 (function (global) {
     $(function () {
+        initEvents();
+        setContents();
 
     });
 
 })(typeof window === 'undefined' ? this : window);
 
 
+function initEvents() {
+    $(document).on('click', '[data-id]', function () {
+        openSubSCO($(this).data('id'));
+        return false;
+    });
+
+    $(document).on('click', '#scobar a.close', function () {
+        closeSubSCO();
+        return false;
+    });
+}
+
+function closeSubSCO() {
+    $("#scowin").removeClass('show');
+    $('#sco').attr('src', '');
+}
+
+function openSubSCO(id) {
+    var module = getModuleData(id);
+    var path = module.path;
+
+    var e = path.split('.');
+    var ext = e.pop().toLowerCase();
+
+    if (ext === 'pdf') {
+        path = 'js/libs/pdfjs/web/viewer.html?file=../../../../' + path;
+    }
+
+    $("#scowin").addClass('show');
+    $("#scowin h2").text(module.title);
+    $("#scobar #scoicon").html(getSpriteIcon('icon-' + module.type));
+    $("#scobar .close").html(getSpriteIcon('interface-close'));
+    $("#sco").attr('src', path);
+}
+
+function getModuleData(id) {
+    for (var k in DATA.modules) {
+        var m = DATA.modules[k];
+        if (m.id == id) {
+            return m;
+        }
+    }
+    return null;
+}
+
+function setContents() {
+    var vcheck = '';
+    var xcheck = '';
+    var types = {IN: 'Infographic PDF', AN: 'Animation', VI: 'Video', FB: 'Fluidbook', PC: 'Podcast HTML', QZ: 'Quiz'};
+    $('header h1').text(DATA.title);
+    $('title').text(DATA.title);
+    $.each(DATA.modules, function (k, v) {
+        var tr = $('<tr data-type="' + v.type + '" data-id="' + v.id + '"><td></td></tr>');
+        $('tbody').append(tr);
+        tr.append('<td>' + v.title + '</td>');
+        tr.append('<td>' + types[v.type] + '</td>');
+        tr.append('<td>' + (v.mandatory ? vcheck : xcheck) + '</td>');
+        tr.append('<td>' + '</td>');
+        tr.append('<td class="score">' + '</td>');
+    });
+}
+
 (function (global) {
     'use strict';
     if (!global.console) {
@@ -88,4 +152,44 @@ function setScormValue(elementName, value) {
     var result = doLMSSetValue(elementName, value);
     doLMSCommit();
     return result;
+}
+
+function getSpriteIcon(icon, attrs, dimensions) {
+    var a = [];
+    var iconSymbol = $('svg symbol[id="' + icon + '"]');
+    if (iconSymbol.length > 1) {
+        $('svg symbol[id="' + icon + '"]:not(:last)').remove();
+        iconSymbol = $('svg symbol[id="' + icon + '"]');
+    }
+
+    if (iconSymbol.length == 0) {
+        //console.warn('Unable to find sprite icon: ' + icon);
+        return ''; // Bail out because symbol doesn't exist
+    }
+
+    if (attrs == undefined) {
+        attrs = {};
+    }
+    if (attrs.viewBox == null) {
+        attrs.viewBox = iconSymbol.get(0).attributes.viewBox.value;
+    }
+    if (dimensions === true) {
+        var vb = attrs.viewBox.split(' ');
+        attrs.x = vb[0];
+        attrs.y = vb[1];
+        attrs.width = vb[2];
+        attrs.height = vb[3];
+    }
+    if (attrs.class == null) {
+        attrs.class = icon;
+    } else {
+        attrs.class += ' ' + icon;
+    }
+
+    attrs.class += ' nav-icon svg-icon'; // Common class for all icons
+
+    $.each(attrs, function (k, v) {
+        a.push(k + '="' + v + '"');
+    });
+    return '<svg ' + a.join(' ') + ' aria-hidden="true"><use xlink:href="#' + icon + '" /></svg>';
 }
\ No newline at end of file
diff --git a/style/open-sans-v27-latin-300.woff2 b/style/open-sans-v27-latin-300.woff2
new file mode 100644 (file)
index 0000000..b7c278a
Binary files /dev/null and b/style/open-sans-v27-latin-300.woff2 differ
diff --git a/style/open-sans-v27-latin-500.woff2 b/style/open-sans-v27-latin-500.woff2
new file mode 100644 (file)
index 0000000..3cd29e1
Binary files /dev/null and b/style/open-sans-v27-latin-500.woff2 differ
diff --git a/style/open-sans-v27-latin-600.woff2 b/style/open-sans-v27-latin-600.woff2
new file mode 100644 (file)
index 0000000..d3eaed3
Binary files /dev/null and b/style/open-sans-v27-latin-600.woff2 differ
diff --git a/style/open-sans-v27-latin-700.woff2 b/style/open-sans-v27-latin-700.woff2
new file mode 100644 (file)
index 0000000..e866070
Binary files /dev/null and b/style/open-sans-v27-latin-700.woff2 differ
diff --git a/style/open-sans-v27-latin-800.woff2 b/style/open-sans-v27-latin-800.woff2
new file mode 100644 (file)
index 0000000..1806943
Binary files /dev/null and b/style/open-sans-v27-latin-800.woff2 differ
diff --git a/style/open-sans-v27-latin-regular.woff2 b/style/open-sans-v27-latin-regular.woff2
new file mode 100644 (file)
index 0000000..6354811
Binary files /dev/null and b/style/open-sans-v27-latin-regular.woff2 differ
diff --git a/style/style.css b/style/style.css
new file mode 100644 (file)
index 0000000..fe2334c
--- /dev/null
@@ -0,0 +1,117 @@
+body, html {
+  min-height: 100%;
+}
+
+* {
+  padding: 0;
+  margin: 0;
+  box-sizing: border-box;
+  font-family: "Open Sans", Arial, Helvetica, sans-serif;
+}
+
+[data-id] {
+  cursor: pointer;
+}
+
+#scowin {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  z-index: 100;
+  display: none;
+  opacity: 0;
+  transition: 500ms opacity;
+  background-color: #fff;
+}
+#scowin.show {
+  opacity: 1;
+  display: block;
+  transition: 500ms opacity;
+}
+#scowin #scobar {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 30px;
+  background: #8b276d;
+  color: #fff;
+}
+#scowin #scobar a.close {
+  position: absolute;
+  top: 5px;
+  right: 5px;
+}
+#scowin #scobar a.close svg {
+  width: 20px;
+  height: 20px;
+  color: #fff;
+}
+#scowin #scobar #scoicon {
+  position: absolute;
+  top: 4px;
+  left: 2px;
+  height: 26px;
+  width: 26px;
+}
+#scowin #scobar h2 {
+  margin-left: 40px;
+  font-size: 18px;
+  margin-top: 3px;
+  font-weight: 400;
+}
+#scowin #sco {
+  position: absolute;
+  width: 100%;
+  height: calc(100% - 30px);
+  top: 30px;
+  left: 0;
+  background-color: #000;
+}
+
+/* open-sans-300 - latin */
+@font-face {
+  font-family: "Open Sans";
+  font-style: normal;
+  font-weight: 300;
+  src: url("open-sans-v27-latin-300.woff2") format("woff2");
+}
+/* open-sans-regular - latin */
+@font-face {
+  font-family: "Open Sans";
+  font-style: normal;
+  font-weight: 400;
+  src: url("open-sans-v27-latin-regular.woff2") format("woff2");
+}
+/* open-sans-500 - latin */
+@font-face {
+  font-family: "Open Sans";
+  font-style: normal;
+  font-weight: 500;
+  src: url("open-sans-v27-latin-500.woff2") format("woff2");
+}
+/* open-sans-600 - latin */
+@font-face {
+  font-family: "Open Sans";
+  font-style: normal;
+  font-weight: 600;
+  src: url("open-sans-v27-latin-600.woff2") format("woff2");
+}
+/* open-sans-700 - latin */
+@font-face {
+  font-family: "Open Sans";
+  font-style: normal;
+  font-weight: 700;
+  src: url("open-sans-v27-latin-700.woff2") format("woff2");
+}
+/* open-sans-800 - latin */
+@font-face {
+  font-family: "Open Sans";
+  font-style: normal;
+  font-weight: 800;
+  src: url("open-sans-v27-latin-800.woff2") format("woff2");
+}
+
+/*# sourceMappingURL=style.css.map */
diff --git a/style/style.css.map b/style/style.css.map
new file mode 100644 (file)
index 0000000..3e219a1
--- /dev/null
@@ -0,0 +1 @@
+{"version":3,"sourceRoot":"","sources":["style.sass"],"names":[],"mappings":"AAAA;EACE;;;AAEF;EACE;EACA;EACA;EACA;;;AAGF;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AACA;EACE;EACA;EACA;;AAEJ;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAEJ;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEJ;AACA;EACE;EACA;EACA;EACA;;AAGF;AACA;EACE;EACA;EACA;EACA;;AAGF;AACA;EACE;EACA;EACA;EACA;;AAGF;AACA;EACE;EACA;EACA;EACA;;AAGF;AACA;EACE;EACA;EACA;EACA;;AAGF;AACA;EACE;EACA;EACA;EACA","file":"style.css"}
\ No newline at end of file
diff --git a/style/style.sass b/style/style.sass
new file mode 100644 (file)
index 0000000..adacb1c
--- /dev/null
@@ -0,0 +1,117 @@
+body, html
+  min-height: 100%
+
+*
+  padding: 0
+  margin: 0
+  box-sizing: border-box
+  font-family: 'Open Sans', Arial, Helvetica, sans-serif
+
+
+[data-id]
+  cursor: pointer
+
+#scowin
+  position: fixed
+  top: 0
+  left: 0
+  width: 100%
+  height: 100%
+  z-index: 100
+  display: none
+  opacity: 0
+  transition: 500ms opacity
+  background-color: #fff
+  &.show
+    opacity: 1
+    display: block
+    transition: 500ms opacity
+
+
+  #scobar
+    position: absolute
+    top: 0
+    left: 0
+    width: 100%
+    height: 30px
+    background: #8b276d
+    color: #fff
+
+    a.close
+      position: absolute
+      top: 5px
+      right: 5px
+      svg
+        width: 20px
+        height: 20px
+        color: #fff
+
+    #scoicon
+      position: absolute
+      top: 4px
+      left: 2px
+      height: 26px
+      width: 26px
+
+
+    h2
+      margin-left: 40px
+      font-size: 18px
+      margin-top: 3px
+      font-weight: 400
+
+  #sco
+    position: absolute
+    width: 100%
+    height: calc(100% - 30px)
+    top: 30px
+    left: 0
+    background-color: #000
+
+/* open-sans-300 - latin */
+@font-face
+  font-family: 'Open Sans'
+  font-style: normal
+  font-weight: 300
+  src: url('open-sans-v27-latin-300.woff2') format('woff2')
+
+
+/* open-sans-regular - latin */
+@font-face
+  font-family: 'Open Sans'
+  font-style: normal
+  font-weight: 400
+  src: url('open-sans-v27-latin-regular.woff2') format('woff2')
+
+
+/* open-sans-500 - latin */
+@font-face
+  font-family: 'Open Sans'
+  font-style: normal
+  font-weight: 500
+  src: url('open-sans-v27-latin-500.woff2') format('woff2')
+
+
+/* open-sans-600 - latin */
+@font-face
+  font-family: 'Open Sans'
+  font-style: normal
+  font-weight: 600
+  src: url('open-sans-v27-latin-600.woff2') format('woff2')
+
+
+/* open-sans-700 - latin */
+@font-face
+  font-family: 'Open Sans'
+  font-style: normal
+  font-weight: 700
+  src: url('open-sans-v27-latin-700.woff2') format('woff2')
+
+
+/* open-sans-800 - latin */
+@font-face
+  font-family: 'Open Sans'
+  font-style: normal
+  font-weight: 800
+  src: url('open-sans-v27-latin-800.woff2') format('woff2')
+