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":"1725.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;;AAEA;;AAEuB;AACoB;AACU;AACA;AACG;AACJ;;AAEpD;AACA;AACA;AACA;AACA;AACA,IAAI,uEAAuE;AAC3E;AACA;AACA;AACA;AACA,kBAAkB,uEAAuE;AACzF;AACA;AACO,wBAAwB,uDAAW;AAC1C;AACA;AACA,aAAa,sCAAsC;AACnD,aAAa,sBAAsB;AACnC,aAAa,8BAA8B;AAC3C;AACA,aAAa,QAAQ;AACrB,aAAa,sBAAsB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,gDAAgD;AAC7D;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,kBAAkB,6CAAC;AACnB,mBAAmB,wDAAS;AAC5B,0BAA0B,wDAAS;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,0BAA0B,4DAAgB;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,kCAAkC;AAC/C,aAAa,SAAS;AACtB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B,iEAAiE;AAC7F,aAAa,kCAAkC;AAC/C,aAAa,SAAS;AACtB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,kCAAkC;AAC/C;AACA;AACA;AACA,eAAe,oDAAK;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,kCAAkC;AAC/C;AACA;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,kCAAkC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,4DAAgB;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA,eAAe,uEAAuE;AACtF,aAAa,mCAAmC;AAChD,aAAa,QAAQ,sBAAsB,sEAAsE;AACjH;AACA;AACA;AACA,uBAAuB,4DAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C,oBAAoB,6CAAC;AACrB;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA,sCAAsC,mBAAmB,KAAK,mBAAmB;AACjF;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;;AAEA;AACA,gCAAgC,6CAAC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;;AAEA;AACA,eAAe,uEAAuE;AACtF;AACA,aAAa,mCAAmC;AAChD,aAAa,QAAQ,sBAAsB,sEAAsE;AACjH;AACA;AACA;AACA,uBAAuB,4DAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,gDAAgD;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,+BAA+B,8CAA8C;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,mCAAmC;AAChD;AACA,aAAa,sBAAsB;AACnC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,cAAc,yDAAQ;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA,0BAA0B,wDAAS;AACnC;AACA;AACA;AACA,QAAQ;AACR,QAAQ,wDAAG,kCAAkC,UAAU,KAAK,WAAW;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wDAAS;AACzB;AACA,gBAAgB,wDAAS;AACzB;AACA,gBAAgB,wDAAS;AACzB;AACA,gBAAgB,wDAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,eAAe;AACvC;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;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,kBAAkB;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,aAAa,mCAAmC;AAChD;AACA;AACA;AACA,QAAQ,yDAAQ;AAChB;AACA;AACA;AACA;;;AAGA;AACA,kDAAkD;AAClD,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA,mCAAmC,2DAAM;AACzC;;AAEA;AACA;AACA,aAAa,gCAAgC,iBAAiB;AAC9D,aAAa,YAAY;AACzB;AACA;AACA;AACA;AACA,MAAM,wDAAG,sBAAsB,4BAA4B;AAC3D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,kDAAkD;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,sBAAsB;AACnC;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,iBAAiB,wDAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB,6EAA6E;AACtG;AACA;AACA,aAAa,SAAS,gCAAgC,kDAAkD;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,UAAU,KAAK,UAAU;AACjD;AACA;AACA,sCAAsC,2BAA2B,KAAK,2BAA2B;AACjG;AACA,WAAW;AACX,UAAU;AACV;AACA;AACA,wBAAwB,UAAU,KAAK,UAAU;AACjD;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,iBAAiB;AAC9B,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,eAAe,iBAAiB;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gCAAgC,6CAAC;AACjC;AACA,iBAAiB,GAAG;AACpB;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,wDAAG,0CAA0C,gBAAgB;AACvE;AACA,qBAAqB,mDAAO;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,UAAU,yDAAQ;AAClB;AACA,UAAU,wDAAG,aAAa,SAAS,sBAAsB,gBAAgB;AACzE;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA,YAAY,gDAAgD;AAC5D;AACA;AACA;AACA;AACA,YAAY,gDAAgD;AAC5D;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,kDAAkD;AAC9D;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA,CAAC;;AAED,iEAAe,SAAS,EAAC","sources":["webpack://jclic/./src/boxes/ActiveBox.js"],"sourcesContent":["/**\n * File : boxes/ActiveBox.js\n * Created : 18/04/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\n/* global document */\n\nimport $ from 'jquery';\nimport AbstractBox from './AbstractBox.js';\nimport ActiveBoxContent from './ActiveBoxContent.js';\nimport ActiveBagContent from './ActiveBagContent.js';\nimport { Rectangle, Point, Container } from '../AWT.js';\nimport { settings, log, getMsg } from '../Utils.js';\n\n/**\n * Objects of this class are widely used in JClic activities: cells in puzzles and associations,\n * messages and other objects are active boxes.\n *\n * The specific content, size and location of `ActiveBox` objects is determined by its\n * {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent} member. Most ActiveBoxes have only one content, but some of them can\n * have a secondary or \"alternative\" content stored in the `altContent` field. This content is\n * used only when the `alternative` flag of the ActiveBox is `on`.\n *\n * Active boxes can host video and interactive media content (specified in the `mediaContent`\n * member of the {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent} through its `hostedMediaPlayer` member.\n * @extends module:boxes/AbstractBox.AbstractBox\n */\nexport class ActiveBox extends AbstractBox {\n /**\n * ActiveBox constructor\n * @param {module:boxes/AbstractBox.AbstractBox} [parent] - The AbstractBox to which this ActiveBox belongs\n * @param {module:AWT.Container} [container] - The container where this box is placed.\n * @param {module:boxes/BoxBase.BoxBase} [boxBase] - The object where colors, fonts, border and other graphic properties\n * of this box are defined.\n * @param {number} [setIdLoc] - A numeric identifier, used to locate this box in a set of sibling objects.\n * @param {module:AWT.Rectangle} [rect] - The initial bounds of the box.\n */\n constructor(parent, container, boxBase, setIdLoc, rect) {\n // ActiveBox extends AbstractBox\n super(parent, container, boxBase);\n this.clear();\n if (typeof setIdLoc === 'number') {\n this.idLoc = setIdLoc;\n this.idAss = 0;\n this.idOrder = 0;\n }\n if (rect)\n this.setBounds(rect);\n }\n\n /**\n * Factory constructor that creates a new cell inside a JQuery DOM element.\n * @param {external:jQuery} $dom - The DOM element that will act as a container\n * @param {module:boxes/ActiveBoxContent.ActiveBoxContent} abc - The cell's content. Must not be null and have the `dimension`\n * member initialized.\n * @returns {module:boxes/ActiveBox.ActiveBox}\n */\n static createCell($dom, abc) {\n if (abc && abc.dimension) {\n const\n box = new ActiveBox(),\n $canvas = $('<canvas width=\"' + abc.dimension.width + '\" height=\"' + abc.dimension.height + '\"/>'),\n rect = new Rectangle(0, 0, abc.dimension.width, abc.dimension.height);\n box.container = new Container();\n box.container.$div = $dom;\n box.setContent(abc);\n box.setBounds(rect);\n $dom.append($canvas);\n // Create accessible, focusable elements only for cells with media content\n // TODO: remove focus mark on blur in cells placed on fillInBlanks activities\n if (abc.mediaContent)\n box.buildAccessibleElement($canvas, $dom);\n box.update($canvas.get(-1).getContext('2d'), rect);\n return box;\n }\n }\n\n /**\n * Returns the current content used by the box\n * @returns {module:boxes/ActiveBoxContent.ActiveBoxContent}\n */\n getCurrentContent() {\n return this.isAlternative() ? this.altContent : this.content;\n }\n\n /**\n * Returns the current content, creating an empty one if needed.\n * @returns {module:boxes/ActiveBoxContent.ActiveBoxContent}\n */\n getContent() {\n if (!this.content)\n this.setContent(new ActiveBoxContent());\n return this.content;\n }\n\n /**\n * Clears the current content\n */\n clear() {\n this.content = null;\n this.altContent = null;\n this.idOrder = -1;\n this.setInactive(true);\n if (!this.hasHostedComponent)\n this.setHostedComponent(null);\n this.setHostedMediaPlayer(null);\n if (this.$accessibleElement)\n this.$accessibleElement.html('');\n if (this.tmpTrans)\n this.tmpTrans = false;\n this.invalidate();\n }\n\n /**\n * Checks if two ActiveBox objects have equivalent content\n * @param {module:boxes/ActiveBox.ActiveBox} bx - The ActiveBox to check against this.\n * @param {boolean} [checkCase] - When `true`, the comparing will be case-sensitive.\n * @returns {boolean} - `true` if both cells are equivalent.\n */\n isEquivalent(bx, checkCase) {\n return bx !== null &&\n this.content !== null &&\n this.content.isEquivalent(bx.content, checkCase);\n }\n\n /**\n * Same functionality as {@link module:boxes/ActiveBox.ActiveBox#isEquivalent isEquivalent}, but comparing the current content.\n * @param {module:boxes/ActiveBox.ActiveBox} bx - The ActiveBox to check against this.\n * @param {boolean} [checkCase] - When `true`, the comparing will be case-sensitive.\n * @returns {boolean}\n */\n isCurrentContentEquivalent(bx, checkCase) {\n return bx !== null &&\n this.getCurrentContent() !== null &&\n this.getCurrentContent().isEquivalent(bx.getCurrentContent(), checkCase);\n }\n\n /**\n * Swaps the location of two active boxes\n * @param {module:boxes/ActiveBox.ActiveBox} bx - The ActiveBox to swap with this one.\n */\n exchangeLocation(bx) {\n const\n pt = new Point(this.pos),\n idLoc0 = this.idLoc;\n this.moveTo(bx.pos);\n bx.moveTo(pt);\n this.idLoc = bx.idLoc;\n bx.idLoc = idLoc0;\n }\n\n /**\n * Copy the content of another ActiveBox into this one\n * @param {module:boxes/ActiveBox.ActiveBox} bx - The ActiveBox from which to take the content\n */\n copyContent(bx) {\n this.idOrder = bx.idOrder;\n this.idAss = bx.idAss;\n this.content = bx.content;\n this.altContent = bx.altContent;\n if (this.content) {\n if (this.content.style)\n this.setBoxBase(this.content.style);\n if (this.content.border !== null && bx.hasBorder() !== this.content.border)\n this.setBorder(this.content.border);\n }\n this.setInactive(bx.isInactive());\n this.setInverted(bx.isInverted());\n this.setAlternative(bx.isAlternative());\n this.setHostedComponent(bx.getHostedComponent());\n this.hasHostedComponent = bx.hasHostedComponent;\n this.setHostedMediaPlayer(bx.hostedMediaPlayer);\n if (this.hostedMediaPlayer)\n this.hostedMediaPlayer.setVisualComponentVisible(!this.isInactive() && this.isVisible());\n if (this.$accessibleElement)\n this.$accessibleElement.html(this.toString());\n }\n\n /**\n *\n * Exhanges the content of this ActiveBox with another one\n * @param {module:boxes/ActiveBox.ActiveBox} bx - The ActiveBox with which to exchange the content.\n */\n exchangeContent(bx) {\n const bx0 = new ActiveBox(this.getParent(), this.getContainerX(), this.boxBase);\n bx0.copyContent(this);\n this.copyContent(bx);\n bx.copyContent(bx0);\n }\n\n /**\n *\n * Sets the text content of this ActiveBox.\n * @param {string} tx - The text to set.\n */\n setTextContent(tx) {\n // only plain text!\n if (!tx)\n tx = '';\n if (!this.content)\n this.content = new ActiveBoxContent();\n this.content.text = tx;\n this.content.mediaContent = null;\n this.content.img = null;\n\n this.setHostedComponent(null);\n this.setInactive(false);\n this.checkHostedComponent();\n this.setHostedMediaPlayer(null);\n\n if (this.$accessibleElement)\n this.$accessibleElement.html(this.toString());\n }\n\n /**\n * Sets the default value to `idAss`\n */\n setDefaultIdAss() {\n this.idAss = this.content === null ? -1 : this.content.id;\n }\n\n /**\n * Checks if this ActiveBox is at its original place.\n * @returns {boolean}\n */\n isAtPlace() {\n return this.idOrder === this.idLoc;\n }\n\n /**\n * Sets the {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent} of this ActiveBox\n * @param {ActiveBoxContent|ActiveBagContent} abc - Object containing the content to set.\n * @param {number} i - When `abc` is an {@link module:boxes/ActiveBagContent.ActiveBagContent ActiveBagContent}, this field indicates an\n * index in the content array.\n */\n setContent(abc, i) {\n if (abc instanceof ActiveBagContent) {\n if (i < 0)\n i = this.idOrder;\n if (i >= abc.getNumCells())\n return;\n if (abc.style !== this.boxBase)\n this.setBoxBase(abc.style);\n\n // `abc` is now an [ActiveBoxContent](ActiveBoxContent.html)\n abc = abc.getActiveBoxContent(i);\n }\n this.setHostedComponent(null);\n this.setHostedMediaPlayer(null);\n this.content = abc;\n if (abc) {\n if (abc.animatedGifFile && !this.specialShape) {\n const url = `url(${abc.animatedGifFile})`;\n const $hc = $('<span/>').css({\n 'background-image': url,\n 'background-position': 'center',\n 'background-repeat': 'no-repeat'\n });\n // Save background image for later use\n $hc.data('background-image', url);\n\n if (abc.imgClip !== null) {\n $hc.css({\n 'background-origin': 'border-box',\n 'background-position': `${-abc.imgClip.pos.x}px ${-abc.imgClip.pos.y}px`\n // TODO: Use background-size only when the original image must be compressed\n //,'background-size': abc.imgClip.dim.width + 'px ' + abc.imgClip.dim.height + 'px'\n });\n }\n this.setHostedComponent($hc);\n }\n\n if (abc.style !== this.boxBase)\n this.setBoxBase(abc.style);\n\n if (abc.innerHtmlText)\n this.setHostedComponent($('<div/>').html(abc.innerHtmlText));\n\n if (abc.hasOwnProperty('border') && this.hasBorder() !== abc.border)\n this.setBorder(abc.border);\n this.setInactive(false);\n if (abc.amp)\n this.setHostedMediaPlayer(abc.amp);\n this.checkHostedComponent();\n this.checkAutoStartMedia();\n } else\n this.clear();\n\n this.invalidate();\n if (this.$accessibleElement)\n this.$accessibleElement.html(this.toString());\n }\n\n /**\n * Sets the {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent} that will act as an alternative content (`altContent` field)\n * of this ActiveBox,\n * @param {ActiveBoxContent|ActiveBagContent} abc - Object containing the content to set.\n * @param {number} i - When `abc` is an {@link module:boxes/ActiveBagContent.ActiveBagContent ActiveBagContent}, this field indicates an\n * index in the content array.\n */\n setAltContent(abc, i) {\n if (abc instanceof ActiveBagContent) {\n if (i < 0)\n i = this.idOrder;\n // `abc` is now an [ActiveBoxContent](ActiveBoxContent.html)\n abc = abc.getActiveBoxContent(i);\n }\n this.altContent = abc;\n this.checkHostedComponent();\n if (this.isAlternative() && this.hostedMediaPlayer)\n this.setHostedMediaPlayer(null);\n\n if (this.$accessibleElement) {\n this.$accessibleElement.html(this.toString());\n this.$accessibleElement.prop('disabled', true);\n }\n }\n\n /**\n * Sets the current content of this ActiveBox\n * @param {module:boxes/ActiveBoxContent.ActiveBoxContent} abc - The content to set.\n */\n setCurrentContent(abc) {\n if (this.isAlternative())\n this.setAltContent(abc);\n else\n this.setContent(abc);\n this.invalidate();\n }\n\n /**\n * Puts this ActiveBox in \"alternative\" mode, meaning that `altContent` will be used instead of `content`\n */\n switchToAlt() {\n if (this.isAlternative() || !this.altContent || this.altContent.isEmpty())\n return false;\n this.setHostedComponent(null);\n this.setHostedMediaPlayer(null);\n this.setAlternative(true);\n this.tmpTrans = false;\n this.checkHostedComponent();\n this.checkAutoStartMedia();\n\n if (this.$accessibleElement)\n this.$accessibleElement.html(this.toString());\n\n return true;\n }\n\n /**\n * Checks the presence of content susceptible to be treated as HTML DOM embedded in this ActiveBox.\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Drawing_DOM_objects_into_a_canvas}\n */\n checkHostedComponent() {\n if (this.hasHostedComponent)\n return;\n const\n abc = this.getCurrentContent(),\n style = this.getBoxBaseResolve();\n if (!this.isInactive() && abc && abc.innerHtmlText)\n style.getCSS()['text-align'] = abc.txtAlign.h.replace('middle', 'center');\n }\n\n /**\n * Checks if the call has a {@link module:media/MediaContent.MediaContent} set to `autostart`, and launches it when found.\n */\n checkAutoStartMedia() {\n const cnt = this.getContent();\n if (cnt && cnt.mediaContent && cnt.mediaContent.autoStart && cnt.amp) {\n cnt.amp.playNow(this);\n }\n }\n\n /**\n * Draws the content of this Activebox on the specified canvas context.\n * @override\n * @param {external:CanvasRenderingContext2D} ctx - The canvas rendering context used to draw the\n * box content.\n * @param {module:AWT.Rectangle} [dirtyRegion] - The area that must be repainted. `null` refers to the whole box.\n */\n updateContent(ctx, dirtyRegion) {\n\n const\n abc = this.getCurrentContent(),\n style = this.getBoxBaseResolve();\n\n if (this.isInactive() || !abc || this.dim.width < 2 || this.dim.height < 2) {\n this._focusAccessibleElement(ctx);\n return true;\n }\n\n if (dirtyRegion && !this.intersects(dirtyRegion))\n return false;\n\n let imgRect = null;\n\n if (abc.img && !this.tmpTrans) {\n try {\n if (abc.imgClip) {\n const r = abc.imgClip.getBounds();\n let img = abc.img;\n if (!abc.imgClip.isRect()) {\n // Prepare a temporary `canvas` object that will contain the clipped image\n const tmpCanvas = document.createElement('canvas');\n tmpCanvas.width = r.pos.x + r.dim.width;\n tmpCanvas.height = r.pos.y + r.dim.height;\n const tmpCtx = tmpCanvas.getContext('2d');\n // Set the clipping region\n abc.imgClip.clip(tmpCtx);\n // Draw the original image\n tmpCtx.drawImage(abc.img, 0, 0);\n // Use the temporary canvas as a source image\n // (as seen on: [http://stackoverflow.com/questions/7242006/html5-copy-a-canvas-to-image-and-back])\n img = tmpCanvas;\n }\n ctx.drawImage(img,\n Math.max(0, r.pos.x), Math.max(0, r.pos.y), Math.min(img.width, r.dim.width), Math.min(img.height, r.dim.height),\n this.pos.x, this.pos.y, this.dim.width, this.dim.height);\n } else {\n let\n imgw = abc.img.naturalWidth || this.dim.width,\n imgh = abc.img.naturalHeight || this.dim.height,\n compress = false,\n scale = 1.0;\n if (settings.COMPRESS_IMAGES &&\n (this.dim.width > 0 && this.dim.height > 0) &&\n (imgw > this.dim.width || imgh > this.dim.height)) {\n\n scale = Math.min(this.dim.width / imgw, this.dim.height / imgh);\n imgw *= scale;\n imgh *= scale;\n compress = true;\n }\n const xs = abc.imgAlign.h === 'left' ? 0\n : abc.imgAlign.h === 'right' ? this.dim.width - imgw\n : (this.dim.width - imgw) / 2;\n const ys = abc.imgAlign.v === 'top' ? 0\n : abc.imgAlign.v === 'bottom' ? this.dim.height - imgh\n : (this.dim.height - imgh) / 2;\n if (compress) {\n ctx.drawImage(abc.img, this.pos.x + xs, this.pos.y + ys, imgw, imgh);\n } else\n ctx.drawImage(abc.img, this.pos.x + xs, this.pos.y + ys);\n\n if (abc.avoidOverlapping && abc.text)\n imgRect = new Rectangle(\n Math.max(0, xs), Math.max(0, ys),\n Math.min(this.dim.width, imgw), Math.min(this.dim.height, imgh));\n }\n } catch (ex) {\n log('warn', `Unable to draw image \"${abc.image}\": ${ex.message}`);\n }\n }\n if (abc.text && abc.text.length > 0) {\n let\n px = this.pos.x,\n py = this.pos.y,\n pWidth = this.dim.width,\n pHeight = this.dim.height;\n\n if (imgRect) {\n // There is an image in the ActiveBox\n // Try to compute the current space available for text\n const\n prx = [0, imgRect.pos.x, imgRect.pos.x + imgRect.dim.width, pWidth],\n pry = [0, imgRect.pos.y, imgRect.pos.y + imgRect.dim.height, pHeight],\n rr = [\n // Calc four rectangles inside BoxBag, sourronding imgRect\n // Top rectangle:\n new Rectangle(prx[0], pry[0], prx[3], pry[1]),\n // Bottom rectangle:\n new Rectangle(prx[0], pry[2], prx[3], pry[3] - pry[2]),\n // Left rectangle:\n new Rectangle(prx[0], pry[0], prx[1], pry[3]),\n // Right rectangle:\n new Rectangle(prx[2], pry[0], prx[3] - prx[2], pry[3])\n ];\n //\n // Find the rectangle with highest surface, and in accordance\n // with the `txtAlign` values of the current\n // [ActiveBoxContent](ActiveBoxContent)\n let rmax = rr[0];\n let maxSurface = rmax.dim.width * rmax.dim.height;\n for (let i = 1; i < rr.length; i++) {\n let s = rr[i].dim.width * rr[i].dim.height;\n if (s > maxSurface - 1) {\n if (Math.abs(s - maxSurface) <= 1) {\n let b = false;\n switch (i) {\n case 1:\n b = abc.txtAlign.v === 'bottom';\n break;\n case 2:\n b = abc.txtAlign.h === 'left';\n break;\n case 3:\n b = abc.txtAlign.h === 'right';\n break;\n }\n if (!b)\n continue;\n }\n maxSurface = s;\n rmax = rr[i];\n }\n }\n // Finally, this is the surface available to draw text:\n px += rmax.pos.x;\n py += rmax.pos.y;\n pWidth = rmax.dim.width;\n pHeight = rmax.dim.height;\n }\n\n // Calc available width and height, discounting margins\n const\n availWidth = Math.max(5, pWidth - 2 * style.textMargin),\n availHeight = Math.max(5, pHeight - 2 * style.textMargin);\n\n // Calc the size of each line\n const lines = style.prepareText(ctx, abc.text, availWidth, availHeight);\n\n ctx.font = style.font.cssFont();\n ctx.textBaseline = 'alphabetic';\n const\n lineHeight = style.font.getHeight(),\n totalHeight = lineHeight * lines.length;\n\n // Calc the vertical co-ordinate of the first line\n // Default is 'middle'\n let y = py + style.textMargin + (abc.txtAlign.v === 'top' ? 0\n : abc.txtAlign.v === 'bottom' ? availHeight - totalHeight\n : (availHeight - totalHeight) / 2) + style.font.getMetrics().ascent;\n\n for (let l = 0; l < lines.length; l++, y += lineHeight) {\n // Calc the horizontal position of each line\n // Default is 'middle'\n const x = px + style.textMargin + (abc.txtAlign.h === 'left' ? 0\n : abc.txtAlign.h === 'right' ?\n availWidth - lines[l].size.width\n : (availWidth - lines[l].size.width) / 2);\n\n if (style.shadow) {\n // Render text shadow\n const d = Math.max(1, style.font.size / 10);\n ctx.fillStyle = style.shadowColor;\n ctx.fillText(lines[l].text, x + d, y + d);\n }\n // Render text\n ctx.fillStyle = this.isInverted() ? style.backColor\n : this.isAlternative() ? style.alternativeColor : style.textColor;\n ctx.fillText(lines[l].text, x, y);\n }\n\n this._focusAccessibleElement(ctx);\n\n }\n return true;\n }\n\n /**\n * Draw focus on accessible element if needed\n * @param {external:CanvasRenderingContext2D} ctx - The canvas rendering context used to draw the\n * box content.\n */\n _focusAccessibleElement(ctx) {\n if (settings.CANVAS_DRAW_FOCUS && this.$accessibleElement) {\n this.shape.preparePath(ctx);\n ctx.drawFocusIfNeeded(this.$accessibleElement.get(-1));\n }\n }\n\n\n /**\n * Gets the `description` field of the current {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent}\n * @returns {string}\n */\n getDescription() {\n return this.content ? this.content.getDescription() : '';\n }\n\n /**\n * Gets a descriptive text for this ActiveBox\n * @returns {string}\n */\n toString() {\n return (this.role !== 'cell' ? getMsg(this.role) : '') + (this.getCurrentContent() || '-').toString();\n }\n\n /**\n * Plays the action or media associated with this ActiveBox\n * @param {module:JClicPlayer.JClicPlayer} ps - Usually, a {@link module:JClicPlayer.JClicPlayer JClicPlayer}\n * @param {function[]} delayedActions - If set, store the the action in this array for future execution\n */\n playMedia(ps, delayedActions = null) {\n const abc = this.getCurrentContent();\n if (abc && abc.mediaContent) {\n log('debug', `Playing: ${abc.mediaContent.toString()}`);\n ps.playMedia(abc.mediaContent, this, delayedActions);\n return true;\n }\n return false;\n }\n\n /**\n * Sets the hosted media player of this ActiveBox\n * @param {module:media/ActiveMediaPlayer.ActiveMediaPlayer} amp - The media player.\n */\n setHostedMediaPlayer(amp) {\n const old = this.hostedMediaPlayer;\n this.hostedMediaPlayer = amp;\n if (old && old !== amp)\n old.linkTo(null);\n if (amp)\n amp.linkTo(this);\n }\n\n /**\n * Sets a new size and/or dimension to this box.\n * @override\n * @param {AWT.Rectangle|number} rect - An AWT.Rectangle object, or the `x` coordinate of the\n * upper-left corner of a new rectangle.\n * @param {number} [y] - `y` coordinate of the upper-left corner of the new rectangle.\n * @param {number} [w] - Width of the new rectangle.\n * @param {number} [h] - Height of the new rectangle.\n */\n setBounds(rect, y, w, h) {\n if (typeof rect === 'number')\n // arguments are co-ordinates and size\n rect = new Rectangle(rect, y, w, h);\n // Rectangle comparision\n if (this.equals(rect))\n return;\n super.setBounds(rect);\n if (this.hostedMediaPlayer)\n this.hostedMediaPlayer.checkVisualComponentBounds(this);\n }\n\n /**\n * Places and resizes {@link module:boxes/AbstractBox.AbstractBox#$hostedComponent $hostedComponent}, based on the size\n * and position of this box.\n * @override\n * @param {boolean} sizeChanged - `true` when this {@link module:boxes/ActiveBox.ActiveBox ActiveBox} has changed its size\n */\n setHostedComponentBounds(sizeChanged) {\n if (this.$hostedComponent) {\n super.setHostedComponentBounds(sizeChanged);\n const abc = this.getCurrentContent();\n if (sizeChanged && abc && abc.animatedGifFile && abc.img) {\n const\n img = abc.img,\n w = Math.max(img.naturalWidth, this.dim.width),\n h = Math.max(img.naturalHeight, this.dim.height);\n let scale = 1, bgSize = '';\n if (abc.imgClip) {\n const r = abc.imgClip.getBounds();\n if (this.dim.width < r.dim.width || this.dim.height < r.dim.height) {\n scale = Math.min(this.dim.width / r.dim.width, this.dim.height / r.dim.height);\n bgSize = `${w * scale}px ${h * scale}px`;\n }\n this.$hostedComponent.css({\n 'background-position': `${-abc.imgClip.pos.x * scale}px ${-abc.imgClip.pos.y * scale}px`,\n 'background-size': bgSize\n });\n } else {\n if (this.dim.width < w || this.dim.height < h) {\n scale = Math.min(this.dim.width / w, this.dim.height / h);\n bgSize = `${w * scale}px ${h * scale}px`;\n }\n this.$hostedComponent.css({\n 'background-size': bgSize\n });\n }\n }\n }\n }\n\n /**\n * Builds a hidden `buton` that will act as a accessible element associated to the canvas area\n * of this ActiveBox.\n * The button will be created only when `CanvasRenderingContext2D` has a method named `addHitRegion`.\n * See https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Hit_regions_and_accessibility\n * for more information and supported browsers.\n * @param {external:jQuery} $canvas - The `canvas` where this `ActiveBox` will deploy, wrapped up in a jQuery object\n * @param {external:jQuery} $clickReceiver - The DOM element that will be notified when `$accessibleElement` is activated.\n * @param {external:jQuery} [$canvasGroup] - Optional DOM element containing the accessible element. Useful to group cells in associations. When `null`, the element belongs to $canvas.\n * @param {string} [eventType] - Type of event sent to $clickReceiver. Default is `click`.\n * @returns {external:jQuery} - The accessible element associated to this ActiveBox.\n */\n buildAccessibleElement($canvas, $clickReceiver, $canvasGroup, eventType) {\n if (this.$accessibleElement)\n this.$accessibleElement.remove();\n\n const canvas = $canvas.get(-1);\n if (canvas.width > 0 && canvas.height > 0) {\n const\n id = Math.round(Math.random() * 100000),\n disabled = this.isInactive() && !this.accessibleAlwaysActive;\n this.$accessibleElement = $('<button/>', {\n tabindex: disabled ? -1 : 0,\n id: `AE${id}`,\n disabled: disabled\n })\n .html(this.toString())\n .on('click', ev => {\n // Check if event was produced by a mouse click\n if (ev.originalEvent && (ev.originalEvent.pageX !== 0 || ev.originalEvent.pageY !== 0)) {\n // Mouse clicks should be processed odirectly by the canvas, so ignore this accessible event\n return true;\n }\n log('debug', `Click on accessible element: ${this.toString()}`);\n const\n $event = $.Event(eventType || 'click'),\n bounds = this.getBounds(),\n offset = $canvas.offset();\n $event.pageX = offset.left + bounds.pos.x + bounds.dim.width / 2;\n $event.pageY = offset.top + bounds.pos.y + bounds.dim.height / 2;\n $clickReceiver.trigger($event);\n return false;\n });\n const $dest = $canvasGroup || $canvas;\n $dest.append(this.$accessibleElement);\n if (settings.CANVAS_DRAW_FOCUS) {\n this.$accessibleElement.on('focus blur', ev => {\n log('debug', `${ev.type} accessible element: ${this.toString()}`);\n if (this.container)\n this.container.update();\n this.updateContent(canvas.getContext('2d'), null);\n });\n }\n }\n return this.$accessibleElement;\n }\n}\n\nObject.assign(ActiveBox.prototype, {\n /**\n * Identifier used to set the relative position of this box in a set.\n * @name module:boxes/ActiveBox.ActiveBox#idOrder\n * @type {number} */\n idOrder: -1,\n /**\n * Identifier used to set a relative position in the space.\n * @name module:boxes/ActiveBox.ActiveBox#idLoc\n * @type {number} */\n idLoc: -1,\n /**\n * Identifier used to establish relationships between cells of different sets (in associations)\n * @name module:boxes/ActiveBox.ActiveBox#idAss\n * @type {number} */\n idAss: -1,\n /**\n * Backup of the original position of the cell, useful when the real position must be restored after a temporary change.\n * @name module:boxes/ActiveBox.ActiveBox#pos0\n * @type {module:AWT.Point} */\n pos0: null,\n /**\n * Main content of this box\n * @name module:boxes/ActiveBox.ActiveBox#content\n * @type {module:boxes/ActiveBoxContent.ActiveBoxContent} */\n content: null,\n /**\n * Alternative content of this box\n * @name module:boxes/ActiveBox.ActiveBox#altContent\n * @type {module:boxes/ActiveBoxContent.ActiveBoxContent} */\n altContent: null,\n /**\n * Flag to check if this box has a 'hosted component'\n * @name module:boxes/ActiveBox.ActiveBox#hostedComponent\n * @type {boolean} */\n hasHostedComponent: false,\n /**\n * The media player associated to this box\n * @name module:boxes/ActiveBox.ActiveBox#hostedMediaPlayer\n * @type {module:media/ActiveMediaPlayer.ActiveMediaPlayer} */\n hostedMediaPlayer: null,\n /**\n * Indicates that this box is used as a background. When drawing, the clipping region must be respected.\n * @name module:boxes/ActiveBox.ActiveBox#isBackground\n * @type {boolean} */\n isBackground: false,\n});\n\nexport default ActiveBox;\n\n"],"names":[],"sourceRoot":""}
@@ -1,438 +0,0 @@
1
- "use strict";
2
- exports.id = 1731;
3
- exports.ids = [1731,1078,7220];
4
- exports.modules = {
5
-
6
- /***/ 4112:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
11
- /* harmony export */ });
12
- /* unused harmony export ActivitySequenceJump */
13
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7750);
14
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
15
- /* harmony import */ var _JumpInfo_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7220);
16
- /* harmony import */ var _ConditionalJumpInfo_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1078);
17
- /* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1253);
18
- /**
19
- * File : bags/ActivitySequenceJump.js
20
- * Created : 05/04/2015
21
- * By : Francesc Busquets <francesc@gmail.com>
22
- *
23
- * JClic.js
24
- * An HTML5 player of JClic activities
25
- * https://projectestac.github.io/jclic.js
26
- *
27
- * @source https://github.com/projectestac/jclic.js
28
- *
29
- * @license EUPL-1.2
30
- * @licstart
31
- * (c) 2000-2020 Catalan Educational Telematic Network (XTEC)
32
- *
33
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
34
- * the European Commission- subsequent versions of the EUPL (the "Licence");
35
- * You may not use this work except in compliance with the Licence.
36
- *
37
- * You may obtain a copy of the Licence at:
38
- * https://joinup.ec.europa.eu/software/page/eupl
39
- *
40
- * Unless required by applicable law or agreed to in writing, software
41
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
42
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
43
- * Licence for the specific language governing permissions and limitations
44
- * under the Licence.
45
- * @licend
46
- * @module
47
- */
48
-
49
-
50
-
51
-
52
-
53
-
54
- /**
55
- * This is a special case of {@link module:bags/JumpInfo.JumpInfo JumpInfo}, used only in {@link module:bags/ActivitySequenceElement.ActivitySequenceElement ActivitySequenceElement} objects.
56
- * Sequence elements can contain up to two ActivitySequenceJump objects: one to be processed
57
- * when the user clicks on the "next" button (or when the activity finishes, if in automatic mode),
58
- * and the other used with the "prev" button. ActivitySequenceJump objects define a default jump
59
- * or action to be performed, but can also have up to two {@link module:bags/ConditionalJumpInfo.ConditionalJumpInfo ConditionalJumpInfo} objects. These
60
- * define alternative jumps that are performed only when score or time are below or over a specific
61
- * threshold.
62
- * @extends module:bags/JumpInfo.JumpInfo
63
- */
64
- class ActivitySequenceJump extends _JumpInfo_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
65
- /**
66
- * ActivitySequenceJump constructor
67
- * @param {string} action - Must be one of the described actions.
68
- * @param {number|string} [sq] - Can be the tag of the sequence element to jump to, or its
69
- * cardinal number in the list.
70
- */
71
- constructor(action, sq) {
72
- super(action, sq);
73
- }
74
-
75
- /**
76
- * Loads the object settings from a specific JQuery XML element.
77
- * @param {external:jQuery} $xml - The XML element to parse
78
- */
79
- setProperties($xml) {
80
- super.setProperties($xml);
81
-
82
- // Read conditional jumps
83
- $xml.children('jump').each((_n, child) => {
84
- const condJmp = new _ConditionalJumpInfo_js__WEBPACK_IMPORTED_MODULE_2__["default"]().setProperties(jquery__WEBPACK_IMPORTED_MODULE_0___default()(child));
85
- if (condJmp.id === 'upper')
86
- this.upperJump = condJmp;
87
- else if (condJmp.id === 'lower')
88
- this.lowerJump = condJmp;
89
- });
90
- return this;
91
- }
92
-
93
- /**
94
- * Gets a object with the basic attributes needed to rebuild this instance excluding functions,
95
- * parent references, constants and also attributes retaining the default value.
96
- * The resulting object is commonly usued to serialize elements in JSON format.
97
- * @returns {object} - The resulting object, with minimal attrributes
98
- */
99
- getAttributes() {
100
- return Object.assign(super.getAttributes(), (0,_Utils_js__WEBPACK_IMPORTED_MODULE_3__/* .getAttr */ .iu)(this, ['upperJump', 'lowerJump']));
101
- }
102
-
103
- /**
104
- * Loads the jump settings from a data object
105
- * @param {object} data - The data object to parse
106
- */
107
- setAttributes(data) {
108
- super.setAttributes(data);
109
-
110
- ['upperJump', 'lowerJump'].forEach(cj => {
111
- if (data[cj])
112
- this[cj] = new _ConditionalJumpInfo_js__WEBPACK_IMPORTED_MODULE_2__["default"]().setAttributes(data[cj]);
113
- });
114
-
115
- return this;
116
- }
117
-
118
-
119
- /**
120
- * Resolves what {@link module:bags/JumpInfo.JumpInfo JumpInfo} must be taken, based on a done time and average rating obtained
121
- * in activities.
122
- * @param {number} rating - Average rating obtained by the user in the activities done during the
123
- * last sequence stretch.
124
- * @param {number} time - Total time spend doing the activities.
125
- * @returns {module:bags/JumpInfo.JumpInfo}
126
- */
127
- resolveJump(rating, time) {
128
- let result = this;
129
- if (rating >= 0 && time >= 0) {
130
- if (this.upperJump !== null &&
131
- rating > this.upperJump.threshold &&
132
- (this.upperJump.time <= 0 || time < this.upperJump.time)) {
133
- result = this.upperJump;
134
- } else if (this.lowerJump !== null &&
135
- (rating < this.lowerJump.threshold ||
136
- this.lowerJump.time > 0 && time > this.lowerJump.time)) {
137
- result = this.lowerJump;
138
- }
139
- }
140
- return result;
141
- }
142
- }
143
-
144
- Object.assign(ActivitySequenceJump.prototype, {
145
- /**
146
- * Optional jump to be performed when the results (score and time) are above a specific threshold.
147
- * @name module:bags/ActivitySequenceJump.ActivitySequenceJump#upperJump
148
- * @type {module:bags/ConditionalJumpInfo.ConditionalJumpInfo} */
149
- upperJump: null,
150
- /**
151
- * Optional jump to be performed when the results (score or time) are below a specific threshold.
152
- * @name module:bags/ActivitySequenceJump.ActivitySequenceJump#lowerJump
153
- * @type {module:bags/ConditionalJumpInfo.ConditionalJumpInfo} */
154
- lowerJump: null,
155
- });
156
-
157
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ActivitySequenceJump);
158
-
159
-
160
- /***/ }),
161
-
162
- /***/ 1078:
163
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
164
-
165
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
166
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
167
- /* harmony export */ });
168
- /* unused harmony export ConditionalJumpInfo */
169
- /* harmony import */ var _JumpInfo_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7220);
170
- /* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1253);
171
- /**
172
- * File : bags/ConditionalJumpInfo.js
173
- * Created : 05/04/2015
174
- * By : Francesc Busquets <francesc@gmail.com>
175
- *
176
- * JClic.js
177
- * An HTML5 player of JClic activities
178
- * https://projectestac.github.io/jclic.js
179
- *
180
- * @source https://github.com/projectestac/jclic.js
181
- *
182
- * @license EUPL-1.2
183
- * @licstart
184
- * (c) 2000-2020 Catalan Educational Telematic Network (XTEC)
185
- *
186
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
187
- * the European Commission- subsequent versions of the EUPL (the "Licence");
188
- * You may not use this work except in compliance with the Licence.
189
- *
190
- * You may obtain a copy of the Licence at:
191
- * https://joinup.ec.europa.eu/software/page/eupl
192
- *
193
- * Unless required by applicable law or agreed to in writing, software
194
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
195
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
196
- * Licence for the specific language governing permissions and limitations
197
- * under the Licence.
198
- * @licend
199
- * @module
200
- */
201
-
202
-
203
-
204
-
205
- /**
206
- * This special case of {@link module:bags/JumpInfo.JumpInfo JumpInfo} is used in {@link module:bags/ActivitySequenceJump.ActivitySequenceJump ActivitySequenceJump} objects to decide
207
- * the type of jump or action to be performed, based on the results obtained by the user when
208
- * playing previous JClic activities.
209
- *
210
- * In addition to the standard {@link module:bags/JumpInfo.JumpInfo JumpInfo} fields and methods, this class has two public
211
- * members where score and time thresholds are stored.
212
- *
213
- * The exact meaning of this members will depend on the type of `ConditionalJumpInfo` in the
214
- * {@link module:bags/ActivitySequenceJump.ActivitySequenceJump ActivitySequenceJump} (it can be `upperJump` or `lowerJump`).
215
- * @extends module:bags/JumpInfo.JumpInfo
216
- */
217
- class ConditionalJumpInfo extends _JumpInfo_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
218
- /**
219
- * ConditionalJumpInfo constructor
220
- * @param {string} action - Must be one of the described actions.
221
- * @param {number|string} [sq] - Can be the tag of the sequence element to jump to, or its
222
- * cardinal number in the list.
223
- * @param {number} [threshold] - Threshold above or below which the action will be triggered,
224
- * depending on the type of JumpInfo.
225
- * @param {number} [time] - Delay to be applied in automatic jumps.
226
- */
227
- constructor(action, sq, threshold, time) {
228
- super(action, sq);
229
- this.threshold = typeof threshold === 'number' ? threshold : -1;
230
- this.time = typeof threshold === 'number' ? time : -1;
231
- }
232
-
233
- /**
234
- * Loads this object settings from a specific JQuery XML element
235
- * @param {external:jQuery} $xml - The XML element to parse
236
- */
237
- setProperties($xml) {
238
- super.setProperties($xml);
239
- if ($xml.attr('threshold') !== undefined)
240
- this.threshold = $xml.attr('threshold');
241
- if ($xml.attr('time') !== undefined)
242
- this.time = $xml.attr('time');
243
- return this;
244
- }
245
-
246
- /**
247
- * Gets a object with the basic attributes needed to rebuild this instance excluding functions,
248
- * parent references, constants and also attributes retaining the default value.
249
- * The resulting object is commonly usued to serialize elements in JSON format.
250
- * @returns {object} - The resulting object, with minimal attrributes
251
- */
252
- getAttributes() {
253
- return Object.assign(super.getAttributes(), (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .getAttr */ .iu)(this, ['threshold', 'time']));
254
- }
255
-
256
- /**
257
- * Loads this conditional jump settings from a data object
258
- * @param {object} data - The data object to parse
259
- */
260
- setAttributes(data) {
261
- super.setAttributes(data);
262
- ['threshold', 'time'].forEach(t => {
263
- if (!(0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .isEmpty */ .Im)(data[t]))
264
- this[t] = data[t];
265
- });
266
- return this;
267
- }
268
- }
269
-
270
- Object.assign(ConditionalJumpInfo.prototype, {
271
- /**
272
- * Threshold above or below which the action will be triggered, depending on the type of JumpInfo.
273
- * @name module:bags/ConditionalJumpInfo.ConditionalJumpInfo#threshold
274
- * @type {number} */
275
- threshold: -1,
276
- /**
277
- * Delay to be applied in automatic jumps.
278
- * @name module:bags/ConditionalJumpInfo.ConditionalJumpInfo#time
279
- * @type {number} */
280
- time: -1,
281
- });
282
-
283
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ConditionalJumpInfo);
284
-
285
-
286
- /***/ }),
287
-
288
- /***/ 7220:
289
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
290
-
291
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
292
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
293
- /* harmony export */ });
294
- /* unused harmony export JumpInfo */
295
- /* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1253);
296
- /**
297
- * File : bags/JumpInfo.js
298
- * Created : 05/04/2015
299
- * By : Francesc Busquets <francesc@gmail.com>
300
- *
301
- * JClic.js
302
- * An HTML5 player of JClic activities
303
- * https://projectestac.github.io/jclic.js
304
- *
305
- * @source https://github.com/projectestac/jclic.js
306
- *
307
- * @license EUPL-1.2
308
- * @licstart
309
- * (c) 2000-2020 Catalan Educational Telematic Network (XTEC)
310
- *
311
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
312
- * the European Commission- subsequent versions of the EUPL (the "Licence");
313
- * You may not use this work except in compliance with the Licence.
314
- *
315
- * You may obtain a copy of the Licence at:
316
- * https://joinup.ec.europa.eu/software/page/eupl
317
- *
318
- * Unless required by applicable law or agreed to in writing, software
319
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
320
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
321
- * Licence for the specific language governing permissions and limitations
322
- * under the Licence.
323
- * @licend
324
- * @module
325
- */
326
-
327
-
328
-
329
- /**
330
- * This class contains information about what things JClic sequence manager has to do in certain
331
- * circumstances, such as:
332
- * - an activity finishes
333
- * - the user clicks on the "next" or "prev" buttons
334
- * - the user clicks or a cell with special "active content"
335
- *
336
- * Different kinds of actions are possible for each of these events:
337
- * - RETURN: to go back to a previous point in the sequence.
338
- * - EXIT: to exit the program (thus navigating to another URL)
339
- * - STOP: to do nothing.
340
- * - JUMP: to jump to a specific point in the sequence of activities, or to another JClic project.
341
- * @see {@link module:bags/ActivitySequenceJump.ActivitySequenceJump ActivitySequenceJump}
342
- * @see {@link module:bags/ConditionalJumpInfo.ConditionalJumpInfo ConditionalJumpInfo}
343
- */
344
- class JumpInfo {
345
- /**
346
- * JumpInfo constructor
347
- * @param {string} action - Must be one of the described actions.
348
- * @param {number|string} [sq] - Can be the tag of the sequence element to jump to, or its
349
- * cardinal number in the list.
350
- */
351
- constructor(action, sq) {
352
- this.action = action;
353
- switch (typeof sq) {
354
- case 'string':
355
- this.sequence = sq;
356
- break;
357
- case 'number':
358
- this.actNum = sq;
359
- break;
360
- }
361
- }
362
-
363
- /**
364
- * Loads the object settings from a specific JQuery XML element
365
- * @param {external:jQuery} $xml - The XML element to parse
366
- */
367
- setProperties($xml) {
368
- this.id = $xml.attr('id');
369
- this.action = $xml.attr('action') || 'JUMP';
370
- if ($xml.attr('tag'))
371
- this.sequence = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_0__/* .nSlash */ .c4)($xml.attr('tag'));
372
- if ($xml.attr('project'))
373
- this.projectPath = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_0__/* .nSlash */ .c4)($xml.attr('project'));
374
- return this;
375
- }
376
-
377
- /**
378
- * Gets a object with the basic attributes needed to rebuild this instance excluding functions,
379
- * parent references, constants and also attributes retaining the default value.
380
- * The resulting object is commonly usued to serialize elements in JSON format.
381
- * @returns {object} - The resulting object, with minimal attrributes
382
- */
383
- getAttributes() {
384
- return (0,_Utils_js__WEBPACK_IMPORTED_MODULE_0__/* .getAttr */ .iu)(this, ['id', 'action', 'actNum', 'sequence', 'projectPath']);
385
- }
386
-
387
- /**
388
- * Loads the object settings from a data object
389
- * @param {object} data - The data object to parse
390
- */
391
- setAttributes(data) {
392
- ['id', 'action', 'actNum', 'sequence', 'projectPath'].forEach(t => {
393
- if (!(0,_Utils_js__WEBPACK_IMPORTED_MODULE_0__/* .isEmpty */ .Im)(data[t]))
394
- this[t] = data[t];
395
- });
396
- return this;
397
- }
398
- }
399
-
400
- Object.assign(JumpInfo.prototype, {
401
- /**
402
- * The JumpInfo identifier
403
- * - For regular jumps: 'forward', 'back'
404
- * - For conditional jumps: 'upper', 'lower'
405
- * @name module:bags/JumpInfo.JumpInfo#id
406
- * @type {string} */
407
- id: null,
408
- /**
409
- * The current action.
410
- * Possible values are: `JUMP`, `STOP`, `RETURN` and `EXIT`.
411
- * @name module:bags/JumpInfo.JumpInfo#action
412
- * @type {string} */
413
- action: null,
414
- /**
415
- * Activity number in the sequence list
416
- * @name module:bags/JumpInfo.JumpInfo#actNum
417
- * @type {number} */
418
- actNum: -1,
419
- /**
420
- * Current sequence tag
421
- * @name module:bags/JumpInfo.JumpInfo#sequence
422
- * @type {string} */
423
- sequence: null,
424
- /**
425
- * Path of another JClic project to jump to
426
- * @name module:bags/JumpInfo.JumpInfo#projectPath
427
- * @type {string} */
428
- projectPath: null,
429
- });
430
-
431
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JumpInfo);
432
-
433
-
434
- /***/ })
435
-
436
- };
437
- ;
438
- //# sourceMappingURL=1731.jclic-node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1731.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;AACc;AACsB;AACrB;;AAEtC;AACA,8BAA8B,6CAA6C,gBAAgB,2FAA2F;AACtL;AACA;AACA;AACA,2DAA2D,+EAA+E;AAC1I;AACA;AACA;AACA;AACO,mCAAmC,oDAAQ;AAClD;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;;AAEA;AACA;AACA,0BAA0B,+DAAmB,iBAAiB,6CAAC;AAC/D;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,gDAAgD,4DAAO;AACvD;;AAEA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,+DAAmB;AAC1C,KAAK;;AAEL;AACA;;;AAGA;AACA,oBAAoB,8CAA8C;AAClE;AACA,aAAa,QAAQ;AACrB;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,qDAAqD;AACjE;AACA;AACA;AACA;AACA,YAAY,qDAAqD;AACjE;AACA,CAAC;;AAED,iEAAe,oBAAoB,EAAC;;;;;;;;;;;;;;AC3IpC;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;;AAEqC;AACU;;AAE/C;AACA,yBAAyB,8CAA8C,YAAY,kFAAkF;AACrK;AACA;AACA;AACA,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA,IAAI,kFAAkF;AACtF;AACA;AACO,kCAAkC,oDAAQ;AACjD;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B;AACA,aAAa,QAAQ;AACrB;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,gDAAgD,4DAAO;AACvD;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,WAAW,4DAAO;AAClB;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA,CAAC;;AAED,iEAAe,mBAAmB,EAAC;;;;;;;;;;;;;AChHnC;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;;AAEuD;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,SAAS;AACT;AACO;AACP;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA,sBAAsB,2DAAM;AAC5B;AACA,yBAAyB,2DAAM;AAC/B;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,WAAW,4DAAO;AAClB;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA,WAAW,4DAAO;AAClB;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA,CAAC;;AAED,iEAAe,QAAQ,EAAC","sources":["webpack://jclic/./src/bags/ActivitySequenceJump.js","webpack://jclic/./src/bags/ConditionalJumpInfo.js","webpack://jclic/./src/bags/JumpInfo.js"],"sourcesContent":["/**\n * File : bags/ActivitySequenceJump.js\n * Created : 05/04/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 $ from 'jquery';\nimport JumpInfo from './JumpInfo.js';\nimport ConditionalJumpInfo from './ConditionalJumpInfo.js';\nimport { getAttr } from '../Utils.js';\n\n/**\n * This is a special case of {@link module:bags/JumpInfo.JumpInfo JumpInfo}, used only in {@link module:bags/ActivitySequenceElement.ActivitySequenceElement ActivitySequenceElement} objects.\n * Sequence elements can contain up to two ActivitySequenceJump objects: one to be processed\n * when the user clicks on the \"next\" button (or when the activity finishes, if in automatic mode),\n * and the other used with the \"prev\" button. ActivitySequenceJump objects define a default jump\n * or action to be performed, but can also have up to two {@link module:bags/ConditionalJumpInfo.ConditionalJumpInfo ConditionalJumpInfo} objects. These\n * define alternative jumps that are performed only when score or time are below or over a specific\n * threshold.\n * @extends module:bags/JumpInfo.JumpInfo\n */\nexport class ActivitySequenceJump extends JumpInfo {\n /**\n * ActivitySequenceJump constructor\n * @param {string} action - Must be one of the described actions.\n * @param {number|string} [sq] - Can be the tag of the sequence element to jump to, or its\n * cardinal number in the list.\n */\n constructor(action, sq) {\n super(action, sq);\n }\n\n /**\n * Loads the object settings from a specific JQuery XML element.\n * @param {external:jQuery} $xml - The XML element to parse\n */\n setProperties($xml) {\n super.setProperties($xml);\n\n // Read conditional jumps\n $xml.children('jump').each((_n, child) => {\n const condJmp = new ConditionalJumpInfo().setProperties($(child));\n if (condJmp.id === 'upper')\n this.upperJump = condJmp;\n else if (condJmp.id === 'lower')\n this.lowerJump = condJmp;\n });\n return this;\n }\n\n /**\n * Gets a object with the basic attributes needed to rebuild this instance excluding functions,\n * parent references, constants and also attributes retaining the default value.\n * The resulting object is commonly usued to serialize elements in JSON format.\n * @returns {object} - The resulting object, with minimal attrributes\n */\n getAttributes() {\n return Object.assign(super.getAttributes(), getAttr(this, ['upperJump', 'lowerJump']));\n }\n\n /**\n * Loads the jump settings from a data object\n * @param {object} data - The data object to parse\n */\n setAttributes(data) {\n super.setAttributes(data);\n\n ['upperJump', 'lowerJump'].forEach(cj => {\n if (data[cj])\n this[cj] = new ConditionalJumpInfo().setAttributes(data[cj]);\n });\n\n return this;\n }\n\n\n /**\n * Resolves what {@link module:bags/JumpInfo.JumpInfo JumpInfo} must be taken, based on a done time and average rating obtained\n * in activities.\n * @param {number} rating - Average rating obtained by the user in the activities done during the\n * last sequence stretch.\n * @param {number} time - Total time spend doing the activities.\n * @returns {module:bags/JumpInfo.JumpInfo}\n */\n resolveJump(rating, time) {\n let result = this;\n if (rating >= 0 && time >= 0) {\n if (this.upperJump !== null &&\n rating > this.upperJump.threshold &&\n (this.upperJump.time <= 0 || time < this.upperJump.time)) {\n result = this.upperJump;\n } else if (this.lowerJump !== null &&\n (rating < this.lowerJump.threshold ||\n this.lowerJump.time > 0 && time > this.lowerJump.time)) {\n result = this.lowerJump;\n }\n }\n return result;\n }\n}\n\nObject.assign(ActivitySequenceJump.prototype, {\n /**\n * Optional jump to be performed when the results (score and time) are above a specific threshold.\n * @name module:bags/ActivitySequenceJump.ActivitySequenceJump#upperJump\n * @type {module:bags/ConditionalJumpInfo.ConditionalJumpInfo} */\n upperJump: null,\n /**\n * Optional jump to be performed when the results (score or time) are below a specific threshold.\n * @name module:bags/ActivitySequenceJump.ActivitySequenceJump#lowerJump\n * @type {module:bags/ConditionalJumpInfo.ConditionalJumpInfo} */\n lowerJump: null,\n});\n\nexport default ActivitySequenceJump;\n","/**\n * File : bags/ConditionalJumpInfo.js\n * Created : 05/04/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 JumpInfo from './JumpInfo.js';\nimport { getAttr, isEmpty } from '../Utils.js';\n\n/**\n * This special case of {@link module:bags/JumpInfo.JumpInfo JumpInfo} is used in {@link module:bags/ActivitySequenceJump.ActivitySequenceJump ActivitySequenceJump} objects to decide\n * the type of jump or action to be performed, based on the results obtained by the user when\n * playing previous JClic activities.\n *\n * In addition to the standard {@link module:bags/JumpInfo.JumpInfo JumpInfo} fields and methods, this class has two public\n * members where score and time thresholds are stored.\n *\n * The exact meaning of this members will depend on the type of `ConditionalJumpInfo` in the\n * {@link module:bags/ActivitySequenceJump.ActivitySequenceJump ActivitySequenceJump} (it can be `upperJump` or `lowerJump`).\n * @extends module:bags/JumpInfo.JumpInfo\n */\nexport class ConditionalJumpInfo extends JumpInfo {\n /**\n * ConditionalJumpInfo constructor\n * @param {string} action - Must be one of the described actions.\n * @param {number|string} [sq] - Can be the tag of the sequence element to jump to, or its\n * cardinal number in the list.\n * @param {number} [threshold] - Threshold above or below which the action will be triggered,\n * depending on the type of JumpInfo.\n * @param {number} [time] - Delay to be applied in automatic jumps.\n */\n constructor(action, sq, threshold, time) {\n super(action, sq);\n this.threshold = typeof threshold === 'number' ? threshold : -1;\n this.time = typeof threshold === 'number' ? time : -1;\n }\n\n /**\n * Loads this object settings from a specific JQuery XML element\n * @param {external:jQuery} $xml - The XML element to parse\n */\n setProperties($xml) {\n super.setProperties($xml);\n if ($xml.attr('threshold') !== undefined)\n this.threshold = $xml.attr('threshold');\n if ($xml.attr('time') !== undefined)\n this.time = $xml.attr('time');\n return this;\n }\n\n /**\n * Gets a object with the basic attributes needed to rebuild this instance excluding functions,\n * parent references, constants and also attributes retaining the default value.\n * The resulting object is commonly usued to serialize elements in JSON format.\n * @returns {object} - The resulting object, with minimal attrributes\n */\n getAttributes() {\n return Object.assign(super.getAttributes(), getAttr(this, ['threshold', 'time']));\n }\n\n /**\n * Loads this conditional jump settings from a data object\n * @param {object} data - The data object to parse\n */\n setAttributes(data) {\n super.setAttributes(data);\n ['threshold', 'time'].forEach(t => {\n if (!isEmpty(data[t]))\n this[t] = data[t];\n });\n return this;\n }\n}\n\nObject.assign(ConditionalJumpInfo.prototype, {\n /**\n * Threshold above or below which the action will be triggered, depending on the type of JumpInfo.\n * @name module:bags/ConditionalJumpInfo.ConditionalJumpInfo#threshold\n * @type {number} */\n threshold: -1,\n /**\n * Delay to be applied in automatic jumps.\n * @name module:bags/ConditionalJumpInfo.ConditionalJumpInfo#time\n * @type {number} */\n time: -1,\n});\n\nexport default ConditionalJumpInfo;\n","/**\n * File : bags/JumpInfo.js\n * Created : 05/04/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 { nSlash, getAttr, isEmpty } from '../Utils.js';\n\n/**\n * This class contains information about what things JClic sequence manager has to do in certain\n * circumstances, such as:\n * - an activity finishes\n * - the user clicks on the \"next\" or \"prev\" buttons\n * - the user clicks or a cell with special \"active content\"\n *\n * Different kinds of actions are possible for each of these events:\n * - RETURN: to go back to a previous point in the sequence.\n * - EXIT: to exit the program (thus navigating to another URL)\n * - STOP: to do nothing.\n * - JUMP: to jump to a specific point in the sequence of activities, or to another JClic project.\n * @see {@link module:bags/ActivitySequenceJump.ActivitySequenceJump ActivitySequenceJump}\n * @see {@link module:bags/ConditionalJumpInfo.ConditionalJumpInfo ConditionalJumpInfo}\n */\nexport class JumpInfo {\n /**\n * JumpInfo constructor\n * @param {string} action - Must be one of the described actions.\n * @param {number|string} [sq] - Can be the tag of the sequence element to jump to, or its\n * cardinal number in the list.\n */\n constructor(action, sq) {\n this.action = action;\n switch (typeof sq) {\n case 'string':\n this.sequence = sq;\n break;\n case 'number':\n this.actNum = sq;\n break;\n }\n }\n\n /**\n * Loads the object settings from a specific JQuery XML element\n * @param {external:jQuery} $xml - The XML element to parse\n */\n setProperties($xml) {\n this.id = $xml.attr('id');\n this.action = $xml.attr('action') || 'JUMP';\n if ($xml.attr('tag'))\n this.sequence = nSlash($xml.attr('tag'));\n if ($xml.attr('project'))\n this.projectPath = nSlash($xml.attr('project'));\n return this;\n }\n\n /**\n * Gets a object with the basic attributes needed to rebuild this instance excluding functions,\n * parent references, constants and also attributes retaining the default value.\n * The resulting object is commonly usued to serialize elements in JSON format.\n * @returns {object} - The resulting object, with minimal attrributes\n */\n getAttributes() {\n return getAttr(this, ['id', 'action', 'actNum', 'sequence', 'projectPath']);\n }\n\n /**\n * Loads the object settings from a data object\n * @param {object} data - The data object to parse\n */\n setAttributes(data) {\n ['id', 'action', 'actNum', 'sequence', 'projectPath'].forEach(t => {\n if (!isEmpty(data[t]))\n this[t] = data[t];\n });\n return this;\n }\n}\n\nObject.assign(JumpInfo.prototype, {\n /**\n * The JumpInfo identifier\n * - For regular jumps: 'forward', 'back'\n * - For conditional jumps: 'upper', 'lower'\n * @name module:bags/JumpInfo.JumpInfo#id\n * @type {string} */\n id: null,\n /**\n * The current action.\n * Possible values are: `JUMP`, `STOP`, `RETURN` and `EXIT`.\n * @name module:bags/JumpInfo.JumpInfo#action\n * @type {string} */\n action: null,\n /**\n * Activity number in the sequence list\n * @name module:bags/JumpInfo.JumpInfo#actNum\n * @type {number} */\n actNum: -1,\n /**\n * Current sequence tag\n * @name module:bags/JumpInfo.JumpInfo#sequence\n * @type {string} */\n sequence: null,\n /**\n * Path of another JClic project to jump to\n * @name module:bags/JumpInfo.JumpInfo#projectPath\n * @type {string} */\n projectPath: null,\n});\n\nexport default JumpInfo;\n"],"names":[],"sourceRoot":""}