Skip to content

Commit

Permalink
create skelet for ui and control
Browse files Browse the repository at this point in the history
  • Loading branch information
vokymir committed May 11, 2024
1 parent d8e25db commit 5e022a0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 44 deletions.
44 changes: 0 additions & 44 deletions TScripts/Control.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@

class Control{

constructor(){

}

static createTournament(){
// new tournament
// buildTournamentPage
Expand All @@ -13,46 +9,6 @@ class Control{
static loadTournament(){
// load
// build
const l = new Log(4,LogEvent.EDIT_MATCH,4,7)
const a = JSON.stringify(l);
const b = JSON.stringify([4,LogEvent.EDIT_MATCH,4,7]);
console.log(a);
console.log(b);
const c = JSON.parse(a);
const d = JSON.parse(b);
console.log(c);
console.log(d);
const e = new Log(c.id,c.type,c.previous,c.after);
console.log(e);
console.log(e.getType());

const jsonBlob = new Blob([a],{type: 'application/json'});

const downloadLink = document.createElement('a');
downloadLink.href = URL.createObjectURL(jsonBlob);
downloadLink.download = 'object.json';
downloadLink.textContent = 'Download Object';

document.body.appendChild(downloadLink);


downloadLink.addEventListener('click', () => {
URL.revokeObjectURL(downloadLink.href);
});

const jsonBlobII = new Blob([b],{type: 'application/json'});

const downloadLinkII = document.createElement('a');
downloadLinkII.href = URL.createObjectURL(jsonBlobII);
downloadLinkII.download = 'tuple.json';
downloadLinkII.textContent = 'Download Tuple';

document.body.appendChild(downloadLinkII);


downloadLinkII.addEventListener('click', () => {
URL.revokeObjectURL(downloadLinkII.href);
});
}

static resumeTournament(){
Expand Down
25 changes: 25 additions & 0 deletions TScripts/UI.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

class UI{

static buildHomePage(){
// append all buttons and whatever
}

static buildTournamentPage(){
// append all buttons with current tournament inserted to html
}

static buildMatchPage(){
// as before, insert specific match to html if needed
}

static buildJustMatchPage(match: Match){
// build a page for it
// add a button for: save and start a tournament from it
}


static updateTournamentPage(){
// basically when change of order method happen, so the ui reflects it
}
}

0 comments on commit 5e022a0

Please sign in to comment.