[mod] tidy
This commit is contained in:
parent
ebcb1b2c57
commit
afe98e48e2
10 changed files with 2561 additions and 2595 deletions
|
|
@ -13,7 +13,7 @@ services:
|
|||
- ./webapp/custom:/srv/basex/lib/custom:ro # jars
|
||||
- ./webapp/lsp:/srv/basex/webapp/lsp
|
||||
- ./webapp/static/clients:/srv/basex/webapp/static/clients:ro
|
||||
- webawesome-3.2.1:/srv/basex/webapp/static/webawesome:ro
|
||||
- webawesome:/srv/basex/webapp/static/webawesome:ro
|
||||
- ./webapp/lsp-manager:/srv/basex/webapp/lsp-manager
|
||||
# - ./repo:/srv/basex/repo
|
||||
environment:
|
||||
|
|
@ -22,5 +22,6 @@ services:
|
|||
|
||||
volumes:
|
||||
basex-lsp:
|
||||
webawesome-3.2.1:
|
||||
webawesome:
|
||||
external: true
|
||||
name: webawesome-3.2.1
|
||||
|
|
|
|||
68
webapp/lsp/storex.xqm
Normal file
68
webapp/lsp/storex.xqm
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
(:~
|
||||
Manage a store for websocket info.It is named as the websocket $sid
|
||||
:)
|
||||
module namespace storex = 'storex';
|
||||
|
||||
(: cache has index :)
|
||||
declare variable $storex:rules:={
|
||||
"doc":{
|
||||
"description":"A text document"
|
||||
},
|
||||
|
||||
"parse":{
|
||||
"description":"XML parse tree" ,
|
||||
"depends":"text",
|
||||
"calc": "xqparse"
|
||||
},
|
||||
|
||||
"symbols":{
|
||||
"description":"LSP symbols",
|
||||
"depends":"parse",
|
||||
"calc": "symbols"
|
||||
}
|
||||
|
||||
};
|
||||
(:~ in store $sid, and key $uri get value of $property :)
|
||||
declare function storex:get($uri as xs:string,$sid as xs:string,$property as xs:string)
|
||||
{
|
||||
let $id:=storex:id($uri,$sid )
|
||||
let $property:=storex:property($property)
|
||||
return store:get($property || $id,$sid)
|
||||
otherwise error(xs:QName("storex:get"),`property unknown: '{$property}'`)
|
||||
};
|
||||
|
||||
(:~ get value of $property :)
|
||||
declare function storex:put($uri as xs:string,
|
||||
$sid as xs:string,
|
||||
$property as xs:string,
|
||||
$value as item())
|
||||
{
|
||||
let $id:=storex:id($uri,$sid ,true() )
|
||||
let $property:=storex:property($property)
|
||||
return store:put($property || $id,$value,$sid)
|
||||
};
|
||||
|
||||
(:~ key for $sid and $uri, error if not found unless $add.
|
||||
if $add then add entry for uri
|
||||
:)
|
||||
declare function storex:id($uri as xs:string,$sid as xs:string,$add as xs:boolean:=false())
|
||||
{
|
||||
let $index:=store:get-or-put("index",fn(){{}},$sid)
|
||||
return if(map:contains($index,$uri))
|
||||
then $index?uri
|
||||
else if($add)
|
||||
then let $id:=random:uuid()
|
||||
return ($id,store:put("index",map:put($index,$uri,$id),$sid))
|
||||
else error(xs:QName("storex:get"),`Uri not found: '{$uri}'`)
|
||||
};
|
||||
|
||||
(:~ key for $sid and $uri, error if not found unless $add.
|
||||
if $add then add entry for uri
|
||||
:)
|
||||
declare function storex:property($property as xs:string)
|
||||
as xs:string
|
||||
{
|
||||
if(map:contains($storex:rules,$property))
|
||||
then $property
|
||||
else error(xs:QName("storex:get"),`property not in rules: '{$property}'`)
|
||||
};
|
||||
|
|
@ -71,9 +71,9 @@
|
|||
<div class="details-container">
|
||||
<div class="details-wrapper">
|
||||
<wa-details id="workspacePanel" open="open" icon-placement="start">
|
||||
<div slot="summary">
|
||||
WORKSPACE
|
||||
<wa-dropdown id="workspaceOptions" style="display:inline-block;float:right;">
|
||||
<div slot="summary" class="wa-split">
|
||||
<div>WORKSPACE</div>
|
||||
<wa-dropdown id="workspaceOptions">
|
||||
<wa-icon id="workspaceTrigger" library="tabler" name="dots-vertical" slot="trigger"></wa-icon>
|
||||
<wa-dropdown-item type="checkbox" value="canvas" checked>Follow cursor</wa-dropdown-item>
|
||||
|
||||
|
|
@ -92,8 +92,9 @@
|
|||
</wa-details>
|
||||
|
||||
<wa-details id="symPanel" open icon-placement="start">
|
||||
<div slot="summary">OUTLINE
|
||||
<wa-dropdown id="symOptions" style="float:right;">
|
||||
<div slot="summary" class="wa-split">
|
||||
<div>OUTLINE</div>
|
||||
<wa-dropdown id="symOptions">
|
||||
<wa-icon id="symTrigger" library="tabler" name="dots-vertical" slot="trigger"></wa-icon>
|
||||
<wa-dropdown-item type="checkbox" value="canvas" checked>Follow cursor</wa-dropdown-item>
|
||||
|
||||
|
|
@ -103,14 +104,24 @@
|
|||
<wa-dropdown-item type="checkbox" value="name">sort by: Name</wa-dropdown-item>
|
||||
<wa-dropdown-item type="checkbox" value="category">sort by: Category</wa-dropdown-item>
|
||||
</wa-dropdown>
|
||||
</summary>
|
||||
<qd-list id="symList" style="flex-grow:1;"></qd-list>
|
||||
</div>
|
||||
<qd-list id="symList" style="flex-grow:1;"></qd-list>
|
||||
|
||||
</wa-details>
|
||||
|
||||
<wa-details id="msgPanel" icon-placement="start">
|
||||
<div slot="summary">MESSAGES
|
||||
<i id="msgIcon" class='codicon codicon-kebab-vertical' style="float:right"></i>
|
||||
<wa-details id="msgPanel" icon-placement="start">
|
||||
<div slot="summary" class="wa-split">
|
||||
<div>MESSAGES</div>
|
||||
<wa-dropdown id="symOptions">
|
||||
<wa-icon id="symTrigger" library="tabler" name="dots-vertical" slot="trigger"></wa-icon>
|
||||
<wa-dropdown-item type="checkbox" value="canvas" checked>Follow cursor</wa-dropdown-item>
|
||||
|
||||
<wa-divider></wa-divider>
|
||||
<wa-dropdown-item type="checkbox" value="position" checked>sort by:
|
||||
Position</wa-dropdown-item>
|
||||
<wa-dropdown-item type="checkbox" value="name">sort by: Name</wa-dropdown-item>
|
||||
<wa-dropdown-item type="checkbox" value="category">sort by: Category</wa-dropdown-item>
|
||||
</wa-dropdown>
|
||||
</div>
|
||||
<qd-list id="msgList" style="flex-grow:1;"></qd-list>
|
||||
</wa-details>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
|
@ -132,6 +132,22 @@ $("popUrl").onsubmit = e => {
|
|||
};
|
||||
$("bnDebug").onclick = e => { debugger; };
|
||||
|
||||
// details dropdown menu
|
||||
function evth(e) {
|
||||
console.log("s h", e);
|
||||
if(e.srcElement.nodeName ==="WA-DROPDOWN") {
|
||||
e.stopPropagation();
|
||||
}
|
||||
//if(e.srcElement)
|
||||
//e.preventDefault();
|
||||
};
|
||||
document.querySelectorAll("div.details-wrapper wa-details")
|
||||
.forEach(item => {
|
||||
item.addEventListener('wa-hide', evth);
|
||||
item.addEventListener('wa-show', evth);
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("bConnect").addEventListener('click', e => {
|
||||
e.preventDefault();
|
||||
|
|
@ -142,7 +158,7 @@ $("samples").addEventListener('wa-selection-change', e => {
|
|||
const sel = e.detail.selection;
|
||||
const href = sel[0].getAttribute("data-href")
|
||||
if (!href) return;
|
||||
const input=$("popUrl").querySelector('input[name="url"]');
|
||||
const input = $("popUrl").querySelector('input[name="url"]');
|
||||
input.value = href;
|
||||
//input.setCustomValidity('');
|
||||
});
|
||||
|
|
@ -169,7 +185,7 @@ function connect() {
|
|||
const file = $("iFile").value;
|
||||
lsp.simpleWebSocketTransport(server)
|
||||
.then(transport => {
|
||||
transport.socket.onclose = (event) => connectState(server,false);
|
||||
transport.socket.onclose = (event) => connectState(server, false);
|
||||
transport.socket.oneror = (event) => $("msg").innerText = "sock error!";
|
||||
transport.subscribe(incoming);
|
||||
client = new lsp.LSPClient({ extensions: lsp.languageServerExtensions() });
|
||||
|
|
@ -196,7 +212,7 @@ function connect() {
|
|||
function connectState(server, bConn) {
|
||||
$("bConnect").setAttribute("variant", bConn ? "success" : "danger")
|
||||
$("tipConnect").innerText = bConn ? server : "Not connected";
|
||||
$("bConnect").querySelector('wa-icon').setAttribute("name", bConn ? "network" : "network-off");
|
||||
$("bConnect").querySelector('wa-icon').setAttribute("name", bConn ? "network" : "network-off");
|
||||
};
|
||||
|
||||
// change active doc
|
||||
|
|
|
|||
|
|
@ -1,340 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en" class="wa-cloak wa-theme-default wa-palette-default wa-brand-blue wa-light">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Codemirror6 example using BaseX LSP</title>
|
||||
|
||||
<link rel="stylesheet" href="../../webawesome/dist-cdn/styles/webawesome.css" />
|
||||
<link rel="icon" type="image/png" href="../favicon.png" />
|
||||
|
||||
<link rel="stylesheet" href="wa.css" />
|
||||
<script type="module" src="wa-setup.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="page-wrap">
|
||||
<header class="page-header">
|
||||
<wa-dropdown>
|
||||
<wa-button slot="trigger" with-caret appearance="plain" variant="neutral">File</wa-button>
|
||||
<wa-dropdown-item id="bnNew">
|
||||
<wa-icon slot="icon" library="tabler" name="file"></wa-icon>New...
|
||||
<div slot="details">empty document</div>
|
||||
</wa-dropdown-item>
|
||||
|
||||
<wa-dropdown-item id="bnRead">
|
||||
<wa-icon slot="icon" library="tabler" name="folder-open"></wa-icon>Open...
|
||||
<div slot="details">a local file</div>
|
||||
</wa-dropdown-item>
|
||||
<input type="file" id="fileElem" multiple accept="*/*" style="display: none;" />
|
||||
|
||||
<wa-dropdown-item id="popover__url">
|
||||
<wa-icon slot="icon" library="tabler" name="link"></wa-icon>Fetch...
|
||||
<div slot="details">a url from the internet</div>
|
||||
</wa-dropdown-item>
|
||||
</wa-dropdown>
|
||||
|
||||
<div>
|
||||
<span class="h4">XQuery 4.0 LSP client</span>
|
||||
|
||||
<wa-button id="bConnect" variant="danger">
|
||||
<wa-icon library="tabler" name="network-off"></wa-icon>
|
||||
</wa-button>
|
||||
<wa-tooltip id="tipConnect" for="bConnect">Not connected</wa-tooltip>
|
||||
</div>
|
||||
|
||||
|
||||
<wa-button-group style="margin-right: 0.2rem;">
|
||||
<wa-dropdown>
|
||||
<wa-button slot="trigger" with-caret appearance="plain" variant="neutral">Dev tools</wa-button>
|
||||
<wa-dropdown-item>
|
||||
<wa-icon slot="icon" library="tabler" name="external-link"></wa-icon>
|
||||
<a href="/app/home" target="lsp" rel="noreferrer noopener">LSP Manager</a>
|
||||
</wa-dropdown-item>
|
||||
<wa-dropdown-item>
|
||||
<wa-icon slot="icon" library="tabler" name="external-link"></wa-icon>
|
||||
<a href="/dba/logs" target="dba" rel="noreferrer noopener">Dba</a>
|
||||
</wa-dropdown-item>
|
||||
<wa-divider></wa-divider>
|
||||
</wa-dropdown>
|
||||
<wa-button popovertarget="popAbout" appearance="plain" variant="neutral">
|
||||
<wa-icon library="tabler" name="help" label="Home"></wa-icon>
|
||||
</wa-button>
|
||||
</wa-button-group>
|
||||
</header>
|
||||
|
||||
|
||||
<main id="main" class="page-main" style="overflow: auto;">
|
||||
<div class="wa-split " style="font-size: 24px;">
|
||||
|
||||
<wa-button-group>
|
||||
<wa-button id="search" title="Search" icon-label="search">
|
||||
<wa-icon name="search"></wa-icon>
|
||||
</wa-button>
|
||||
|
||||
<wa-button id="lint" title="Display diagnostics" icon-label="diagnostics">
|
||||
<wa-icon library="tabler" name="message-report"></wa-icon>
|
||||
</wa-button>
|
||||
|
||||
<wa-button id="symbols2" title="symbols" icon-label="Symbols">
|
||||
<wa-icon library="tabler" name="icons"></wa-icon>
|
||||
</wa-button>
|
||||
|
||||
<wa-button id="format" type="button" title="Format (Shift-Alt-f)" icon-label="Format">
|
||||
<wa-icon library="tabler" name="align-justified"></wa-icon>
|
||||
</wa-button>
|
||||
|
||||
</wa-button-group>
|
||||
|
||||
<wa-button-group>
|
||||
<wa-button id="sync" title="Sync changes to server">
|
||||
<wa-icon library="codicon" name="sync"></wa-icon>
|
||||
</wa-button>
|
||||
|
||||
<wa-button id="cmdList" title="Command and key mapping help">
|
||||
<wa-icon library="codicon" name="record-keys"></wa-icon>
|
||||
</wa-button>
|
||||
|
||||
<wa-button id="popover__settings" title="Settings">
|
||||
<wa-icon library="codicon" name="settings"></wa-icon>
|
||||
</wa-button>
|
||||
|
||||
<wa-button id="fullscreen" title="Full screen editor">
|
||||
<wa-icon library="codicon" name="screen-full"></wa-icon>
|
||||
</wa-button>
|
||||
|
||||
<wa-button id="bnSave" title="save view">
|
||||
<wa-icon library="codicon" name="git-stash"></wa-icon>
|
||||
</wa-button>
|
||||
|
||||
<wa-button id="bnLoad" title="load view">
|
||||
<wa-icon library="codicon" name="git-stash-pop"></wa-icon>
|
||||
</wa-button>
|
||||
|
||||
<wa-button id="bnWordAt" type="wa-button" title="word at">
|
||||
<wa-icon library="codicon" name="whole-word"></wa-icon>
|
||||
</wa-button>
|
||||
|
||||
<wa-button id="bnDebug" title="Debug " icon-label="debug">
|
||||
<wa-icon library="codicon" name="debug"></wa-icon>
|
||||
</wa-button>
|
||||
</wa-button-group>
|
||||
|
||||
<div></div>
|
||||
</div>
|
||||
|
||||
<!-- Editor goes in here -->
|
||||
<div id="editor"></div>
|
||||
</main>
|
||||
|
||||
<aside class="page-sidebar">
|
||||
|
||||
<wa-details id="workspacePanel" open="open" icon-placement="start">
|
||||
<div slot="summary">
|
||||
WORKSPACE
|
||||
<wa-dropdown id="workspaceOptions" style="display:inline-block;float:right;">
|
||||
<wa-icon id="workspaceTrigger" library="tabler" name="dots-vertical" slot="trigger"></wa-icon>
|
||||
<wa-dropdown-item type="checkbox" value="canvas" checked>Follow cursor</wa-dropdown-item>
|
||||
|
||||
<wa-divider></wa-divider>
|
||||
<wa-dropdown-item type="checkbox" value="position" checked>sort by:
|
||||
Position</wa-dropdown-item>
|
||||
<wa-dropdown-item type="checkbox" value="name">sort by: Name</wa-dropdown-item>
|
||||
<wa-dropdown-item type="checkbox" value="category">sort by: Category</wa-dropdown-item>
|
||||
</wa-dropdown>
|
||||
</div>
|
||||
<div style="overflow: scroll;">
|
||||
<wa-tree id="workspace" selection="single">
|
||||
<wa-tree-item>file:///some/file.xqm</wa-tree-item>
|
||||
</wa-tree>
|
||||
</div>
|
||||
</wa-details>
|
||||
|
||||
<wa-details id="symPanel" icon-placement="start">
|
||||
<div slot="summary">OUTLINE
|
||||
<wa-dropdown id="symOptions" style="display:inline-block;float:right;">
|
||||
<wa-icon id="symTrigger" library="tabler" name="dots-vertical" slot="trigger"></wa-icon>
|
||||
<wa-dropdown-item type="checkbox" value="canvas" checked>Follow cursor</wa-dropdown-item>
|
||||
|
||||
<wa-divider></wa-divider>
|
||||
<wa-dropdown-item type="checkbox" value="position" checked>sort by:
|
||||
Position</wa-dropdown-item>
|
||||
<wa-dropdown-item type="checkbox" value="name">sort by: Name</wa-dropdown-item>
|
||||
<wa-dropdown-item type="checkbox" value="category">sort by: Category</wa-dropdown-item>
|
||||
</wa-dropdown>
|
||||
</div>
|
||||
|
||||
<qd-list id="symList" style="height: 10em;overflow: scroll;"></qd-list>
|
||||
|
||||
</wa-details>
|
||||
|
||||
<details id="msgPanel">
|
||||
<summary>MESSAGES
|
||||
<i id="msgIcon" class='codicon codicon-kebab-vertical' style="float:right"></i>
|
||||
</summary>
|
||||
<qd-list id="msgList" style="flex-grow:1;"></qd-list>
|
||||
</details>
|
||||
|
||||
|
||||
</aside>
|
||||
|
||||
<footer class="page-footer">
|
||||
<div style="display:flex;">
|
||||
|
||||
<div>
|
||||
<label for="iFile">File:</label>
|
||||
<input id="iFile" type="url" value="file:///some/file.xqm"
|
||||
style="width:20em;display:inline-block;" />
|
||||
|
||||
<label for="symbols">Symbols:</label>
|
||||
<select id="symbols" disabled="disabled" style="width:10em;display:inline-block;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<wa-relative-time live id="relative-time__live" sync second="numeric" format='short'
|
||||
style="width:10em;"></wa-relative-time>
|
||||
<select id="language" style="width:10em;display:inline-block;">
|
||||
<option selected>Language</option>
|
||||
<option value="plaintext">plaintext</option>
|
||||
<option value="xquery">xquery</option>
|
||||
<option value="xml">xml</option>
|
||||
</select>
|
||||
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- dialogs -->
|
||||
<wa-popover id="popWeb" for="popover__url">
|
||||
<div style="display:flex;background: #ffecb3;">
|
||||
<div style="flex: 1 1 auto;">Load a document from the web</div>
|
||||
<wa-button icon-label="Close" appearance="text" data-popover="close">
|
||||
<wa-icon name="circle-xmark" library="system"></wa-icon>
|
||||
</wa-button>
|
||||
</div>
|
||||
|
||||
<form id="popUrl">
|
||||
<wa-input type="url" name="url" label="URL to fetch" placeholder="http://..." with-clear required
|
||||
style="width: 20em;">
|
||||
|
||||
<datalist>
|
||||
|
||||
<option
|
||||
value="https://raw.githubusercontent.com/Quodatum/xqdoca/refs/heads/master/src/main/lib/model.xqm">
|
||||
model.xqm (Quodatum/xqdoca)</option>
|
||||
<option
|
||||
value="https://git.quodatum.duckdns.org/api/v1/repos/quodatum/basex-lsp/raw/webapp/lsp/lsp-text.xqm">
|
||||
lsp-text.xqm (quodatum/basex-lsp FORGEIO)</option>
|
||||
<option
|
||||
value="https://git.quodatum.duckdns.org/api/v1/repos/quodatum/basex-lsp/raw/webapp/lsp/set.xqm">
|
||||
set.xqm (quodatum/basex-lsp FORGEIO)</option>
|
||||
|
||||
<option
|
||||
value="https://raw.githubusercontent.com/dnovatchev/Articles/refs/heads/main/Generators/Code/generator.xq">
|
||||
generator.xquery</option>
|
||||
</datalist>
|
||||
</wa-input>
|
||||
<wa-button type="submit" variant="primary">Fetch</wa-button>
|
||||
<hr />
|
||||
<wa-tree id="samples" selection="leaf">
|
||||
<wa-tree-item>
|
||||
XQuery 3.1
|
||||
<wa-tree-item
|
||||
data-href="https://raw.githubusercontent.com/expkg-zone58/pdfbox/refs/heads/main/src/Pdfbox3.xqm">Pdfbox3.xqm
|
||||
(expkg-zone58/pdfbox)</wa-tree-item>
|
||||
<wa-tree-item
|
||||
data-href="https://raw.githubusercontent.com/Quodatum/xqdoca/refs/heads/master/src/main/lib/model.xqm">
|
||||
model.xqm (Quodatum/xqdoca)</option></wa-tree-item>
|
||||
<wa-tree-item>Item X</wa-tree-item>
|
||||
</wa-tree-item>
|
||||
<wa-tree-item>
|
||||
XQuery 4
|
||||
<wa-tree-item>Item B</wa-tree-item>
|
||||
<wa-tree-item>Item C</wa-tree-item>
|
||||
</wa-tree-item>
|
||||
<wa-tree-item>Item 2</wa-tree-item>
|
||||
<wa-tree-item>Item 3</wa-tree-item>
|
||||
</wa-tree>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
</wa-popover>
|
||||
<!-- Popovers -->
|
||||
<dialog id="popConnect" popover>
|
||||
<form>
|
||||
<header>Connect to LSP
|
||||
<button type="button" class="btn-close" aria-label="Close"
|
||||
onclick="$('popConnect').hidePopover(); "></button>
|
||||
</header>
|
||||
<div class="modal-body">
|
||||
<div id="state">🔴</div>
|
||||
<input id="iServer" type="text" style="width:25em" />
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="connect">connect</button>
|
||||
</div>
|
||||
</form>
|
||||
</dialog>
|
||||
|
||||
<dialog id="popCmds" popover>
|
||||
<form>
|
||||
<header>Commands and keys
|
||||
<button type="button" class="btn-close" aria-label="Close"
|
||||
onclick="$('popCmds').hidePopover(); "></button>
|
||||
</header>
|
||||
<div id="popHelpInfo" class="modal-body" style="height: 50vh;overflow:scroll;">
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</dialog>
|
||||
<dialog id="popAbout" popover>
|
||||
<form>
|
||||
<header>Help</header>
|
||||
<div class="modal-body" style="height: 50vh;overflow:scroll;">
|
||||
<p>TODO help info</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</dialog>
|
||||
<!-- <popup-info id="popHelp">hhhh</popup-info> -->
|
||||
|
||||
<wa-popover for="popover__settings">
|
||||
<form id="fSettings">
|
||||
<header>Editor configuration
|
||||
<button type="button" class="btn-close" aria-label="Close"
|
||||
onclick="$('popSettings').hidePopover(); "></button>
|
||||
</header>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="mb-3 form-check">
|
||||
<input name="wrapLines" type="checkbox" class="form-check-input" id="lineWrap">
|
||||
<label class="form-check-label" for="lineWrap">Wrap lines</label>
|
||||
</div>
|
||||
<div class="mb-3 form-check">
|
||||
<input name="highlightWhitespace" type="checkbox" class="form-check-input" id="highlightWhitespace">
|
||||
<label class="form-check-label" for="highlightWhitespace">highlight Whitespace</label>
|
||||
</div>
|
||||
<div class="mb-3 form-check">
|
||||
<input name="minimap" type="checkbox" class="form-check-input" id="minimap">
|
||||
<label class="form-check-label" for="minimap">Show minimap</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-primary">Apply</button>
|
||||
</div>
|
||||
</form>
|
||||
</wa-popover>
|
||||
<!-- CodeMirror 6 -->
|
||||
<script src="./lsp.bundle.js"></script>
|
||||
<script src="./script.js"></script>
|
||||
<script src="./wc-qd-list.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -59,7 +59,6 @@ body {
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: white;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
|
||||
overflow: hidden;
|
||||
min-width: 0;
|
||||
|
|
@ -88,7 +87,7 @@ body {
|
|||
.details-wrapper {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 15px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
/* Right Column styling - Controls and Information (3/4 width) */
|
||||
|
|
|
|||
26
webapp/static/clients/monaco/index.html
Normal file
26
webapp/static/clients/monaco/index.html
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Monaco LSP - Vanilla JS</title>
|
||||
<link rel="icon" type="image/png" href="../favicon.png" />
|
||||
<link rel="stylesheet" href='./style.css' />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="container" style="height: 400px;"></div>
|
||||
|
||||
<script type="module">
|
||||
|
||||
import { monaco } from "https://cdn.jsdelivr.net/npm/monaco-editor-esm-cdn/monaco.js";
|
||||
|
||||
monaco.editor.create(document.getElementById("container"), {
|
||||
value: `function x() {\n\tconsole.log("Hello world!");\n}`,
|
||||
language: "xquery",
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
10
webapp/static/clients/monaco/style.css
Normal file
10
webapp/static/clients/monaco/style.css
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/* style.css */
|
||||
body {
|
||||
background-color: #242424;
|
||||
}
|
||||
|
||||
#editor {
|
||||
margin: 10vh auto;
|
||||
width: 720px;
|
||||
height: 20vh;
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue