diff --git a/dashboard.html b/dashboard.html index 08f6cb4..d98d91f 100644 --- a/dashboard.html +++ b/dashboard.html @@ -1,67 +1,150 @@ - -LAX18's Homepage | Admin Dashboard - - - - - - - - - - - -
- - -
-

Admin Dashboard

- Add Project:
- Title:
-
- Link:
-
- Status:
-
- Description:
-
- -

- Select Project to Edit:
-
- Link:
-
- Status:
-
- Description:
-
- - - + + LAX18's Homepage | Admin Dashboard + + + + + + + + + + + +
+ + +
+

Admin Dashboard

+ + + + + +
+ Projects + +
+
+ + + + + + + +
+ Add Project:

+ Title:
+
+ Link:
+
+ Status:
+ +
+ Description:
+ +
+ +

+
+ Select Project to Edit:
+
+ Link:
+
+ Status:
+ +
+ Description:
+ +
+ +
+


+ + + + + +
+ Programs + +
+
+ + + + + + + +
+ Add Program:

+ Title:
+
+ Link:
+
+ Image Link:
+
+ Author
+
+ Type
+
+ Description:
+ +
+ +

+
+ Select Program to Edit:
+
+ Link:
+
+ Image Link:
+
+ Author
+
+ Type
+
+ Description:
+ +
+ +
+ + \ No newline at end of file diff --git a/js/script.js b/js/script.js index 70063ac..8a7c2dd 100644 --- a/js/script.js +++ b/js/script.js @@ -1,3 +1,86 @@ +// Display List of Programs in form +function programList() { + database = firebase.database().ref("programs"); + database.once('value', function(snapshot) { + snapshot.forEach(function(child) { + var a = document.createElement("option") + a.setAttribute("value",child["key"].replace(/,/g,".")) + a.innerHTML = child["key"].replace(/,/g,".") + document.getElementById("program-list").appendChild(a) + }) + }); + programOnChange(); +} + +// Add New Program +function submitProgram() { + var data = { + title: document.getElementById("new-program-title").value.replace(".",","), + link: document.getElementById("new-program-link").value, + imglink: document.getElementById("new-program-imglink").value, + author: document.getElementById("new-program-author").value, + description: document.getElementById("new-program-description").value, + programtype: document.getElementById("new-program-type").value + } + firebase.database().ref("programs/"+document.getElementById("new-program-title").value.replace(".",",")).set(data) + document.getElementById("new-program-title").value = ''; + document.getElementById("new-program-link").value = ''; + document.getElementById("new-program-imglink").value = ''; + document.getElementById("new-program-description").value = ''; + document.getElementById("new-program-author").value = ""; + document.getElementById("new-program-type").value = ""; +} + + +// onChange Page Update +function programOnChange() { + var title = document.getElementById("program-list").value + var database = firebase.database().ref("programs/"+title.replace(/,/g,".")); + database.on('value', function(data) { + var data1 = data.val() + document.getElementById("edit-program-link").value = data1["link"] + document.getElementById("edit-program-imglink").value = data1["imglink"] + document.getElementById("edit-program-description").value = data1["description"] + document.getElementById("edit-program-author").value = data1["author"] + document.getElementById("edit-program-type").value = data1["programtype"] + }) +} + + +// Display all programs +function displayPrograms() { + database = firebase.database().ref("programs"); + database.once('value', function(snapshot) { + snapshot.forEach(function(child) { + firebase.database().ref("programs/"+child["key"]).on('value', function (data) { + var data1 = data.val(); + var a = document.createElement("tr") + a.innerHTML = ""+data1["title"]+"
By "+data1["author"]+"
"+data1["programtype"]+"
"+data1["description"]+"" + document.getElementById("programs").appendChild(a) + } + )}) + }); +} + +// Edit Program Entry +function editProgram() { + var data = { + title: document.getElementById("program-list").value.replace(".",","), + link: document.getElementById("edit-program-link").value, + imglink: document.getElementById("edit-program-imglink").value, + author: document.getElementById("edit-program-author").value, + description: document.getElementById("edit-program-description").value, + programtype: document.getElementById("edit-program-type").value + } + firebase.database().ref("programs/"+document.getElementById("program-list").value.replace(".",",")).set(data) + document.getElementById("program-list").value = ''; + document.getElementById("edit-program-link").value = ''; + document.getElementById("edit-program-author").value = ''; + document.getElementById("edit-program-description").value = ''; + document.getElementById("edit-program-type").value = ""; + document.getElementById("edit-program-imglink").value = ""; +} + // Display all projects function displayProjects() { database = firebase.database().ref("projects"); @@ -7,9 +90,9 @@ function displayProjects() { var data1 = data.val(); var a = document.createElement("table") if (data1["link"] == "") { - a.innerHTML = "
"+data1["title"]+"
"+data1["status"]+"
"+data1["description"]+"" + a.innerHTML = "
"+data1["title"].replace(/,/g,".")+"
"+data1["status"]+"
"+data1["description"]+"" } else { - a.innerHTML = "
"+data1["title"]+"
"+data1["status"]+"
"+data1["description"]+"" + a.innerHTML = "
"+data1["title"].replace(/,/g,".")+"
"+data1["status"]+"
"+data1["description"]+"" } document.getElementById("projects").appendChild(a) } @@ -20,12 +103,12 @@ function displayProjects() { // Edit Selected Project function editProject() { var data = { - title: document.getElementById("project-list").value, + title: document.getElementById("project-list").value.replace(".",","), link: document.getElementById("edit-project-link").value, status: document.getElementById("edit-project-status").value, description: document.getElementById("edit-project-description").value } - firebase.database().ref("projects/"+document.getElementById("project-list").value).set(data) + firebase.database().ref("projects/"+document.getElementById("project-list").value.replace(".",",")).set(data) document.getElementById("project-list").value = ''; document.getElementById("edit-project-link").value = ''; document.getElementById("edit-project-status").value = 'active'; @@ -35,7 +118,7 @@ function editProject() { // onChange page update function projectOnChange() { var title = document.getElementById("project-list").value - var database = firebase.database().ref("projects/"+title); + var database = firebase.database().ref("projects/"+title.replace(/,/g,".")); database.on('value', function(data) { var data1 = data.val() document.getElementById("edit-project-link").value = data1["link"] @@ -47,12 +130,12 @@ function projectOnChange() { // Project Submit function submitProject() { var data = { - title: document.getElementById("new-project-title").value, + title: document.getElementById("new-project-title").value.replace(".",","), link: document.getElementById("new-project-link").value, status: document.getElementById("new-project-status").value, description: document.getElementById("new-project-description").value } - firebase.database().ref("projects/"+document.getElementById("new-project-title").value).set(data) + firebase.database().ref("projects/"+document.getElementById("new-project-title").value.replace(".",",")).set(data) document.getElementById("new-project-title").value = ''; document.getElementById("new-project-link").value = ''; document.getElementById("new-project-status").value = 'active'; @@ -65,8 +148,8 @@ function projectList() { database.once('value', function(snapshot) { snapshot.forEach(function(child) { var a = document.createElement("option") - a.setAttribute("value",child["key"]) - a.innerHTML = child["key"] + a.setAttribute("value",child["key"].replace(/,/g,".")) + a.innerHTML = child["key"].replace(/,/g,".") document.getElementById("project-list").appendChild(a) }) }); diff --git a/programs.html b/programs.html index d216358..af5cd28 100644 --- a/programs.html +++ b/programs.html @@ -7,11 +7,11 @@ - +

Programs:

- - - - - - - - - - - - - - - - - - - - - +
- Fake Calc
- By LAX18
- TI83+ / TI84+ / CE BASIC
- This is a program that makes the calculator display incorrect results for calculations inputted. Use this to prank your friends. I do not take responsibility for those who abuse this and mess up others tests. -
- StockSim v.1
- by LAX18
- TI84+CE Assembly (ICE)
- StockSim is a simulation game based on the American stock market. Players can buy and sell stocks while monitoring several charts. Players have to determine the best times to sell, whilst monitoring best times to buy other stocks. Players can select from EASY and HARD modes and can save/continue their games. -
- TaxFind2017
- by LAX18
- TI84+CE BASIC
- This program calculates a user-selectable applied tax on the input amount. VERY HELPFUL!!! UPDATE: Now allows you to set a custom tax percentage and store it locally, idea provided by KermPhd NOTE: You need to set a local percentage BEFORE using the custom percentage tool! Redo this on RAM resets.
- Asteroids 3 ICE
- by LAX18
- TI84+CE Assembly (ICE)
- This game places you as the pilot of a spacecraft tasked with the task of destroying incomming asteroids. For every asteroid that you hit you gain a point, for every asteroid that you miss, you lose a point. UPDATE: - FASTER KEYPRESSES - Cesium ICON AND DESCRIPTION THIS GAME IS VERY SIMILAR TO ASTEROIDS 3 CE v.1.8 TIBASIC
- Asteroids 3 CE
- By LAX18
- TI84+CE BASIC
- This game places you as the operator of a space craft as you attempt to shoot down ALL of the asteroids hurtling towards you. If you miss one, you lose a point. If you hit one, you gain a point. Controls: [<] Moves spacecraft left [>] Moves spacecraft right [Up] or [2nd] Fires up [Enter] or [Alpha] Pause [Mode] Quit -
+