[mod] doc change
This commit is contained in:
parent
53d78573b1
commit
93770708f6
30 changed files with 61 additions and 21 deletions
|
|
@ -10,14 +10,10 @@
|
|||
<!-- Quiet theme + autoloader -->
|
||||
<!-- Default theme (if not already installed) -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@quietui/quiet-browser@1.6.1/dist/themes/quiet.css">
|
||||
|
||||
<!-- Quiet Restyle -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@quietui/quiet-browser@1.6.1/dist/themes/restyle.css">
|
||||
|
||||
|
||||
<script type="module" src="https://cdn.jsdelivr.net/npm/@quietui/quiet-browser@1.6.1/dist/quiet.loader.js"></script>
|
||||
|
||||
|
||||
<script type="module" src="icons.js"></script>
|
||||
<link rel="stylesheet" href="grail.css" />
|
||||
</head>
|
||||
|
||||
|
|
@ -73,9 +69,9 @@
|
|||
|
||||
|
||||
<main id="main" class="page-main" style="overflow: auto;">
|
||||
<quiet-toolbar style="padding:2px;">
|
||||
<quiet-toolbar style="padding:2px;background-color: var(--quiet-neutral-fill-softer);">
|
||||
|
||||
<quiet-button-group style="background-color: var(--quiet-neutral-fill-softer);">
|
||||
<quiet-button-group>
|
||||
<quiet-button id="search" title="Search" icon-label="search" size="xs">
|
||||
<quiet-icon name="search"></quiet-icon>
|
||||
</quiet-button>
|
||||
|
|
@ -88,22 +84,24 @@
|
|||
<quiet-icon name="icons"></quiet-icon>
|
||||
</quiet-button>
|
||||
|
||||
<button id="format" type="button" title="Format (Shift-Alt-f)"><i
|
||||
class="codicon codicon-list-flat"></i></button>
|
||||
<quiet-button id="format" type="button" title="Format (Shift-Alt-f)" icon-label="Format" size="xs">
|
||||
<quiet-icon name="align-justified"></quiet-icon>
|
||||
</quiet-button>
|
||||
|
||||
<button id="sync" title="Sync changes to server" type="button">
|
||||
</quiet-button-group>
|
||||
|
||||
<quiet-button-group>
|
||||
<button id="sync" title="Sync changes to server">
|
||||
<i class="codicon codicon-sync"></i>
|
||||
</button>
|
||||
|
||||
<button id="cmdList" type="button" title="Command and key mapping help">
|
||||
<button id="cmdList" title="Command and key mapping help">
|
||||
<i class="codicon codicon-record-keys"></i>
|
||||
</button>
|
||||
|
||||
<button type="button" popovertarget="popSettings" title="Settings">
|
||||
<i class="codicon codicon-settings"></i></button>
|
||||
</quiet-button-group>
|
||||
|
||||
<quiet-button-group>
|
||||
<i class="codicon codicon-settings"></i>
|
||||
</button>
|
||||
<button id="fullscreen" title="Full screen editor" type="button">
|
||||
<i class="codicon codicon-screen-full"></i>
|
||||
</button>
|
||||
|
|
@ -117,6 +115,10 @@
|
|||
<button id="bnWordAt" type="button" title="word at">
|
||||
<i class="codicon codicon-whole-word"></i></button>
|
||||
|
||||
|
||||
<quiet-button id="bnDebug" title="Debug " icon-label="debug" size="xs">
|
||||
<quiet-icon library="codicon" name="debug"></quiet-icon>
|
||||
</quiet-button>
|
||||
</quiet-button-group>
|
||||
</quiet-toolbar>
|
||||
|
||||
|
|
@ -177,7 +179,7 @@
|
|||
<select id="symbols" disabled="disabled" style="width:10em;display:inline-block;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<quiet-relative-time live id="relative-time__live" style="width:10em;"></quiet-relative-time>
|
||||
<quiet-relative-time live id="relative-time__live" numeric='always' format='short' style="width:10em;"></quiet-relative-time>
|
||||
<select id="language" style="width:10em;display:inline-block;">
|
||||
<option selected>Language</option>
|
||||
<option value="plaintext">plaintext</option>
|
||||
|
|
|
|||
6
webapp/static/clients/codemirror/icons.js
Normal file
6
webapp/static/clients/codemirror/icons.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { registerIconLibrary } from 'https://cdn.jsdelivr.net/npm/@quietui/quiet-browser@1.6.1/dist/quiet.loader.js';
|
||||
|
||||
registerIconLibrary('codicon', {
|
||||
resolve: (name, family) => {
|
||||
return `/static/clients/codicon@0.0.40/icons/${name}.svg`
|
||||
}});
|
||||
|
|
@ -14,6 +14,7 @@ function $(id) { return document.getElementById(id) };
|
|||
|
||||
// Load saved content from localStorage when the page loads
|
||||
window.addEventListener('load', () => {
|
||||
|
||||
const savedText = localStorage.getItem('code');
|
||||
if (savedText) doc = savedText;
|
||||
let svr = localStorage.getItem('lsp');
|
||||
|
|
@ -97,6 +98,7 @@ $("sync").onclick = e => { client.sync(); console.log("XXXsync"); };
|
|||
$("bnSave").onclick = e => { workspace[iFile] = view.state; };
|
||||
$("bnLoad").onclick = e => { const v = workspace[iFile]; if (v) view.setState(v) };
|
||||
|
||||
|
||||
// select local file
|
||||
$("bnRead").onclick = e => { $("fileElem").click(); };
|
||||
$("fileElem").onchange = e => {
|
||||
|
|
@ -121,7 +123,7 @@ $("popUrl").onsubmit = e => {
|
|||
alert("CORS?: " + error)
|
||||
});
|
||||
};
|
||||
|
||||
$("bnDebug").onclick = e => { debugger; };
|
||||
|
||||
|
||||
$("tConnect").addEventListener('quiet-change', e => {
|
||||
|
|
@ -181,7 +183,9 @@ function connect() {
|
|||
};
|
||||
|
||||
// change active doc
|
||||
function docSwitch(text, url) {
|
||||
function docSwitch(text,urlNew) {
|
||||
const urlOld=$("iFile").value;
|
||||
client.workspace.closeFile(urlOld);
|
||||
view.dispatch({
|
||||
changes: {
|
||||
from: 0,
|
||||
|
|
@ -189,7 +193,8 @@ function docSwitch(text, url) {
|
|||
insert: text
|
||||
}
|
||||
})
|
||||
$("iFile").value = url;
|
||||
client.workspace.openFile(urlNew,"xquery",view)
|
||||
$("iFile").value = urlNew;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -201,11 +206,11 @@ function incoming(msg) {
|
|||
|
||||
function log(rpc) {
|
||||
console.log("<-", rpc)
|
||||
if (rpc.id) return;
|
||||
const when = (new Date()).toISOString();
|
||||
const msg = { name: rpc.method, detail: when.substring(1 + when.indexOf("T")), kind: 23 /* event */ };
|
||||
const msg = { name: rpc.method ?? rpc.id, detail: when.substring(1 + when.indexOf("T")), kind: 23 /* event */ };
|
||||
//name,details,kind
|
||||
$("msgList").setData([msg], true)
|
||||
$("relative-time__live").date=new Date();
|
||||
};
|
||||
|
||||
function formFromStore(name) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue