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 +0,0 @@
1
- {"version":3,"file":"2531.jclic-node.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEuB;AACqC;AACH;AACd;AACK;AACQ;AACD;;AAEvD;AACA,kBAAkB,yCAAyC,oBAAoB,kDAAkD;AACjI;AACA;AACA,yDAAyD,uEAAuE;AAChI;AACA,aAAa,uEAAuE;AACpF;AACA;AACA;AACO,4BAA4B,2DAAQ;AAC3C;AACA;AACA,aAAa,0CAA0C;AACvD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA,CAAC;;AAED;AACA,QAAQ,mDAAmD,OAAO,wEAAwE;AAC1I;AACA;AACO,iCAAiC,gEAAa;AACrD;AACA;AACA,aAAa,0BAA0B,WAAW,yCAAyC;AAC3F,aAAa,gCAAgC;AAC7C;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B,6CAAC;AAC9B;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,+DAAa;;AAE9B;AACA;AACA;AACA;AACA;AACA,qBAAqB,+DAAa,0EAA0E,+DAAW;AACvH,mBAAmB,6CAAC,cAAc,gCAAgC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP,wBAAwB,6CAAC,eAAe,yBAAyB;AACjE;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,4BAA4B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC,mCAAmC;AACzE;AACA,aAAa,sBAAsB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,wDAAS;AACnC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,sBAAsB;AACnC,eAAe;AACf;AACA;AACA;AACA;AACA,MAAM,wDAAM;AACZ;;AAEA;AACA;AACA;AACA,aAAa,sBAAsB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,6CAAC;AACtB;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ,oBAAoB,2DAA2D;AACpG,aAAa,YAAY;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2EAAsB;AAClC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,4BAA4B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,gBAAgB;AAC7B,eAAe,SAAS;AACxB,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,oDAAK;AAC7B;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,iBAAiB;AAC7B;AACA;AACA;AACA;AACA,YAAY,WAAW;AACvB;AACA;AACA,UAAU,2DAA2D;AACrE;AACA,YAAY,wCAAwC;AACpD;AACA;AACA,kBAAkB,2DAA2D;AAC7E;AACA,YAAY,wCAAwC;AACpD;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,YAAY,UAAU;AACtB;AACA,CAAC;;AAED;AACA,qDAAqD;AACrD,UAAU,OAAO;AACjB;;AAEA;AACA,iEAAe,2DAAQ,oDAAoD,EAAC;;;;;;;;;;;;;;;;AC5iB5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAE6C;AACN;AACiB;AACR;;AAEhD;AACA,uBAAuB,2DAA2D;AAClF,IAAI,2CAA2C,uBAAuB,iDAAiD;AACvH;AACA;AACA;AACA;AACO,4BAA4B,wDAAY;AAC/C;AACA;AACA,aAAa,sCAAsC;AACnD,aAAa,sBAAsB;AACnC,aAAa,sBAAsB;AACnC,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,8BAA8B;AAC3C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,wDAAS;AAC3B,UAAU,oDAAK;AACf,UAAU,wDAAS;AACnB;AACA;;AAEA;AACA;AACA,oBAAoB,eAAe;AACnC;AACA;AACA,iBAAiB,qDAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qDAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM,uEAAuE;AAC7E,aAAa,sCAAsC;AACnD,aAAa,sBAAsB;AACnC,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,gDAAgD;AAC7D,aAAa,8BAA8B;AAC3C,aAAa,8BAA8B;AAC3C;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe,wDAAS;AACxB,MAAM,yDAAQ;AACd,MAAM,yDAAQ;AACd;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA,eAAe,wDAAS;AACxB,MAAM,4DAAO;AACb,MAAM,4DAAO;AACb;;AAEA;AACA,sDAAsD,iDAAiD;AACvG;AACA;AACA,aAAa,kCAAkC;AAC/C,eAAe;AACf;AACA;AACA,eAAe,oDAAK;AACpB;;AAEA;AACA,kDAAkD,kDAAkD;AACpG;AACA;AACA,aAAa,kCAAkC;AAC/C,aAAa,kCAAkC;AAC/C,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,eAAe,oDAAK;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA,CAAC;;AAED,iEAAe,aAAa,EAAC;;;;;;;;;;;;;;AClL7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEiC;AACuB;;AAExD;AACA;AACA,yBAAyB,0CAA0C;AACnE;AACA;AACA;AACO,0BAA0B,kDAAM;AACvC;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC,sBAAsB,gBAAgB;AACtC,iDAAiD,wDAAS,KAAK,oDAAK,oBAAoB,wDAAS;AACjG;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,YAAY,SAAS;AACrB;AACA,CAAC;;AAED;AACA,iEAAe,kDAAM,2CAA2C,EAAC","sources":["webpack://jclic/./src/activities/text/WrittenAnswer.js","webpack://jclic/./src/boxes/ActiveBoxGrid.js","webpack://jclic/./src/shapers/Rectangular.js"],"sourcesContent":["/**\n * File : activities/text/WrittenAnswer.js\n * Created : 04/06/2015\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\nimport $ from 'jquery';\nimport { Activity, ActivityPanel } from '../../Activity.js';\nimport ActiveBoxGrid from '../../boxes/ActiveBoxGrid.js';\nimport BoxBag from '../../boxes/BoxBag.js';\nimport { Rectangle, Point } from '../../AWT.js';\nimport { compareMultipleOptions } from '../../Utils.js';\nimport Rectangular from '../../shapers/Rectangular.js';\n\n/**\n * This class of {@link module:Activity.Activity Activity} shows a panel with {@link module:boxes/ActiveBox.ActiveBox ActiveBox} objects acting as cells\n * with questions. The answers to these questions must be written in a separate text field.\n *\n * The ActiveBox objects are filled with data stored in {@link module:boxes/ActiveBagContent.ActiveBagContent ActiveBagContent} repositories.\n *\n * A second {@link module:boxes/ActiveBagContent.ActiveBagContent ActiveBagContent} can be used as alternative content, revealed as the questions\n * are solved.\n * @extends module:Activity.Activity\n */\nexport class WrittenAnswer extends Activity {\n /**\n * WrittenAnswer constructor\n * @param {module:project/JClicProject.JClicProject} project - The JClic project to which this activity belongs\n */\n constructor(project) {\n super(project);\n }\n\n /**\n * Loads this object settings from an XML element\n * @override\n * @param {external:jQuery} $xml - The jQuery XML element to parse\n */\n setProperties($xml) {\n super.setProperties($xml);\n this.abc['primary'].avoidAllIdsNull(this.abc['answers'].getNumCells());\n }\n\n /**\n * Retrieves the minimum number of actions needed to solve this activity\n * @override\n * @returns {number}\n */\n getMinNumActions() {\n return this.invAss ?\n this.abc['answers'].getNumCells() :\n this.abc['primary'].getNumCells() - this.nonAssignedCells;\n }\n\n /**\n * This activity uses random values to shuffle its internal components\n * @override\n * @returns {boolean}\n */\n hasRandom() {\n return true;\n }\n\n /**\n * This activity makes use of the keyboard\n * @override\n * @returns {boolean}\n */\n needsKeyboard() {\n return true;\n }\n\n /**\n * This activity can permit the user to display the solution\n * @override\n * @returns {boolean}\n */\n helpSolutionAllowed() {\n return true;\n }\n}\n\nObject.assign(WrittenAnswer.prototype, {\n /**\n * Number of unassigned cells\n * @name module:activities/text/WrittenAnswer.WrittenAnswer#nonAssignedCells\n * @type {number} */\n nonAssignedCells: 0,\n /**\n * Whether to use or not the cell's `idAss` field to check if pairings match\n * @name module:activities/text/WrittenAnswer.WrittenAnswer#useIdAss\n * @type {boolean} */\n useIdAss: true,\n});\n\n/**\n * The {@link module:Activity.ActivityPanel ActivityPanel} where {@link module:activities/text/WrittenAnswer.WrittenAnswer WrittenAnswer} activities are played.\n * @extends module:Activity.ActivityPanel\n */\nexport class WrittenAnswerPanel extends ActivityPanel {\n /**\n * WrittenAnswerPanel constructor\n * @param {module:Activity.Activity} act - The {@link module:Activity.Activity Activity} to which this Panel belongs\n * @param {module:JClicPlayer.JClicPlayer} ps - Any object implementing the methods defined in the\n * [PlayStation](http://projectestac.github.io/jclic/apidoc/edu/xtec/jclic/PlayStation.html) Java interface.\n * @param {external:jQuery} [$div] - The jQuery DOM element where this Panel will deploy\n */\n constructor(act, ps, $div) {\n super(act, ps, $div);\n }\n\n /**\n * Performs miscellaneous cleaning operations\n * @override\n */\n clear() {\n if (this.bgA) {\n this.bgA.end();\n this.bgA = null;\n }\n if (this.bgB) {\n this.bgB.end();\n this.bgB = null;\n }\n }\n\n /**\n * Prepares the visual components of the activity\n * @override\n */\n buildVisualComponents() {\n if (this.firstRun)\n super.buildVisualComponents();\n\n this.clear();\n\n const\n abcA = this.act.abc['primary'],\n abcB = this.act.abc['answers'],\n solved = this.act.abc['solvedPrimary'];\n\n if (abcA && abcB) {\n if (this.act.invAss)\n this.invAssCheck = Array(abcB.getNumCells()).fill(false);\n\n if (abcA.image) {\n abcA.setImgContent(this.act.project.mediaBag, null, false);\n if (abcA.animatedGifFile && !abcA.shaper.rectangularShapes && !this.act.shuffleA)\n this.$animatedBg = $('<span/>').css({\n 'background-image': 'url(' + abcA.animatedGifFile + ')',\n 'background-position': 'center',\n 'background-repeat': 'no-repeat',\n position: 'absolute'\n }).appendTo(this.$div);\n }\n\n if (solved && solved.image)\n solved.setImgContent(this.act.project.mediaBag, null, false);\n\n if (this.act.acp !== null) {\n const contentKit = [abcA, abcB];\n if (solved)\n contentKit.push(solved);\n this.act.acp.generateContent(abcA.nch, abcA.ncw, contentKit, false);\n }\n\n this.bgA = ActiveBoxGrid.createEmptyGrid(null, this, this.act.margin, this.act.margin, abcA);\n\n let w = abcB.w;\n if (this.act.boxGridPos === 'AUB' || this.act.boxGridPos === 'BUA')\n w = abcA.getTotalWidth();\n //\n // bgB will be used only as a placeholder for `$textField`\n this.bgB = new ActiveBoxGrid(null, this, abcB.style, this.act.margin, this.act.margin, w, abcB.h, new Rectangular(1, 1));\n this.$form = $('<form/>', { id: 'form1' /*, action: '#' */ });\n // Modified 05/Feb/2020: jQuery not catching submit event when on first activity\n this.$form[0].addEventListener('submit', event => {\n event.preventDefault();\n if (this.playing)\n this.setCurrentCell(this.currentCell);\n return false;\n });\n\n this.$textField = $('<input/>', { type: 'text', size: 200 })\n .css(abcB.style.getCSS())\n .css({\n position: 'absolute', top: 0, left: 0,\n border: 0, padding: 0, margin: 0,\n 'text-align': 'center'\n })\n .attr({\n autocomplete: 'off',\n autocorrect: 'off',\n autocapitalize: 'off',\n spellcheck: 'false',\n });\n\n this.$div.append(this.$form.append(this.$textField));\n this.bgA.setContent(abcA, solved || null);\n this.bgA.setDefaultIdAss();\n if (this.$animatedBg)\n this.bgA.setCellAttr('tmpTrans', true);\n\n this.act.nonAssignedCells = 0;\n for (let i = 0; i < this.bgA.getNumCells(); i++) {\n var bx = this.bgA.getActiveBox(i);\n if (bx.idAss === -1) {\n this.act.nonAssignedCells++;\n bx.switchToAlt(this.ps);\n }\n }\n this.bgA.setVisible(true);\n this.bgB.setVisible(false);\n }\n }\n\n /**\n * Basic initialization procedure\n * @override\n */\n initActivity() {\n super.initActivity();\n if (!this.firstRun)\n this.buildVisualComponents();\n else\n this.firstRun = false;\n\n if (this.bgA && this.bgB) {\n // Scramble cells\n if (this.act.shuffleA)\n this.shuffle([this.bgA], true, true);\n\n if (this.useOrder)\n this.currentItem = this.bgA.getNextItem(-1);\n\n this.setAndPlayMsg('initial', 'start');\n this.invalidate().update();\n this.playing = true;\n }\n }\n\n /**\n * Called by [JClicPlayer](JClicPlayer.html) when this activity panel is fully visible, just\n * after the initialization process.\n * @override\n */\n activityReady() {\n super.activityReady();\n this.setCurrentCell(0);\n }\n\n /**\n * Updates the graphic content of this panel.\n * This method will be called from {@link module:AWT.Container#update} when needed.\n * @override\n * @param {module:AWT.Rectangle} dirtyRegion - Specifies the area to be updated. When `null`,\n * it's the whole panel.\n */\n updateContent(dirtyRegion) {\n super.updateContent(dirtyRegion);\n if (this.bgA && this.$canvas) {\n const\n canvas = this.$canvas.get(-1),\n ctx = canvas.getContext('2d');\n if (!dirtyRegion)\n dirtyRegion = new Rectangle(0, 0, canvas.width, canvas.height);\n ctx.clearRect(dirtyRegion.pos.x, dirtyRegion.pos.y, dirtyRegion.dim.width, dirtyRegion.dim.height);\n this.bgA.update(ctx, dirtyRegion);\n }\n return this;\n }\n\n /**\n * Sets the real dimension of this panel.\n * @override\n * @param {module:AWT.Dimension} preferredMaxSize - The maximum surface available for the activity panel\n * @returns {module:AWT.Dimension}\n */\n setDimension(preferredMaxSize) {\n return (!this.bgA || !this.bgB || this.getBounds().equals(preferredMaxSize)) ?\n preferredMaxSize :\n BoxBag.layoutDouble(preferredMaxSize, this.bgA, this.bgB, this.act.boxGridPos, this.act.margin);\n }\n\n /**\n * Sets the size and position of this activity panel\n * @override\n * @param {module:AWT.Rectangle} rect\n */\n setBounds(rect) {\n if (this.$canvas)\n this.$canvas.remove();\n\n super.setBounds(rect);\n if (this.bgA || this.bgB) {\n const r = rect.clone();\n if (this.act.boxGridPos === 'AUB')\n r.height -= this.bgB.pos.y + this.act.margin / 2;\n else if (this.act.boxGridPos === 'AB')\n r.width -= this.bgB.pos.x + this.act.margin / 2;\n\n // Create the main canvas\n this.$canvas = $('<canvas width=\"' + r.dim.width + '\" height=\"' + r.dim.height + '\"/>').css({\n position: 'absolute',\n top: 0,\n left: 0\n });\n\n // Resize animated gif background\n if (this.bgA && this.$animatedBg) {\n var bgRect = this.bgA.getBounds();\n this.$animatedBg.css({\n left: bgRect.pos.x,\n top: bgRect.pos.y,\n width: bgRect.dim.width + 'px',\n height: bgRect.dim.height + 'px',\n 'background-size': bgRect.dim.width + 'px ' + bgRect.dim.height + 'px'\n });\n this.$canvas.insertAfter(this.$animatedBg);\n } else\n this.$div.prepend(this.$canvas);\n\n if (this.$textField) {\n this.$textField.css({\n top: this.bgB.pos.y,\n left: this.bgB.pos.x,\n width: this.bgB.dim.width,\n height: this.bgB.dim.height,\n zIndex: 9\n });\n }\n // Repaint all\n this.invalidate().update();\n }\n }\n\n /**\n * Builds the accessible components needed for this ActivityPanel\n * This method is called when all main elements are placed and visible, when the activity is ready\n * to start or when resized.\n * @override\n */\n buildAccessibleComponents() {\n if (this.$canvas && this.accessibleCanvas) {\n super.buildAccessibleComponents();\n if (this.bgA)\n this.bgA.buildAccessibleElements(this.$canvas, this.$div, 'click');\n // bgB has a regular input element, so it's already accessible\n }\n }\n\n /**\n * Checks if all inverse associations are done\n * @returns {boolean}\n */\n checkInvAss() {\n return this.act.invAss && this.invAssCheck && this.invAssCheck.every(chk => chk);\n }\n\n /**\n * Updates the currently selected cell, evaluating the answer written by the user on the text field.\n * @param {number} i - Index into the {@link module:boxes/ActiveBoxbag.ActiveBoxBag ActiveBoxBag} of the cell to make active\n * @param {function[]} delayedActions - If set, store the the action in this array for future execution\n */\n setCurrentCell(i, delayedActions = null) {\n if (!this.playing)\n return;\n\n let\n bx = null,\n m = false;\n\n if (this.currentCell !== -1) {\n let ok = false;\n bx = this.bgA ? this.bgA.getActiveBoxWithIdLoc(this.currentCell) : null;\n if (bx) {\n bx.setMarked(false);\n const\n src = bx.getDescription(),\n id = bx.idAss,\n txCheck = id >= 0 ? this.act.abc['answers'].getActiveBoxContent(id).text : '',\n txAnswer = this.$textField.val().trim();\n if (compareMultipleOptions(txAnswer, txCheck, false, this.act.numericContent)) {\n ok = true;\n bx.idAss = -1;\n // When in multiple-answer, fill-in textField with the first valid option:\n const p = txCheck.indexOf('|');\n if (p >= 0)\n this.$textField.val(txCheck.substring(0, p));\n\n if (this.act.abc['solvedPrimary']) {\n bx.switchToAlt(this.ps);\n m = bx.playMedia(this.ps, delayedActions);\n } else\n bx.clear();\n if (this.act.invAss && id >= 0 && id < this.invAssCheck.length) {\n this.invAssCheck[id] = true;\n }\n if (this.act.useOrder)\n this.currentItem = this.bgA.getNextItem(this.currentItem);\n }\n\n const cellsPlaced = this.bgA.countCellsWithIdAss(-1);\n if (txAnswer.length > 0) {\n this.ps.reportNewAction(this.act, 'WRITE', src, txAnswer, ok, cellsPlaced);\n }\n if (ok && (this.checkInvAss() || cellsPlaced === this.bgA.getNumCells())) {\n this.finishActivity(true);\n this.$textField.prop('disabled', true);\n this.invalidate().update();\n return;\n } else if (!m && txAnswer.length > 0)\n this.playEvent(ok ? 'actionOk' : 'actionError');\n }\n }\n\n bx = this.bgA ?\n this.act.useOrder ?\n this.bgA.getBox(this.currentItem) :\n this.bgA.getActiveBoxWithIdLoc(i) :\n null;\n\n if (this.bgA && (!bx || bx.idAss === -1)) {\n for (var j = 0; j < this.bgA.getNumCells(); j++) {\n bx = this.bgA.getActiveBoxWithIdLoc(j);\n if (bx.idAss !== -1)\n break;\n }\n if (bx && bx.idAss === -1) {\n this.finishActivity(false);\n this.$textField.prop('disabled', true);\n this.invalidate().update();\n return;\n }\n }\n // Draw border only if it has more than one cell\n if (bx && this.bgA && this.bgA.getNumCells() > 1)\n bx.setMarked(true);\n if (bx)\n this.currentCell = bx.idLoc;\n this.$textField.val('');\n this.$textField.focus();\n this.invalidate().update();\n if (bx)\n bx.playMedia(this.ps, delayedActions);\n }\n\n /**\n * Main handler used to process mouse, touch, keyboard and edit events\n * @override\n * @param {external:Event} event - The HTML event to be processed\n * @returns {boolean} - When this event handler returns `false`, jQuery will stop its\n * propagation through the DOM tree. See: {@link http://api.jquery.com/on}\n */\n processEvent(event) {\n if (this.playing) {\n // Array to be filled with actions to be executed at the end of event processing\n const delayedActions = [];\n switch (event.type) {\n case 'click':\n event.preventDefault();\n this.ps.stopMedia(1);\n const p = new Point(\n event.pageX - this.$div.offset().left,\n event.pageY - this.$div.offset().top);\n\n // Avoid clicks on the text field\n if (this.bgB.contains(p)) {\n this.$textField.focus();\n break;\n }\n\n const bx = this.bgA ? this.bgA.findActiveBox(p) : null;\n if (bx && !bx.isInactive()) {\n if (bx.getContent() && bx.getContent().mediaContent === null)\n this.playEvent('CLICK');\n this.setCurrentCell(bx.idLoc, delayedActions);\n }\n break;\n\n case 'change':\n event.preventDefault();\n this.setCurrentCell(this.currentCell, delayedActions);\n break;\n }\n delayedActions.forEach(action => action());\n return false;\n }\n }\n}\n\nObject.assign(WrittenAnswerPanel.prototype, {\n /**\n * The input text field where users write the answers\n * @name module:activities/text/WrittenAnswer.WrittenAnswerPanel#$textField\n * @type {external:jQuery} */\n $textField: null,\n /**\n * Array for storing checked associations\n * @name module:activities/text/WrittenAnswer.WrittenAnswerPanel#invAssCheck\n * @type {boolean[]} */\n invAssCheck: null,\n /**\n * The {@link module:boxes/ActiveBoxbag.ActiveBoxBag ActiveBoxBag} object containing the questions\n * @name module:activities/text/WrittenAnswer.WrittenAnswerPanel#bgA\n * @type {module:boxes/ActiveBoxBag.ActiveBoxBag} */\n bgA: null,\n /**\n * An optional {@link module:boxes/ActiveBoxbag.ActiveBoxBag ActiveBoxBag} with content displayed as cells are solved.\n * @name module:activities/text/WrittenAnswer.WrittenAnswerPanel#bgB\n * @type {module:boxes/ActiveBoxBag.ActiveBoxBag} */\n bgB: null,\n /**\n * The currently selected cell\n * @name module:activities/text/WrittenAnswer.WrittenAnswerPanel#currentCell\n * @type {number} */\n currentCell: -1,\n /**\n * Mouse events intercepted by this panel\n * @override\n * @name module:activities/text/WrittenAnswer.WrittenAnswerPanel#events\n * @type {string[]} */\n events: ['click', 'change'],\n});\n\n/**\n * Panel class associated to this type of activity: {@link module:activities/text/WrittenAnswer.WrittenAnswerPanel WrittenAnswerPanel}\n * @type {class} */\nWrittenAnswer.Panel = WrittenAnswerPanel;\n\n// Register activity class\nexport default Activity.registerClass('@text.WrittenAnswer', WrittenAnswer);\n","/**\n * File : boxes/ActiveBoxGrid.js\n * Created : 19/05/2015\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Catalan Educational Telematic Network (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\nimport ActiveBoxBag from './ActiveBoxBag.js';\nimport ActiveBox from './ActiveBox.js';\nimport { Rectangle, Dimension, Point } from '../AWT.js';\nimport { settings, roundTo } from '../Utils.js';\n\n/**\n * This class extends {@link module:boxes/ActiveBoxbag.ActiveBoxBag ActiveBoxBag} with constructors that take an argument of type\n * {@link module:shapers/Shaper.Shaper Shaper} used to build all its {@link module:boxes/ActiveBox.ActiveBox ActiveBox}components. It also maintains information\n * about the number of \"rows\" and \"columns\", useful to compute valid (integer) values when\n * resizing or moving its components.\n * @extends module:boxes/ActiveBoxBag.ActiveBoxBag\n */\nexport class ActiveBoxGrid extends ActiveBoxBag {\n /**\n * ActiveBxGrid constructor\n * @param {module:boxes/AbstractBox.AbstractBox} parent - The AbstractBox to which this box grid belongs\n * @param {module:AWT.Container} container - The container where this box grid is placed.\n * @param {module:boxes/BoxBase} boxBase - The object where colors, fonts, border and other graphic properties\n * @param {number} px - `X` coordinate of the upper left corner of this box grid\n * @param {number} py - `Y` coordinate of the upper left corner of this box grid\n * @param {number} setWidth - Total width of the box grid\n * @param {number} setHeight - Total height of the box grid\n * @param {module:shapers/Shaper.Shaper} sh - Shaper used to build the ActiveBox objects\n */\n constructor(parent, container, boxBase, px, py, setWidth, setHeight, sh) {\n // ActiveBoxGrid derives from ActiveBoxBag\n super(parent, container, boxBase);\n\n this.nCols = sh.nCols;\n this.nRows = sh.nRows;\n\n // This will be the enclosing rectangle of this ActiveBox bag\n const r = new Rectangle(\n new Point(px, py),\n new Dimension(\n Math.round(setWidth / this.nCols) * this.nCols,\n Math.round(setHeight / this.nRows) * this.nRows));\n\n // Create all the [ActiveBox](ActiveBox.html) objects based on the\n // shapes provided by the [Shaper](Shaper.html)\n for (let i = 0; i < sh.nCells; i++) {\n const\n tmpSh = sh.getShape(i, r),\n bx = new ActiveBox(this, container, boxBase, i, tmpSh.getBounds());\n if (!sh.rectangularShapes)\n bx.setShape(tmpSh);\n this.addActiveBox(bx);\n }\n\n // If the Shaper has `remainder` (extra space), set the background box of this\n // [BoxBag](BoxBag.html)\n if (sh.hasRemainder) {\n const\n tmpSh = sh.getRemainderShape(r),\n bx = new ActiveBox(this, container, boxBase, 0, tmpSh.getBounds());\n bx.setShape(tmpSh);\n this.setBackgroundBox(bx);\n }\n }\n\n /**\n * This factory constructor creates a new empty grid with the number of cells indicated by the\n * {@link module:boxes/ActiveBagContent.ActiveBagContent ActiveBagContent} `abc`, not filling the cells with any content.\n * @param {module:boxes/AbstractBox.AbstractBox} parent - The AbstractBox to which this box grid belongs\n * @param {module:AWT.Container} container - The container where this box grid is placed.\n * @param {number} px - `X` coordinate of the upper left corner of this box grid\n * @param {number} py - `Y` coordinate of the upper left corner of this box grid\n * @param {module:boxes/ActiveBagContent.ActiveBagContent} abc - Used only to get the number of cells and the shaper (when `sh` is `null`)\n * @param {module:shapers/Shaper.Shaper} sh - Shaper used to build the ActiveBox objects\n * @param {module:boxes/BoxBase.BoxBase} boxBase - The object where colors, fonts, border and other graphic properties\n * of this box grid are defined.\n * @returns {module:boxes/ActiveBoxGrid.ActiveBoxGrid}\n */\n static createEmptyGrid(parent, container, px, py, abc, sh, boxBase) {\n const result = abc ? new ActiveBoxGrid(parent, container,\n boxBase || abc.style,\n px, py,\n abc.getTotalWidth(), abc.getTotalHeight(),\n sh || abc.getShaper()) : null;\n\n if (result)\n result.setBorder(abc.border);\n\n return result;\n }\n\n /**\n * Gets the minimum size of this grid\n * @returns {module:AWT.Dimension}\n */\n getMinimumSize() {\n return new Dimension(\n settings.MIN_CELL_SIZE * this.nCols,\n settings.MIN_CELL_SIZE * this.nRows);\n }\n\n /**\n * Gets a scaled size of this grid, rounded to the nearest integer values\n * @param {number} scale - The scale factor\n * @returns {module:AWT.Dimension}\n */\n getScaledSize(scale) {\n return new Dimension(\n roundTo(scale * this.preferredBounds.dim.width, this.nCols),\n roundTo(scale * this.preferredBounds.dim.height, this.nRows));\n }\n\n /**\n * Returns the logical coordinates of the provided {@link module:boxes/ActiveBox.ActiveBox ActiveBox}.\n * The units of the result are not pixels, but ordinal numbers (relative positions) of columns\n * and rows in the grid.\n * @param {module:boxes/ActiveBox.ActiveBox} bx - The box to process\n * @returns {module:AWT.Point}\n */\n getCoord(bx) {\n return new Point(bx.idLoc % this.nCols, Math.floor(bx.idLoc / this.nCols));\n }\n\n /**\n * Calculates the logical distance between two {@link module:boxes/ActiveBox.ActiveBox ActiveBox} objects.\n * Resulting units are not pixels, but ordinal numbers (relative positions) of columns and rows\n * in the grid.\n * @param {module:boxes/ActiveBox.ActiveBox} src - First box\n * @param {module:boxes/ActiveBox.ActiveBox} dest - Second box\n * @returns {module:AWT.Point}\n */\n getCoordDist(src, dest) {\n const\n ptSrc = this.getCoord(src),\n ptDest = this.getCoord(dest);\n return new Point(ptDest.x - ptSrc.x, ptDest.y - ptSrc.y);\n }\n}\n\nObject.assign(ActiveBoxGrid.prototype, {\n /**\n * Number of columns of this box grid\n * @name module:boxes/ActiveBoxGrid.ActiveBoxGrid#nCols\n * @type {number} */\n nCols: 1,\n /**\n * Number of rows of this box grid\n * @name module:boxes/ActiveBoxGrid.ActiveBoxGrid#nRows\n * @type {number} */\n nRows: 1,\n});\n\nexport default ActiveBoxGrid;\n","/**\n * File : shapers/Rectangular.js\n * Created : 19/05/2015\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Catalan Educational Telematic Network (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\nimport Shaper from './Shaper.js';\nimport { Rectangle, Point, Dimension } from '../AWT.js';\n\n/**\n *\n * This is the simplest {@link module:shapers/Shaper.Shaper Shaper}. It divides the graphic object in a set of rectangular\n * shapes distributed in the specified number of rows and columns.\n * @extends module:shapers/Shaper.Shaper\n */\nexport class Rectangular extends Shaper {\n /**\n * Rectangular constructor\n * @param {number} nx - Number of columns\n * @param {number} ny - Number of rows\n */\n constructor(nx, ny) {\n super(nx, ny);\n }\n\n /**\n * Builds the rectangular shapes based on the number of rows and columns\n * @override\n */\n buildShapes() {\n const\n w = 1 / this.nCols,\n h = 1 / this.nRows;\n for (let y = 0; y < this.nRows; y++) {\n for (let x = 0; x < this.nCols; x++) {\n this.shapeData[y * this.nCols + x] = new Rectangle(new Point(x * w, y * h), new Dimension(w, h));\n }\n }\n this.initiated = true;\n }\n}\n\nObject.assign(Rectangular.prototype, {\n /**\n * Overrides same flag in {@link module:/shapers/Shaper.Shaper#rectangularShapes Shaper#rectangularShapes}\n * @name module:shapers/Rectangular.Rectangular#rectangularShapes\n * @override\n * @type {boolean} */\n rectangularShapes: true,\n});\n\n// Register this class in the list of known shapers\nexport default Shaper.registerClass('@Rectangular', Rectangular);\n"],"names":[],"sourceRoot":""}
@@ -1,160 +0,0 @@
1
- "use strict";
2
- exports.id = 2608;
3
- exports.ids = [2608];
4
- exports.modules = {
5
-
6
- /***/ 2608:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
-
10
- // EXPORTS
11
- __webpack_require__.d(__webpack_exports__, {
12
- "default": () => (/* binding */ skins_MiniSkin)
13
- });
14
-
15
- // UNUSED EXPORTS: MiniSkin
16
-
17
- // EXTERNAL MODULE: ./src/skins/Skin.js + 9 modules
18
- var Skin = __webpack_require__(757);
19
- // EXTERNAL MODULE: ./src/skins/DefaultSkin.js + 13 modules
20
- var DefaultSkin = __webpack_require__(1588);
21
- ;// ./src/skins/assets/mini.css
22
- const mini_namespaceObject = ".ID {\n background-color: #F4F4F4;\n}\n\n.ID .JClicPlayerCnt {\n margin: 4px;\n}\n\n.ID .JClicCtrlCnt {\n margin: 0 2px 4px 2px;\n}\n\n.ID .JClicMsgBox {\n height: 25px;\n}\n";
23
- ;// ./src/skins/MiniSkin.js
24
- /**
25
- * File : skins/MiniSkin.js
26
- * Created : 05/07/2016
27
- * By : Francesc Busquets <francesc@gmail.com>
28
- *
29
- * JClic.js
30
- * An HTML5 player of JClic activities
31
- * https://projectestac.github.io/jclic.js
32
- *
33
- * @source https://github.com/projectestac/jclic.js
34
- *
35
- * @license EUPL-1.2
36
- * @licstart
37
- * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
38
- *
39
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
40
- * the European Commission- subsequent versions of the EUPL (the "Licence");
41
- * You may not use this work except in compliance with the Licence.
42
- *
43
- * You may obtain a copy of the Licence at:
44
- * https://joinup.ec.europa.eu/software/page/eupl
45
- *
46
- * Unless required by applicable law or agreed to in writing, software
47
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
48
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
49
- * Licence for the specific language governing permissions and limitations
50
- * under the Licence.
51
- * @licend
52
- * @module
53
- */
54
-
55
-
56
-
57
-
58
- // Use Webpack to import CSS and SVG files
59
-
60
-
61
- /**
62
- * This is a variant of the default {@link module:skins/Skin.Skin Skin} used by JClic.js
63
- * It differs from {@link module:skins/DefaultSkin.DefaultSkin DefaultSkin} in colors and sizes
64
- * @extends module:skins/DefaultSkin.DefaultSkin
65
- */
66
- class MiniSkin extends DefaultSkin["default"] {
67
- /**
68
- * MiniSkin constructor
69
- *
70
- * @param {module:JClicPlayer.JClicPlayer} ps - The PlayStation (currently a {@link module:JClicPlayer.JClicPlayer JClicPlayer}) used to load and
71
- * realize the media objects meeded tot build the Skin.
72
- * @param {string} [name] - The skin class name
73
- * @param {object} [options] - Optional parameter with additional options
74
- */
75
- constructor(ps, name = null, options = {}) {
76
- // MiniSkin extends [DefaultSkin](DefaultSkin.html)
77
- super(ps, name, Object.assign({}, options, { counters: false, reportsBtn: true }));
78
- }
79
-
80
- /**
81
- * Returns the CSS styles used by this skin. This method should be called only from
82
- * the `Skin` constructor, and overridded by subclasses if needed.
83
- * @param {string} media - A specific media size. Possible values are: 'default', 'half' and 'twoThirds'
84
- * @returns {string}
85
- */
86
- _getStyleSheets(media = 'default') {
87
- return super._getStyleSheets(media) + (media === 'default' ? this.skinCSS : '');
88
- }
89
- }
90
-
91
- Object.assign(MiniSkin.prototype, {
92
- /**
93
- * Class name of this skin. It will be used as a base selector in the definition of all CSS styles.
94
- * @name MiniSkin#skinId
95
- * @override
96
- * @type {string}
97
- */
98
- skinId: 'JClicMiniSkin',
99
- // Buttons and other graphical resources used by this skin.
100
- //
101
- /**
102
- * Icon width
103
- * @name MiniSkin#iconWidth
104
- * @override
105
- * @type {number} */
106
- iconWidth: 18,
107
- /**
108
- * Icon height
109
- * @name MiniSkin#iconHeight
110
- * @override
111
- * @type {number} */
112
- iconHeight: 18,
113
- /**
114
- * Fill color for icons
115
- * @name MiniSkin#iconFill
116
- * @override
117
- * @type {string} */
118
- iconFill: '#080808',
119
- /**
120
- * Fill-in color for counters
121
- * @name MiniSkin#counterIconFill
122
- * @override
123
- * @type {string} */
124
- counterIconFill: '#080808',
125
- /**
126
- * Default margin between elements
127
- * @name MiniSkin#margin
128
- * @override
129
- * @type {number} */
130
- margin: 8,
131
- /**
132
- * Styles used in this skin
133
- * @name MiniSkin#skinCSS
134
- * @type {string} */
135
- skinCSS: mini_namespaceObject,
136
- /**
137
- * Styles used in this skin, sized to half its regular size.
138
- * (_null_ here because MiniSkin it's already very small)
139
- * @name MiniSkin#mainCSSHalf
140
- * @override
141
- * @type {string} */
142
- mainCSSHalf: '',
143
- /**
144
- * Styles used in this skin, sized to two thirds of its regular size
145
- * (_null_ here because MiniSkin it's already very small)
146
- * @name MiniSkin#mainCSSTwoThirds
147
- * @override
148
- * @type {string} */
149
- mainCSSTwoThirds: '',
150
- });
151
-
152
- // Register this class in the list of available skins
153
- /* harmony default export */ const skins_MiniSkin = (Skin["default"].registerClass('mini', MiniSkin));
154
-
155
-
156
- /***/ })
157
-
158
- };
159
- ;
160
- //# sourceMappingURL=2608.jclic-node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"2608.jclic-node.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAE6B;AACc;;AAE3C;AACwC;;AAExC;AACA,qCAAqC,mCAAmC;AACxE,oBAAoB,wDAAwD;AAC5E;AACA;AACO,uBAAuB,sBAAW;AACzC;AACA;AACA;AACA,aAAa,gCAAgC,mCAAmC,iDAAiD;AACjI;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA,2CAA2C;AAC3C;AACA,oCAAoC,aAAa,mCAAmC;AACpF;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA,CAAC;;AAED;AACA,qDAAe,eAAI,gCAAgC,EAAC","sources":["webpack://jclic/./src/skins/MiniSkin.js"],"sourcesContent":["/**\n * File : skins/MiniSkin.js\n * Created : 05/07/2016\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\nimport Skin from './Skin.js';\nimport DefaultSkin from './DefaultSkin.js';\n\n// Use Webpack to import CSS and SVG files\nimport skinCSS from './assets/mini.css';\n\n/**\n * This is a variant of the default {@link module:skins/Skin.Skin Skin} used by JClic.js\n * It differs from {@link module:skins/DefaultSkin.DefaultSkin DefaultSkin} in colors and sizes\n * @extends module:skins/DefaultSkin.DefaultSkin\n */\nexport class MiniSkin extends DefaultSkin {\n /**\n * MiniSkin constructor\n *\n * @param {module:JClicPlayer.JClicPlayer} ps - The PlayStation (currently a {@link module:JClicPlayer.JClicPlayer JClicPlayer}) used to load and\n * realize the media objects meeded tot build the Skin.\n * @param {string} [name] - The skin class name\n * @param {object} [options] - Optional parameter with additional options\n */\n constructor(ps, name = null, options = {}) {\n // MiniSkin extends [DefaultSkin](DefaultSkin.html)\n super(ps, name, Object.assign({}, options, { counters: false, reportsBtn: true }));\n }\n\n /**\n * Returns the CSS styles used by this skin. This method should be called only from\n * the `Skin` constructor, and overridded by subclasses if needed.\n * @param {string} media - A specific media size. Possible values are: 'default', 'half' and 'twoThirds'\n * @returns {string}\n */\n _getStyleSheets(media = 'default') {\n return super._getStyleSheets(media) + (media === 'default' ? this.skinCSS : '');\n }\n}\n\nObject.assign(MiniSkin.prototype, {\n /**\n * Class name of this skin. It will be used as a base selector in the definition of all CSS styles.\n * @name MiniSkin#skinId\n * @override\n * @type {string}\n */\n skinId: 'JClicMiniSkin',\n // Buttons and other graphical resources used by this skin.\n //\n /**\n * Icon width\n * @name MiniSkin#iconWidth\n * @override\n * @type {number} */\n iconWidth: 18,\n /**\n * Icon height\n * @name MiniSkin#iconHeight\n * @override\n * @type {number} */\n iconHeight: 18,\n /**\n * Fill color for icons\n * @name MiniSkin#iconFill\n * @override\n * @type {string} */\n iconFill: '#080808',\n /**\n * Fill-in color for counters\n * @name MiniSkin#counterIconFill\n * @override\n * @type {string} */\n counterIconFill: '#080808',\n /**\n * Default margin between elements\n * @name MiniSkin#margin\n * @override\n * @type {number} */\n margin: 8,\n /**\n * Styles used in this skin\n * @name MiniSkin#skinCSS\n * @type {string} */\n skinCSS,\n /**\n * Styles used in this skin, sized to half its regular size.\n * (_null_ here because MiniSkin it's already very small)\n * @name MiniSkin#mainCSSHalf\n * @override\n * @type {string} */\n mainCSSHalf: '',\n /**\n * Styles used in this skin, sized to two thirds of its regular size\n * (_null_ here because MiniSkin it's already very small)\n * @name MiniSkin#mainCSSTwoThirds\n * @override\n * @type {string} */\n mainCSSTwoThirds: '',\n});\n\n// Register this class in the list of available skins\nexport default Skin.registerClass('mini', MiniSkin);\n"],"names":[],"sourceRoot":""}