PageSourceSearch

https://ball-labyrinth-game.web.app/js/commons/methods.js

js ball-labyrinth-game.web.app collected 2026-10-03 12:17:33 UTC 1,170 bytes, 55 lines download raw bytes

1function getCell(row, col) {
2    return get("cell-" + row + "-" + col);
3}
4
5function get(id) {
6    return document.getElementById(id);
7}
8
9function rm(id) {
10    var itm = get(id);
11    if (itm) itm.remove();
12}
13
14function fireEvent(evt, details) {
15    var event = new CustomEvent(
16        evt,
17        {
18            detail: details,
19            bubbles: true,
20            cancelable: true
21        }
22    );
23
24    window.dispatchEvent(event);
25
26    app && app.log('fireEvent(' + evt + ', ' + JSON.stringify(details) + ')')
27}
28
29function uuid() {
30  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
31    var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
32    return v.toString(16);
33  });
34}
35
36function clone(obj) {
37    return JSON.parse(JSON.stringify(obj))
38}
39
40function seconds() {
41    return new Date().getTime() / 1000;
42}
43
44function round(number, precise=2) {
45    let n = Math.pow(10, precise)
46    return Math.round(number * n) / n
47}
48
49function wait(ms){
50    var start = new Date().getTime();
51    var end = start;
52    while(end < start + ms) {
53        end = new Date().getTime();
54    }
55}

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.