-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
162 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
<!DOCTYPE html> | ||
<html lang=""> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>Text Box</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous"> | ||
</head> | ||
|
||
<style> | ||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
html, body { | ||
width: 100%; | ||
height: 100%; | ||
margin: 0; | ||
} | ||
|
||
#container { | ||
width: 100%; | ||
height: 100%; | ||
margin: 0; | ||
padding: 10; | ||
border: none; | ||
display: flex; | ||
flex-direction: column; | ||
|
||
/* font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; */ | ||
} | ||
|
||
#about { | ||
float: right; | ||
margin-right: 25px; | ||
} | ||
|
||
.swal2-title, .swal2-html-container { | ||
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; | ||
} | ||
</style> | ||
|
||
<body> | ||
<div id="container"> | ||
<div id="toolbar"> | ||
|
||
<span class="ql-formats"> | ||
<select class="ql-size"></select> | ||
<select class="ql-header"></select> | ||
<select class="ql-font"></select> | ||
</span> | ||
|
||
<span class="ql-formats"> | ||
<button class="ql-bold"></button> | ||
<button class="ql-italic"></button> | ||
<button class="ql-underline"></button> | ||
<button class="ql-strike"></button> | ||
<button class="ql-script" value="sub"></button> | ||
<button class="ql-script" value="super"></button> | ||
</span> | ||
|
||
<span class="ql-formats"> | ||
<select class="ql-color"></select> | ||
<select class="ql-background"></select> | ||
</span> | ||
|
||
<span class="ql-formats"> | ||
<button class="ql-list" value="ordered"></button> | ||
<button class="ql-list" value="bullet"></button> | ||
</span> | ||
|
||
<span class="ql-formats"> | ||
<select class="ql-align"></select> | ||
<button class="ql-blockquote"></button> | ||
<button class="ql-code-block"></button> | ||
</span> | ||
|
||
<span class="ql-formats"> | ||
<button class="ql-indent" value="-1"></button> | ||
<button class="ql-indent" value="+1"></button> | ||
<button class="ql-direction" value="rtl"></button> | ||
</span> | ||
|
||
<span class="ql-formats"> | ||
<button class="ql-image"></button> | ||
<button class="ql-video"></button> | ||
<button class="ql-formula"></button> | ||
</span> | ||
|
||
<span class="ql-formats"> | ||
<button class="ql-clean"></button> | ||
</span> | ||
|
||
<span class="ql-formats" id="about"> | ||
<button onclick="show_about();">About</button> | ||
</span> | ||
|
||
</div> | ||
<div id="text"></div> | ||
</div> | ||
</body> | ||
|
||
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script> | ||
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> | ||
<script> | ||
|
||
function show_about() { | ||
console.log("Text Box"); | ||
Swal.fire({ | ||
title: "About", | ||
html: ` | ||
Welcome to Text Box! This is just a really simple scratch pad so you can type stuff into a browser page. | ||
It uses a couple of libraries:<br><br> | ||
<a href="https://quilljs.com/">Quill</a> rich text editor component<br> | ||
<a href="https://katex.org/">KaTeX</a> math typesetting library<br> | ||
<a href="https://sweetalert2.github.io/">sweetalert2</a> for this popup dialog | ||
` | ||
}) | ||
} | ||
|
||
var toolbarOptions = [ | ||
[{ 'size': ['small', false, 'large', 'huge'] }], // custom dropdown | ||
[{ 'header': [1, 2, 3, 4, 5, 6, false] }], | ||
[{ 'font': [] }], | ||
|
||
['bold', 'italic', 'underline', 'strike'], // toggled buttons | ||
[{ 'script': 'sub'}, { 'script': 'super' }], // superscript/subscript | ||
[{ 'color': [] }, { 'background': [] }], // dropdown with defaults from theme | ||
[{ 'align': [] }], | ||
['blockquote', 'code-block'], | ||
|
||
[{ 'list': 'ordered'}, { 'list': 'bullet' }], | ||
[{ 'indent': '-1'}, { 'indent': '+1' }], // outdent/indent | ||
[{ 'direction': 'rtl' }], // text direction | ||
|
||
["image", "video", "formula"], // embeds | ||
|
||
['clean'], // remove formatting button | ||
|
||
[{"about": (v) => {console.log(v)}}], | ||
[{container: "#toolbar"}] | ||
]; | ||
|
||
var quill = new Quill('#text', { | ||
bounds: "#container", | ||
theme: 'snow', | ||
modules: { | ||
toolbar: "#toolbar" | ||
} | ||
}); | ||
</script> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters