alessandro trinca tornidor
feat: add some helper functions from lite.koboldai.net integration
0a8999b
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Words Frequency Statistics</title> | |
<link rel="stylesheet" href="/static/index-dark.css"> | |
<script src="/static/index.js"></script> | |
</head> | |
<body> | |
<h1 id="id-title" class="h1">Words Frequency Statistics in text</h1> | |
<div id="id-orientation-message" class="id-orientation-message" aria-hidden="true"><!-- ::before (Mobile users: use this project in landscape mode!) --></div> | |
<div class="margin10px"> | |
<button id="btn4-get-words-frequency" aria-label="btn4-get-words-frequency" onclick="getWordsFrequency()" type="submit">get words frequency</button> | |
<label for="id-input-webserver-wordfreq-checkbox" class="margin5px-left">Use a custom webserver endpoint</label> | |
<input | |
type="checkbox" | |
id="id-input-webserver-wordfreq-checkbox" | |
aria-label="id-input-webserver-wordfreq-checkbox" | |
name="id-input-webserver-wordfreq-checkbox" | |
onchange="document.getElementById('id-input-webserver-wordfreq').disabled=!this.checked;document.getElementById('id-wordfreq-show-analyzer').innerText=this.checked?'webserver':'embedded';" | |
checked | |
/> | |
<input type="URL" id="id-input-webserver-wordfreq" aria-label="id-input-webserver-wordfreq" value="http://localhost:7860" /> | |
<span>Currently using: <span id="id-wordfreq-show-analyzer" aria-label="id-wordfreq-show-analyzer">webserver</span></span> | |
<label for="id-input-file-selector" class="margin5px-left">Text file selector</label> | |
<input type="file" onchange="previewFile()" id="id-input-file-selector" aria-label="id-input-file-selector" /> | |
</div> | |
<div id="id-container-row-global-editor-frequency" class="display-flex"> | |
<div id="id-col1-editor" class="col-flex50 border-black padding10px margin10px overflow-hidden background-color-lightgray"> | |
<h4>Text Editor</h4> | |
<div class="gamescreenbgnormal calc98vh_less_240px" id="gamescreen"> | |
<span id="editor" contenteditable="true" class="max-height-90vh calc96vh_less_240px overflow-auto background-color-whitesmoke" aria-label="editor">Once upon a time, in the kingdom of Elwoodia, there lived a young and wise young Princess named Isabella. She loved | |
nothing more than to explore the world around her and experience new things. One day, she set off on an adventure to | |
find out about the mysterious and enchanting forest beyond the village gate. | |
<br> | |
As she journeyed through the woods, Isabella stumbled upon a large clearing where she saw a small group of woodland | |
creatures gathered around something. Curious, she went over to take a look. There she noticed a large, red apple | |
lying across the ground. It was so unusual that she had never seen anything like it before; its shape was round but | |
oval, and it was larger than any fruit she'd ever seen. | |
<br> | |
<br> | |
The creatures surrounding the apple moved aside to let Isabella get a closer look. As she came closer, she saw a | |
tiny fairy perched on top of the apple. The fairy flew to Isabella and spoke in a soft voice. | |
<br> | |
<br> | |
<br> | |
<br> | |
<span> | |
"Hi Isabella. Do you know where Harry is?" The fairy said. She was shy since they never spoken before. | |
<br> | |
Another sentence with the word "She". | |
<br> | |
<br> | |
"No, I don't know, but probably his father Harry Senior knows." Responded Isabella, a little unsure. She was | |
afraid... | |
<br> | |
She was right? | |
</span> | |
<span><br></span> | |
<span> | |
Or not? | |
<br> | |
<br> | |
<br> | |
<br> | |
"Thank you, I really need to find that boy, Harry!" Said the small creature. She turned back. | |
<br> | |
<br> | |
</span> | |
<span> | |
The fairy was really beautiful, dressed with colourful flowers and green leaves. | |
<br> | |
</span> | |
<span><br></span> | |
<span> | |
She grabbed some rocks. One was red. | |
<br> | |
The second one was gray. | |
<br> | |
The third was... different: almost transparent, she almost cut her fingers while turning it. | |
<br> | |
The last one was black with plenty of holes within. | |
<br><br> | |
A Row in the middle. | |
<br><br> | |
Another row. | |
<br> | |
More one. | |
<br> | |
A last row, I hope. | |
</span></span> | |
</div> | |
<div class="display-none collapse"><span id="id-hidden-editor" aria-label="id-hidden-editor">placehoder</span></div> | |
</div> | |
<!-- start HTML section - My Ghost Writer - https://github.com/trincadev/my_ghost_writer --> | |
<div id="id-col2-words-frequency" style="display:none" class="col-flex50 border-gray-litekoboldai padding10px margin10px overflow-hidden font-size-12px"> | |
<div id="words-freq-menu" class="topmenu"> | |
<div style="width: 100%;"> | |
<div class="display-grid grid-template-5x1"> | |
<h4 id="id-words-frequency-table-title" aria-label="id-words-frequency-table-title" class="">Words Frequency Stats</h4> | |
<button id="id-words-frequency-btn-navbar" title="Words freq Menu Options" class="navtoggler-words-freq" type="button" onclick="toggleWordsFreqNav()" tabindex="0"> | |
Menù | |
</button> | |
</div> | |
<div class="collapse" id="wordsFreqNavbarNavDropdown"> | |
<input type="text" id="filter-words-frequency" aria-label="filter-words-frequency" placeholder="Filter the output..." class="background-color-verydarkgrey" onkeypress="updateWordsFreqIfPressEnterSimple()"/> | |
<ul class="nav navbar-nav display-grid margin5px-top"> | |
<li class="nav-item" id="words_freq_topbtn_1"> | |
<button type="button" class="btn btn-primary mainnav" id="btn4-get-words-frequency-get" aria-label="btn4-get-words-frequency-get" onclick="closeWordsFreqTopNav();getWordsFrequency()">Words Freq</button> | |
</li> | |
<li class="nav-item" id="words_freq_topbtn_2"> | |
<button type="submit" class="btn btn-primary bg_green mainnav" id="btn-filter-words-frequency-filter" aria-label="btn-filter-words-frequency-filter" onclick="closeWordsFreqTopNav();updateWordsFrequencyTables()">Filter / Update</button> | |
</li> | |
<li class="nav-item display-block" id="words_freq_topbtn_3"> | |
<div class="grid-template-1x2 margin2px-bottom"> | |
<form id="id-form-sort-by" aria-label="id-form-sort-by"> | |
<fieldset> | |
<legend>Sort:</legend> | |
<div> | |
<input type="radio" id="sort-by-count" aria-label="sort-by-count" name="sort" value="count"/> | |
<label for="sort-by-count" id="sort-by-count-label" aria-label="sort-by-count-label">Count</label> | |
<input type="radio" id="sort-by-name" aria-label="sort-by-name" name="sort" value="word_prefix" /> | |
<label for="sort-by-name" id="sort-by-name-label" aria-label="sort-by-name-label">Name</label> | |
</div> | |
</fieldset> | |
</form> | |
<form id="id-form-order-by" aria-label="id-form-order-by"> | |
<fieldset> | |
<legend>Order:</legend> | |
<div> | |
<input type="radio" id="order-by-asc" aria-label="order-by-asc" name="order" value="asc" /> | |
<label for="order-by-asc" id="order-by-asc-label" aria-label="order-by-asc-label">Ascend</label> | |
<input type="radio" id="order-by-desc" aria-label="order-by-desc" name="order" value="desc" checked/> | |
<label for="order-by-desc" id="order-by-desc-label" aria-label="order-by-desc-label">Descend</label> | |
</div> | |
</fieldset> | |
</form> | |
</div> | |
</li> | |
</ul> | |
</div> | |
</div> | |
</div> | |
<span id="id-n-total-rows" aria-label="id-n-total-rows" class="display-none"></span> | |
<span id="waiting-for-be" class="display-none">waiting for backend response...</span> | |
<span id="waiting-for-be-error" class="display-none">Error!</span> | |
<!-- max-height-50vh instead of max-height-80vh --> | |
<div id="words-frequency" class="max-height-80perc overflow-hidden" aria-label="words-frequency"> | |
<div id="id-list-of-words" class="margin10px overflow-auto" aria-label="id-list-of-words"></div> | |
<div id="id-current-table-of-words" class="margin10px overflow-auto" aria-label="id-current-table-of-words"></div> | |
</div> | |
</div> | |
<!-- end HTML section - My Ghost Writer - https://github.com/trincadev/my_ghost_writer --> | |
</div> | |
</body> | |
</html> |