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.
- package/CHANGELOG.md +13 -0
- package/dist/jclic-node.js +9 -8
- package/dist/jclic-node.js.map +1 -1
- package/dist/jclic.min.js +2 -2
- package/dist/jclic.min.js.map +1 -1
- package/package.json +4 -4
- package/src/GlobalData.js +1 -1
- package/src/JClicPlayer.js +2 -2
- package/src/bags/MediaBag.js +6 -5
- package/dist/1078.jclic-node.js +0 -282
- package/dist/1078.jclic-node.js.map +0 -1
- package/dist/1196.jclic-node.js +0 -808
- package/dist/1196.jclic-node.js.map +0 -1
- package/dist/1253.jclic-node.js +0 -1432
- package/dist/1253.jclic-node.js.map +0 -1
- package/dist/13.jclic-node.js +0 -103
- package/dist/13.jclic-node.js.map +0 -1
- package/dist/1567.jclic-node.js +0 -2313
- package/dist/1567.jclic-node.js.map +0 -1
- package/dist/1588.jclic-node.js +0 -602
- package/dist/1588.jclic-node.js.map +0 -1
- package/dist/1725.jclic-node.js +0 -836
- package/dist/1725.jclic-node.js.map +0 -1
- package/dist/1731.jclic-node.js +0 -438
- package/dist/1731.jclic-node.js.map +0 -1
- package/dist/1842.jclic-node.js +0 -651
- package/dist/1842.jclic-node.js.map +0 -1
- package/dist/2160.jclic-node.js +0 -1016
- package/dist/2160.jclic-node.js.map +0 -1
- package/dist/222.jclic-node.js +0 -129
- package/dist/222.jclic-node.js.map +0 -1
- package/dist/2316.jclic-node.js +0 -949
- package/dist/2316.jclic-node.js.map +0 -1
- package/dist/2355.jclic-node.js +0 -371
- package/dist/2355.jclic-node.js.map +0 -1
- package/dist/2366.jclic-node.js +0 -431
- package/dist/2366.jclic-node.js.map +0 -1
- package/dist/2379.jclic-node.js +0 -202
- package/dist/2379.jclic-node.js.map +0 -1
- package/dist/2437.jclic-node.js +0 -450
- package/dist/2437.jclic-node.js.map +0 -1
- package/dist/2531.jclic-node.js +0 -869
- package/dist/2531.jclic-node.js.map +0 -1
- package/dist/2608.jclic-node.js +0 -160
- package/dist/2608.jclic-node.js.map +0 -1
- package/dist/2715.jclic-node.js +0 -554
- package/dist/2715.jclic-node.js.map +0 -1
- package/dist/277.jclic-node.js +0 -22
- package/dist/277.jclic-node.js.map +0 -1
- package/dist/2921.jclic-node.js +0 -660
- package/dist/2921.jclic-node.js.map +0 -1
- package/dist/2952.jclic-node.js +0 -101
- package/dist/2952.jclic-node.js.map +0 -1
- package/dist/3018.jclic-node.js +0 -421
- package/dist/3018.jclic-node.js.map +0 -1
- package/dist/3019.jclic-node.js +0 -682
- package/dist/3019.jclic-node.js.map +0 -1
- package/dist/3231.jclic-node.js +0 -274
- package/dist/3231.jclic-node.js.map +0 -1
- package/dist/331.jclic-node.js +0 -115
- package/dist/331.jclic-node.js.map +0 -1
- package/dist/3391.jclic-node.js +0 -276
- package/dist/3391.jclic-node.js.map +0 -1
- package/dist/3502.jclic-node.js +0 -671
- package/dist/3502.jclic-node.js.map +0 -1
- package/dist/3653.jclic-node.js +0 -982
- package/dist/3653.jclic-node.js.map +0 -1
- package/dist/371.jclic.min.js +0 -2
- package/dist/371.jclic.min.js.map +0 -1
- package/dist/3856.jclic-node.js +0 -575
- package/dist/3856.jclic-node.js.map +0 -1
- package/dist/4112.jclic-node.js +0 -659
- package/dist/4112.jclic-node.js.map +0 -1
- package/dist/4123.jclic-node.js +0 -910
- package/dist/4123.jclic-node.js.map +0 -1
- package/dist/427.jclic-node.js +0 -894
- package/dist/427.jclic-node.js.map +0 -1
- package/dist/4483.jclic-node.js +0 -327
- package/dist/4483.jclic-node.js.map +0 -1
- package/dist/4548.jclic-node.js +0 -1078
- package/dist/4548.jclic-node.js.map +0 -1
- package/dist/466.jclic-node.js +0 -99
- package/dist/466.jclic-node.js.map +0 -1
- package/dist/485.jclic-node.js +0 -783
- package/dist/485.jclic-node.js.map +0 -1
- package/dist/4921.jclic-node.js +0 -500
- package/dist/4921.jclic-node.js.map +0 -1
- package/dist/5091.jclic-node.js +0 -239
- package/dist/5091.jclic-node.js.map +0 -1
- package/dist/520.jclic-node.js +0 -550
- package/dist/520.jclic-node.js.map +0 -1
- package/dist/5312.jclic-node.js +0 -1126
- package/dist/5312.jclic-node.js.map +0 -1
- package/dist/5338.jclic-node.js +0 -212
- package/dist/5338.jclic-node.js.map +0 -1
- package/dist/5344.jclic-node.js +0 -229
- package/dist/5344.jclic-node.js.map +0 -1
- package/dist/5550.jclic-node.js +0 -238
- package/dist/5550.jclic-node.js.map +0 -1
- package/dist/5626.jclic-node.js +0 -614
- package/dist/5626.jclic-node.js.map +0 -1
- package/dist/5977.jclic-node.js +0 -1081
- package/dist/5977.jclic-node.js.map +0 -1
- package/dist/6148.jclic-node.js +0 -345
- package/dist/6148.jclic-node.js.map +0 -1
- package/dist/6176.jclic-node.js +0 -481
- package/dist/6176.jclic-node.js.map +0 -1
- package/dist/6221.jclic-node.js +0 -1072
- package/dist/6221.jclic-node.js.map +0 -1
- package/dist/6238.jclic-node.js +0 -718
- package/dist/6238.jclic-node.js.map +0 -1
- package/dist/6454.jclic-node.js +0 -1413
- package/dist/6454.jclic-node.js.map +0 -1
- package/dist/6565.jclic-node.js +0 -294
- package/dist/6565.jclic-node.js.map +0 -1
- package/dist/6579.jclic-node.js +0 -719
- package/dist/6579.jclic-node.js.map +0 -1
- package/dist/6715.jclic-node.js +0 -148
- package/dist/6715.jclic-node.js.map +0 -1
- package/dist/6777.jclic-node.js +0 -171
- package/dist/6777.jclic-node.js.map +0 -1
- package/dist/6782.jclic-node.js +0 -1611
- package/dist/6782.jclic-node.js.map +0 -1
- package/dist/6847.jclic-node.js +0 -601
- package/dist/6847.jclic-node.js.map +0 -1
- package/dist/6856.jclic-node.js +0 -252
- package/dist/6856.jclic-node.js.map +0 -1
- package/dist/696.jclic-node.js +0 -1821
- package/dist/696.jclic-node.js.map +0 -1
- package/dist/698.jclic-node.js +0 -583
- package/dist/698.jclic-node.js.map +0 -1
- package/dist/704.jclic-node.js +0 -80
- package/dist/704.jclic-node.js.map +0 -1
- package/dist/7046.jclic-node.js +0 -735
- package/dist/7046.jclic-node.js.map +0 -1
- package/dist/7220.jclic-node.js +0 -156
- package/dist/7220.jclic-node.js.map +0 -1
- package/dist/7257.jclic-node.js +0 -931
- package/dist/7257.jclic-node.js.map +0 -1
- package/dist/743.jclic-node.js +0 -583
- package/dist/743.jclic-node.js.map +0 -1
- package/dist/757.jclic-node.js +0 -1072
- package/dist/757.jclic-node.js.map +0 -1
- package/dist/7781.jclic-node.js +0 -202
- package/dist/7781.jclic-node.js.map +0 -1
- package/dist/7912.jclic-node.js +0 -2103
- package/dist/7912.jclic-node.js.map +0 -1
- package/dist/827.jclic-node.js +0 -708
- package/dist/827.jclic-node.js.map +0 -1
- package/dist/8276.jclic-node.js +0 -409
- package/dist/8276.jclic-node.js.map +0 -1
- package/dist/8322.jclic-node.js +0 -498
- package/dist/8322.jclic-node.js.map +0 -1
- package/dist/8641.jclic-node.js +0 -360
- package/dist/8641.jclic-node.js.map +0 -1
- package/dist/8837.jclic-node.js +0 -651
- package/dist/8837.jclic-node.js.map +0 -1
- package/dist/8895.jclic-node.js +0 -151
- package/dist/8895.jclic-node.js.map +0 -1
- package/dist/9072.jclic-node.js +0 -1285
- package/dist/9072.jclic-node.js.map +0 -1
- package/dist/9078.jclic-node.js +0 -935
- package/dist/9078.jclic-node.js.map +0 -1
- package/dist/9103.jclic-node.js +0 -718
- package/dist/9103.jclic-node.js.map +0 -1
- package/dist/9359.jclic-node.js +0 -145
- package/dist/9359.jclic-node.js.map +0 -1
- package/dist/9409.jclic-node.js +0 -921
- package/dist/9409.jclic-node.js.map +0 -1
- package/dist/9513.jclic-node.js +0 -720
- package/dist/9513.jclic-node.js.map +0 -1
- package/dist/9704.jclic-node.js +0 -81
- package/dist/9704.jclic-node.js.map +0 -1
- package/dist/9950.jclic-node.js +0 -827
- package/dist/9950.jclic-node.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"3019.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;AACkG;AAC1D;AACR;;AAEvD;AACA,8DAA8D,oEAAoE;AAClI,IAAI,oEAAoE,GAAG,4DAA4D,KAAK,wDAAwD;AACpM,qEAAqE,oEAAoE;AACzI,gCAAgC,yEAAyE;AACzG;AACO;AACP;AACA;AACA;AACA;AACA;AACA,mBAAmB,aAAa;AAChC;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,+BAA+B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,0CAA0C,6CAAC;AAC3C;AACA,wDAAwD,oDAAQ;AAChE,KAAK;;AAEL;AACA;;AAEA,kBAAkB;;AAElB;AACA,MAAM,gEAAW;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA,MAAM,6CAAC;AACP;AACA,uBAAuB,6CAAC;AACxB;;AAEA;AACA,sBAAsB,kEAAgB;AACtC;;AAEA;AACA,oBAAoB,4CAA4C;AAChE;AACA,iBAAiB,2DAAe;AAChC;AACA;AACA;;AAEA;AACA,6EAA6E;AAC7E;AACA;AACA;;AAEA;AACA,YAAY,wDAAG,mDAAmD,eAAe;AACjF;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B,eAAe;AACf;AACA;AACA;AACA,eAAe;AACf;AACA,IAAI,gEAAW;AACf;AACA;AACA,gBAAgB,+DAAU;AAC1B;AACA;AACA;AACA;AACA,gBAAgB,+DAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC,mBAAmB,oDAAQ,SAAS;AACpC;AACA,qCAAqC;AACrC,oBAAoB,oDAAQ,GAAG;AAC/B;AACA;AACA;AACA,gBAAgB,+DAAU;AAC1B;AACA;AACA;AACA;AACA,gBAAgB,+DAAU;AAC1B;AACA;AACA;AACA;AACA,uBAAuB,+DAAU;AACjC;AACA;AACA;AACA,gCAAgC,IAAI;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,wDAAG,qCAAqC,KAAK,OAAO,IAAI;AAClE;AACA;AACA;AACA,KAAK;;AAEL,SAAS,2DAAe;AACxB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,WAAW,4DAAO;AAClB;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;;AAEA,IAAI,4DAAO;;AAEX;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAgB;AACxC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,kBAAkB,6CAAC;AACnB;AACA;AACA;AACA,iBAAiB,6CAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,oDAAQ,SAAS;AAChC,WAAW,oDAAQ,mDAAmD;AACtE,6BAA6B,8DAA8D;AAC3F;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA,wBAAwB,kDAAkD;AAC1E;AACA,YAAY,QAAQ;AACpB;AACA;AACA,eAAe,6EAA6E;AAC5F;AACA,YAAY,QAAQ;AACpB;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,CAAC;;AAED;AACA;AACA;AACA;AACO;AACP;AACA;AACA,aAAa,kEAAkE;AAC/E,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,+BAA+B;AAC5C;AACA;AACA;AACA;AACA;AACA,oBAAoB,6CAAC;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA,yBAAyB,2DAAM;AAC/B;AACA,cAAc,yDAAQ;AACtB;AACA,6BAA6B,8DAAS;AACtC,4BAA4B,8DAAS;AACrC,yBAAyB,2DAAM;AAC/B;;AAEA;AACA,0BAA0B,2DAAM;AAChC,4BAA4B,8DAAS;AACrC,8BAA8B,8DAAS;AACvC;AACA;AACA,oCAAoC,kEAAgB;AACpD,iDAAiD,8DAAY,iBAAiB,6CAAC;AAC/E,WAAW;AACX;AACA;AACA,sCAAsC,kEAAgB,iBAAiB,6CAAC;AACxE,aAAa;AACb;AACA;;AAEA;AACA,4DAA4D;AAC5D,kDAAkD,6CAAC;AACnD,eAAe,2DAAe;AAC9B;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,WAAW,4DAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA,WAAW,4DAAO;AAClB;AACA;AACA;AACA,QAAQ,yBAAyB,kEAAgB,sBAAsB;AACvE;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,6FAA6F;AACvG;AACA,YAAY,kEAAkE;AAC9E;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;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,UAAU;AACtB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA,kBAAkB,uEAAuE;AACzF;AACA,YAAY,gDAAgD;AAC5D;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iBAAiB;AAC7B;AACA;AACA;AACA;AACA,YAAY,iBAAiB;AAC7B;AACA;AACA;AACA;AACA,YAAY,iBAAiB;AAC7B;AACA;AACA;AACA;AACA,YAAY,iBAAiB;AAC7B;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA,eAAe,4DAA4D;AAC3E;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,+DAA+D;AAC3E;AACA,CAAC;;AAED;;AAEA,iEAAe,oBAAoB,EAAC","sources":["webpack://jclic/./src/activities/text/TextActivityDocument.js"],"sourcesContent":["/**\n * File : activities/text/TextActivityDocument.js\n * Created : 14/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\nimport $ from 'jquery';\nimport { log, attrForEach, checkColor, getBoolean, getAttr, setAttr, getVal, getNumber, settings } from '../../Utils.js';\nimport ActiveBoxContent from '../../boxes/ActiveBoxContent.js';\nimport MediaContent from '../../media/MediaContent.js';\n\n/**\n * This is the HTML DOM element used in text activities like {@link module:activities/text/FillInBlanks.FillInBlanks FillInBlanks},\n * {@link module:activities/text/IdentifyText.IdentifyText IdentifyText}, {@link module:activities/text/OrderText.OrderText OrderText} and {@link module:activities/text/Complete.Complete Complete}. It contains the main document of\n * the activity, usually with some elements marked as \"targets\". In {@link module:activities/text/FillInBlanks.FillInBlanks FillInBlanks}, this\n * targets are encapsulated in {@link module:activities/text/TextActivityDocument.TextTarget TextTarget} objects.\n */\nexport class TextActivityDocument {\n /**\n * TextActivityDocument constructor\n */\n constructor() {\n // Make a deep clone of the default style\n this.style = { 'default': { ...TextActivityDocument.DEFAULT_DOC_STYLE } };\n this.p = [];\n }\n\n /**\n * Loads the document settings from a specific JQuery XML element\n * @param {external:jQuery} $xml - The XML element to parse\n * @param {module:bags/MediaBag.MediaBag} mediaBag - The media bag used to load images and media content\n */\n setProperties($xml, mediaBag) {\n // Read named styles\n // Sort styles according to its \"base\" dependencies\n const styles = $xml.children('style').toArray().sort((a, b) => {\n var aName = a.getAttribute('name'), aBase = a.getAttribute('base') || null;\n var bName = b.getAttribute('name'), bBase = b.getAttribute('base') || null;\n // Put 'default' always first, then each style below their base (if any)\n return aName === 'default' ? -1 : bName === 'default' ? 1\n : aBase === bName ? 1 : bBase === aName ? -1\n : !aBase ? -1 : !bBase ? 1 : 0;\n });\n\n // Process the ordered list of styles\n styles.forEach(style => {\n const attr = this.readDocAttributes($(style));\n // Grant always that basic attributes are defined\n this.style[attr.name] = attr.name === 'default' ? $.extend(true, this.style.default, attr) : attr;\n });\n\n // Read paragraphs\n $xml.find('section > p').each((_n, par) => {\n\n const p = { elements: [] };\n\n // Read paragraph attributes\n attrForEach(par.attributes, (name, value) => {\n switch (name) {\n case 'style':\n p[name] = value;\n break;\n case 'bidiLevel':\n case 'Alignment':\n p[name] = Number(value);\n break;\n }\n });\n\n // Read paragraph objects\n $(par).children().each((_n, child) => {\n let obj;\n const $child = $(child);\n switch (child.nodeName) {\n\n case 'cell':\n obj = new ActiveBoxContent().setProperties($child, mediaBag);\n break;\n\n case 'text':\n obj = { text: child.textContent.replace(/\\t/g, '	') };\n const attr = this.readDocAttributes($child);\n if (!$.isEmptyObject(attr)) {\n obj.attr = attr;\n }\n break;\n\n case 'target':\n obj = new TextTarget(this, child.textContent.replace(/\\t/g, '	'));\n obj.setProperties($child, mediaBag);\n this.numTargets++;\n break;\n\n default:\n log('error', `Unknown object in activity document: \"${child.nodeName}\"`);\n }\n if (obj) {\n obj.objectType = child.nodeName;\n p.elements.push(obj);\n }\n });\n\n this.p.push(p);\n });\n return this;\n }\n\n /**\n * Reads sets of text attributes, sometimes in form of named styles\n * @param {external:jQuery} $xml - The XML element to parse\n * @returns {object}\n */\n readDocAttributes($xml) {\n let\n attr = {},\n css = {};\n attrForEach($xml.get(0).attributes, (name, val) => {\n switch (name) {\n case 'background':\n val = checkColor(val, 'white');\n attr[name] = val;\n css['background-color'] = val;\n break;\n case 'foreground':\n val = checkColor(val, 'black');\n attr[name] = val;\n css['color'] = val;\n break;\n case 'family':\n css['font-family'] = val;\n /* falls through */\n case 'name':\n case 'style':\n // Attributes specific to named styles:\n attr[name] = val;\n break;\n case 'base':\n attr[name] = val;\n // If base style exists, merge it with current settings\n if (this.style[val]) {\n //attr = Object.apply({}, this.style[val], attr)\n attr = $.extend(true, {}, this.style[val], attr);\n if (this.style[val].css)\n //css = Object.apply({}, this.style[val].css, css)\n css = $.extend({}, this.style[val].css, css);\n }\n break;\n case 'bold':\n val = getBoolean(val);\n attr[name] = val;\n css['font-weight'] = val ? 'bold' : 'normal';\n break;\n case 'italic':\n val = getBoolean(val);\n attr[name] = val;\n css['font-style'] = val ? 'italic' : 'normal';\n break;\n case 'target':\n attr[name] = getBoolean(val);\n break;\n case 'size':\n attr[name] = Number(val);\n css['font-size'] = `${val}px`;\n break;\n case 'tabWidth':\n // `tab-size` CSS attribute is only set when the document has a specific `tabWidth`\n // setting. It must be accompanied of `white-space:pre` to successfully work.\n this.tabSpc = val;\n css['tab-size'] = this.tabSpc;\n css['white-space'] = 'pre-wrap';\n break;\n default:\n log('warn', `Unknown text attribute: \"${name}\" = \"${val}\"`);\n attr[name] = val;\n break;\n }\n });\n\n if (!$.isEmptyObject(css))\n attr['css'] = css;\n\n return attr;\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 // TODO: simplify the serialization of styles (now too verbose!)\n return getAttr(this, ['style', 'tabSpc', 'targetType', 'p']);\n }\n\n /**\n * Reads the properties of this TextActivityDocument from a data object\n * @param {object} data - The data object to be parsed, or just the text content\n * @returns {module:activities/text/TextActivityDocument.TextActivityDocument}\n */\n setAttributes(data, mediaBag) {\n\n setAttr(this, data, ['style', 'tabSpc', 'targetType', 'p']);\n\n // Build paragraphs:\n this.p.forEach(p => {\n if (p.elements)\n p.elements = p.elements.map(el => {\n if (el.objectType === 'cell')\n return (new ActiveBoxContent()).setAttributes(el, mediaBag);\n else if (el.objectType === 'target')\n return (new TextTarget(this)).setAttributes(el, mediaBag);\n else\n return el;\n });\n else\n p.elements = [];\n });\n return this;\n }\n\n /**\n * Gets the full text of this document in raw format\n * @returns {string} - The text of the document.\n */\n getRawText() {\n const $html = $('<div/>');\n // Process paragraphs\n this.p.forEach(p => {\n // Creates a new DOM paragraph\n const $p = $('<p/>');\n let empty = true;\n // Process the paragraph elements\n p.elements.forEach(element => {\n switch (element.objectType) {\n case 'text':\n case 'target':\n $p.append(element.text);\n break;\n case 'cell':\n // cells are not considered raw text of the document\n break;\n default:\n break;\n }\n empty = false;\n });\n if (empty) {\n // Don't leave paragraphs empty\n $p.html(' ');\n }\n // Adds the paragraph to the DOM element\n $html.append($p);\n });\n return $html.text().trim();\n }\n\n /**\n * Gets a `style` object filled with default attributes plus attributes present in the\n * requested style name.\n * @param {string} name - The requested style name\n * @returns {object} - The result of combining `default` with the requested style\n */\n getFullStyle(name) {\n const st = $.extend(true, {}, this.style.default);\n return $.extend(true, st, this.style[name] ? this.style[name] : {});\n //return Object.assign({}, this.style.default, this.style[name] ? this.style[name] : {})\n }\n}\n\n/**\n * Default style\n */\nTextActivityDocument.DEFAULT_DOC_STYLE = {\n background: '0xFFFFFF',\n foreground: '0x000000',\n family: 'Arial',\n bold: false,\n italic: false,\n size: 17,\n css: {\n 'background-color': '#FFFFFF',\n 'color': '#000000',\n 'font-family': 'Arial',\n 'font-weight': 'normal',\n 'font-style': 'normal',\n 'font-size': '17px',\n },\n};\n\nObject.assign(TextActivityDocument.prototype, {\n /**\n * Number of blank spaces between tabulators.\n * @name module:activities/text/TextActivityDocument.TextActivityDocument#tabSpc\n * @type {number} */\n tabSpc: 12,\n /**\n * Index of the last {@link module:boxes/ActiveBox.ActiveBox ActiveBox} activated.\n * @name module:activities/text/TextActivityDocument.TextActivityDocument#lastBoxId\n * @type {number} */\n lastBoxId: 0,\n /**\n * A bag of {@link module:activities/text/TextActivityDocument.TargetMarker TargetMarker} objects\n * @name module:activities/text/TextActivityDocument.TextActivityDocument#tmb\n * @type {object} */\n tmb: null,\n /**\n * Number of targets\n * @name module:activities/text/TextActivityDocument.TextActivityDocument#numTargets\n * @type {number} */\n numTargets: 0,\n /**\n * Type of targets used in this activity. Possible values are: `TT_FREE`, `TT_CHAR`, `TT_WORD`\n * and `TT_PARAGRAPH`.\n * @name module:activities/text/TextActivityDocument.TextActivityDocument#targetType\n * @type {string} */\n targetType: 'TT_FREE',\n /**\n * Collection of named styles of the document\n * @name module:activities/text/TextActivityDocument.TextActivityDocument#style\n * @type {object} */\n style: null,\n /**\n * The main document, represented as a collection of DOM objects\n * @name module:activities/text/TextActivityDocument.TextActivityDocument#p\n * @type {object} */\n p: null,\n});\n\n/**\n * This class contains the properties and methods of the document elements that are the real\n * targets of user actions in text activities.\n */\nexport class TextTarget {\n /**\n * TextTarget constructor\n * @param {module:activities/text/TextActivityDocument.TextActivityDocument} doc - The document to which this target belongs.\n * @param {string} text - Main text of this target.\n */\n constructor(doc, text = '') {\n this.doc = doc;\n this.text = text;\n this.numIniChars = text.length;\n this.answers = [text];\n this.maxLenResp = this.numIniChars;\n }\n\n /**\n * Resets the TextTarget status\n * @param {string} [status] - The `targetStatus` to be established. Default is `NOT_EDITED`\n */\n reset(status) {\n this.targetStatus = status ? status : 'NOT_EDITED';\n this.flagModified = false;\n }\n\n /**\n * Loads the text target settings from a specific JQuery XML element\n * @param {external:jQuery} $xml - The XML element to parse\n * @param {module:bags/MediaBag.MediaBag} mediaBag - The media bag used to load images and media content\n */\n setProperties($xml, mediaBag) {\n let firstAnswer = true;\n // Read specific nodes\n $xml.children().each((_n, child) => {\n const $node = $(child);\n switch (child.nodeName) {\n case 'answer':\n if (firstAnswer) {\n firstAnswer = false;\n this.answers = [];\n }\n if (this.answers === null)\n this.answers = [];\n this.answers.push(child.textContent);\n break;\n\n case 'optionList':\n $node.children('option').each((_n, opChild) => {\n this.isList = true;\n if (this.options === null)\n this.options = [];\n this.options.push(opChild.textContent);\n });\n break;\n\n case 'response':\n this.iniChar = getVal($node.attr('fill'), this.iniChar).charAt(0);\n // Use underscores instead of whitespace chars\n if (settings.WHITESPACES.indexOf(this.iniChar) >= 0)\n this.iniChar = '_';\n this.numIniChars = getNumber($node.attr('length'), this.numIniChars);\n this.maxLenResp = getNumber($node.attr('maxLength'), this.maxLenResp);\n this.iniText = getVal($node.attr('show'), this.iniText);\n break;\n\n case 'info':\n this.infoMode = getVal($node.attr('mode'), 'always');\n this.popupDelay = getNumber($node.attr('delay'), this.popupDelay);\n this.popupMaxTime = getNumber($node.attr('maxTime'), this.popupMaxTime);\n $node.children('media').each((_n, media) => {\n this.onlyPlay = true;\n this.popupContent = new ActiveBoxContent();\n this.popupContent.mediaContent = new MediaContent().setProperties($(media));\n });\n if (!this.popupContent) {\n $node.children('cell').each((_n, cell) => {\n this.popupContent = new ActiveBoxContent().setProperties($(cell), mediaBag);\n });\n }\n break;\n\n case 'text':\n this.text = child.textContent.replace(/\\t/g, '	');\n const attr = this.doc.readDocAttributes($(child));\n if (!$.isEmptyObject(attr))\n this.attr = attr;\n break;\n\n default:\n break;\n }\n });\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, [\n 'objectType', 'text', 'attr', 'isList',\n 'answers', 'options', 'iniChar', 'numIniChars', 'maxLenResp', 'iniText',\n 'infoMode', 'popupDelay', 'popupKey', 'popupMaxTime', 'onlyPlay',\n 'popupContent',\n ]);\n }\n\n /**\n * Reads the properties of this TextTarget from a data object\n * @param {object} data - The data object to be parsed, or just the text content\n * @returns {module:activities/text/TextActivityDocument.TextTarget}\n */\n setAttributes(data, mediaBag) {\n return setAttr(this, data, [\n 'objectType', 'text', 'attr', 'isList',\n 'answers', 'options', 'iniChar', 'numIniChars', 'maxLenResp', 'iniText',\n 'infoMode', 'popupDelay', 'popupKey', 'popupMaxTime', 'onlyPlay',\n { key: 'popupContent', fn: ActiveBoxContent, params: [mediaBag] },\n ]);\n }\n\n /**\n * Gets a string with all valid answers of this TextTarget. Useful for reporting users' activity.\n * @returns {string}\n */\n getAnswers() {\n return this.answers ? this.answers.join('|') : '';\n }\n\n /**\n * Sets specific colors to the target jQuery element, based on its `targetStatus` value. Red\n * color usually means error.\n */\n checkColors() {\n const $element = this.$comboList || this.$span;\n if ($element) {\n const style = this.doc.style[\n this.targetStatus === 'WITH_ERROR' ? 'targetError' :\n this.targetStatus === 'HIDDEN' ? 'default' : 'target'];\n if (style && style.css) {\n $element.css(style.css);\n }\n }\n }\n\n /**\n * Fills the `currentText` member with the text currently hosted in $span or selected in $comboList\n * @returns {string} - The current text of this target\n */\n readCurrentText() {\n if (this.$span)\n this.currentText = this.$span.text();\n else if (this.$comboList)\n this.currentText = this.$comboList.val();\n return this.currentText;\n }\n}\n\nObject.assign(TextTarget.prototype, {\n /**\n * The {@link module:activities/text/TextActivityDocument.TextActivityDocument TextActivityDocument} to which this target belongs\n * @name module:activities/text/TextActivityDocument.TextTarget#doc\n * @type {module:activities/text/TextActivityDocument.TextActivityDocument} */\n doc: null,\n /**\n * The current text displayed by this TextTarget\n * @name module:activities/text/TextActivityDocument.TextTarget#text\n * @type {string} */\n text: null,\n /**\n * A set of optional attributes for `text`\n * @name module:activities/text/TextActivityDocument.TextTarget#attr\n * @type {object} */\n attr: null,\n /**\n * `true` when the target is a drop-down list\n * @name module:activities/text/TextActivityDocument.TextTarget#isList\n * @type {boolean} */\n isList: false,\n /**\n * Number of characters initially displayed on the text field\n * @name module:activities/text/TextActivityDocument.TextTarget#numIniChars\n * @type {number} */\n numIniChars: 1,\n /**\n * Character used to fill-in the text field\n * @name module:activities/text/TextActivityDocument.TextTarget#iniChar\n * @type {string} */\n iniChar: '_',\n /**\n * Maximum length of the answer\n * @name module:activities/text/TextActivityDocument.TextTarget#maxLenResp\n * @type {number} */\n maxLenResp: 0,\n /**\n * Array of valid answers\n * @name module:activities/text/TextActivityDocument.TextTarget#answers\n * @type {string[]} */\n answers: null,\n /**\n * Set of specific options\n * @name module:activities/text/TextActivityDocument.TextTarget#options\n * @type {object} */\n options: null,\n /**\n * Text displayed by the target when the activity begins\n * @name module:activities/text/TextActivityDocument.TextTarget#iniText\n * @type {string} */\n iniText: null,\n /**\n * Type of additional information offered to the user. Possible values are: `no_info`, `always`,\n * `onError` and `onDemand`.\n * @name module:activities/text/TextActivityDocument.TextTarget#infoMode\n * @type {string} */\n infoMode: 'no_info',\n /**\n * Key that triggers the associated popup when `infoMode` is `onDemand`\n * @name module:activities/text/TextActivityDocument.TextTarget#popupKey\n * @type {string} */\n popupKey: 'F1',\n /**\n * An optional {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent} with information about this TextTarget\n * @name module:activities/text/TextActivityDocument.TextTarget#popupContent\n * @type {module:boxes/ActiveBoxContent.ActiveBoxContent} */\n popupContent: null,\n /**\n * Time (seconds) to wait before showing the additional information\n * @name module:activities/text/TextActivityDocument.TextTarget#popupDelay\n * @type {number} */\n popupDelay: 0,\n /**\n * Maximum amount of time (seconds) that the additional information will be shown\n * @name module:activities/text/TextActivityDocument.TextTarget#popupMaxTime\n * @type {number} */\n popupMaxTime: 0,\n /**\n * When this flag is `true` and `popupContent` contains audio, no visual feedback will be\n * provided (meaning that audio will be just played)\n * @name module:activities/text/TextActivityDocument.TextTarget#onlyPlay\n * @type {boolean} */\n onlyPlay: false,\n //\n // TRANSIENT PROPERTIES\n //\n /**\n * The drop-down list associated to this target\n * @name module:activities/text/TextActivityDocument.TextTarget#$comboList\n * @type {external:jQuery} */\n $comboList: null,\n /**\n * The span element associated to this target\n * @name module:activities/text/TextActivityDocument.TextTarget#$span\n * @type {external:jQuery} */\n $span: null,\n /**\n * The paragraph element where $span is currently located\n * @name module:activities/text/TextActivityDocument.TextTarget#$p\n * @type {external:jQuery} */\n $p: null,\n /**\n * The span element containing the popup\n * @name module:activities/text/TextActivityDocument.TextTarget#$popup\n * @type {external:jQuery} */\n $popup: null,\n /**\n * Current text in the $span element\n * @name module:activities/text/TextActivityDocument.TextTarget#currentText\n * @type {string} */\n currentText: '',\n /**\n * Ordinal number of this target in the collection of targets\n * @name module:activities/text/TextActivityDocument.TextTarget#num\n * @type {number} */\n num: 0,\n /**\n * Current ordinal position of this target in the document\n * (used in {@link module:activities/text/OrderText.OrderText OrderText} activities)\n * @name module:activities/text/TextActivityDocument.TextTarget#pos\n * @type {number} */\n pos: 0,\n /**\n * Current status of the target. Valid values are: `NOT_EDITED`, `EDITED`, `SOLVED`, `WITH_ERROR` and `HIDDEN`\n * @name module:activities/text/TextActivityDocument.TextTarget#targetStatus\n * @type {string} */\n targetStatus: 'NOT_EDITED',\n /**\n * Flag to control if the initial content of this TextTarget has been modified\n * @name module:activities/text/TextActivityDocument.TextTarget#flagModified\n * @type {boolean} */\n flagModified: false,\n /**\n * Pointer to the activity panel containing this TextTarget\n * @name module:activities/text/TextActivityDocument.TextTarget#parentPane\n * @type {module:activities/text/TextActivityBase.TextActivityBasePanel} */\n parentPane: null,\n});\n\nTextActivityDocument.TextTarget = TextTarget;\n\nexport default TextActivityDocument;\n"],"names":[],"sourceRoot":""}
|
package/dist/3231.jclic-node.js
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.id = 3231;
|
|
3
|
-
exports.ids = [3231];
|
|
4
|
-
exports.modules = {
|
|
5
|
-
|
|
6
|
-
/***/ 3231:
|
|
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 IdentifyText */
|
|
13
|
-
/* harmony import */ var _Activity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1567);
|
|
14
|
-
/* harmony import */ var _TextActivityBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(743);
|
|
15
|
-
/**
|
|
16
|
-
* File : activities/text/Identify.js
|
|
17
|
-
* Created : 20/06/2015
|
|
18
|
-
* By : Francesc Busquets <francesc@gmail.com>
|
|
19
|
-
*
|
|
20
|
-
* JClic.js
|
|
21
|
-
* An HTML5 player of JClic activities
|
|
22
|
-
* https://projectestac.github.io/jclic.js
|
|
23
|
-
*
|
|
24
|
-
* @source https://github.com/projectestac/jclic.js
|
|
25
|
-
*
|
|
26
|
-
* @license EUPL-1.2
|
|
27
|
-
* @licstart
|
|
28
|
-
* (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
|
|
29
|
-
*
|
|
30
|
-
* Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
|
|
31
|
-
* the European Commission- subsequent versions of the EUPL (the "Licence");
|
|
32
|
-
* You may not use this work except in compliance with the Licence.
|
|
33
|
-
*
|
|
34
|
-
* You may obtain a copy of the Licence at:
|
|
35
|
-
* https://joinup.ec.europa.eu/software/page/eupl
|
|
36
|
-
*
|
|
37
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
38
|
-
* distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
|
|
39
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
40
|
-
* Licence for the specific language governing permissions and limitations
|
|
41
|
-
* under the Licence.
|
|
42
|
-
* @licend
|
|
43
|
-
* @module
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* This type of text activity suggests users to click on specific words or single letters of a
|
|
51
|
-
* given text, without any help on where these elements are placed.
|
|
52
|
-
* @extends module:activities/text/TextActivityBase.TextActivityBase
|
|
53
|
-
*/
|
|
54
|
-
class IdentifyText extends _TextActivityBase_js__WEBPACK_IMPORTED_MODULE_1__/* .TextActivityBase */ .q {
|
|
55
|
-
/**
|
|
56
|
-
* IdentifyText constructor
|
|
57
|
-
* @param {module:project/JClicProject.JClicProject} project - The project to which this activity belongs
|
|
58
|
-
*/
|
|
59
|
-
constructor(project) {
|
|
60
|
-
super(project);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* The {@link module:activities/text/TextActivityBase.TextActivityBasePanel TextActivityBasePanel} where {@link module:activities/text/IdentifyText.IdentifyText IdentifyText} activities are played.
|
|
66
|
-
* @extends module:activities/text/TextActivityBase.TextActivityBasePanel
|
|
67
|
-
*/
|
|
68
|
-
class IdentifyTextPanel extends _TextActivityBase_js__WEBPACK_IMPORTED_MODULE_1__/* .TextActivityBasePanel */ .c {
|
|
69
|
-
/**
|
|
70
|
-
* IdentifyTextPanel constructor
|
|
71
|
-
* @param {module:Activity.Activity} act - The {@link module:Activity.Activity Activity} to which this Panel belongs
|
|
72
|
-
* @param {module:JClicPlayer.JClicPlayer} ps - Any object implementing the methods defined in the
|
|
73
|
-
* [PlayStation](http://projectestac.github.io/jclic/apidoc/edu/xtec/jclic/PlayStation.html) Java interface.
|
|
74
|
-
* @param {external:jQuery} [$div] - The jQuery DOM element where this Panel will deploy
|
|
75
|
-
*/
|
|
76
|
-
constructor(act, ps, $div) {
|
|
77
|
-
super(act, ps, $div);
|
|
78
|
-
this.spanText = true;
|
|
79
|
-
this.spanChars = act.type === 'identifyChars';
|
|
80
|
-
this.spansChecked = new Set();
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Creates a target DOM element for the provided target.
|
|
85
|
-
* @override
|
|
86
|
-
* @param {module:activities/text/TextActivityDocument.TextTarget} target - The target related to the DOM object to be created
|
|
87
|
-
* @param {external:jQuery} $span - - An initial DOM object (usually a `span`) that can be used
|
|
88
|
-
* to store the target, or replaced by another type of object.
|
|
89
|
-
* @returns {external:jQuery} - The jQuery DOM element loaded with the target data.
|
|
90
|
-
*/
|
|
91
|
-
$createTargetElement(target, $span) {
|
|
92
|
-
super.$createTargetElement(target, $span);
|
|
93
|
-
const idLabel = `target${`000${this.targets.length - 1}`.slice(-3)}`;
|
|
94
|
-
$span.bind('click', event => {
|
|
95
|
-
event.textTarget = target;
|
|
96
|
-
event.idLabel = idLabel;
|
|
97
|
-
this.processEvent(event);
|
|
98
|
-
});
|
|
99
|
-
return $span;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
$createSpanElement($span) {
|
|
103
|
-
$span.bind('click', event => {
|
|
104
|
-
event.$spanElement = $span;
|
|
105
|
-
this.processEvent(event);
|
|
106
|
-
});
|
|
107
|
-
return $span;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Basic initialization procedure
|
|
112
|
-
* @override
|
|
113
|
-
*/
|
|
114
|
-
initActivity() {
|
|
115
|
-
super.initActivity(this);
|
|
116
|
-
this.$div.find('.JClicTextDocument > p').css('cursor', 'pointer');
|
|
117
|
-
this.$div.find('.JClicTextDocument > span').css('cursor', 'pointer');
|
|
118
|
-
// Clean possible previous errors
|
|
119
|
-
this.spansChecked.forEach($spanElement => $spanElement.css($spanElement.initialCSS || this.act.document.style['default'].css));
|
|
120
|
-
this.spansChecked.clear();
|
|
121
|
-
this.playing = true;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Counts the number of targets that are solved
|
|
126
|
-
* @returns {number}
|
|
127
|
-
*/
|
|
128
|
-
countSolvedTargets() {
|
|
129
|
-
return this.targets.filter(({ targetStatus }) => targetStatus === 'SOLVED').length;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Evaluates all the targets in this panel. This method is usually called from the `Check` button.
|
|
134
|
-
* @override
|
|
135
|
-
* @returns {boolean} - `true` when all targets are OK, `false` otherwise.
|
|
136
|
-
*/
|
|
137
|
-
evaluatePanel() {
|
|
138
|
-
let targetsOk = 0;
|
|
139
|
-
this.targets.forEach(target => {
|
|
140
|
-
const ok = target.targetStatus === 'SOLVED';
|
|
141
|
-
if (ok)
|
|
142
|
-
targetsOk++;
|
|
143
|
-
target.checkColors();
|
|
144
|
-
this.ps.reportNewAction(this.act, 'SELECT', target.text, target.pos, ok, targetsOk);
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (targetsOk === this.targets.length && this.spansChecked.size === 0) {
|
|
149
|
-
this.finishActivity(true);
|
|
150
|
-
return true;
|
|
151
|
-
} else {
|
|
152
|
-
// Mark selected spans as error
|
|
153
|
-
this.spansChecked.forEach($spanElement => $spanElement.css(this.act.document.style['targetError'].css));
|
|
154
|
-
this.playEvent('finishedError');
|
|
155
|
-
}
|
|
156
|
-
return false;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Ordinary ending of the activity, usually called form `processEvent`
|
|
161
|
-
* @override
|
|
162
|
-
* @param {boolean} result - `true` if the activity was successfully completed, `false` otherwise
|
|
163
|
-
*/
|
|
164
|
-
finishActivity(result) {
|
|
165
|
-
this.$div.find('.JClicTextDocument > p').css('cursor', 'pointer');
|
|
166
|
-
return super.finishActivity(result);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Main handler used to process mouse, touch, keyboard and edit events.
|
|
171
|
-
* @override
|
|
172
|
-
* @param {external:Event} event - The HTML event to be processed
|
|
173
|
-
* @returns {boolean} - When this event handler returns `false`, jQuery will stop its
|
|
174
|
-
* propagation through the DOM tree. See: {@link http://api.jquery.com/on}
|
|
175
|
-
*/
|
|
176
|
-
processEvent(event) {
|
|
177
|
-
if (!super.processEvent(event) ||
|
|
178
|
-
event.timeStamp === this.lastTimeStamp)
|
|
179
|
-
return false;
|
|
180
|
-
|
|
181
|
-
if (event.timeStamp)
|
|
182
|
-
this.lastTimeStamp = event.timeStamp;
|
|
183
|
-
|
|
184
|
-
const target = event.textTarget;
|
|
185
|
-
const $spanElement = event.$spanElement;
|
|
186
|
-
|
|
187
|
-
switch (event.type) {
|
|
188
|
-
case 'click':
|
|
189
|
-
let text, pos, ok = false;
|
|
190
|
-
if (target) {
|
|
191
|
-
if (target.targetStatus === 'SOLVED')
|
|
192
|
-
target.targetStatus = 'HIDDEN';
|
|
193
|
-
else {
|
|
194
|
-
target.targetStatus = 'SOLVED';
|
|
195
|
-
ok = true;
|
|
196
|
-
}
|
|
197
|
-
text = target.text;
|
|
198
|
-
pos = target.pos;
|
|
199
|
-
// TODO: Just on/off target colors, don't mark it as error!
|
|
200
|
-
target.checkColors();
|
|
201
|
-
} else {
|
|
202
|
-
if ($spanElement) {
|
|
203
|
-
$spanElement.checked = !$spanElement.checked;
|
|
204
|
-
if ($spanElement.checked) {
|
|
205
|
-
this.spansChecked.add($spanElement);
|
|
206
|
-
$spanElement.css(this.act.document.style.target.css);
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
this.spansChecked.delete($spanElement);
|
|
210
|
-
$spanElement.css($spanElement.initialCSS || this.act.document.style.default.css);
|
|
211
|
-
}
|
|
212
|
-
text = $spanElement.text();
|
|
213
|
-
}
|
|
214
|
-
else
|
|
215
|
-
text = 'unknown';
|
|
216
|
-
pos = 0;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
if (!this.$checkButton) {
|
|
220
|
-
// Check and notify action
|
|
221
|
-
const cellsAtPlace = this.countSolvedTargets();
|
|
222
|
-
this.ps.reportNewAction(this.act, 'SELECT', text, pos, ok, cellsAtPlace);
|
|
223
|
-
|
|
224
|
-
// End activity or play event sound
|
|
225
|
-
if (ok && this.spansChecked.size === 0 && cellsAtPlace === this.targets.length)
|
|
226
|
-
this.finishActivity(true);
|
|
227
|
-
else
|
|
228
|
-
this.playEvent(ok ? 'actionOk' : 'actionError');
|
|
229
|
-
}
|
|
230
|
-
event.preventDefault();
|
|
231
|
-
break;
|
|
232
|
-
|
|
233
|
-
default:
|
|
234
|
-
break;
|
|
235
|
-
}
|
|
236
|
-
return true;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
Object.assign(IdentifyTextPanel.prototype, {
|
|
241
|
-
/**
|
|
242
|
-
* Flag indicating if targets must be visually marked when the activity begins. In this type of
|
|
243
|
-
* activity should be always `false` to avoid revealing the words o letters that must be found.
|
|
244
|
-
* @name module:activities/text/IdentifyText.IdentifyTextPanel#targetsMarked
|
|
245
|
-
* @type {boolean} */
|
|
246
|
-
targetsMarked: false,
|
|
247
|
-
/**
|
|
248
|
-
* Used to avoid duplicate event processing
|
|
249
|
-
* @name module:activities/text/IdentifyText.IdentifyTextPanel#lastTimeStamp
|
|
250
|
-
* @type {number}
|
|
251
|
-
*/
|
|
252
|
-
lastTimeStamp: 0,
|
|
253
|
-
/**
|
|
254
|
-
* Set of non-target spans currently selected by the player.
|
|
255
|
-
* This attribute should be empty to solve the activity.
|
|
256
|
-
* @name module:activities/text/IdentifyText.IdentifyTextPanel#spansChecked
|
|
257
|
-
* @type {set} */
|
|
258
|
-
spansChecked: new Set(),
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Panel class associated to this type of activity: {@link module:activities/text/IdentifyText.IdentifyTextPanel IdentifyTextPanel}
|
|
263
|
-
* @type {class} */
|
|
264
|
-
IdentifyText.Panel = IdentifyTextPanel;
|
|
265
|
-
|
|
266
|
-
// Register activity class
|
|
267
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_Activity_js__WEBPACK_IMPORTED_MODULE_0__["default"].registerClass('@text.Identify', IdentifyText));
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
/***/ })
|
|
271
|
-
|
|
272
|
-
};
|
|
273
|
-
;
|
|
274
|
-
//# sourceMappingURL=3231.jclic-node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"3231.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;;AAEyC;AACuC;;AAEhF;AACA;AACA;AACA;AACA;AACO,2BAA2B,2EAAgB;AAClD;AACA;AACA,aAAa,0CAA0C;AACvD;AACA;AACA;AACA;AACA;;AAEA;AACA,QAAQ,2FAA2F,OAAO,qEAAqE;AAC/K;AACA;AACA,gCAAgC,gFAAqB;AACrD;AACA;AACA,aAAa,0BAA0B,WAAW,yCAAyC;AAC3F,aAAa,gCAAgC;AAC7C;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,wDAAwD;AACrE,aAAa,iBAAiB;AAC9B;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA,6BAA6B,MAAM,wBAAwB,YAAY;AACvE;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA,kCAAkC,cAAc;AAChD;;AAEA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,gBAAgB;AAC7B,eAAe,SAAS;AACxB,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB;AACA,CAAC;;AAED;AACA,qDAAqD;AACrD,UAAU,OAAO;AACjB;;AAEA;AACA,iEAAe,oDAAQ,8CAA8C,EAAC","sources":["webpack://jclic/./src/activities/text/IdentifyText.js"],"sourcesContent":["/**\n * File : activities/text/Identify.js\n * Created : 20/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 Activity from '../../Activity.js';\nimport { TextActivityBase, TextActivityBasePanel } from './TextActivityBase.js';\n\n/**\n * This type of text activity suggests users to click on specific words or single letters of a\n * given text, without any help on where these elements are placed.\n * @extends module:activities/text/TextActivityBase.TextActivityBase\n */\nexport class IdentifyText extends TextActivityBase {\n /**\n * IdentifyText constructor\n * @param {module:project/JClicProject.JClicProject} project - The project to which this activity belongs\n */\n constructor(project) {\n super(project);\n }\n}\n\n/**\n * The {@link module:activities/text/TextActivityBase.TextActivityBasePanel TextActivityBasePanel} where {@link module:activities/text/IdentifyText.IdentifyText IdentifyText} activities are played.\n * @extends module:activities/text/TextActivityBase.TextActivityBasePanel\n */\nclass IdentifyTextPanel extends TextActivityBasePanel {\n /**\n * IdentifyTextPanel 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 this.spanText = true;\n this.spanChars = act.type === 'identifyChars';\n this.spansChecked = new Set();\n }\n\n /**\n * Creates a target DOM element for the provided target.\n * @override\n * @param {module:activities/text/TextActivityDocument.TextTarget} target - The target related to the DOM object to be created\n * @param {external:jQuery} $span - - An initial DOM object (usually a `span`) that can be used\n * to store the target, or replaced by another type of object.\n * @returns {external:jQuery} - The jQuery DOM element loaded with the target data.\n */\n $createTargetElement(target, $span) {\n super.$createTargetElement(target, $span);\n const idLabel = `target${`000${this.targets.length - 1}`.slice(-3)}`;\n $span.bind('click', event => {\n event.textTarget = target;\n event.idLabel = idLabel;\n this.processEvent(event);\n });\n return $span;\n }\n\n $createSpanElement($span) {\n $span.bind('click', event => {\n event.$spanElement = $span;\n this.processEvent(event);\n });\n return $span;\n }\n\n /**\n * Basic initialization procedure\n * @override\n */\n initActivity() {\n super.initActivity(this);\n this.$div.find('.JClicTextDocument > p').css('cursor', 'pointer');\n this.$div.find('.JClicTextDocument > span').css('cursor', 'pointer');\n // Clean possible previous errors\n this.spansChecked.forEach($spanElement => $spanElement.css($spanElement.initialCSS || this.act.document.style['default'].css));\n this.spansChecked.clear();\n this.playing = true;\n }\n\n /**\n * Counts the number of targets that are solved\n * @returns {number}\n */\n countSolvedTargets() {\n return this.targets.filter(({ targetStatus }) => targetStatus === 'SOLVED').length;\n }\n\n /**\n * Evaluates all the targets in this panel. This method is usually called from the `Check` button.\n * @override\n * @returns {boolean} - `true` when all targets are OK, `false` otherwise.\n */\n evaluatePanel() {\n let targetsOk = 0;\n this.targets.forEach(target => {\n const ok = target.targetStatus === 'SOLVED';\n if (ok)\n targetsOk++;\n target.checkColors();\n this.ps.reportNewAction(this.act, 'SELECT', target.text, target.pos, ok, targetsOk);\n });\n\n\n if (targetsOk === this.targets.length && this.spansChecked.size === 0) {\n this.finishActivity(true);\n return true;\n } else {\n // Mark selected spans as error\n this.spansChecked.forEach($spanElement => $spanElement.css(this.act.document.style['targetError'].css));\n this.playEvent('finishedError');\n }\n return false;\n }\n\n /**\n * Ordinary ending of the activity, usually called form `processEvent`\n * @override\n * @param {boolean} result - `true` if the activity was successfully completed, `false` otherwise\n */\n finishActivity(result) {\n this.$div.find('.JClicTextDocument > p').css('cursor', 'pointer');\n return super.finishActivity(result);\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 (!super.processEvent(event) ||\n event.timeStamp === this.lastTimeStamp)\n return false;\n\n if (event.timeStamp)\n this.lastTimeStamp = event.timeStamp;\n\n const target = event.textTarget;\n const $spanElement = event.$spanElement;\n\n switch (event.type) {\n case 'click':\n let text, pos, ok = false;\n if (target) {\n if (target.targetStatus === 'SOLVED')\n target.targetStatus = 'HIDDEN';\n else {\n target.targetStatus = 'SOLVED';\n ok = true;\n }\n text = target.text;\n pos = target.pos;\n // TODO: Just on/off target colors, don't mark it as error!\n target.checkColors();\n } else {\n if ($spanElement) {\n $spanElement.checked = !$spanElement.checked;\n if ($spanElement.checked) {\n this.spansChecked.add($spanElement);\n $spanElement.css(this.act.document.style.target.css);\n }\n else {\n this.spansChecked.delete($spanElement);\n $spanElement.css($spanElement.initialCSS || this.act.document.style.default.css);\n }\n text = $spanElement.text();\n }\n else\n text = 'unknown';\n pos = 0;\n }\n\n if (!this.$checkButton) {\n // Check and notify action\n const cellsAtPlace = this.countSolvedTargets();\n this.ps.reportNewAction(this.act, 'SELECT', text, pos, ok, cellsAtPlace);\n\n // End activity or play event sound\n if (ok && this.spansChecked.size === 0 && cellsAtPlace === this.targets.length)\n this.finishActivity(true);\n else\n this.playEvent(ok ? 'actionOk' : 'actionError');\n }\n event.preventDefault();\n break;\n\n default:\n break;\n }\n return true;\n }\n}\n\nObject.assign(IdentifyTextPanel.prototype, {\n /**\n * Flag indicating if targets must be visually marked when the activity begins. In this type of\n * activity should be always `false` to avoid revealing the words o letters that must be found.\n * @name module:activities/text/IdentifyText.IdentifyTextPanel#targetsMarked\n * @type {boolean} */\n targetsMarked: false,\n /**\n * Used to avoid duplicate event processing\n * @name module:activities/text/IdentifyText.IdentifyTextPanel#lastTimeStamp\n * @type {number}\n */\n lastTimeStamp: 0,\n /**\n * Set of non-target spans currently selected by the player.\n * This attribute should be empty to solve the activity.\n * @name module:activities/text/IdentifyText.IdentifyTextPanel#spansChecked\n * @type {set} */\n spansChecked: new Set(),\n});\n\n/**\n * Panel class associated to this type of activity: {@link module:activities/text/IdentifyText.IdentifyTextPanel IdentifyTextPanel}\n * @type {class} */\nIdentifyText.Panel = IdentifyTextPanel;\n\n// Register activity class\nexport default Activity.registerClass('@text.Identify', IdentifyText);\n"],"names":[],"sourceRoot":""}
|
package/dist/331.jclic-node.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.id = 331;
|
|
3
|
-
exports.ids = [331];
|
|
4
|
-
exports.modules = {
|
|
5
|
-
|
|
6
|
-
/***/ 331:
|
|
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 GreenSkin */
|
|
13
|
-
/* harmony import */ var _Skin_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(757);
|
|
14
|
-
/* harmony import */ var _DefaultSkin_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1588);
|
|
15
|
-
/**
|
|
16
|
-
* File : skins/GreenSkin.js
|
|
17
|
-
* Created : 04/07/2016
|
|
18
|
-
* By : Francesc Busquets <francesc@gmail.com>
|
|
19
|
-
*
|
|
20
|
-
* JClic.js
|
|
21
|
-
* An HTML5 player of JClic activities
|
|
22
|
-
* https://projectestac.github.io/jclic.js
|
|
23
|
-
*
|
|
24
|
-
* @source https://github.com/projectestac/jclic.js
|
|
25
|
-
*
|
|
26
|
-
* @license EUPL-1.2
|
|
27
|
-
* @licstart
|
|
28
|
-
* (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
|
|
29
|
-
*
|
|
30
|
-
* Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
|
|
31
|
-
* the European Commission- subsequent versions of the EUPL (the "Licence");
|
|
32
|
-
* You may not use this work except in compliance with the Licence.
|
|
33
|
-
*
|
|
34
|
-
* You may obtain a copy of the Licence at:
|
|
35
|
-
* https://joinup.ec.europa.eu/software/page/eupl
|
|
36
|
-
*
|
|
37
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
38
|
-
* distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
|
|
39
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
40
|
-
* Licence for the specific language governing permissions and limitations
|
|
41
|
-
* under the Licence.
|
|
42
|
-
* @licend
|
|
43
|
-
* @module
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* This is a variant of the default {@link module:skins/Skin.Skin Skin} used by JClic.js
|
|
51
|
-
* It differs from {@link module:skins/DefaultSkin.DefaultSkin DefaultSkin} only in some colors
|
|
52
|
-
* @extends module:skins/DefaultSkin.DefaultSkin
|
|
53
|
-
*/
|
|
54
|
-
class GreenSkin extends _DefaultSkin_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
|
|
55
|
-
/**
|
|
56
|
-
* GreenSkin constructor
|
|
57
|
-
*
|
|
58
|
-
* @param {module:JClicPlayer.JClicPlayer} ps - The PlayStation (currently a {@link module:JClicPlayer.JClicPlayer JClicPlayer}) used to load and
|
|
59
|
-
* realize the media objects needed to build this Skin.
|
|
60
|
-
* @param {string} [name] - The skin class name
|
|
61
|
-
* @param {object} [options] - Optional parameter with additional options
|
|
62
|
-
*/
|
|
63
|
-
constructor(ps, name = null, options = {}) {
|
|
64
|
-
// GreenSkin extends [DefaultSkin](DefaultSkin.html)
|
|
65
|
-
super(ps, name, options);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Returns the CSS styles used by this skin. This method should be called only from
|
|
70
|
-
* the `Skin` constructor, and overridded by subclasses if needed.
|
|
71
|
-
* @param {string} media - A specific media size. Possible values are: 'default', 'half' and 'twoThirds'
|
|
72
|
-
* @returns {string}
|
|
73
|
-
*/
|
|
74
|
-
_getStyleSheets(media = 'default') {
|
|
75
|
-
return super._getStyleSheets(media) + (media === 'default' ? this.skinCSS : '');
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
Object.assign(GreenSkin.prototype, {
|
|
80
|
-
/**
|
|
81
|
-
* Class name of this skin. It will be used as a base selector in the definition of all CSS styles.
|
|
82
|
-
* @name module:skins/GreenSkin.GreenSkin#skinId
|
|
83
|
-
* @override
|
|
84
|
-
* @type {string} */
|
|
85
|
-
skinId: 'JClicGreenSkin',
|
|
86
|
-
//
|
|
87
|
-
// Buttons and other graphical resources used by this skin:
|
|
88
|
-
/**
|
|
89
|
-
* Fill color for icons
|
|
90
|
-
* @name module:skins/GreenSkin.GreenSkin#iconFill
|
|
91
|
-
* @override
|
|
92
|
-
* @type {string} */
|
|
93
|
-
iconFill: '#20640E',
|
|
94
|
-
/**
|
|
95
|
-
* Fill-in color for counters
|
|
96
|
-
* @name module:skins/GreenSkin.GreenSkin#counterIconFill
|
|
97
|
-
* @override
|
|
98
|
-
* @type {string} */
|
|
99
|
-
counterIconFill: '#20640E',
|
|
100
|
-
/**
|
|
101
|
-
* Styles used in this skin
|
|
102
|
-
* @name module:skins/GreenSkin.GreenSkin#skinCSS
|
|
103
|
-
* @type {string} */
|
|
104
|
-
skinCSS: '.ID {background-color:#4AFF19;}'
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
// Register this class in the list of available skins
|
|
108
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_Skin_js__WEBPACK_IMPORTED_MODULE_0__["default"].registerClass('green', GreenSkin));
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
/***/ })
|
|
112
|
-
|
|
113
|
-
};
|
|
114
|
-
;
|
|
115
|
-
//# sourceMappingURL=331.jclic-node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"331.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;AACA,qCAAqC,mCAAmC;AACxE,oBAAoB,wDAAwD;AAC5E;AACA;AACO,wBAAwB,uDAAW;AAC1C;AACA;AACA;AACA,aAAa,gCAAgC,mCAAmC,iDAAiD;AACjI;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA,2CAA2C;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB,iBAAiB,0BAA0B;AAC3C,CAAC;;AAED;AACA,iEAAe,gDAAI,kCAAkC,EAAC","sources":["webpack://jclic/./src/skins/GreenSkin.js"],"sourcesContent":["/**\n * File : skins/GreenSkin.js\n * Created : 04/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/**\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} only in some colors\n * @extends module:skins/DefaultSkin.DefaultSkin\n */\nexport class GreenSkin extends DefaultSkin {\n /**\n * GreenSkin 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 needed to build this 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 // GreenSkin extends [DefaultSkin](DefaultSkin.html)\n super(ps, name, options);\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(GreenSkin.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 module:skins/GreenSkin.GreenSkin#skinId\n * @override\n * @type {string} */\n skinId: 'JClicGreenSkin',\n //\n // Buttons and other graphical resources used by this skin:\n /**\n * Fill color for icons\n * @name module:skins/GreenSkin.GreenSkin#iconFill\n * @override\n * @type {string} */\n iconFill: '#20640E',\n /**\n * Fill-in color for counters\n * @name module:skins/GreenSkin.GreenSkin#counterIconFill\n * @override\n * @type {string} */\n counterIconFill: '#20640E',\n /**\n * Styles used in this skin\n * @name module:skins/GreenSkin.GreenSkin#skinCSS\n * @type {string} */\n skinCSS: '.ID {background-color:#4AFF19;}'\n});\n\n// Register this class in the list of available skins\nexport default Skin.registerClass('green', GreenSkin);\n"],"names":[],"sourceRoot":""}
|