[fix] connected indictor
This commit is contained in:
parent
566831c73d
commit
7d0414a43f
4 changed files with 43 additions and 76 deletions
|
|
@ -103,7 +103,6 @@ form header {
|
||||||
|
|
||||||
.page-nav {
|
.page-nav {
|
||||||
grid-column: 2 / 3;
|
grid-column: 2 / 3;
|
||||||
background: red;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ $("popUrl").onsubmit = e => {
|
||||||
$("bnDebug").onclick = e => { debugger; };
|
$("bnDebug").onclick = e => { debugger; };
|
||||||
|
|
||||||
|
|
||||||
$("tConnect").addEventListener('quiet-change', e => {
|
$("bConnect").addEventListener('click', e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$("popConnect").showPopover()
|
$("popConnect").showPopover()
|
||||||
});
|
});
|
||||||
|
|
@ -142,10 +142,10 @@ $("msgIcon").onclick = e => {
|
||||||
alert("NOT YET")
|
alert("NOT YET")
|
||||||
};
|
};
|
||||||
$("samples").addEventListener('wa-selection-change', e => {
|
$("samples").addEventListener('wa-selection-change', e => {
|
||||||
const sel=e.detail.selection;
|
const sel = e.detail.selection;
|
||||||
const href=sel[0].getAttribute("data-href")
|
const href = sel[0].getAttribute("data-href")
|
||||||
if(!href) return;
|
if (!href) return;
|
||||||
$("popUrl").querySelector('wa-input[name="url"]').value=href;
|
$("popUrl").querySelector('wa-input[name="url"]').value = href;
|
||||||
});
|
});
|
||||||
|
|
||||||
function updateSettings(event) {
|
function updateSettings(event) {
|
||||||
|
|
@ -176,8 +176,7 @@ function connect() {
|
||||||
client = new lsp.LSPClient({ extensions: lsp.languageServerExtensions() });
|
client = new lsp.LSPClient({ extensions: lsp.languageServerExtensions() });
|
||||||
client.connect(transport);
|
client.connect(transport);
|
||||||
$("popConnect").hidePopover();
|
$("popConnect").hidePopover();
|
||||||
$("tConnect").checked = true;
|
connectState(server, true)
|
||||||
$("tipConnect").innerText = server;
|
|
||||||
const extLsp = client.plugin(file, "xquery");
|
const extLsp = client.plugin(file, "xquery");
|
||||||
|
|
||||||
view.dispatch({
|
view.dispatch({
|
||||||
|
|
@ -188,12 +187,19 @@ function connect() {
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
$("tConnect").checked = false;
|
connectState(server, false)
|
||||||
alert("connection failed: " + server)
|
alert("connection failed: " + server)
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// set ui state for connection
|
||||||
|
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");
|
||||||
|
};
|
||||||
|
|
||||||
// change active doc
|
// change active doc
|
||||||
function docSwitch(text, urlNew) {
|
function docSwitch(text, urlNew) {
|
||||||
const urlOld = $("iFile").value;
|
const urlOld = $("iFile").value;
|
||||||
|
|
@ -214,8 +220,8 @@ function treeAdd(tree, txt) {
|
||||||
const treeItem = document.createElement('wa-tree-item');
|
const treeItem = document.createElement('wa-tree-item');
|
||||||
treeItem.innerText = txt;
|
treeItem.innerText = txt;
|
||||||
tree.querySelectorAll('wa-tree-item').forEach(item => (item.selected = false));
|
tree.querySelectorAll('wa-tree-item').forEach(item => (item.selected = false));
|
||||||
tree.insertBefore(treeItem,tree.firstChild);
|
tree.insertBefore(treeItem, tree.firstChild);
|
||||||
treeItem.selected=true;
|
treeItem.selected = true;
|
||||||
};
|
};
|
||||||
function incoming(msg) {
|
function incoming(msg) {
|
||||||
const rpc = JSON.parse(msg);
|
const rpc = JSON.parse(msg);
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,6 @@ details[open]::details-content {
|
||||||
grid-column: 1 / -1;
|
grid-column: 1 / -1;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
background: red;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-sidebar {
|
.page-sidebar {
|
||||||
|
|
@ -118,34 +117,3 @@ details[open]::details-content {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
wa-button.pink::part(base) {
|
|
||||||
border-radius: 6px;
|
|
||||||
border: solid 2px;
|
|
||||||
background: #ff1493;
|
|
||||||
border-top-color: #ff7ac1;
|
|
||||||
border-left-color: #ff7ac1;
|
|
||||||
border-bottom-color: #ad005c;
|
|
||||||
border-right-color: #ad005c;
|
|
||||||
color: white;
|
|
||||||
font-size: 1.125rem;
|
|
||||||
box-shadow: 0 2px 10px #0002;
|
|
||||||
transition: all var(--wa-transition-slow) var(--wa-transition-easing);
|
|
||||||
}
|
|
||||||
|
|
||||||
wa-button.pink::part(base):hover {
|
|
||||||
transform: scale(1.05);
|
|
||||||
}
|
|
||||||
|
|
||||||
wa-button.pink::part(base):active {
|
|
||||||
border-top-color: #ad005c;
|
|
||||||
border-right-color: #ff7ac1;
|
|
||||||
border-bottom-color: #ff7ac1;
|
|
||||||
border-left-color: #ad005c;
|
|
||||||
transform: translateY(1px);
|
|
||||||
}
|
|
||||||
|
|
||||||
wa-button.pink::part(base):focus-visible {
|
|
||||||
outline: dashed 2px deeppink;
|
|
||||||
outline-offset: 4px;
|
|
||||||
}
|
|
||||||
|
|
@ -37,14 +37,11 @@
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<span class="h4">XQuery 4.0 LSP client</span>
|
<span class="h4">XQuery 4.0 LSP client</span>
|
||||||
<quiet-toggle-icon id="tConnect" label="Connection status" size="lg"
|
|
||||||
style="--checked-color: green;--unchecked-color: red;">
|
|
||||||
<wa-icon slot="unchecked" library="tabler" name="network-off" family="outline"></wa-icon>
|
|
||||||
<wa-icon slot="checked" library="tabler" name="network" family="outline"></wa-icon>
|
|
||||||
</quiet-toggle-icon>
|
|
||||||
<wa-tooltip id="tipConnect" for="tConnect">I'm a tooltip</wa-tooltip>
|
|
||||||
|
|
||||||
|
|
||||||
|
<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>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -99,7 +96,7 @@
|
||||||
<wa-icon library="codicon" name="record-keys"></wa-icon>
|
<wa-icon library="codicon" name="record-keys"></wa-icon>
|
||||||
</wa-button>
|
</wa-button>
|
||||||
|
|
||||||
<wa-button id="popover__settings" title="Settings">
|
<wa-button id="popover__settings" title="Settings">
|
||||||
<wa-icon library="codicon" name="settings"></wa-icon>
|
<wa-icon library="codicon" name="settings"></wa-icon>
|
||||||
</wa-button>
|
</wa-button>
|
||||||
|
|
||||||
|
|
@ -137,9 +134,11 @@
|
||||||
<summary class='bg-info'>WORKSPACE
|
<summary class='bg-info'>WORKSPACE
|
||||||
<wa-icon library="codicon" name="kebab-vertical" style="float:right"></wa-icon>
|
<wa-icon library="codicon" name="kebab-vertical" style="float:right"></wa-icon>
|
||||||
</summary>
|
</summary>
|
||||||
<wa-tree id="workspace" selection="single">
|
<div style="overflow: scroll;">
|
||||||
<wa-tree-item >file:///some/file.xqm</wa-tree-item>
|
<wa-tree id="workspace" selection="single">
|
||||||
</wa-tree>
|
<wa-tree-item>file:///some/file.xqm</wa-tree-item>
|
||||||
|
</wa-tree>
|
||||||
|
</div>
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
@ -187,12 +186,7 @@
|
||||||
<option value="xquery">xquery</option>
|
<option value="xquery">xquery</option>
|
||||||
<option value="xml">xml</option>
|
<option value="xml">xml</option>
|
||||||
</select>
|
</select>
|
||||||
<wa-button>
|
|
||||||
aaaaa
|
|
||||||
</wa-button>
|
|
||||||
<button>
|
|
||||||
ddddd
|
|
||||||
</button>
|
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -202,7 +196,7 @@
|
||||||
<div style="display:flex;background: #ffecb3;">
|
<div style="display:flex;background: #ffecb3;">
|
||||||
<div style="flex: 1 1 auto;">Load a document from the web</div>
|
<div style="flex: 1 1 auto;">Load a document from the web</div>
|
||||||
<wa-button icon-label="Close" appearance="text" data-popover="close">
|
<wa-button icon-label="Close" appearance="text" data-popover="close">
|
||||||
<wa-icon name="circle-xmark" library="system" ></wa-icon>
|
<wa-icon name="circle-xmark" library="system"></wa-icon>
|
||||||
</wa-button>
|
</wa-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -227,14 +221,14 @@
|
||||||
generator.xquery</option>
|
generator.xquery</option>
|
||||||
</datalist>
|
</datalist>
|
||||||
</wa-input>
|
</wa-input>
|
||||||
<wa-button type="submit" variant="primary">Fetch</wa-button>
|
<wa-button type="submit" variant="primary">Fetch</wa-button>
|
||||||
<hr/>
|
<hr />
|
||||||
<wa-tree id="samples" selection="leaf">
|
<wa-tree id="samples" selection="leaf">
|
||||||
<wa-tree-item>
|
<wa-tree-item>
|
||||||
XQuery 3.1
|
XQuery 3.1
|
||||||
<wa-tree-item
|
<wa-tree-item
|
||||||
data-href="https://raw.githubusercontent.com/expkg-zone58/pdfbox/refs/heads/main/src/Pdfbox3.xqm"
|
data-href="https://raw.githubusercontent.com/expkg-zone58/pdfbox/refs/heads/main/src/Pdfbox3.xqm">Pdfbox3.xqm
|
||||||
>Pdfbox3.xqm (expkg-zone58/pdfbox)</wa-tree-item>
|
(expkg-zone58/pdfbox)</wa-tree-item>
|
||||||
<wa-tree-item
|
<wa-tree-item
|
||||||
data-href="https://raw.githubusercontent.com/Quodatum/xqdoca/refs/heads/master/src/main/lib/model.xqm">
|
data-href="https://raw.githubusercontent.com/Quodatum/xqdoca/refs/heads/master/src/main/lib/model.xqm">
|
||||||
model.xqm (Quodatum/xqdoca)</option></wa-tree-item>
|
model.xqm (Quodatum/xqdoca)</option></wa-tree-item>
|
||||||
|
|
@ -327,11 +321,11 @@
|
||||||
<button type="submit" class="btn btn-primary">Apply</button>
|
<button type="submit" class="btn btn-primary">Apply</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</wa-popover>
|
</wa-popover>
|
||||||
<!-- CodeMirror 6 -->
|
<!-- CodeMirror 6 -->
|
||||||
<script src="./lsp.bundle.js"></script>
|
<script src="./lsp.bundle.js"></script>
|
||||||
<script src="./script.js"></script>
|
<script src="./script.js"></script>
|
||||||
<script src="./wc-qd-list.js"></script>
|
<script src="./wc-qd-list.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue