From 4da9f525dabd1acbe887706b9e85cfb6034f58b6 Mon Sep 17 00:00:00 2001 From: jelveh Date: Mon, 30 Dec 2024 20:39:51 -0800 Subject: [PATCH] delete components that aren't used --- src/gui/src/UI/Components/ActionCard.js | 59 ------------------------- src/gui/src/UI/Components/Frame.js | 40 ----------------- src/gui/src/UI/Components/Glyph.js | 48 -------------------- src/gui/src/UI/Components/JustID.js | 19 -------- src/gui/src/UI/Components/NotifCard.js | 41 ----------------- src/gui/src/UI/Components/TestView.js | 42 ------------------ src/gui/src/init_async.js | 6 --- src/gui/utils.js | 1 - 8 files changed, 256 deletions(-) delete mode 100644 src/gui/src/UI/Components/ActionCard.js delete mode 100644 src/gui/src/UI/Components/Frame.js delete mode 100644 src/gui/src/UI/Components/Glyph.js delete mode 100644 src/gui/src/UI/Components/JustID.js delete mode 100644 src/gui/src/UI/Components/NotifCard.js delete mode 100644 src/gui/src/UI/Components/TestView.js diff --git a/src/gui/src/UI/Components/ActionCard.js b/src/gui/src/UI/Components/ActionCard.js deleted file mode 100644 index dc115b2a..00000000 --- a/src/gui/src/UI/Components/ActionCard.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (C) 2024 Puter Technologies Inc. - * - * This file is part of Puter. - * - * Puter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - - -const Component = use('util.Component'); - -export default def(class ActionCard extends Component { - static ID = 'ui.component.ActionCard'; - static RENDER_MODE = Component.NO_SHADOW; - - static PROPERTIES = { - title: { - value: 'Title' - }, - info: {}, - button_text: {}, - button_style: {}, - on_click: {}, - style: {}, - } - - create_template ({ template }) { - $(template).html(/*html*/` -
-
- ${ this.get('title') } - ${ - this.get('info') - } -
-
- -
-
- `); - } - - on_ready ({ listen }) { - $(this.dom_).find('button').on('click', this.get('on_click') || (() => {})); - } -}); diff --git a/src/gui/src/UI/Components/Frame.js b/src/gui/src/UI/Components/Frame.js deleted file mode 100644 index 581481f3..00000000 --- a/src/gui/src/UI/Components/Frame.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (C) 2024 Puter Technologies Inc. - * - * This file is part of Puter. - * - * Puter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - - -const Component = use('util.Component'); - -export default def(class Frame extends Component { - static ID = 'ui.component.Frame'; - static RENDER_MODE = Component.NO_SHADOW; - - static PROPERTIES = { - component: {}, - } - - on_ready ({ listen }) { - listen('component', component => { - this.dom_.innerHTML = ''; - if ( ! component ) { - return; - } - component.attach(this.dom_); - }); - } -}); diff --git a/src/gui/src/UI/Components/Glyph.js b/src/gui/src/UI/Components/Glyph.js deleted file mode 100644 index 39f6c145..00000000 --- a/src/gui/src/UI/Components/Glyph.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (C) 2024 Puter Technologies Inc. - * - * This file is part of Puter. - * - * Puter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - - -import { Component } from "../../util/Component.js"; - -export default def(class Glyph extends Component { - static ID = 'ui.component.Glyph'; - - static PROPERTIES = { - size: { - value: 24, - }, - codepoint: { - value: '✅', - }, - } - - static CSS = ` - div { - text-align: center; - } - `; - - create_template ({ template }) { - template.innerHTML = /*html*/` -
- ${this.get('codepoint')} -
- `; - } -}); diff --git a/src/gui/src/UI/Components/JustID.js b/src/gui/src/UI/Components/JustID.js deleted file mode 100644 index 495108c2..00000000 --- a/src/gui/src/UI/Components/JustID.js +++ /dev/null @@ -1,19 +0,0 @@ -const Component = use('util.Component'); - -export default def(class JustID extends Component { - static ID = 'ui.component.JustID'; - static RENDER_MODE = Component.NO_SHADOW; - - static PROPERTIES = { - id: { value: undefined }, - } - - create_template ({ template }) { - const size = 24; - $(template).html(/*html*/` -
- `); - } -}) diff --git a/src/gui/src/UI/Components/NotifCard.js b/src/gui/src/UI/Components/NotifCard.js deleted file mode 100644 index 9f71a8b4..00000000 --- a/src/gui/src/UI/Components/NotifCard.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (C) 2024 Puter Technologies Inc. - * - * This file is part of Puter. - * - * Puter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - - -const Component = use('util.Component'); - -export default def(class NotifCard extends Component { - static ID = 'ui.component.NotifCard'; - static RENDER_MODE = Component.NO_SHADOW; - - static PROPERTIES = { - text: { value: 'no text' }, - style: {}, - } - - create_template ({ template }) { - $(template).html(/*html*/` -
-
- ${ this.get('text') } -
-
- `); - } -}); diff --git a/src/gui/src/UI/Components/TestView.js b/src/gui/src/UI/Components/TestView.js deleted file mode 100644 index f92eacb2..00000000 --- a/src/gui/src/UI/Components/TestView.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (C) 2024 Puter Technologies Inc. - * - * This file is part of Puter. - * - * Puter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - - -const Component = use('util.Component'); - -/** - * A simple component when you just need to test something. - */ -export default def(class TestView extends Component { - static ID = 'ui.component.TestView'; - - static CSS = ` - div { - background-color: lightblue; - padding: 1em; - border-radius: 0.5em; - } - `; - - create_template ({ template }) { - $(template).html(` -
I am a test view
- `); - } -}); diff --git a/src/gui/src/init_async.js b/src/gui/src/init_async.js index 97e05b76..bc58bd40 100644 --- a/src/gui/src/init_async.js +++ b/src/gui/src/init_async.js @@ -22,13 +22,7 @@ logger.info('start -> async initialization'); import './util/TeePromise.js'; import './util/Component.js'; import './util/Collector.js'; -import './UI/Components/Frame.js'; -import './UI/Components/Glyph.js'; import './UI/Components/Spinner.js'; -import './UI/Components/ActionCard.js'; -import './UI/Components/NotifCard.js'; -import './UI/Components/TestView.js'; -import './UI/Components/JustID.js'; import './UI/UIElement.js'; import './UI/UIWindowSaveAccount.js'; import './UI/UIWindowEmailConfirmationRequired.js'; diff --git a/src/gui/utils.js b/src/gui/utils.js index 748fb836..46a60710 100644 --- a/src/gui/utils.js +++ b/src/gui/utils.js @@ -20,7 +20,6 @@ import { encode } from 'html-entities'; import fs from 'fs'; import path from 'path'; import webpack from 'webpack'; -import webpack_config from './webpack.config.cjs'; import CleanCSS from 'clean-css'; import uglifyjs from 'uglify-js'; import { lib_paths, css_paths, js_paths } from './src/static-assets.js';