jclic 2.1.21 → 2.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/jclic-node.js +9 -8
  3. package/dist/jclic-node.js.map +1 -1
  4. package/dist/jclic.min.js +2 -2
  5. package/dist/jclic.min.js.map +1 -1
  6. package/package.json +4 -4
  7. package/src/GlobalData.js +1 -1
  8. package/src/JClicPlayer.js +2 -2
  9. package/src/bags/MediaBag.js +6 -5
  10. package/dist/1078.jclic-node.js +0 -282
  11. package/dist/1078.jclic-node.js.map +0 -1
  12. package/dist/1196.jclic-node.js +0 -808
  13. package/dist/1196.jclic-node.js.map +0 -1
  14. package/dist/1253.jclic-node.js +0 -1432
  15. package/dist/1253.jclic-node.js.map +0 -1
  16. package/dist/13.jclic-node.js +0 -103
  17. package/dist/13.jclic-node.js.map +0 -1
  18. package/dist/1567.jclic-node.js +0 -2313
  19. package/dist/1567.jclic-node.js.map +0 -1
  20. package/dist/1588.jclic-node.js +0 -602
  21. package/dist/1588.jclic-node.js.map +0 -1
  22. package/dist/1725.jclic-node.js +0 -836
  23. package/dist/1725.jclic-node.js.map +0 -1
  24. package/dist/1731.jclic-node.js +0 -438
  25. package/dist/1731.jclic-node.js.map +0 -1
  26. package/dist/1842.jclic-node.js +0 -651
  27. package/dist/1842.jclic-node.js.map +0 -1
  28. package/dist/2160.jclic-node.js +0 -1016
  29. package/dist/2160.jclic-node.js.map +0 -1
  30. package/dist/222.jclic-node.js +0 -129
  31. package/dist/222.jclic-node.js.map +0 -1
  32. package/dist/2316.jclic-node.js +0 -949
  33. package/dist/2316.jclic-node.js.map +0 -1
  34. package/dist/2355.jclic-node.js +0 -371
  35. package/dist/2355.jclic-node.js.map +0 -1
  36. package/dist/2366.jclic-node.js +0 -431
  37. package/dist/2366.jclic-node.js.map +0 -1
  38. package/dist/2379.jclic-node.js +0 -202
  39. package/dist/2379.jclic-node.js.map +0 -1
  40. package/dist/2437.jclic-node.js +0 -450
  41. package/dist/2437.jclic-node.js.map +0 -1
  42. package/dist/2531.jclic-node.js +0 -869
  43. package/dist/2531.jclic-node.js.map +0 -1
  44. package/dist/2608.jclic-node.js +0 -160
  45. package/dist/2608.jclic-node.js.map +0 -1
  46. package/dist/2715.jclic-node.js +0 -554
  47. package/dist/2715.jclic-node.js.map +0 -1
  48. package/dist/277.jclic-node.js +0 -22
  49. package/dist/277.jclic-node.js.map +0 -1
  50. package/dist/2921.jclic-node.js +0 -660
  51. package/dist/2921.jclic-node.js.map +0 -1
  52. package/dist/2952.jclic-node.js +0 -101
  53. package/dist/2952.jclic-node.js.map +0 -1
  54. package/dist/3018.jclic-node.js +0 -421
  55. package/dist/3018.jclic-node.js.map +0 -1
  56. package/dist/3019.jclic-node.js +0 -682
  57. package/dist/3019.jclic-node.js.map +0 -1
  58. package/dist/3231.jclic-node.js +0 -274
  59. package/dist/3231.jclic-node.js.map +0 -1
  60. package/dist/331.jclic-node.js +0 -115
  61. package/dist/331.jclic-node.js.map +0 -1
  62. package/dist/3391.jclic-node.js +0 -276
  63. package/dist/3391.jclic-node.js.map +0 -1
  64. package/dist/3502.jclic-node.js +0 -671
  65. package/dist/3502.jclic-node.js.map +0 -1
  66. package/dist/3653.jclic-node.js +0 -982
  67. package/dist/3653.jclic-node.js.map +0 -1
  68. package/dist/371.jclic.min.js +0 -2
  69. package/dist/371.jclic.min.js.map +0 -1
  70. package/dist/3856.jclic-node.js +0 -575
  71. package/dist/3856.jclic-node.js.map +0 -1
  72. package/dist/4112.jclic-node.js +0 -659
  73. package/dist/4112.jclic-node.js.map +0 -1
  74. package/dist/4123.jclic-node.js +0 -910
  75. package/dist/4123.jclic-node.js.map +0 -1
  76. package/dist/427.jclic-node.js +0 -894
  77. package/dist/427.jclic-node.js.map +0 -1
  78. package/dist/4483.jclic-node.js +0 -327
  79. package/dist/4483.jclic-node.js.map +0 -1
  80. package/dist/4548.jclic-node.js +0 -1078
  81. package/dist/4548.jclic-node.js.map +0 -1
  82. package/dist/466.jclic-node.js +0 -99
  83. package/dist/466.jclic-node.js.map +0 -1
  84. package/dist/485.jclic-node.js +0 -783
  85. package/dist/485.jclic-node.js.map +0 -1
  86. package/dist/4921.jclic-node.js +0 -500
  87. package/dist/4921.jclic-node.js.map +0 -1
  88. package/dist/5091.jclic-node.js +0 -239
  89. package/dist/5091.jclic-node.js.map +0 -1
  90. package/dist/520.jclic-node.js +0 -550
  91. package/dist/520.jclic-node.js.map +0 -1
  92. package/dist/5312.jclic-node.js +0 -1126
  93. package/dist/5312.jclic-node.js.map +0 -1
  94. package/dist/5338.jclic-node.js +0 -212
  95. package/dist/5338.jclic-node.js.map +0 -1
  96. package/dist/5344.jclic-node.js +0 -229
  97. package/dist/5344.jclic-node.js.map +0 -1
  98. package/dist/5550.jclic-node.js +0 -238
  99. package/dist/5550.jclic-node.js.map +0 -1
  100. package/dist/5626.jclic-node.js +0 -614
  101. package/dist/5626.jclic-node.js.map +0 -1
  102. package/dist/5977.jclic-node.js +0 -1081
  103. package/dist/5977.jclic-node.js.map +0 -1
  104. package/dist/6148.jclic-node.js +0 -345
  105. package/dist/6148.jclic-node.js.map +0 -1
  106. package/dist/6176.jclic-node.js +0 -481
  107. package/dist/6176.jclic-node.js.map +0 -1
  108. package/dist/6221.jclic-node.js +0 -1072
  109. package/dist/6221.jclic-node.js.map +0 -1
  110. package/dist/6238.jclic-node.js +0 -718
  111. package/dist/6238.jclic-node.js.map +0 -1
  112. package/dist/6454.jclic-node.js +0 -1413
  113. package/dist/6454.jclic-node.js.map +0 -1
  114. package/dist/6565.jclic-node.js +0 -294
  115. package/dist/6565.jclic-node.js.map +0 -1
  116. package/dist/6579.jclic-node.js +0 -719
  117. package/dist/6579.jclic-node.js.map +0 -1
  118. package/dist/6715.jclic-node.js +0 -148
  119. package/dist/6715.jclic-node.js.map +0 -1
  120. package/dist/6777.jclic-node.js +0 -171
  121. package/dist/6777.jclic-node.js.map +0 -1
  122. package/dist/6782.jclic-node.js +0 -1611
  123. package/dist/6782.jclic-node.js.map +0 -1
  124. package/dist/6847.jclic-node.js +0 -601
  125. package/dist/6847.jclic-node.js.map +0 -1
  126. package/dist/6856.jclic-node.js +0 -252
  127. package/dist/6856.jclic-node.js.map +0 -1
  128. package/dist/696.jclic-node.js +0 -1821
  129. package/dist/696.jclic-node.js.map +0 -1
  130. package/dist/698.jclic-node.js +0 -583
  131. package/dist/698.jclic-node.js.map +0 -1
  132. package/dist/704.jclic-node.js +0 -80
  133. package/dist/704.jclic-node.js.map +0 -1
  134. package/dist/7046.jclic-node.js +0 -735
  135. package/dist/7046.jclic-node.js.map +0 -1
  136. package/dist/7220.jclic-node.js +0 -156
  137. package/dist/7220.jclic-node.js.map +0 -1
  138. package/dist/7257.jclic-node.js +0 -931
  139. package/dist/7257.jclic-node.js.map +0 -1
  140. package/dist/743.jclic-node.js +0 -583
  141. package/dist/743.jclic-node.js.map +0 -1
  142. package/dist/757.jclic-node.js +0 -1072
  143. package/dist/757.jclic-node.js.map +0 -1
  144. package/dist/7781.jclic-node.js +0 -202
  145. package/dist/7781.jclic-node.js.map +0 -1
  146. package/dist/7912.jclic-node.js +0 -2103
  147. package/dist/7912.jclic-node.js.map +0 -1
  148. package/dist/827.jclic-node.js +0 -708
  149. package/dist/827.jclic-node.js.map +0 -1
  150. package/dist/8276.jclic-node.js +0 -409
  151. package/dist/8276.jclic-node.js.map +0 -1
  152. package/dist/8322.jclic-node.js +0 -498
  153. package/dist/8322.jclic-node.js.map +0 -1
  154. package/dist/8641.jclic-node.js +0 -360
  155. package/dist/8641.jclic-node.js.map +0 -1
  156. package/dist/8837.jclic-node.js +0 -651
  157. package/dist/8837.jclic-node.js.map +0 -1
  158. package/dist/8895.jclic-node.js +0 -151
  159. package/dist/8895.jclic-node.js.map +0 -1
  160. package/dist/9072.jclic-node.js +0 -1285
  161. package/dist/9072.jclic-node.js.map +0 -1
  162. package/dist/9078.jclic-node.js +0 -935
  163. package/dist/9078.jclic-node.js.map +0 -1
  164. package/dist/9103.jclic-node.js +0 -718
  165. package/dist/9103.jclic-node.js.map +0 -1
  166. package/dist/9359.jclic-node.js +0 -145
  167. package/dist/9359.jclic-node.js.map +0 -1
  168. package/dist/9409.jclic-node.js +0 -921
  169. package/dist/9409.jclic-node.js.map +0 -1
  170. package/dist/9513.jclic-node.js +0 -720
  171. package/dist/9513.jclic-node.js.map +0 -1
  172. package/dist/9704.jclic-node.js +0 -81
  173. package/dist/9704.jclic-node.js.map +0 -1
  174. package/dist/9950.jclic-node.js +0 -827
  175. package/dist/9950.jclic-node.js.map +0 -1
@@ -1,1072 +0,0 @@
1
- "use strict";
2
- exports.id = 757;
3
- exports.ids = [757];
4
- exports.modules = {
5
-
6
- /***/ 757:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
-
10
- // EXPORTS
11
- __webpack_require__.d(__webpack_exports__, {
12
- "default": () => (/* binding */ skins_Skin)
13
- });
14
-
15
- // UNUSED EXPORTS: Skin
16
-
17
- // EXTERNAL MODULE: external "jquery"
18
- var external_jquery_ = __webpack_require__(7750);
19
- var external_jquery_default = /*#__PURE__*/__webpack_require__.n(external_jquery_);
20
- // EXTERNAL MODULE: ./src/Utils.js
21
- var Utils = __webpack_require__(1253);
22
- // EXTERNAL MODULE: ./src/AWT.js
23
- var AWT = __webpack_require__(7912);
24
- ;// ./src/skins/assets/basic.css
25
- const basic_namespaceObject = ".ID {\n width: 100%;\n background-color: #3F51B5;\n display: -webkit-flex;\n display: flex;\n -webkit-flex-direction: column;\n flex-direction: column;\n}\n\n.ID .JClicPlayerCnt {\n background-color: lightblue;\n margin: 18px;\n -webkit-flex-grow: 1;\n flex-grow: 1;\n position: relative;\n}\n\n.ID .JClicPlayerCnt>div {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n.ID button:not(.StockBtn) {\n background: transparent;\n padding: 0;\n border: none;\n box-shadow: none;\n text-shadow: none;\n}\n\n.ID .unselectableText {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.ID .progressBar {\n width: 250px\n}\n";
26
- ;// ./src/skins/assets/waitAnim.css
27
- const waitAnim_namespaceObject = ".ID .waitPanel {\n display: -webkit-flex;\n display: flex;\n width: 100%;\n height: 100%;\n -webkit-justify-content: center;\n justify-content: center;\n -webkit-align-items: center;\n align-items: center;\n}\n\n.ID .animImgBox {\n position: relative;\n width: 300px;\n height: 300px;\n max-width: 80%;\n max-height: 80%;\n}\n\n.ID .animImgBox svg {\n position: absolute;\n width: 100%;\n height: 100%;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n}\n\n.ID #waitImgBig {\n animation-duration: 0.8s;\n animation-name: rotate-right;\n}\n\n@keyframes rotate-right {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(1turn);\n }\n}\n\n.ID #waitImgSmall {\n animation-duration: 0.6s;\n animation-name: rotate-left;\n}\n\n@keyframes rotate-left {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(-1turn);\n }\n}\n";
28
- ;// ./src/skins/assets/reports.css
29
- const reports_namespaceObject = ".ID .dlgDiv {\n background-color: #efefef;\n color: #757575;\n font-family: Roboto, sans-serif;\n font-size: 10pt;\n line-height: normal;\n}\n\n.ID .dlgDiv a, a:visited, a:active, a:hover {\n text-decoration: none;\n color: inherit;\n}\n\n.ID .dlgMainPanel {\n padding: 1em 2em;\n max-height: calc(100vh - 8em);\n max-width: calc(100vw - 2em);\n min-width: 20em;\n overflow: auto;\n}\n\n.ID .dlgMainPanel .headTitle {\n font-size: 2.5em;\n font-weight: bold;\n margin: auto;\n}\n\n.ID .dlgMainPanel .subTitle {\n font-size: 1.4em;\n font-weight: bold;\n margin-bottom: 0.5em;\n}\n\n.ID .dlgMainPanel p {\n font-size: 1.1em;\n margin-bottom: 0.5em;\n}\n\n.ID .dlgMainPanel table {\n table-layout: fixed;\n width: 40em;\n margin: 0.5em 0 1.7em 0;\n border-collapse: collapse;\n}\n\n.ID .dlgMainPanel select {\n min-width: 20em;\n font-size: 1.2em;\n font-family: Roboto, sans-serif;\n color: #757575;\n}\n\n.ID .dlgMainPanel input {\n margin-left: 1em;\n font-size: 1.2em;\n font-family: Roboto, sans-serif;\n border-color: lightgray;\n}\n\n.ID .infoHead {\n padding: 1em 0em 0.5em;\n}\n\n.ID .JCGlobalResults td {\n padding: 0.4em;\n border-bottom: 1px solid #b6b6b6;\n}\n\n.ID .JCGlobalResults td:first-child {\n font-weight: 600;\n width: 14em;\n}\n\n.ID .JCDetailed td, th {\n border-bottom: 1px solid #b6b6b6;\n padding: 0.3em 0.4em;\n vertical-align: top;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ID .JCDetailed thead {\n font-weight: 600;\n}\n\n.ID .JCDetailed th:first-child {\n width: 7em;\n}\n\n.ID .JCDetailed th:nth-last-child(4) {\n width: 4em;\n}\n\n.ID .JCDetailed th:nth-last-child(-n+3) {\n width: 4.1em;\n text-align: right;\n}\n\n.ID .JCDetailed td:nth-last-child(-n+3) {\n text-align: right;\n}\n\n.ID .JCDetailed .ok {\n color: #4bae4f;\n font-weight: 600;\n}\n\n.ID .JCDetailed .no {\n color: #f34235;\n font-weight: 600;\n}\n\n.ID .JCDetailed tr:last-child {\n font-weight: bold;\n}\n\n.ID .JCDetailed .incomplete {\n font-style: italic;\n}\n\n.ID .dlgBottomPanel {\n height: 3.5em;\n background-color: white;\n padding: 0.5em;\n font-weight: bold;\n text-align: right;\n border-top: 1px solid #eee;\n position: relative;\n}\n\n.ID .dlgBottomPanel .smallPopup {\n background-color: #222;\n color: #ddd;\n padding: 0.5em;\n font-size: 0.9em;\n position: absolute;\n right: 6em;\n top: 1em;\n}\n\n.ID .dlgBottomPanel button {\n display: inline-block;\n padding: 10px;\n cursor: pointer;\n line-height: 0;\n}\n\n.ID .dlgBottomPanel button:hover {\n background-color: #eee;\n border-radius: 80px;\n}\n\n.ID .dlgBottomPanel button:active {\n background-color: #b3e5fc;\n}\n";
30
- ;// ./src/skins/assets/waitImgSmall.svg
31
- const waitImgSmall_namespaceObject = "<svg id=\"waitImgSmall\" viewBox=\"0 0 80 80\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill=\"#3F51B5\" d=\"m 57.00,39.43 c -0.28,-3.53 5.16,-3.27 5.37,-0.13 0.26,3.99 -5.13,21.04 -20.63,21.44 C 23.85,61.19 19.93,46.50 19.92,39.94 23.48,67.11 58.73,61.35 57.00,39.43 Z\" />\n</svg>\n";
32
- ;// ./src/skins/assets/waitImgBig.svg
33
- const waitImgBig_namespaceObject = "<svg id=\"waitImgBig\" viewBox=\"0 0 80 80\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill=\"#3F51B5\" d=\"m 65.99,40.19 c -0.42,5.33 7.80,4.94 8.11,0.20 C 74.50,34.37 66.35,8.59 42.92,7.98 15.90,7.29 9.96,29.50 9.94,39.41 15.33,-1.66 68.61,7.048 65.99,40.19 Z\" />\n</svg>\n";
34
- ;// ./src/skins/assets/appLogo.svg
35
- const appLogo_namespaceObject = "<svg viewBox=\"0 0 64 64\" xmlns=\"http://www.w3.org/2000/svg\">\n <g transform=\"matrix(.02081 0 0-.02081 5 62.33)\">\n <path d=\"m1263 1297l270 1003 996-267-267-990c-427-1583-2420-1046-1999 519 3 11 999-266 999-266z\" fill=\"none\" stroke=\"#9d6329\" stroke-linejoin=\"round\" stroke-linecap=\"round\" stroke-width=\"180\" stroke-miterlimit=\"3.864\" />\n <path d=\"m1263 1297l270 1003 996-267-267-990c-427-1583-2420-1046-1998 519 3 11 999-266 999-266\" fill=\"#f89c0e\" />\n <path d=\"m357 2850l1000-268-267-992-1000 266 267 994z\" fill=\"none\" stroke=\"#86882b\" stroke-linejoin=\"round\" stroke-linecap=\"round\" stroke-width=\"180\" stroke-miterlimit=\"3.864\" />\n <path d=\"m357 2850l1000-268-267-992-1000 266 267 994\" fill=\"#d9e70c\" />\n </g>\n</svg>\n";
36
- ;// ./src/skins/assets/closeDialogIcon.svg
37
- const closeDialogIcon_namespaceObject = "<svg fill=\"#757575\" viewBox=\"0 0 24 24\" width=\"36\" height=\"36\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\" />\n</svg>\n";
38
- ;// ./src/skins/assets/okDialogIcon.svg
39
- const okDialogIcon_namespaceObject = "<svg fill=\"#757575\" viewBox=\"0 0 24 24\" width=\"36\" height=\"36\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\" />\n</svg>\n";
40
- ;// ./src/skins/assets/copyIcon.svg
41
- const copyIcon_namespaceObject = "<svg fill=\"#757575\" viewBox=\"0 0 24 24\" width=\"36\" height=\"36\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\" />\n</svg>\n";
42
- ;// ./src/skins/Skin.js
43
- /**
44
- * File : skins/Skin.js
45
- * Created : 29/04/2015
46
- * By : Francesc Busquets <francesc@gmail.com>
47
- *
48
- * JClic.js
49
- * An HTML5 player of JClic activities
50
- * https://projectestac.github.io/jclic.js
51
- *
52
- * @source https://github.com/projectestac/jclic.js
53
- *
54
- * @license EUPL-1.2
55
- * @licstart
56
- * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
57
- *
58
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
59
- * the European Commission- subsequent versions of the EUPL (the "Licence");
60
- * You may not use this work except in compliance with the Licence.
61
- *
62
- * You may obtain a copy of the Licence at:
63
- * https://joinup.ec.europa.eu/software/page/eupl
64
- *
65
- * Unless required by applicable law or agreed to in writing, software
66
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
67
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
68
- * Licence for the specific language governing permissions and limitations
69
- * under the Licence.
70
- * @licend
71
- * @module
72
- */
73
-
74
- /* global Promise, window, document, navigator, ClipboardItem, Blob */
75
-
76
-
77
-
78
-
79
-
80
- // Use Webpack to import CSS and SVG files
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
- /**
92
- * This abstract class manages the layout, position ans size of the visual components of JClic:
93
- * player window, message box, counters, buttons, status... and also the appearance of the main
94
- * container.
95
- * The basic implementation of Skin is {@link module:skins/DefaultSkin.DefaultSkin DefaultSkin}.
96
- * @abstract
97
- * @extends module:AWT.Container
98
- */
99
- class Skin extends AWT/* Container */.mc {
100
- /**
101
- * Skin constructor
102
- * @param {module:JClicPlayer.JClicPlayer} ps - The `PlayStation` (currently a {@link module:JClicPlayer.JClicPlayer JClicPlayer}) used to load and
103
- * realize the media objects needed tot build the Skin.
104
- * @param {string} [name] - The skin name
105
- * @param {object} [options] - Optional parameter with additional options
106
- */
107
- constructor(ps, name = null, options = {}) {
108
-
109
- // Skin extends [AWT.Container](AWT.html)
110
- super();
111
-
112
- // Save parameters for later use
113
- this.ps = ps;
114
- if (name !== null)
115
- this.name = name;
116
- this.options = options;
117
-
118
- if (this.options.skinId)
119
- this.skinId = this.options.skinId;
120
-
121
- if (!Skin.registerStyleSheet(this.skinId, ps)) {
122
- let css = this._getStyleSheets('default');
123
- let twoThirds = this._getStyleSheets('twoThirds');
124
- if (twoThirds.length > 0)
125
- css += ` @media (max-width:${this.twoThirdsMedia.width}px),(max-height:${this.twoThirdsMedia.height}px){${twoThirds}}`;
126
- let half = this._getStyleSheets('half');
127
- if (half.length > 0)
128
- css += ` @media (max-width:${this.halfMedia.width}px),(max-height:${this.halfMedia.height}px){${half}}`;
129
- (0,Utils/* appendStyleAtHead */.dw)(css.replace(/\.ID/g, `.${this.skinId}`), ps);
130
- }
131
-
132
- let msg = '';
133
-
134
- this.$div = external_jquery_default()('<div/>', { class: this.skinId });
135
- this.$playerCnt = external_jquery_default()('<div/>', { class: 'JClicPlayerCnt' });
136
-
137
- // Add waiting panel and progress bar
138
- this.$progress = external_jquery_default()('<progress/>', { class: 'progressBar' })
139
- .css({ display: 'none' });
140
- this.$waitPanel = external_jquery_default()('<div/>')
141
- .css({ display: 'none', 'background-color': 'rgba(255, 255, 255, .60)', 'z-index': 99 })
142
- .append(external_jquery_default()('<div/>', { class: 'waitPanel' }).css({ display: 'flex', 'flex-direction': 'column' })
143
- .append(external_jquery_default()('<div/>', { class: 'animImgBox' })
144
- .append(external_jquery_default()(this.waitImgBig), external_jquery_default()(this.waitImgSmall)))
145
- .append(this.$progress));
146
- this.$playerCnt.append(this.$waitPanel);
147
-
148
- this.buttons = (0,Utils/* cloneObject */.h2)(Skin.prototype.buttons);
149
- this.counters = (0,Utils/* cloneObject */.h2)(Skin.prototype.counters);
150
- this.msgArea = (0,Utils/* cloneObject */.h2)(Skin.prototype.msgArea);
151
-
152
- // Create dialog overlay and panel
153
- this.$dlgOverlay = external_jquery_default()('<div/>', { class: 'dlgOverlay' }).css({
154
- 'z-index': 98,
155
- position: 'fixed',
156
- left: 0,
157
- top: 0,
158
- width: '100%',
159
- height: '100%',
160
- display: 'none',
161
- 'background-color': 'rgba(30,30,30,0.7)'
162
- }).on('click', () => {
163
- if (!this._isModalDlg)
164
- // Non-modal dialogs are closed on click outside the main area
165
- this._closeDlg(true);
166
- return false;
167
- });
168
-
169
- const $dlgDiv = external_jquery_default()('<div/>', {
170
- class: 'dlgDiv',
171
- role: 'dialog',
172
- 'aria-labelledby': ps.getUniqueId('ReportsLb'),
173
- 'aria-describedby': ps.getUniqueId('ReportsCnt')
174
- }).css({
175
- display: 'inline-block',
176
- position: 'relative',
177
- top: '50%',
178
- left: '50%',
179
- transform: 'translate(-50%, -50%)'
180
- }).on('click', () => {
181
- // Clicks not passed to parent
182
- return false;
183
- });
184
-
185
- this.$dlgMainPanel = external_jquery_default()('<div/>', { class: 'dlgMainPanel', id: ps.getUniqueId('ReportsCnt') });
186
- this.$dlgBottomPanel = external_jquery_default()('<div/>', { class: 'dlgBottomPanel', role: 'navigation' });
187
-
188
- // Basic dialog structure:
189
- this.$div.append(
190
- this.$playerCnt,
191
- this.$dlgOverlay.append(
192
- $dlgDiv.append(
193
- this.$dlgMainPanel,
194
- this.$dlgBottomPanel)));
195
-
196
- msg = (0,Utils/* getMsg */.qG)('JClic logo');
197
- this.$infoHead = external_jquery_default()('<div/>', { class: 'infoHead' })
198
- .append(external_jquery_default()('<div/>', { class: 'headTitle unselectableText' })
199
- .append(external_jquery_default()(this.appLogo, { 'aria-label': msg }).css({ width: '1.5em', height: '1.5em', 'vertical-align': 'bottom' })
200
- .on('dblclick', () => {
201
- // Double click on JClic logo is a hidden method to increase verbosity on Javascript console
202
- (0,Utils/* setLogLevel */.He)('all');
203
- (0,Utils/* log */.Rm)('trace', 'Log level set to "trace"');
204
- }))
205
- .append(external_jquery_default()('<span/>').html('JClic.js')))
206
- .append(external_jquery_default()('<p/>').css({ 'margin-top': 0, 'margin-left': '3.5em' })
207
- .append(external_jquery_default()('<a/>', { href: 'https://projectes.xtec.cat/clic/' }).html('https://projectes.xtec.cat/clic/'))
208
- .append(external_jquery_default()('<br>'))
209
- .append(external_jquery_default()('<span/>').html(`${(0,Utils/* getMsg */.qG)('Version')} ${Utils/* settings */.W0.VERSION}`)));
210
-
211
- this.$reportsPanel = external_jquery_default()('<div/>', { class: 'reportsPanel', role: 'document' });
212
-
213
- msg = (0,Utils/* getMsg */.qG)('Copy data to clipboard');
214
- this.$copyBtn = external_jquery_default()('<button/>', { title: msg, 'aria-label': msg })
215
- .append(external_jquery_default()(this.copyIcon).css({ width: '26px', height: '26px' }))
216
- .on('click', () => {
217
- const item = new ClipboardItem({
218
- 'text/plain': new Blob([`===> ${(0,Utils/* getMsg */.qG)('The data has been copied in HTML format. Please paste them into a spreadsheet or in a rich text editor')} <===`], {type: 'text/plain'}),
219
- 'text/html': new Blob([this.$reportsPanel.html()], {type: 'text/html'}),
220
- });
221
- navigator.clipboard.write([item])
222
- .then(() => this.$copyBtn.parent().append(
223
- external_jquery_default()('<div/>', { class: 'smallPopup' })
224
- .html((0,Utils/* getMsg */.qG)('The data has been copied to clipboard'))
225
- .fadeIn()
226
- .delay(3000)
227
- .fadeOut(function () { external_jquery_default()(this).remove(); })))
228
- .catch(err => this.$copyBtn.parent().append(
229
- external_jquery_default()('<div/>', { class: 'smallPopup' })
230
- .html(`ERROR: Unable to write data into the clipboard: ${err}`)
231
- .fadeIn()
232
- .delay(3000)
233
- .fadeOut(function () { external_jquery_default()(this).remove(); })));
234
- });
235
-
236
- msg = (0,Utils/* getMsg */.qG)('Close');
237
- this.$closeDlgBtn = external_jquery_default()('<button/>', { title: msg, 'aria-label': msg })
238
- .append(external_jquery_default()(this.closeDialogIcon).css({ width: '26px', height: '26px' }))
239
- .on('click', () => this._closeDlg(true));
240
-
241
- msg = (0,Utils/* getMsg */.qG)('OK');
242
- this.$okDlgBtn = external_jquery_default()('<button/>', { title: msg, 'aria-label': msg })
243
- .append(external_jquery_default()(this.okDialogIcon).css({ width: '26px', height: '26px' }))
244
- .on('click', () => this._closeDlg(true));
245
-
246
- msg = (0,Utils/* getMsg */.qG)('Cancel');
247
- this.$cancelDlgBtn = external_jquery_default()('<button/>', { title: msg, 'aria-label': msg })
248
- .append(external_jquery_default()(this.closeDialogIcon).css({ width: '26px', height: '26px' }))
249
- .on('click', () => this._closeDlg(false));
250
-
251
- // Registers this Skin in the list of realized Skin objects
252
- Skin.skinStack.push(this);
253
- }
254
-
255
- /**
256
- * Registers a new type of skin
257
- * @param {string} skinName - The name used to identify this skin
258
- * @param {function} skinClass - The skin class, usually extending Skin
259
- * @returns {module:skins/Skin.Skin} - The provided skin class
260
- */
261
- static registerClass(skinName, skinClass) {
262
- Skin.CLASSES[skinName] = skinClass;
263
- return skinClass;
264
- }
265
-
266
- /**
267
- * Checks if the provided stylesheet ID is already registered in the root node where the current player is placed
268
- * @param {string} skinId - The unique identifier of the skin to check
269
- * @param {module:JClicPlayer.JClicPlayer} [ps] - An optional `PlayStation` (currently a {@link module:JClicPlayer.JClicPlayer JClicPlayer}) used as a base to find the root node
270
- * @returns {boolean} - _true_ when the skin stylesheet is already defined in the current root node, _false_ otherwise
271
- */
272
- static registerStyleSheet(skinId, ps) {
273
- let result = false;
274
- const root = (0,Utils/* getRootHead */.NQ)(ps);
275
- if (!root['__JClicID'])
276
- root.__JClicID = `SK${Skin.lastId++}`;
277
-
278
- let styles = Skin.rootStyles[root.__JClicID];
279
- if (!styles) {
280
- styles = [];
281
- Skin.rootStyles[root.__JClicID] = styles;
282
- }
283
-
284
- if (styles.indexOf(skinId) < 0) {
285
- (0,Utils/* log */.Rm)('trace', `Stylesheet "${skinId}" has been registered for root node labeled as "${root.__JClicID}"`);
286
- styles.push(skinId);
287
- } else
288
- result = true;
289
-
290
- return result;
291
- }
292
-
293
- /**
294
- * Gets the specified Skin from `skinStack`, or creates a new one if not found.
295
- * This function should be used only through `Skin.getSkin`
296
- * @param {string} skinName - The name of the searched skin
297
- * @param {module:JClicPlayer.JClicPlayer} ps - The PlayStation (usually a {@link module:JClicPlayer.JClicPlayer JClicPlayer}) used to build the new skin.
298
- * @param {object} [options] - Optional parameter with additional options
299
- * @returns {module:skins/Skin.Skin}
300
- */
301
- static getSkin(skinName = 'default', ps, options = {}) {
302
- skinName = skinName || 'default';
303
-
304
- // Correct old skin names
305
- if (skinName.charAt(0, 1) === '@' && skinName.endsWith('.xml'))
306
- skinName = skinName.substring(1, skinName.length - 4);
307
-
308
- // look for the skin in the stack of realized skins
309
- if (skinName && ps) {
310
- // TODO: Check also `options`!
311
- const sk = Skin.skinStack.find(s => s.name === skinName && s.ps === ps);
312
- if (sk)
313
- return sk;
314
- }
315
-
316
- // Locates the class of the requested Skin (or [DefaultSkin](DefaultSkin.html)
317
- // if not specified). When not found, a new one is created and registered in `skinStack`
318
- let cl = Skin.CLASSES[skinName];
319
- if (!cl) {
320
- // Process custom skin XML files
321
- const mbe = ps.project.mediaBag.getElement(skinName, false);
322
- if (mbe && mbe.data) {
323
- options = Object.assign({}, options, mbe.data);
324
- options.skinId = `JClic-${skinName.replace('.xml', '')}`;
325
- }
326
-
327
- if (!ps.zip
328
- && options.class === 'edu.xtec.jclic.skins.BasicSkin'
329
- && options.image
330
- && ps.project.mediaBag.getElement(options.image, false)
331
- && ps.project.mediaBag.getElement(options.image, false).data)
332
- cl = Skin.CLASSES.custom;
333
- else {
334
- (0,Utils/* log */.Rm)('warn', `Unknown skin class: ${skinName}`);
335
- cl = Skin.CLASSES.default;
336
- }
337
- }
338
-
339
- // Build and return the requested skin
340
- return new cl(ps, skinName, options);
341
- }
342
-
343
- /**
344
- * Returns the CSS styles used by this skin. This method should be called only from
345
- * the `Skin` constructor, and overridded by subclasses if needed.
346
- * @param {string} media - A specific media size. Possible values are: 'default', 'half' and 'twoThirds'
347
- * @returns {string}
348
- */
349
- _getStyleSheets(media = 'default') {
350
- return media === 'default' ? (this.basicCSS + this.waitAnimCSS + this.reportsCSS) : '';
351
- }
352
-
353
- /**
354
- * Attaches a {@link module:JClicPlayer.JClicPlayer JClicPlayer} object to this Skin
355
- * @param {module:JClicPlayer.JClicPlayer} player
356
- */
357
- attach(player) {
358
- this.detach();
359
- if (player !== null && player.skin !== null)
360
- player.skin.detach();
361
- this.player = player;
362
- this.$playerCnt.prepend(player.$div);
363
- this.setSkinSizes();
364
- player.$mainContainer.append(this.$div);
365
- }
366
-
367
- /**
368
- * Sets the 'size' CSS values (max, min and compulsory) to the main `div` of this skin
369
- * @param {boolean} full - `true` when the skin is in full screen mode
370
- */
371
- setSkinSizes(full) {
372
- const
373
- css = {},
374
- topHeight = this.player?.$topDiv.height() || 0,
375
- nilValue = this.player.fullScreenChecked ? 'inherit' : null;
376
-
377
- // When `full` no set, detect the current status
378
- if (typeof full === 'undefined')
379
- full = document && document.fullscreenElement ? true : false;
380
-
381
- (0,Utils/* toCssSize */.SV)(full ? '100vw' : this.ps.options.minWidth, css, 'min-width', nilValue);
382
- (0,Utils/* toCssSize */.SV)(full ? '100vh' : this.ps.options.minHeight, css, 'min-height', nilValue);
383
- (0,Utils/* toCssSize */.SV)(full ? '100vw' : this.ps.options.maxWidth, css, 'max-width', nilValue);
384
- (0,Utils/* toCssSize */.SV)(full ? '100vh' : this.ps.options.maxHeight, css, 'max-height', nilValue);
385
- (0,Utils/* toCssSize */.SV)(full ? '100vw' : this.ps.options.width, css, 'width', '100%');
386
- (0,Utils/* toCssSize */.SV)(full ? '100vh' : this.ps.options.height, css, 'height', topHeight > 0 ? '100%' : '100vh');
387
- this.$div.css(css);
388
- }
389
-
390
- /**
391
- * Detaches the `player` element from this Skin
392
- */
393
- detach() {
394
- if (this.player !== null) {
395
- this.player.$div.remove();
396
- this.$div.detach();
397
- this.player = null;
398
- }
399
- }
400
-
401
- /**
402
- * Updates the graphic contents of this skin.
403
- * This method should be called from {@link module:skins/Skin.Skin#update}
404
- * @override
405
- * @param {module:AWT.Rectangle} dirtyRegion - Specifies the area to be updated. When `null`, it's the
406
- * whole panel.
407
- */
408
- updateContent(dirtyRegion) {
409
- if (this.$msgBoxDivCanvas) {
410
- const ctx = this.$msgBoxDivCanvas.get(-1).getContext('2d');
411
- ctx.clearRect(0, 0, ctx.canvas.clientWidth, ctx.canvas.clientHeight);
412
- this.msgBox.update(ctx, dirtyRegion);
413
- }
414
- return super.updateContent();
415
- }
416
-
417
- /**
418
- * Resets all counters
419
- * @param {boolean} bEnabled - Leave it enabled/disabled
420
- */
421
- resetAllCounters(bEnabled) {
422
- external_jquery_default().each(this.counters, (_name, counter) => {
423
- if (counter !== null) {
424
- counter.value = 0;
425
- counter.countDown = 0;
426
- counter.enabled = bEnabled;
427
- counter.refreshDisplay();
428
- }
429
- });
430
- }
431
-
432
- /**
433
- * Sets/unsets the 'wait' state
434
- * @param {boolean} status - Whether to set or unset the wait status. When `undefined`, the
435
- * `waitCursorCount` member is evaluated to decide if the wait state should be activated or deactivated.
436
- */
437
- setWaitCursor(status) {
438
- if (typeof status === 'undefined') {
439
- if (this.$waitPanel)
440
- this.$waitPanel.css({
441
- display: this.waitCursorCount > 0 ? 'initial' : 'none'
442
- });
443
- } else {
444
- switch (status) {
445
- case true:
446
- this.waitCursorCount++;
447
- break;
448
- case false:
449
- if (--this.waitCursorCount < 0)
450
- this.waitCursorCount = 0;
451
- break;
452
- case 'reset':
453
- this.waitCursorCount = 0;
454
- break;
455
- }
456
- this.setWaitCursor();
457
- }
458
- }
459
-
460
- /**
461
- * Sets the current value of the progress bar
462
- * @param {number} val - The current value. Should be less or equal than `max`. When -1, the progress bar will be hidden.
463
- * @param {number} [max] - Optional parameter representing the maximum value. When passed, the progress bar will be displayed.
464
- */
465
- setProgress(val, max) {
466
- if (this.$progress) {
467
- this.currentProgress = val;
468
- if (val < 0)
469
- this.$progress.css({ display: 'none' });
470
- else {
471
- if (max) {
472
- this.maxProgress = max;
473
- this.$progress.attr('max', max).css({ display: 'initial' });
474
- }
475
- this.$progress.attr('value', val);
476
- }
477
- (0,Utils/* log */.Rm)('trace', `Progress: ${this.currentProgress}/${this.maxProgress}`);
478
- }
479
- }
480
-
481
- /**
482
- * Increments the progress bar value by the specified amount, only when the progress bar is running.
483
- * @param {number} [val] - The amount to increment. When not defined, it's 1.
484
- */
485
- incProgress(val) {
486
- if (this.currentProgress >= 0)
487
- this.setProgress(this.currentProgress + (val || 1));
488
- }
489
-
490
- /**
491
- * Shows a window with clues or help for the current activity
492
- * @param {external:jQuery} _$hlpComponent - A JQuery DOM element with the information to be shown.
493
- * It can be a string or number. When `null`, the help window (if any) must be closed.
494
- */
495
- showHelp(_$hlpComponent) {
496
- // TODO: Implement HelpWindow
497
- }
498
-
499
- /**
500
- * Shows a "dialog" panel, useful for displaying information or prompt something to users
501
- * @param {boolean} modal - When `true`, the dialog should be closed by any click outside the main panel
502
- * @param {object} options - This object should have two components: `main` and `bottom`, both
503
- * containing a jQuery HTML element (or array of elements) to be placed on the main and bottom panels
504
- * of the dialog.
505
- * @returns {external:Promise} - A Promise that will be fulfilled when the dialog is closed.
506
- */
507
- showDlg(modal, options) {
508
- return new Promise((resolve, reject) => {
509
- this._dlgOkValue = 'ok';
510
- this._dlgCancelValue = 'cancelled';
511
- this._isModalDlg = modal;
512
-
513
- this.$dlgMainPanel.children().detach();
514
- this.$dlgBottomPanel.children().detach();
515
- if (options.main)
516
- this.$dlgMainPanel.append(options.main);
517
- if (options.bottom)
518
- this.$dlgBottomPanel.append(options.bottom);
519
-
520
- this._closeDlg = resolved => {
521
- if (resolved && resolve)
522
- resolve(this._dlgOkValue);
523
- else if (!resolved && reject)
524
- reject(this._dlgCancelValue);
525
- this.$dlgOverlay.css({ display: 'none' });
526
- this.enableMainButtons(true);
527
- this._closeDlg = Skin.prototype._closeDlg;
528
- };
529
- this.enableMainButtons(false);
530
- this.$dlgOverlay.css({ display: 'initial' });
531
- });
532
- }
533
-
534
- /**
535
- * Enables or disables the `tabindex` attribute of the main buttons. Useful when a modal dialog
536
- * overlay is active, to avoid direct access to controls not related with the dialog.
537
- * @param {boolean} status - `true` to make main controls navigable, `false` otherwise
538
- */
539
- enableMainButtons(status) {
540
- this.$playerCnt.find('button').attr('tabindex', status ? '0' : '-1');
541
- }
542
-
543
- /**
544
- * Called when the dialog must be closed, usually only by Skin members.
545
- * This method is re-defined on each call to `showDlg`, so the `resolve` and `reject`
546
- * functions can be safely called.
547
- */
548
- _closeDlg() {
549
- // Do nothing
550
- }
551
-
552
- /**
553
- * Displays a dialog with a report of the current results achieved by the user.
554
- * @param {module:report/Reporter.Reporter} reporter - The reporter system currently in use
555
- * @returns {external:Promise} - The Promise returned by {@link module:skins/Skin.Skin.showDlg}.
556
- */
557
- showReports(reporter) {
558
- this.$reportsPanel.html(this.$printReport(reporter));
559
- return this.showDlg(false, {
560
- main: [this.$infoHead, this.$reportsPanel],
561
- bottom: [this.$copyBtn, this.$closeDlgBtn]
562
- });
563
- }
564
-
565
- /**
566
- * Formats the current report in a DOM tree, ready to be placed in `$reportsPanel`
567
- * @param {module:report/Reporter.Reporter} reporter - The reporter system currently in use
568
- * @returns {external:jQuery[]} - An array of jQuery objects containing the full report
569
- */
570
- $printReport(reporter) {
571
- let result = [];
572
- if (reporter) {
573
- const
574
- report = reporter.getData(),
575
- started = new Date(report.started);
576
-
577
- result.push(external_jquery_default()('<div/>', { class: 'subTitle', id: this.ps.getUniqueId('ReportsLb') }).html((0,Utils/* getMsg */.qG)('Current results')));
578
-
579
- const $t = external_jquery_default()('<table/>', { class: 'JCGlobalResults' });
580
- $t.append(
581
- Utils/* $HTML */.GV.doubleCell(
582
- (0,Utils/* getMsg */.qG)('Session started:'),
583
- `${started.toLocaleDateString()} ${started.toLocaleTimeString()}`),
584
- Utils/* $HTML */.GV.doubleCell(
585
- (0,Utils/* getMsg */.qG)('Reports system:'),
586
- `${(0,Utils/* getMsg */.qG)(report.descriptionKey)} ${report.descriptionDetail}`));
587
- if (report.userId)
588
- $t.append(Utils/* $HTML */.GV.doubleCell(
589
- (0,Utils/* getMsg */.qG)('User:'),
590
- report.userId));
591
- else if (report.user) // SCORM user
592
- $t.append(Utils/* $HTML */.GV.doubleCell(
593
- (0,Utils/* getMsg */.qG)('User:'),
594
- report.user));
595
-
596
- if (report.sequences > 0) {
597
- if (report.sessions.length > 1)
598
- $t.append(Utils/* $HTML */.GV.doubleCell(
599
- (0,Utils/* getMsg */.qG)('Projects:'),
600
- report.sessions.length));
601
- $t.append(
602
- Utils/* $HTML */.GV.doubleCell(
603
- (0,Utils/* getMsg */.qG)('Sequences:'),
604
- report.sequences),
605
- Utils/* $HTML */.GV.doubleCell(
606
- (0,Utils/* getMsg */.qG)('Activities done:'),
607
- report.activitiesDone),
608
- Utils/* $HTML */.GV.doubleCell(
609
- (0,Utils/* getMsg */.qG)('Activities played at least once:'),
610
- `${report.playedOnce}/${report.reportable} (${(0,Utils/* getPercent */.Os)(report.ratioPlayed / 100)})`));
611
- if (report.activitiesDone > 0) {
612
- $t.append(Utils/* $HTML */.GV.doubleCell(
613
- (0,Utils/* getMsg */.qG)('Activities solved:'),
614
- `${report.activitiesSolved} (${(0,Utils/* getPercent */.Os)(report.ratioSolved / 100)})`));
615
- if (report.actScore > 0)
616
- $t.append(
617
- Utils/* $HTML */.GV.doubleCell(
618
- (0,Utils/* getMsg */.qG)('Partial score:'),
619
- `${(0,Utils/* getPercent */.Os)(report.partialScore / 100)} ${(0,Utils/* getMsg */.qG)('(out of played activities)')}`),
620
- Utils/* $HTML */.GV.doubleCell(
621
- (0,Utils/* getMsg */.qG)('Global score:'),
622
- `${(0,Utils/* getPercent */.Os)(report.globalScore / 100)} ${(0,Utils/* getMsg */.qG)('(out of all project activities)')}`));
623
- $t.append(
624
- Utils/* $HTML */.GV.doubleCell(
625
- (0,Utils/* getMsg */.qG)('Total time in activities:'),
626
- (0,Utils/* getHMStime */.EB)(report.time * 1000)),
627
- Utils/* $HTML */.GV.doubleCell(
628
- (0,Utils/* getMsg */.qG)('Actions done:'),
629
- report.actions));
630
- }
631
- result.push($t);
632
-
633
- report.sessions.forEach(sr => {
634
- if (sr.sequences.length > 0) {
635
- const $t = external_jquery_default()('<table/>', { class: 'JCDetailed' });
636
- result.push(external_jquery_default()('<p/>').html(report.sessions.length > 1 ? `${(0,Utils/* getMsg */.qG)('Project')} ${sr.projectName}` : ''));
637
- $t.append(external_jquery_default()('<thead/>').append(external_jquery_default()('<tr/>').append(
638
- Utils/* $HTML */.GV.th((0,Utils/* getMsg */.qG)('sequence')),
639
- Utils/* $HTML */.GV.th((0,Utils/* getMsg */.qG)('activity')),
640
- Utils/* $HTML */.GV.th((0,Utils/* getMsg */.qG)('OK')),
641
- Utils/* $HTML */.GV.th((0,Utils/* getMsg */.qG)('actions')),
642
- Utils/* $HTML */.GV.th((0,Utils/* getMsg */.qG)('score')),
643
- Utils/* $HTML */.GV.th((0,Utils/* getMsg */.qG)('time')))));
644
-
645
- sr.sequences.forEach(seq => {
646
- let $tr = external_jquery_default()('<tr/>').append(external_jquery_default()('<td/>', { rowspan: seq.activities.length }).html(seq.sequence));
647
- seq.activities.forEach(act => {
648
- if (act.closed) {
649
- $tr.append(Utils/* $HTML */.GV.td(act.name));
650
- $tr.append(act.solved ? Utils/* $HTML */.GV.td((0,Utils/* getMsg */.qG)('YES'), 'ok') : Utils/* $HTML */.GV.td((0,Utils/* getMsg */.qG)('NO'), 'no'));
651
- $tr.append(Utils/* $HTML */.GV.td(act.actions));
652
- $tr.append(Utils/* $HTML */.GV.td((0,Utils/* getPercent */.Os)(act.precision / 100)));
653
- $tr.append(Utils/* $HTML */.GV.td((0,Utils/* getHMStime */.EB)(act.time * 1000)));
654
- } else {
655
- $tr.append(Utils/* $HTML */.GV.td(act.name, 'incomplete'));
656
- for (let r = 0; r < 4; r++)
657
- $tr.append(Utils/* $HTML */.GV.td('-', 'incomplete'));
658
- }
659
- $t.append($tr);
660
- $tr = external_jquery_default()('<tr/>');
661
- });
662
- });
663
-
664
- $t.append(external_jquery_default()('<tr/>').append(
665
- Utils/* $HTML */.GV.td((0,Utils/* getMsg */.qG)('Total:')),
666
- Utils/* $HTML */.GV.td(`${sr.played} (${(0,Utils/* getPercent */.Os)(sr.ratioPlayed / 100)})`),
667
- Utils/* $HTML */.GV.td(`${sr.solved} (${(0,Utils/* getPercent */.Os)(sr.ratioSolved / 100)})`),
668
- Utils/* $HTML */.GV.td(sr.actions),
669
- Utils/* $HTML */.GV.td((0,Utils/* getPercent */.Os)(sr.score / 100)),
670
- Utils/* $HTML */.GV.td((0,Utils/* getHMStime */.EB)(sr.time * 1000))));
671
-
672
- result.push($t);
673
- }
674
- }, this);
675
- } else
676
- result.push(external_jquery_default()('<p/>').html((0,Utils/* getMsg */.qG)('No activities done!')));
677
- }
678
- return result;
679
- }
680
-
681
- /**
682
- * Enables or disables a specific counter
683
- * @param {string} counter - Which counter
684
- * @param {boolean} bEnabled - When `true`, the counter will be enabled.
685
- */
686
- enableCounter(counter, bEnabled) {
687
- if (this.counters[counter])
688
- this.counters[counter].setEnabled(bEnabled);
689
- }
690
-
691
- /**
692
- * Main method used to build the content of the skin. Resizes and places internal objects.
693
- */
694
- doLayout() {
695
- // Resize player
696
- this.player.doLayout();
697
-
698
- // Build ths canvas at the end of current thread, thus avoiding
699
- // invalid sizes due to incomplete layout of DOM objects
700
- if (this.$msgBoxDiv)
701
- window.setTimeout(() => {
702
-
703
- // Temporary remove canvas to let div get its natural size:
704
- if (this.$msgBoxDivCanvas)
705
- this.$msgBoxDivCanvas.remove();
706
-
707
- // Get current size of message box div without canvas
708
- const
709
- msgWidth = this.$msgBoxDiv.outerWidth(),
710
- msgHeight = this.$msgBoxDiv.outerHeight();
711
-
712
- // Replace existing canvas if size has changed
713
- if (this.$msgBoxDivCanvas === null ||
714
- this.msgBox.dim.widht !== msgWidth ||
715
- this.msgBox.dim.height !== msgHeight) {
716
- this.$msgBoxDivCanvas = external_jquery_default()(`<canvas width="${msgWidth}" height="${msgHeight}"/>`);
717
- this.msgBox.setBounds(new AWT/* Rectangle */.M_(0, 0, msgWidth + 1, msgHeight));
718
- this.msgBox.buildAccessibleElement(this.$msgBoxDivCanvas, this.$msgBoxDiv);
719
- }
720
- // restore canvas
721
- this.$msgBoxDiv.append(this.$msgBoxDivCanvas);
722
- this.updateContent();
723
- }, 0);
724
- }
725
-
726
- /**
727
- * adjusts the skin to the dimension of its `$div` container
728
- * @returns {module:AWT.Dimension} the new dimension of the skin
729
- */
730
- fit() {
731
- this.doLayout();
732
- return new AWT/* Dimension */.fg(this.$div.width(), this.$div.height());
733
- }
734
-
735
- /**
736
- * Sets or unsets the player in fullscreen mode, when allowed, using the
737
- * {@link https://github.com/sindresorhus/screenfull.js|screenfull.js} library.
738
- * @param {boolean} status - Whether to set or unset the player in fullscreen mode. When `null`
739
- * or `undefined`, the status toggles between fullscreen and windowed modes.
740
- * @returns {boolean} `true` if the request was successful, `false` otherwise.
741
- */
742
- setScreenFull(status) {
743
- if (document && document.fullscreenEnabled && (
744
- status === true && !document.fullscreenElement ||
745
- status === false && !document.fullscreenElement ||
746
- status !== true && status !== false)) {
747
- // Save current value of fullScreen for later use
748
- const full = document.fullscreenElement ? true : false;
749
- if (!document.fullscreenElement) {
750
- const element = this.player.$mainContainer.get(-1);
751
- if (element && element.requestFullscreen)
752
- element.requestFullscreen();
753
- } else {
754
- if (document.exitFullscreen) {
755
- document.exitFullscreen();
756
- }
757
- }
758
- this.player.fullScreenChecked = true;
759
- // Firefox don't updates `document.fullscreenElement` in real time, so use the saved value instead
760
- this.setSkinSizes(!full);
761
- }
762
- }
763
-
764
- /**
765
- * Method used to notify this skin that a specific action has changed its enabled/disabled status
766
- * @param {module:AWT.Action} _action - The action originating the change event
767
- */
768
- actionStatusChanged(act) {
769
- if (act.name && this.buttons[act.name])
770
- this.setEnabled(this.buttons[act.name], act.enabled);
771
- }
772
-
773
- /**
774
- * Enables or disables an object
775
- * @param {external:jQuery} $object - A JQuery DOM element
776
- * @override
777
- * @param {boolean} enabled
778
- */
779
- setEnabled($object, enabled) {
780
- if ($object && enabled)
781
- $object.removeAttr('disabled');
782
- else if ($object)
783
- $object.attr('disabled', true);
784
- }
785
-
786
- /**
787
- * Compares two Skin objects
788
- * @param {module:skins/Skin.Skin} skin - The Skin to compare against this
789
- * @returns {boolean} - `true` if both skins are equivalent.
790
- */
791
- equals(skin) {
792
- return skin &&
793
- this.name === skin.name &&
794
- this.ps === skin.ps;
795
- }
796
-
797
- /**
798
- * Gets the {@link module:boxes/ActiveBox.ActiveBox ActiveBox} used to display the main messages of activities
799
- * @returns {module:boxes/ActiveBox.ActiveBox}
800
- */
801
- getMsgBox() {
802
- return this.msgBox;
803
- }
804
- }
805
-
806
- /**
807
- * Collection of realized __Skin__ objects.
808
- * @type {module:skins/Skin.Skin[]}
809
- */
810
- Skin.skinStack = [];
811
-
812
- /**
813
- * Collection of skin style sheets already registered on the current document
814
- * @type {object}
815
- */
816
- Skin.rootStyles = {};
817
-
818
- /**
819
- * Counter used to label root nodes with unique IDs
820
- * @type {number}
821
- */
822
- Skin.lastId = 1;
823
-
824
- /**
825
- * List of classes derived from Skin. It should be filled by real skin classes at declaration time.
826
- * @type {object}
827
- */
828
- Skin.CLASSES = {};
829
-
830
- Object.assign(Skin.prototype, {
831
- /**
832
- * Class name of this skin. It will be used as a base selector in the definition of all CSS styles.
833
- * @name module:skins/Skin.Skin#skinId
834
- * @type {string} */
835
- skinId: 'JClicBasicSkin',
836
- /**
837
- * The HTML div object used by this Skin
838
- * @name module:skins/Skin.Skin#$div
839
- * @type {external:jQuery} */
840
- $div: null,
841
- /**
842
- * The HTML div where JClic Player will be placed
843
- * @name module:skins/Skin.Skin#$playerCnt
844
- * @type {external:jQuery} */
845
- $playerCnt: null,
846
- /**
847
- * Current name of the skin.
848
- * @name module:skins/Skin.Skin#name
849
- * @type {string} */
850
- name: 'default',
851
- /**
852
- * Specific options of this skin
853
- * @name module:skins/Skin.Skin#options
854
- * @type {object} */
855
- options: {},
856
- /**
857
- * Waiting panel, displayed while loading resources.
858
- * @name module:skins/Skin.Skin#$waitPanel
859
- * @type {external:jQuery} */
860
- $waitPanel: null,
861
- /**
862
- * Graphic indicator of loading progress
863
- * @name module:skins/Skin.Skin#$progress
864
- * @type {external:jQuery} */
865
- $progress: null,
866
- /**
867
- * Current value of the progress bar
868
- * @name module:skins/Skin.Skin#currentProgress
869
- * @type {number} */
870
- currentProgress: -1,
871
- /**
872
- * Max value of the progress bar
873
- * @name module:skins/Skin.Skin#maxProgress
874
- * @type {number} */
875
- maxProgress: 0,
876
- /**
877
- * The box used to display the main messages of JClic activities
878
- * @name module:skins/Skin.DefaultSkin#msgBox
879
- * @type {module:boxes/ActiveBox.ActiveBox} */
880
- msgBox: null,
881
- /**
882
- * The `div` DOM object where `msgBox` is located
883
- * @name module:skins/Skin.DefaultSkin#$msgBoxDiv
884
- * @type {external:jQuery} */
885
- $msgBoxDiv: null,
886
- /*
887
- * An HTML `canvas` object created in `$msgBoxDiv`
888
- * @name module:skins/Skin.DefaultSkin#$msgBoxDivCanvas
889
- * @type {external:jQuery} */
890
- $msgBoxDivCanvas: null,
891
- /**
892
- * Main panel used to display modal and non-modal dialogs
893
- * @name module:skins/Skin.Skin#$dlgOverlay
894
- * @type {external:jQuery} */
895
- $dlgOverlay: null,
896
- /**
897
- * Main panel of dialogs, where relevant information must be placed
898
- * @name module:skins/Skin.Skin#$dlgMainPanel
899
- * @type {external:jQuery} */
900
- $dlgMainPanel: null,
901
- /**
902
- * Bottom panel of dialogs, used for action buttons
903
- * @name module:skins/Skin.Skin#$dlgBottomPanel
904
- * @type {external:jQuery} */
905
- $dlgBottomPanel: null,
906
- /**
907
- * Element usually used as header in dialogs, with JClic logo, name and version
908
- * @name module:skins/Skin.Skin#infoHead
909
- * @type {external:jQuery} */
910
- $infoHead: null,
911
- /**
912
- * Iconic button used to copy content to clipboard
913
- * @name module:skins/Skin.Skin#$copyBtn
914
- * @type {external:jQuery} */
915
- $copyBtn: null,
916
- /**
917
- * Iconic button used to close the dialog
918
- * @name module:skins/Skin.Skin#$closeDlgBtn
919
- * @type {external:jQuery} */
920
- $closeDlgBtn: null,
921
- /**
922
- * OK dialog button
923
- * @name module:skins/Skin.Skin#$okDlgBtn
924
- * @type {external:jQuery} */
925
- $okDlgBtn: null,
926
- /**
927
- * Cancel dialog button
928
- * @name module:skins/Skin.Skin#$cancelDlgBtn
929
- * @type {external:jQuery} */
930
- $cancelDlgBtn: null,
931
- /**
932
- * Value to be returned by the dialog promise when the presented task is fulfilled
933
- * @name module:skins/Skin.Skin#_dlgOkValue
934
- * @type {object} */
935
- _dlgOkValue: null,
936
- /**
937
- * Value to be returned in user-canceled dialogs
938
- * @name module:skins/Skin.Skin#_dlgCancelValue
939
- * @type {object} */
940
- _dlgCancelValue: null,
941
- /**
942
- * Flag indicating if the current dialog is modal or not
943
- * @name module:skins/Skin.Skin#_isModalDlg
944
- * @type {boolean} */
945
- _isModalDlg: false,
946
- /**
947
- * Div inside {@link module:skins/Skin.Skin#$dlgOverlay $dlgOverlay} where JClicPlayer will place the information to be shown
948
- * @name module:skins/Skin.Skin#$reportsPanel
949
- * @type {external:jQuery} */
950
- $reportsPanel: null,
951
- /**
952
- * The basic collection of buttons that most skins implement
953
- * @name module:skins/Skin.Skin#buttons
954
- * @type {object} */
955
- buttons: {
956
- 'prev': null,
957
- 'next': null,
958
- 'return': null,
959
- 'reset': null,
960
- 'info': null,
961
- 'help': null,
962
- 'audio': null,
963
- 'about': null,
964
- 'fullscreen': null,
965
- 'close': null
966
- },
967
- /**
968
- * The collection of counters
969
- * @name module:skins/Skin.Skin#counters
970
- * @type {object} */
971
- counters: {
972
- 'actions': null,
973
- 'score': null,
974
- 'time': null
975
- },
976
- /**
977
- * The collection of message areas
978
- * @name module:skins/Skin.Skin#msgArea
979
- * @type {object} */
980
- msgArea: {
981
- 'main': null,
982
- 'aux': null,
983
- 'mem': null
984
- },
985
- /**
986
- * The {@link module:JClicPlayer.JClicPlayer JClicPlayer} object associated to this skin
987
- * @name module:skins/Skin.Skin#player
988
- * @type {module:JClicPlayer.JClicPlayer} */
989
- player: null,
990
- /**
991
- * The {@link http://projectestac.github.io/jclic/apidoc/edu/xtec/jclic/PlayStation.html|PlayStation}
992
- * used by this Skin. Usually, the same as `player`
993
- * @name module:skins/Skin.Skin#ps
994
- * @type {module:JClicPlayer.JClicPlayer} */
995
- ps: null,
996
- /**
997
- * Counter to be incremented or decremented as `waitCursor` is requested or released.
998
- * @name module:skins/Skin.Skin#waitCursorCount
999
- * @type {number} */
1000
- waitCursorCount: 0,
1001
- //
1002
- // Buttons and other graphical resources used by this skin.
1003
- //
1004
- /**
1005
- * Main styles
1006
- * @name module:skins/Skin.Skin#basicCSS
1007
- * @type {string} */
1008
- basicCSS: basic_namespaceObject,
1009
- /**
1010
- * Waiting screen styles
1011
- * @name module:skins/Skin.Skin#waitAnimCSS
1012
- * @type {string} */
1013
- waitAnimCSS: waitAnim_namespaceObject,
1014
- /**
1015
- * Animated image displayed while loading resources
1016
- * Based on Ryan Allen's [svg-spinner](http://articles.dappergentlemen.com/2015/01/13/svg-spinner/)
1017
- * @name module:skins/Skin.Skin#waitImgBig
1018
- * @type {string} */
1019
- waitImgBig: waitImgBig_namespaceObject,
1020
- /**
1021
- * Animated image displayed while loading resources (small)
1022
- * @name module:skins/Skin.Skin#waitImgSmall
1023
- * @type {string} */
1024
- waitImgSmall: waitImgSmall_namespaceObject,
1025
- /**
1026
- * Reports screen styles
1027
- * @name module:skins/Skin.Skin#reportsCSS
1028
- * @type {string} */
1029
- reportsCSS: reports_namespaceObject,
1030
- //
1031
- // Icons used in buttons:
1032
- //
1033
- /**
1034
- * Icon for 'close dialog' button
1035
- * @name module:skins/Skin.Skin#closeDialogIcon
1036
- * @type {string} */
1037
- closeDialogIcon: closeDialogIcon_namespaceObject,
1038
- /**
1039
- * Icon for 'ok' button
1040
- * @name module:skins/Skin.Skin#okDialogIcon
1041
- * @type {string} */
1042
- okDialogIcon: okDialogIcon_namespaceObject,
1043
- /**
1044
- * Icon for 'copy' button
1045
- * @name module:skins/Skin.Skin#copyIcon
1046
- * @type {string} */
1047
- copyIcon: copyIcon_namespaceObject,
1048
- /**
1049
- * JClic logo
1050
- * @name module:skins/Skin.Skin#appLogo
1051
- * @type {string} */
1052
- appLogo: appLogo_namespaceObject,
1053
- /**
1054
- * Screen sizes (width and height) below which will half sized elements will be used
1055
- * @name module:skins/Skin.DefaultSkin#halfMedia
1056
- * @type {object} */
1057
- halfMedia: { width: 376, height: 282 },
1058
- /**
1059
- * Screen sizes (width and height) below which will two-thirds sized elements will be used
1060
- * @name module:skins/Skin.DefaultSkin#twoThirdsMedia
1061
- * @type {object} */
1062
- twoThirdsMedia: { width: 420, height: 315 },
1063
- });
1064
-
1065
- /* harmony default export */ const skins_Skin = (Skin);
1066
-
1067
-
1068
- /***/ })
1069
-
1070
- };
1071
- ;
1072
- //# sourceMappingURL=757.jclic-node.js.map