PageSourceSearch

https://h5p.org/sites/default/files/h5p/libraries/H5P.MemoryGame-1.3.29/counter.js?the41y

js h5p.org collected 2026-10-01 07:29:59 UTC 900 bytes, 49 lines download raw bytes

1(function (MemoryGame) {
2
3  /**
4   * Keeps track of the number of cards that has been turned
5   *
6   * @class H5P.MemoryGame.Counter
7   * @param {H5P.jQuery} $container
8   */
9  MemoryGame.Counter = function ($container, startValue = 0) {
10    /** @alias H5P.MemoryGame.Counter# */
11    var self = this;
12
13    var current = startValue;
14
15    /**
16     * @private
17     */
18    self.update = function () {
19      $container[0].innerText = current;
20    };
21
22    /**
23     * Get current count.
24     * @returns {number} Current count.
25     */
26    self.getCount = () => {
27      return current;
28    }
29
30    /**
31     * Increment the counter.
32     */
33    self.increment = function () {
34      current++;
35      self.update();
36    };
37
38    /**
39     * Revert counter back to its natural state
40     */
41    self.reset = function () {
42      current = 0;
43      self.update();
44    };
45
46    self.update();
47  };
48
49})(H5P.MemoryGame);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.