From 6459aa1cfe8fdefd3aebb389a6bb91377aba3f28 Mon Sep 17 00:00:00 2001 From: Guyutongxue Date: Tue, 30 Jan 2024 17:02:31 +0800 Subject: [PATCH] license etc --- LICENSE | 19 +++++++++++++++++++ README.md | 2 +- index.html | 3 ++- src/style.css | 4 ++++ src/ui.ts | 8 ++++++-- 5 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..99d849f --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2024 Guyutongxue + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 665efea..8933de5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repo contains a build script for clangd on WebAssembly (TBD), and an exampl ## How to build -I'm working on the build instruction, but you can take a look at `build.sh`. +You can take a look at `build.sh` for how to build clangd to WASM. Once `clangd.wasm` generated at `public/wasm`, you can build those frontend code using `pnpm install` and `pnpm build`. ## About the example page diff --git a/index.html b/index.html index da20a1c..2e9c30d 100644 --- a/index.html +++ b/index.html @@ -16,7 +16,8 @@
diff --git a/src/style.css b/src/style.css index 31cd423..e6c9f74 100644 --- a/src/style.css +++ b/src/style.css @@ -224,6 +224,10 @@ body { overflow: auto; user-select: text; } + + hr { + border-color: var(--c-bg-lighter); + } } .spacer { diff --git a/src/ui.ts b/src/ui.ts index 8d7ab59..2979462 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -57,11 +57,13 @@ function showInput() { outputEl.classList.add("display-none"); } const EMPTY_HINT_HTML = `No output.`; +const RESULT_COPY_HTML = ` +
Compilation provided by Compiler Explorer`; function showOutput(text: string) { if (text === "") { text = EMPTY_HINT_HTML; } - outputEl.innerHTML = text; + outputEl.innerHTML = text + RESULT_COPY_HTML; outputEl.classList.remove("display-none"); inputEl.classList.add("display-none"); } @@ -135,7 +137,9 @@ function toggleTheme() { } toggleThemeBtn.addEventListener("click", toggleTheme); -export function setClangdStatus(status: "ready" | "indeterminate" | "disabled"): void; +export function setClangdStatus( + status: "ready" | "indeterminate" | "disabled" +): void; export function setClangdStatus(value: number, max: number): void; export function setClangdStatus(strOrVal: string | number, max?: number) { if (typeof strOrVal === "number") {