Remove unused code

This commit is contained in:
Daoud Clarke 2023-10-30 16:44:15 +00:00
parent 6e39893bc1
commit f25f7057a2
4 changed files with 0 additions and 78 deletions

View file

@ -1,33 +0,0 @@
import define from '../utils/define.js';
import addResult from "./molecules/add-result.js";
import save from "./organisms/save.js";
const template = () => /*html*/`
<header class="search-menu">
<ul>
<li is="${save}"></li>
</ul>
<div><a href="/accounts/login/">Login</a> <a href="/accounts/signup/">Sign up</a> </div>
<div class="branding">
<img class="brand-icon" src="/static/images/logo.svg" width="40" height="40" alt="mwmbl logo">
<span class="brand-title">MWMBL</span>
</div>
<mwmbl-search-bar></mwmbl-search-bar>
</header>
<main>
<mwmbl-results></mwmbl-results>
</main>
<div is="${addResult}"></div>
<footer is="mwmbl-footer"></footer>
`;
export default define('app', class extends HTMLElement {
constructor() {
super();
this.__setup();
}
__setup() {
this.innerHTML = template();
}
});

View file

@ -1,26 +1,7 @@
import define from '../../utils/define.js';
import escapeString from '../../utils/escapeString.js';
import { globalBus } from '../../utils/events.js';
import deleteButton from "./delete-button.js";
import validateButton from "./validate-button.js";
import addButton from "./add-button.js";
// const template = ({ data }) => /*html*/`
// <div class="result-container">
// <div class="curation-buttons">
// <button class="curation-button curate-delete" is="${deleteButton}">✕</button>
// <button class="curation-button curate-approve" is="${validateButton}">✓</button>
// <button class="curation-button curate-add" is="${addButton}"></button>
// </div>
// <div class="result-link">
// <a href='${data.url}'>
// <p class='link'>${data.url}</p>
// <p class='title'>${data.title}</p>
// <p class='extract'>${data.extract}</p>
// </a>
// </div>
// </div>
// `;
export default define('result', class extends HTMLLIElement {
constructor() {
@ -30,11 +11,6 @@ export default define('result', class extends HTMLLIElement {
}
__setup() {
// this.innerHTML = template({ data: {
// url: this.dataset.url,
// title: this.__handleBold(JSON.parse(this.dataset.title)),
// extract: this.__handleBold(JSON.parse(this.dataset.extract))
// }});
this.__events();
}

View file

@ -1,26 +1,11 @@
import define from '../../utils/define.js';
import {globalBus} from '../../utils/events.js';
// Components
import result from '../molecules/result.js';
import emptyResult from '../molecules/empty-result.js';
import home from './home.js';
import escapeString from '../../utils/escapeString.js';
// const template = () => /*html*/`
// <ul class='results'>
// <li is='${home}'></li>
// </ul>
// `;
document.body.addEventListener('htmx:load', function(evt) {
});
// export default define('results', class extends HTMLElement {
class ResultsHandler {
constructor() {
this.results = null;
@ -30,15 +15,11 @@ class ResultsHandler {
}
__setup() {
// this.innerHTML = template();
this.__events();
}
__events() {
document.body.addEventListener('htmx:load', e => {
// });
//
// globalBus.on('search', (e) => {
this.results = document.querySelector('.results');
// Allow the user to re-order search results
@ -204,4 +185,3 @@ class ResultsHandler {
}
const resultsHandler = new ResultsHandler();

View file

@ -14,7 +14,6 @@
if (!redirected) {
// Load components only after redirects are checked.
// import('./components/app.js');
import('./components/login.js');
import('./components/register.js');
import("./components/organisms/search-bar.js");