<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Designer.aspx.cs" Inherits="eDocument.Server.Administrator.edoc_designer.Designer" MasterPageFile="~/Site.Designer.Master" %>

<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <meta charset="utf-8"/>
    <link rel="icon" href="../ui/dasset/favicon.ico"/>
    <meta name="viewport" content="width=device-width,initial-scale=1"/>
    <meta name="theme-color" content="#680094"/>
    <meta name="description" content="Verktøy for å lage skjemaer"/>
    <link rel="apple-touch-icon" href="../ui/dasset/logo192.png"/>
    <link rel="manifest" href="../ui/dasset/manifest.json"/>
    <title>Skjemadesigner</title>
    
    <script defer="defer" src='<%= GetJsUrl() ?? "../ui/dasset/static/js/main.7af6f103.js" %>'></script>
    <link href='<%= GetCssUrl() ?? "../ui/dasset/static/css/main.2da19e40.css" %>' rel="stylesheet">

    <style>
        #root {
            height:100%;
            padding-bottom:40px;
        }
    </style>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <!--
        hello '<%= CustomerUsername %>'
        id  <%= CurrentAdministratorId %>
        apiUrl '<%= ApiUrl %>'
        hostUrl '<%= HostUrl %>' 
    -->

    <script>
        //Redirect to new designer-editor page
        if (typeof window !== "undefined") {
            let newEditorUrl = "<%= ResolveUrl("~") %>page/designer/editor";
            const params = (location.href || '').split('?')?.[1] || '';
            newEditorUrl += '?' + params;

            //Redirect if testparameter is not set.
            location.href = newEditorUrl;
        }
    </script>

    <noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="designer_editor" 
        data-api-url="<%= ApiUrl %>/<%= CustomerUsername %>/designer" 
        data-userid="<%= CurrentAdministratorId %>" 
        data-logouturl="../User/LogOut.aspx"
        data-keepaliveurl="/keepalive.aspx"
        data-timeout="20">
    </div>

    
    <!--<script src="http://192.168.1.19:3000/static/js/bundle.js"></script>-->
    <!--<script src="http://10.60.107.105:3000/static/js/bundle.js"></script>-->
   
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="Message" runat="server">
    <div id="divNoLicense" runat="server" style="border: 2px; border-style: solid; border-color: red">
        OBS: organisasjonen har ikke lisens for bruk av designer. 
    </div>
</asp:Content>
