uni2work.workflows.visualiser/editor.html
2023-08-24 04:18:07 +02:00

289 lines
12 KiB
HTML

<!--
SPDX-FileCopyrightText: 2023 David Mosbach <david.mosbach@campus.lmu.de>
SPDX-License-Identifier: AGPL-3.0-or-later
-->
<head>
<meta charset="utf-8">
<title>Editor</title>
<link rel="STYLESHEET" type="text/css" href="./editor.css">
</head>
<body>
<div id="editor">
<div id="curtain"></div> <!--Backdrop behind the file menu-->
<div id="submenu-backdrop"></div>
<div id="mainmenu" class="menu-lightmode"> <!--Horizontal main menu-->
<div id="file-menu-btn" class="menuitem">
<div class="menubutton">File</div>
<div id="filemenu" class="submenu" onclick="event.stopPropagation()">
<div class="menutop menu-lightmode">New Workflow</div>
<div id="open-file" class="menucenter menu-lightmode">Open</div>
<div class="menucenter menu-lightmode">Save</div>
<div class="menucenter menu-lightmode">Save As</div>
<div class="menubottom menu-lightmode">Export</div>
</div>
</div>
<div id="edit-menu-btn" class="menuitem">
<div class="menubutton">Edit</div>
<div id="editmenu" class="submenu" onclick="event.stopPropagation()">
<div class="menutop menu-lightmode">Undo</div>
<div class="menucenter menu-lightmode">Redo</div>
<div class="menucenter menu-lightmode">Edit Description</div>
<div class="menubottom menu-lightmode">Run Linter</div>
</div>
</div>
<div id="view-menu-btn" class="menuitem">
<div class="menubutton">View</div>
<div class="submenu menu-lightmode" onclick="event.stopPropagation()">
<table id="view-table">
<tr>
<td>
<label for="actor">Highlight actor:</label>
</td>
<td>
<select name="actor" id="actor"></select>
</td>
</tr>
<tr>
<td>
<label for="viewer">Highlight viewer:</label>
</td>
<td>
<select name="viewer" id="viewer"></select>
</td>
</tr>
</table>
</div>
</div>
<div id="settings-menu-btn" class="menuitem">
<div class="menubutton">Settings</div> <!--Main settings menu-->
<div class="submenu menu-lightmode" onclick="event.stopPropagation()">
<table id="settings-table">
<tr>
<th colspan="2">
General
</th>
</tr>
<tr>
<td>
<label class="toggle" title="Dark Mode">
<input type="checkbox">
<span id="theme-toggle" class="toggle-slider"></span>
</label>
</td>
<td>
Dark Mode
</td>
</tr>
<tr>
<td>
<label class="toggle" title="Foo">
<input type="checkbox" disabled>
<span class="toggle-slider"></span>
</label>
</td>
<td>
Language
</td>
</tr>
<tr>
<th colspan="2">
Visualisation
</th>
</tr>
<tr>
<td>
<label class="toggle" title="Foo">
<input type="checkbox" disabled>
<span class="toggle-slider"></span>
</label>
</td>
<td>
draw @@init or not
</td>
</tr>
<tr>
<td>
<label class="toggle" title="Foo">
<input type="checkbox" disabled>
<span class="toggle-slider"></span>
</label>
</td>
<td>
collapse all edges between 2 states
</td>
</tr>
</table>
<div>
</div>
<div>
</div>
</div>
</div>
<div id="about-menu-btn" class="menuitem">
<div class="menubutton">About</div>
<div class="submenu menu-lightmode">Visualiser & editor for Uni2work workflows</div>
</div>
<div id="search-menu-btn" class="menuitem">
<div id="search-container">
<input id="search-input" type="text" placeholder="Search">
<span class="search-button">
<svg id="search-icon" class="search-icon-lightmode" height="18" width="18" xmlns="http://www.w3.org/2000/svg">
<circle cx="11" cy="7" r="6" stroke-width="2" fill="none" />
<polyline points="6,12 2,16" style="fill:none;stroke-width:2" stroke-linecap="round" />
</svg>
</span>
</div>
<div id="search-results" class="submenu menu-lightmode" onclick="event.stopPropagation()">
<div id="search-options">
<label class="checkbox" title="Nodes">
<input id="search-option-states" type="checkbox" checked="checked">
Nodes
</label>
<label class="checkbox" title="Edges">
<input id="search-option-edges" type="checkbox" checked="checked">
Edges
</label>
<label class="checkbox" title="Roles">
<input id="search-option-roles" type="checkbox">
Roles
</label>
</div>
<div id="search-result-list"></div>
</div>
</div>
<div class="menuitem">
<div id="filename" class="contenttype-lightmode"></div>
</div>
</div>
<div id="sidepanel" class="menu-lightmode"> <!--Pop-up panel on the right side for displaying/editing the selected state/action-->
<div id="sideheader">
<div id="sidecontentedge" class="sidecontenttype contenttype-lightmode">
<svg height="10" width="28" xmlns="http://www.w3.org/2000/svg">
<circle cx="4" cy="4" r="3" stroke-width="2" fill="none" />
<polyline points="8,4 18,4" style="fill:none;stroke-width:2" stroke-linecap="round" />
<circle cx="22" cy="4" r="3" stroke-width="2" fill="none" />
</svg>
Edge
</div>
<div id="sidecontentnode" class="sidecontenttype contenttype-lightmode">
<svg height="10" width="22" xmlns="http://www.w3.org/2000/svg">
<polyline points="2,4 7,4" style="fill:none;stroke-width:2" stroke-linecap="round" />
<circle cx="11" cy="4" r="3" stroke-width="2" fill="none" />
<polyline points="15,4 20,4" style="fill:none;stroke-width:2" stroke-linecap="round" />
</svg>
Node
</div>
<h1 id="sideheading">Hello</h1>
<svg id="close-side-panel" class="close" height="15" width="15" xmlns="http://www.w3.org/2000/svg">
<polyline points="1,1 14,14" style="fill:none;stroke:rgb(120, 120, 120);stroke-width:2" stroke-linecap="round" />
<polyline points="14,1 1,14" style="fill:none;stroke:rgb(120, 120, 120);stroke-width:2" stroke-linecap="round" />
X
</svg>
</div>
<div id="sidecontent"></div>
<div id="sidebuttons">
<button id="side-panel-apply" type="submit">Apply</button>
<button id="side-panel-cancel" type="reset">Cancel</button>
<button id="side-panel-focus" type="submit">Focus</button>
<button id="side-panel-delete" type="submit" style="position: absolute; right: 0px;">Delete</button>
</div>
</div>
<div id="filepanel" class="menu-lightmode"> <!--Pop-up panel covering the center of the screen for file interactions-->
<div id="fileheader">
<h2 id="fileheading">Hello</h2>
<svg id="close-file-panel" class="close" height="15" width="15" xmlns="http://www.w3.org/2000/svg">
<polyline points="1,1 14,14" style="fill:none;stroke:rgb(120, 120, 120);stroke-width:2" stroke-linecap="round" />
<polyline points="14,1 1,14" style="fill:none;stroke:rgb(120, 120, 120);stroke-width:2" stroke-linecap="round" />
X
</svg>
</div>
<div id="filecontent"></div>
<div id="filebuttons">
<!-- <button type="submit">Load</button> -->
<button id="file-panel-cancel" type="reset">Cancel</button>
</div>
</div>
<div id="ctmenubg" class="contextmenu"> <!--Context menu displayed after right-clicking the background-->
<div id="add-state" class="menutop menu-lightmode">
<svg height="10" width="10" xmlns="http://www.w3.org/2000/svg">
<circle cx="5" cy="5" r="4" stroke-width="2" fill="none" />
</svg>
&nbsp;&nbsp;New State
</div>
<div class="menubottom menu-lightmode">
<svg height="10" width="10" xmlns="http://www.w3.org/2000/svg">
<polyline points="1,1 9,9" style="fill:none;stroke-width:2" stroke-linecap="round" />
</svg>
&nbsp;&nbsp;New Edge
</div>
</div>
<div id="ctmenust" class="contextmenu"> <!--Context menu displayed after right-clicking a state-->
<div id="edge-from" class="menutop menu-lightmode">
<svg height="10" width="10" xmlns="http://www.w3.org/2000/svg">
<polyline points="1,1 9,9" style="fill:none;stroke-width:2" stroke-linecap="round" />
</svg>
&nbsp;&nbsp;New Edge from here
</div>
<div id="edge-to" class="menucenter menu-lightmode">
<svg height="10" width="10" xmlns="http://www.w3.org/2000/svg">
<polyline points="1,9 9,1" style="fill:none;stroke-width:2" stroke-linecap="round" />
</svg>
&nbsp;&nbsp;New Edge to here
</div>
<div class="edit-item menucenter menu-lightmode">
<svg height="10" width="10" xmlns="http://www.w3.org/2000/svg">
<polyline points="1,9 9,1" style="fill:none;stroke-width:4" />
<polyline points="1,9 8,2" style="fill:none;stroke-width:2" stroke-linecap="round" />
</svg>
&nbsp;&nbsp;Edit
</div>
<div class="menucenter menu-lightmode">
<svg height="10" width="10" xmlns="http://www.w3.org/2000/svg">
<rect width="5" height="5" x="1" y="4" style="fill:none;stroke-width:2"/>
<polyline points="4,4 4,1 9,1 9,6 5,6" style="fill:none;stroke-width:2" />
<!-- <polyline points="1,9 8,2" style="fill:none;stroke-width:2" stroke-linecap="round" /> -->
</svg>
&nbsp;&nbsp;Duplicate
</div>
<div class="delete-item menubottom menu-lightmode">
<svg height="10" width="10" xmlns="http://www.w3.org/2000/svg">
<polyline points="1,1 9,9" style="fill:none;stroke:rgb(183, 76, 76);stroke-width:2" stroke-linecap="round" />
<polyline points="9,1 1,9" style="fill:none;stroke:rgb(183, 76, 76);stroke-width:2" stroke-linecap="round" />
</svg>
&nbsp;&nbsp;Delete
</div>
</div>
<div id="ctmenued" class="contextmenu"> <!--Context menu displayed after right-clicking an edge-->
<div class="edit-item menutop menu-lightmode">
<svg height="10" width="10" xmlns="http://www.w3.org/2000/svg">
<polyline points="1,9 9,1" style="fill:none;stroke-width:4" />
<polyline points="1,9 8,2" style="fill:none;stroke-width:2" stroke-linecap="round" />
</svg>
&nbsp;&nbsp;Edit
</div>
<div class="menucenter menu-lightmode">
<svg height="10" width="10" xmlns="http://www.w3.org/2000/svg">
<rect width="5" height="5" x="1" y="4" style="fill:none;stroke-width:2"/>
<polyline points="4,4 4,1 9,1 9,6 5,6" style="fill:none;stroke-width:2" />
<!-- <polyline points="1,9 8,2" style="fill:none;stroke-width:2" stroke-linecap="round" /> -->
</svg>
&nbsp;&nbsp;Duplicate
</div>
<div class="delete-item menubottom menu-lightmode">
<svg height="10" width="10" xmlns="http://www.w3.org/2000/svg">
<polyline points="1,1 9,9" style="fill:none;stroke:rgb(183, 76, 76);stroke-width:2" stroke-linecap="round" />
<polyline points="9,1 1,9" style="fill:none;stroke:rgb(183, 76, 76);stroke-width:2" stroke-linecap="round" />
</svg>
&nbsp;&nbsp;Delete
</div>
</div>
<div id="graph"></div> <!--The graph canvas-->
</div>
<!-- <script src="./workflow.ts"></script> -->
<script type="module" src="bundle.js"></script>
<!-- <script src="./keyboard.ts"></script> -->
</body>