HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/RMourik/bassol.nl/CMS/CMSModules/Workflows/Controls/Scripts/StandardNode.js
var JsPlumbStandardNode = $class({

    Extends: JsPlumbAbstractNode,

    constructor: function (readOnly, graph, definition) {
        JsPlumbAbstractNode.call(this, readOnly, graph, definition);

        this.everySideAnchors = [[0.5, 0, 0, -1], [0.5, 1, 0, 1], [0, 0.5, -1, 0], [1, 0.5, 1, 0]];
        this.everySideFakeAnchors = [   
                                        [0.1, 0, 0, -1], [0.1, 1, 0, 1], [0, 0.1, -1, 0], [1, 0.1, 1, 0],
                                        [0.3, 0, 0, -1], [0.3, 1, 0, 1], [0, 0.3, -1, 0], [1, 0.3, 1, 0],
                                        [0.5, 0, 0, -1], [0.5, 1, 0, 1], [0, 0.5, -1, 0], [1, 0.5, 1, 0],
                                        [0.7, 0, 0, -1], [0.7, 1, 0, 1], [0, 0.7, -1, 0], [1, 0.7, 1, 0],
                                        [0.9, 0, 0, -1], [0.9, 1, 0, 1], [0, 0.9, -1, 0], [1, 0.9, 1, 0]
                                    ];

        //Fake endpoint definitions are used instead of actual target point
        //You can specify better anchors and prevents changing position of selected connection
        this.fakeEndpointDefinition = {
            dynamicAnchors: this.everySideFakeAnchors,
            isSource: false,
            isTarget: true,
            reattach: true,
            endpoint: ["Blank"]
        };

        this.standardSourcePointTemplate = {
            anchor: "BottomRight",
            attachedAnchors: this.everySideAnchors,
            endpoint: ["Image", { url: this.graph.addresses["ImagesUrl"] + "/endpoint_standard.png"}],
            endpointSelected: ["Image", { url: this.graph.addresses["ImagesUrl"] + "/endpoint_standard_selected.png"}],
            tooltip: graph.getReadOnlyResourceString("SourcepointStandardTooltip"),
            reattachHelperTooltip: graph.getReadOnlyResourceString("ReattachHelperTooltip"),
            isSource: true,
            isTarget: true,
            reattach: true,
            maxConnections: 1,
            dragOptions: { disabled: this.readOnly }
        };

        this.timeoutSourcePointTemplate = {
            anchor: "BottomCenter",
            endpoint: ["Image", { url: this.graph.addresses["ImagesUrl"] + "/endpoint_timeout.png"}],
            endpointSelected: ["Image", { url: this.graph.addresses["ImagesUrl"] + "/endpoint_standard_selected.png"}],
            tooltip: graph.getReadOnlyResourceString("SourcepointTimeoutTooltip"),
            reattachHelperTooltip: graph.getReadOnlyResourceString("ReattachHelperTooltip"),
            isSource: true,
            isTarget: true,
            reattach: true,
            maxConnections: 1,
            dragOptions: { disabled: this.readOnly },
            connectorStyle: { lineWidth: 2, strokeStyle: '#bdbbbb' }
        };

        //Redefinition of standard templates
        this.sourcePointTemplates = {
            standard: this.standardSourcePointTemplate,
            timeout: this.timeoutSourcePointTemplate
        };

        this.targetPointTemplate = {
            anchor: "Center",
            endpoint: ["Blank"],
            isSource: false,
            isTarget: true,
            reattach: true,
            maxConnections: -1,
            fakeEndpointDefinition: this.fakeEndpointDefinition
        };

        this.connectionTemplate = { lineWidth: 2, strokeStyle: '#1175ae' };
    },


    /*
    *   Sets node to be have timeout properties
    */
    setTimeoutProperties: function () {
        this.standardSourcePointTemplate.dynamicAnchors = [[0.5, 0, 0, -1], [0, 0.5, -1, 0], [1, 0.5, 1, 0]];
        this.standardSourcePointTemplate.attachedAnchors = undefined;
    },


    /*
    *   Removes timeout properties of node.
    */
    removeTimeoutProperties: function () {
        this.standardSourcePointTemplate.dynamicAnchors = undefined;
        this.standardSourcePointTemplate.attachedAnchors = this.everySideAnchors;
    }
});