Skip to content

Commit 439a5a3

Browse files
authored
[merge] pull request #21 from akrck02/dev
Dev
2 parents 387ffd5 + f264b8d commit 439a5a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2482
-2014
lines changed

app/styles/src/components/notification/Notification.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ notification #nt-bar.hidden{
3131
}
3232

3333
notification #nt-bar #nt-title{
34-
font-size : 1.25rem"
34+
font-size : 1.25rem;
3535
}
3636

3737
notification #nt-content {

container/deploy/.gitkeep

Whitespace-only changes.

container/develop/.gitkeep

Whitespace-only changes.

frontend/src/App.ts

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import Router from "./views/Router.js";
2-
import { getParametersByIndex } from "./lib/gtd/data/urltools.js";
3-
import { TextBundle } from "./lang/TextBundle.js";
2+
import URLs from "./lib/gtdf/data/Urls.js";
43
import { Config } from "./config/Config.js";
54
import { Events, IEvents } from "./core/events/Events.js";
65
import Keyboard from "./core/events/Keyboard.js";
76
import NotificationUI, { NotificationProperties } from "./components/notifications/Notification.js";
8-
7+
import Initializer from "./core/Initializer.js";
98

109
/**
1110
* Class that represents the application frontend proccess
@@ -19,19 +18,18 @@ export default class App {
1918
private notification : NotificationUI;
2019

2120
/**
22-
* Create an instance of the application
21+
* Create an instance of the apjplication
2322
*/
2423
constructor(){
24+
2525
this.router = new Router();
2626
this.events = Events;
27-
2827
Keyboard.setEventListeners(this.events);
2928

3029
// Set the notification element
3130
this.notification = new NotificationUI();
3231
document.body.appendChild(this.notification.element);
3332
this.setNoficationSystem();
34-
console.log("App loaded!");
3533
}
3634

3735
/**
@@ -45,8 +43,11 @@ export default class App {
4543
* The first parameter must be a view name, otherwise the
4644
* app will redirect the user to an 404 error page.
4745
*/
48-
load(){
49-
const params = getParametersByIndex(window.location.hash.slice(1).toLowerCase(),1);
46+
async load(){
47+
await Initializer.subscribeInitializables();
48+
await Initializer.notify();
49+
50+
const params = URLs.getParametersByIndex(window.location.hash.slice(1).toLowerCase(),1);
5051
this.router.load(params);
5152
}
5253

@@ -65,8 +66,8 @@ export default class App {
6566
// If the desktop notification are active
6667
if(properties.desktop){
6768

68-
new Notification(Config.BASE.APP_NAME ,{
69-
icon: Config.PATHS.ICONS + "logo.svg",
69+
new Notification(Config.Base.app_name ,{
70+
icon: Config.Path.icons + "logo.svg",
7071
body: properties.message,
7172
})
7273
}
@@ -75,15 +76,5 @@ export default class App {
7576

7677
}
7778

78-
/**
79-
* Get current language text bundle
80-
* @returns The text bundle int the current app language.
81-
*/
82-
public static getBundle() : any {
83-
let lang = Config.getLanguage();
84-
return TextBundle.get(lang);
85-
}
86-
8779
}
8880

89-

frontend/src/Start.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import App from "./App.js";
2-
import { Config } from "./config/Config.js";
2+
import { Config, Configuration } from "./config/Config.js";
33

44

55
export let app : App;
66

7-
87
/**
98
* When the dynamic URL changes loads
109
* the correspoding view from the URL
1110
*/
12-
window.addEventListener('hashchange',() => {
13-
app.load()
11+
window.addEventListener('hashchange',async () => {
12+
await app.load()
1413
});
1514

1615
/**
@@ -20,9 +19,8 @@ window.addEventListener('hashchange',() => {
2019
window.onload = async () => {
2120

2221
if(app === undefined){
23-
await Config.setDefaultVariables();
2422
app = new App();
2523
}
2624

27-
app.load();
25+
await app.load();
2826
}

frontend/src/components/canvas/Canvas.ts

Lines changed: 0 additions & 125 deletions
This file was deleted.

frontend/src/components/clock/Clock.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

frontend/src/components/notifications/Notification.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { getMaterialIcon } from "../../lib/gtd/material/materialicons.js";
2-
import { setClasses, setStyles, UIComponent } from "../../lib/gtdf/components/uicomponent.js";
1+
import MaterialIcons from "../../lib/gtdf/resources/MaterialIcons.js";
2+
import { UIComponent } from "../../lib/gtdf/components/UIComponent.js";
33

44
export interface NotificationProperties {
55
title ?: string,
@@ -53,7 +53,7 @@ export default class NotificationUI extends UIComponent {
5353
this.bar.element.classList.remove("hidden");
5454
this.bar.appendChild(title);
5555
} else {
56-
setClasses(this.bar.element,["hidden"])
56+
this.bar.setClasses(["hidden"])
5757
}
5858

5959
if(properties.message){
@@ -66,18 +66,18 @@ export default class NotificationUI extends UIComponent {
6666
}
6767

6868
if(properties.icon) {
69-
const icon = getMaterialIcon(properties.icon,{size: "1.25rem" , fill: "#404040"});
69+
const icon = MaterialIcons.get(properties.icon,{size: "1.25rem" , fill: "#404040"});
7070
this.content.appendChild(icon);
7171
}
7272
}
7373

7474
public async show(seconds : number = 1) {
7575

7676
if(this.showing)
77-
return;
77+
return;
7878

7979
setTimeout(() => {
80-
setClasses(this.element,["show"])
80+
this.setClasses(["show"])
8181
}, 1);
8282

8383
this.showing = true;

frontend/src/components/select/Select.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { getMaterialIcon } from "../../lib/gtd/material/materialicons.js";
2-
import { setEvents, UIComponent } from "../../lib/gtdf/components/uicomponent.js";
1+
import MaterialIcons from "../../lib/gtdf/resources/MaterialIcons.js";
2+
import { UIComponent } from "../../lib/gtdf/components/UIComponent.js";
33

44

55
export interface StringMap {
@@ -33,16 +33,19 @@ export default class Select extends UIComponent {
3333
});
3434
displayBox.appendTo(this);
3535

36-
setEvents(displayBox.element, {
36+
displayBox.setEvents({
3737
click : (e : Event) => {
38+
3839
e.preventDefault();
3940
e.stopPropagation();
4041

4142
if(this.element.classList.contains("show")){
4243
this.element.classList.remove("show");
43-
} else {
44-
this.element.classList.add("show")
45-
}
44+
return;
45+
}
46+
47+
this.element.classList.add("show")
48+
4649
}
4750
})
4851

@@ -55,8 +58,8 @@ export default class Select extends UIComponent {
5558
})
5659
this.display.appendTo(displayBox);
5760

58-
const icon = getMaterialIcon("expand",{
59-
size: "1rem",
61+
const icon = MaterialIcons.get("expand",{
62+
size: "1.15em",
6063
fill: "#404040"
6164
})
6265

@@ -81,7 +84,7 @@ export default class Select extends UIComponent {
8184
},
8285
})
8386

84-
setEvents(option.element, {
87+
option.setEvents({
8588
click : () =>{
8689
onclick(option.element.dataset.value);
8790
}

0 commit comments

Comments
 (0)