Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
akurilov committed Mar 23, 2024
1 parent 96492c4 commit 1dc3b01
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 633 deletions.
62 changes: 22 additions & 40 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<link rel="apple-touch-icon" sizes="180x180" href="logo-color.svg">
<link rel="icon" href="logo-color.svg">
<link rel="manifest" href="manifest.json">
<link href="select2.css" rel="stylesheet" />

<meta name="msapplication-TileColor" content="#0ed3cf">
<meta name="theme-color" content="#0ed3cf">
Expand Down Expand Up @@ -146,13 +145,10 @@
<script src="evts.js"></script>
<script src="intcomm.js"></script>
<script src="jquery-3.7.1.min.js"></script>
<script src="select2.min.js"></script>
<script src="query.js"></script>
<script src="login.js"></script>
<script src="status.js"></script>

<link href="select2.css" rel="stylesheet" />

</head>
<body class="bg-gray-200" onload="loadQuery(); loadStatus();">

Expand Down Expand Up @@ -181,12 +177,9 @@
spellcheck="false"
required="required"
type="search"
placeholder="Future Search..."
placeholder="Future Search"
class="ml-1 border-0 outline-none w-52 sm:w-[480px] dark:bg-gray-800 text-md text-lg"
minlength="3"/>
<!-- <input name="curr" id="q-curr" type="hidden"/>-->
<!-- <input name="lang" id="q-lang" type="hidden"/>-->
<!-- <input name="subj" id="q-subj" type="hidden"/>-->
</div>
</form>

Expand All @@ -203,33 +196,6 @@
</div>
</div>

<!-- <div class="flex space-x-2 pt-2 align-middle justify-center text-sm sm:text-md h-12 max-w-[624px] mx-auto text-neutral-600 dark:text-neutral-300">-->
<!-- <select class="dropdown-multiselect js-states form-control min-w-20 sm:w-40"-->
<!-- id="currencies"-->
<!-- name="currencies[]"-->
<!-- multiple="multiple"-->
<!-- data-placeholder="Currency...">-->
<!-- </select>-->
<!-- <select class="dropdown-multiselect js-states form-control min-w-20 sm:w-40"-->
<!-- id="languages"-->
<!-- name="languages[]"-->
<!-- multiple="multiple"-->
<!-- data-placeholder="Language...">-->
<!-- </select>-->
<!-- <select class="dropdown-multiselect js-states form-control min-w-20 sm:w-40"-->
<!-- id="subjects"-->
<!-- name="subjects[]"-->
<!-- multiple="multiple"-->
<!-- data-placeholder="Subject...">-->
<!-- </select>-->
<!-- <select class="border-0 outline-none focus:outline-none text-gray-600 dark:text-gray-400" style="background-color: unset; margin-bottom: 14px">-->
<!-- <option value="5m" class="dark:bg-gray-800">5 min</option>-->
<!-- <option value="15m" class="dark:bg-gray-800" selected="selected">15 min</option>-->
<!-- <option value="1h" class="dark:bg-gray-800">1 h</option>-->
<!-- <option value="6h" class="dark:bg-gray-800">6 h</option>-->
<!-- </select>-->
<!-- </div>-->

<!-- Mobile Menu open: "block", Menu closed: "hidden" -->
<div id="menu" x-cloak :class="[isOpen ? 'translate-x-0 opacity-100 ' : 'opacity-0 -translate-x-full']" class="absolute inset-x-0 z-20 w-full bg-white px-6 py-4 shadow-md transition-all duration-300 ease-in-out dark:bg-gray-900">
<div id="menu-default" class="flex flex-col space-y-4 lg:mt-0 lg:flex-row lg:space-y-0 text-right md:text-center md:justify-center">
Expand All @@ -247,16 +213,16 @@
class="absolute inset-x-0 z-20 w-full bg-white px-1 py-1 shadow-md transition-all duration-300 ease-in-out dark:bg-gray-900 items-center justify-center flex flex-col space-y-1">

<div class="grid space-x-2">
<span class="col-span-2 text-center text-gray-600 dark:text-gray-400 text-sm">
<span class="col-span-2 text-center text-gray-600 dark:text-gray-400">
<p id="streaming-results">
Results will appear below.
Results will appear below for the next 1h.</p>
<p>
<a href="login.html" class="text-blue-500">Sign In</a>
for the full mode.
</p>
for the full-featured mode.</p>
<div class="flex">
<div class="grow w-full"></div>
<svg xmlns="http://www.w3.org/2000/svg"
onclick="queryStop()"
onclick="confirm('Stop search and results streaming?') ? queryStop() : console.log('query stop cancelled by user')"
class="h-6 w-6 place-self-end sm:place-self-center text-gray-800 dark:text-gray-200"
fill="none"
viewBox="0 0 24 24"
Expand Down Expand Up @@ -486,6 +452,14 @@ <h2 class="px-2 capitalize text-2xl">No More Spam</h2>
<p class="px-2">
Structured search across attributes:
</p>
<p class="px-2 align-text-middle space-x-2 flex">
<span class="h-6 w-6">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 min-w-max text-blue-400" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
</svg>
</span>
<span>Author</span>
</p>
<p class="px-2 align-text-middle space-x-2 flex">
<span class="h-6 w-6">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 min-w-max text-blue-400" viewBox="0 0 20 20" fill="currentColor">
Expand Down Expand Up @@ -518,6 +492,14 @@ <h2 class="px-2 capitalize text-2xl">No More Spam</h2>
</span>
<span>Price</span>
</p>
<p class="px-2 align-text-middle space-x-2 flex">
<span class="h-6 w-6">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 min-w-max text-blue-400" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
</svg>
</span>
<span>Source</span>
</p>
<p class="px-2">
...and much more
</p>
Expand Down
101 changes: 0 additions & 101 deletions web/query.js
Original file line number Diff line number Diff line change
@@ -1,104 +1,3 @@
// select2 init
//$(document).ready(function() {

// $('#currencies').select2({
// ajax: {
// url: '/v1/status/attr/values/offerspricecurrency',
// processResults: function (data) {
// let results = [];
// let i = 0;
// for (const v of data) {
// results.push({
// id: i,
// text: v,
// });
// i ++;
// }
// return {
// results: results,
// };
// },
// placeholder: function() {
// // 'this' refers to the current select2 element
// return $(this).data('placeholder'); // Assuming you have a 'data-placeholder' attribute in your HTML
// },
// allowClear: true,
// }
// });

// $('#languages').select2({
// ajax: {
// url: '/v1/status/attr/values/language',
// processResults: function (data) {
// let results = [];
// let i = 0;
// for (const v of data) {
// results.push({
// id: i,
// text: v,
// });
// i ++;
// }
// return {
// results: results,
// };
// },
// placeholder: function() {
// // 'this' refers to the current select2 element
// return $(this).data('placeholder'); // Assuming you have a 'data-placeholder' attribute in your HTML
// },
// allowClear: true,
// }
// });

// $('#subjects').select2({
// ajax: {
// url: '/v1/status/attr/values/subject',
// processResults: function (data) {
// let results = [];
// let i = 0;
// for (const v of data) {
// results.push({
// id: i,
// text: v,
// });
// i ++;
// }
// return {
// results: results,
// };
// },
// placeholder: function() {
// // 'this' refers to the current select2 element
// return $(this).data('placeholder'); // Assuming you have a 'data-placeholder' attribute in your HTML
// },
// allowClear: true,
// }
// });
//
// document.getElementById("currencies").onchange = (evt) => {
// let currencies = [];
// for (const item of $('#currencies').select2('data')) {
// currencies.push(item.text);
// }
// document.getElementById("q-curr").value = currencies.join(",");
// }
// document.getElementById("languages").onchange = (evt) => {
// let languages = [];
// for (const item of $('#languages').select2('data')) {
// languages.push(item.text);
// }
// document.getElementById("q-lang").value = languages.join(",");
// }
// document.getElementById("subjects").onchange = (evt) => {
// let subjects = [];
// for (const item of $('#subjects').select2('data')) {
// subjects.push(item.text);
// }
// document.getElementById("q-subj").value = subjects.join(",");
// }
//});

const resultsStreamingTimeout = 3_600_000;

function loadQuery() {
Expand Down
Loading

0 comments on commit 1dc3b01

Please sign in to comment.