PageSourceSearch

https://ilias.phnmsbern.ch/Services/COPage/PC/InteractiveImage/js/editor/src/shape-edit/poly.js

js phnmsbern.ch collected 2026-09-24 12:50:30 UTC 1,508 bytes, 65 lines download raw bytes

1
2/**
3 * This file is part of ILIAS, a powerful learning management system
4 * published by ILIAS open source e-Learning e.V.
5 *
6 * ILIAS is licensed with the GPL-3.0,
7 * see https://www.gnu.org/licenses/gpl-3.0.en.html
8 * You should have received a copy of said license along with the
9 * source code, too.
10 *
11 * If this is not the case or you just want to try ILIAS, you'll find
12 * us at:
13 * https://www.ilias.de
14 * https://github.com/ILIAS-eLearning
15 *
16 *********************************************************************/
17
18import Shape from "./shape.js";
19
20/**
21 * Poly
22 */
23export default class Poly extends Shape {
24
25    constructor(data = {}) {
26        super([], data);
27    }
28
29    /**
30     * @return Handle
31     */
32    addHandle(h) {
33        return this.handles.push(h);
34    }
35
36    addToSvg(svg) {
37        let p = this.createSvgElement("polygon");
38        let points = "";
39        this.handles.forEach((h) => {
40            points = points + h.getX() + "," + h.getY() + " ";
41        });
42        p = svg.appendChild(p);
43        p.setAttribute("points", points);
44        //p.id = this.getElementId(nr);
45        this.addDataAttributes(p);
46        this.setStyle(p);
47        return p;
48    }
49
50    getAreaCoordsString() {
51        let cstr = "";
52        this.handles.forEach((h) => {
53            if (cstr != "") {
54                cstr = cstr + ",";
55            }
56            cstr = cstr + h.getX() + "," + h.getY();
57        });
58        return cstr;
59    }
60
61    getAreaShapeString() {
62        return "poly";
63    }
64
65}

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.