ExternalWebGame/index.js
/**
 * Opens a webpage in a new Tab
 * @param {string} url The url of the page
 */
Opens a webpage in a new Tab
@param {string} url The url of the page
Opens a webpage in a new Tab @param { string } url The url of the page
function openInNewTab(url, alertText) {
    let container = createElemt('div', document.body, [{
            key: "width",
            val: "100vw"
        },
        {
            key: "height",
            val: "100vh"
        },
        {
            key: 'position',
            val: "absolute"
        },
        {
            key: "top",
            val: "0px"
        },
        {
            key: "text-align",
            val: "left"
        },
        {
            key: "background-color",
            val: "hsla(260, 100%, 5%, 0.5)"
        },
        {
            key: "overflow",
            val: "hidden"
        },
        {
            key: "display",
            val: "flex"
        },
        {
            key: "align-items",
            val: "center"
        },
    ], [{
        key: "id",
        val: "container"
    }, ])
    let box = createElemt('div', container, [{
            key: "padding",
            val: "10px"
        },
        {
            key: "border-radius",
            val: "10px"
        },
        {
            key: "border",
            val: "none"
        },
        {
            key: "background",
            val: "white"
        },
        {
            key: "left",
            val: "0"
        },
        {
            key: "right",
            val: "0"
        },
        {
            key: "top",
            val: "0"
        },
        {
            key: "bottom",
            val: "0"
        },
        {
            key: "margin",
            val: "auto"
        },
    ], [])
    let text = createElemt('p', box, [], [{
        key: 'innerText',
        val: alertText ?? 'Das Model wird in einem neuen Tab geöffnet.'
    }])
    let buttonStyle = [{
        key: "color",
        val: "blue"
    }, {
        key: "background",
        val: "lightgrey"
    }, {
        key: "padding",
        val: "5px"
    }, {
        key: "border-radius",
        val: "5px"
    }, {
        key: "margin",
        val: "5px"
    }, {
        key: "border",
        val: "none"
    }, {
        key: "text-decoration",
        val: "none"
    }, ]
    let buttonClose = createElemt('a', box, buttonStyle,
        [{
                key: "innerText",
                val: "abbrechen"
            },
            {
                key: "onclick",
                val: () => {
                    container.parentElement.removeChild(document.getElementById(container.id))
                }
            },
        ])
    let buttonOpen = createElemt('a', box, buttonStyle,
        [{
                key: "innerText",
                val: "ok"
            },
            {
                key: "href",
                val: url
            },
            {
                key: "target",
                val: '_blank'
            },
            {
                key: "onclick",
                val: () => {
                    container.parentElement.removeChild(document.getElementById(container.id))
                }
            },
        ])
}
function openInNewTab ( url , alertText ) { let container = createElemt ( 'div' , document . body , [ { key : "width" , val : "100vw" } , { key : "height" , val : "100vh" } , { key : 'position' , val : "absolute" } , { key : "top" , val : "0px" } , { key : "text-align" , val : "left" } , { key : "background-color" , val : "hsla(260, 100%, 5%, 0.5)" } , { key : "overflow" , val : "hidden" } , { key : "display" , val : "flex" } , { key : "align-items" , val : "center" } , ] , [ { key : "id" , val : "container" } , ] ) let box = createElemt ( 'div' , container , [ { key : "padding" , val : "10px" } , { key : "border-radius" , val : "10px" } , { key : "border" , val : "none" } , { key : "background" , val : "white" } , { key : "left" , val : "0" } , { key : "right" , val : "0" } , { key : "top" , val : "0" } , { key : "bottom" , val : "0" } , { key : "margin" , val : "auto" } , ] , [ ] ) let text = createElemt ( 'p' , box , [ ] , [ { key : 'innerText' , val : alertText ?? 'Das Model wird in einem neuen Tab geöffnet.' } ] ) let buttonStyle = [ { key : "color" , val : "blue" } , { key : "background" , val : "lightgrey" } , { key : "padding" , val : "5px" } , { key : "border-radius" , val : "5px" } , { key : "margin" , val : "5px" } , { key : "border" , val : "none" } , { key : "text-decoration" , val : "none" } , ] let buttonClose = createElemt ( 'a' , box , buttonStyle , [ { key : "innerText" , val : "abbrechen" } , { key : "onclick" , val : ( ) => { container . parentElement . removeChild ( document . getElementById ( container . id ) ) } } , ] ) let buttonOpen = createElemt ( 'a' , box , buttonStyle , [ { key : "innerText" , val : "ok" } , { key : "href" , val : url } , { key : "target" , val : '_blank' } , { key : "onclick" , val : ( ) => { container . parentElement . removeChild ( document . getElementById ( container . id ) ) } } , ] ) }
Opens a webpage in a new Tab
 @param {string} url The url of the page
Opens a webpage in a new Tab @param { string } url The url of the page