Merge pull request #5 from NokomisJROTC/master

Adding Commits
This commit is contained in:
2019-10-31 09:38:20 -04:00
committed by GitHub
16 changed files with 332 additions and 9 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
@ECHO OFF
ECHO Starting Web Server...
python3 -m http.server
python -m http.server
+4
View File
@@ -60,6 +60,10 @@
<span class="mdl-layout-title">Admin Dashboard</span>
<!-- Add spacer, to align navigation to the right -->
<div class="mdl-layout-spacer"></div>
<!-- Navigation -->
<nav class="mdl-navigation">
<a href="../help/index.html" class="mdl-navigation__link" href="">Help</a>
</nav>
</div>
</header>
<main class="mdl-layout__content">
+2
View File
@@ -1,3 +1,5 @@
.news-item:nth-child(odd) {background: #CCC}
.accountbutton {
display: inline-block;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

+38
View File
@@ -0,0 +1,38 @@
img {
width: 75%
}
.mdl-layout__content {
margin-left: 10px;
}
.docs-toc {
font-size: 14px;
font-weight: 400;
line-height: 20px;
margin-left: 5px;
}
.docs-toc ul {
border-left: solid 3px #3f51b5;
padding-left: 20px;
line-height: 28px
}
.docs-toc a {
font-weight: 400;
color: #00BCD4
}
.docs-toc li {
font-size: 16px;
list-style: none
}
a {
text-decoration: none;
color: black;
}
td a {
color: #00BCD4;
}
+154
View File
@@ -0,0 +1,154 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Nokomis JROTC - Help</title>
<script src="//cdn.letreach.com/js/main/a99d6ff3dec6106a641e37d249ac4762.js"></script>
<link rel="manifest" href="../manifest.json">
<link rel="stylesheet" href="../css/font.css">
<link rel="stylesheet" href="../css/material.indigo-red.min.css">
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="css/style.css">
<script src="../js/material.min.js"></script>
<script src="../js/firebase.js"></script>
<link rel="apple-touch-icon" sizes="57x57" href="/LAX18/General/messaging2/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/LAX18/General/messaging2/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/LAX18/General/messaging2/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/LAX18/General/messaging2/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/LAX18/General/messaging2/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/LAX18/General/messaging2/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/LAX18/General/messaging2/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/LAX18/General/messaging2/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/LAX18/General/messaging2/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" sizes="32x32" href="/LAX18/General/messaging2/assets/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="194x194" href="/LAX18/General/messaging2/assets/favicons/favicon-194x194.png">
<link rel="icon" type="image/png" sizes="192x192" href="/LAX18/General/messaging2/assets/favicons/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="16x16" href="/LAX18/General/messaging2/assets/favicons/favicon-16x16.png">
<link rel="mask-icon" href="/LAX18/General/messaging2/assets/favicons/safari-pinned-tab.svg" color="#5bbad5">
<meta name="apple-mobile-web-app-title" content="JROTC">
<meta name="application-name" content="JROTC">
<meta name="msapplication-TileColor" content="#3f51b5">
<script>
function onLoad() {
// Initialize Firebase
var config = {
apiKey: "AIzaSyB0keF26uKYDOR2o-8HYkgoOGWhsPyHdkg",
authDomain: "jrotc-database.firebaseapp.com",
databaseURL: "https://jrotc-database.firebaseio.com",
projectId: "jrotc-database",
storageBucket: "jrotc-database.appspot.com",
messagingSenderId: "787128694744"
};
firebase.initializeApp(config);
externalOnLoad();
};
</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="#3f51b5">
</head>
<body onload="onLoad()">
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<button class="mdl-layout__drawer-button mdl-button mdl-js-button mdl-button--icon" onclick="history.go(-1);">
<i class="material-icons">arrow_back</i>
</button>
<div class="mdl-layout__header-row">
<!-- Title -->
<span class="mdl-layout-title">Help</span>
<!-- Add spacer, to align navigation to the right -->
<div class="mdl-layout-spacer"></div>
</div>
</header>
<main class="mdl-layout__content">
<section class="docs-toc">
<h3>Nokomis JROTC Admin Help</h3>
<h4>Contents</h4>
<nav class="section-content">
<ul>
<li><a href="#accounts">Account Login Information and External Services</a></li>
<li><a href="#nxtformation">Update Next Formation Event</a></li>
<li><a href="#companyupdate">Update Company Values and Comments</a></li>
<li><a href="#blogpost">Create a New Blog Post</a></li>
<li><a href="#pushnotification">Send a Push Notification</a></li>
<li><a href="#addadmin">Add a Admin</a></li>
<li><a href="#removeadmin">Remove an Admin</a></li>
<li><a href="#modifyapp">Modify the App [ADVANCED]</a></li>
<li><a href="#modifydatabase">Modify the Database [ADVANCED]</a></li>
</ul>
</nav>
</section>
<h3>
<a name="accounts">Account Login Information and External Services</a>
</h3>
For security purposes, the account information cannot be listed here. However, the email for the accounts is nokomisarmyjrotc@gmail.com.
The password is the same as the one used on the computers in the JROTC office.<br>
<br>
Here is the list of the external services that this app employs, their function, and their URL.
<table class="mdl-data-table mdl-js-data-table mdl-shadow--2dp" style="margin-left: 10px;">
<thead>
<tr>
<th class="mdl-data-table__cell--non-numeric">Service Name</th>
<th class="mdl-data-table__cell--non-numeric">Function</th>
<th class="mdl-data-table__cell--non-numeric">URL</th>
</tr>
</thead>
<tbody>
<tr>
<td class="mdl-data-table__cell--non-numeric">Firebase</td>
<td class="mdl-data-table__cell--non-numeric">Database, Authentication, and Backend Services</td>
<td class="mdl-data-table__cell--non-numeric"><a href="https://console.firebase.google.com/u/0/">Open</a></td>
</tr>
<tr>
<td class="mdl-data-table__cell--non-numeric">LetReach</td>
<td class="mdl-data-table__cell--non-numeric">Push Notification Service</td>
<td class="mdl-data-table__cell--non-numeric"><a href="https://app.letreach.com/5d5daebbddb25e461d8b465c">Open</a></td>
</tr>
<tr>
<td class="mdl-data-table__cell--non-numeric">Wordpress</td>
<td class="mdl-data-table__cell--non-numeric">Blog</td>
<td class="mdl-data-table__cell--non-numeric"><a href="">Open</a></td>
</tr>
</tbody>
</table>
<h3>
<a name="nxtformation">Update Next Formation Event</a>
</h3>
To update the next event display found on the homepage, follow the steps below.
<h4>
1. Go to the <a href="../admin/index.html">Admin Console</a>.
</h4>
<h4>
2. Find the box as shown below.
</h4>
<img src="assets/updateformation.png">
<h4>
3. Fill in fields with information of the next formation.
</h4>
<h4>
4. Click "Preview" to see changes in the preview box.
</h4>
<img src="assets/preview.png">
<h4>
5. When satisfied with the results, press update to update homepage.
</h4>
<img src="assets/update.png">
<h3>
<a name="companyupdate">Update Company Values and Comments</a>
</h3>
To update the commanders cup points and the comments, located on the company pages, follow the steps below.
<h4>
1. Go to the <a href="../admin/index.html">Admin Console</a>.
</h4>
<h4>
2. Find the box as shown below.
</h4>
<h6>
Choose the box that corresponds to the company that you wish to edit
</h6>
<img src="assets/companyselect.png">
</main>
</div>
</body>
</html>
+1 -1
View File
@@ -1,7 +1,7 @@
function externalOnLoad() {
var isMobile = window.orientation > -1;
if (isMobile) {
location.href = "https://lax18.github.io/WebJROTC/index.html"
location.href = "https://lax18.github.io/MobileJROTC/index.html"
}
console.log("[index.html] LOADED")
var data = readData("nextevent", function(data) {
+87
View File
@@ -0,0 +1,87 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Nokomis JROTC</title>
<script src="//cdn.letreach.com/js/main/a99d6ff3dec6106a641e37d249ac4762.js"></script>
<link rel="manifest" href="https://lax18.github.io/WebJROTC/manifest.json">
<link rel="stylesheet" href="https://lax18.github.io/WebJROTC/css/font.css">
<link rel="stylesheet" href="https://lax18.github.io/WebJROTC/css/material.indigo-red.min.css">
<link rel="stylesheet" href="https://lax18.github.io/WebJROTC/css/style.css">
<script src="js/authentication.js"></script>
<script src="https://lax18.github.io/WebJROTC/js/material.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://www.gstatic.com/firebasejs/5.5.3/firebase.js"></script>
<script src="nscript.js"></script>
<meta name="theme-color" content="#3f51b5">
<link rel="apple-touch-icon" sizes="57x57" href="/WebJROTC/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/WebJROTC/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/WebJROTC/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/WebJROTC/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/WebJROTC/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/WebJROTC/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/WebJROTC/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/WebJROTC/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/WebJROTC/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" sizes="32x32" href="/WebJROTC/assets/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="194x194" href="/WebJROTC/assets/favicons/favicon-194x194.png">
<link rel="icon" type="image/png" sizes="192x192" href="/WebJROTC/assets/favicons/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="16x16" href="/WebJROTC/assets/favicons/favicon-16x16.png">
<link rel="mask-icon" href="/WebJROTC/assets/favicons/safari-pinned-tab.svg" color="#5bbad5">
<meta name="apple-mobile-web-app-title" content="JROTC">
<meta name="application-name" content="JROTC">
<meta name="msapplication-TileColor" content="#3f51b5">
<script>
function onLoad() {
// Initialize Firebase
var config = {
apiKey: "AIzaSyB0keF26uKYDOR2o-8HYkgoOGWhsPyHdkg",
authDomain: "jrotc-database.firebaseapp.com",
databaseURL: "https://jrotc-database.firebaseio.com",
projectId: "jrotc-database",
storageBucket: "jrotc-database.appspot.com",
messagingSenderId: "787128694744"
};
firebase.initializeApp(config);
navigator.serviceWorker.register('sw.js');
externalOnLoad();
}
</script>
</head>
<body onload="onLoad()">
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<!-- Title -->
<span class="mdl-layout-title">News</span>
<!-- Add spacer, to align navigation to the right -->
<div class="mdl-layout-spacer"></div>
<div class="clickable"><i class="material-icons" onclick="location.href='info.html'">info</i></div>
</div>
</header>
<div class="mdl-layout__drawer">
<span class="mdl-layout-title">Nokomis JROTC</span>
<nav class="mdl-navigation">
<div id="loginbutton" class="accountbutton">
<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect" onclick="logIn();">
Log In
</button>
</div>
<div id="logoutbutton" class="accountbutton" style="display: none;">
<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect" onclick="logOut();">
Log Out
</button>
</div>
</nav>
</div>
<main class="mdl-layout__content">
<div class="page-content">
<div id="news-holder">
</div>
</div>
</main>
</div>
</body>
</html>
+33
View File
@@ -0,0 +1,33 @@
// onLoad Script to fetch and sort
function externalOnLoad() {
firebase.database().ref("news")
.orderByChild('timestamp')
.on('value', function(snapshot) {
this.data = [];
snapshot.forEach(function(child) {
console.log(child)
var data = child.val
var a = document.createElement("div")
a.innerHTML = "<div id='news-item'><span id='news-title'><h3>"+child.key+"</h3></span><span id='news-time'>"+data.timestamp+"</span><br><span id='news-content'>"+data.content+"</span></div>"
document.getElementById("news-holder").appendChild(a);
}.bind(this));
});
}
// Firebase Scripts
// global read data and place on page function
function setData(ref, element, read1) {
var array = readData(ref, function(array) {
document.getElementById(element).innerHTML = array[read1]
});
}
function readData(ref, callback) {
var nextformation = firebase.database().ref(ref);
nextformation.on("value", function(data) {
var array = data.val();
callback(array)
});
}
+6 -2
View File
@@ -1,3 +1,7 @@
.ribbon-center {
justify-content: center;
}
.ribbons-display {
margin-left: auto;
margin-right: auto;
@@ -27,11 +31,11 @@
}
.ribbons {
margin-right: auto;
margin-right: auto;
margin-left: 0px;
display: inline;
}
.ribbon_selector {
margin: auto;
}
}
+3 -3
View File
@@ -49,12 +49,12 @@
<div class="ribbons-display" id="ribbons-display">
</div>
<div class="spacer"></div>
<div id="ribbon_selector">
<div id="ribbon_selector" class="ribbon-center">
</div>
</div>
</main>
</div>
</body>
</html>
</html>
+3 -2
View File
@@ -1,5 +1,5 @@
// Ribbon Rack Builder
// v.2
// v.2.0.1
//
//
// (C) 2019 Nicholas Pease
@@ -17,7 +17,7 @@ function onLoad() {
var newelement = document.createElement("span")
newelement.setAttribute("class", "ribbon-selector-span")
if (i <= 1) {
newelement.innerHTML = "<div id='ribbons-selector'> <div class='ribbon-card mdl-card mdl-shadow--2dp'> <div class='mdl-card__title'> <h2 class='mdl-card__title-text'>" + ribbon_name[i] + "<br>&nbsp</h2> </div> <div class='mdl-card__media'> <img src='assets/ribbons/" + ribbon_filename[i] + ".gif' width='154px' height='42px' border='0' alt='' style='padding:10px;'> </div> <div class='mdl-card__supporting-text'> <img src='assets/add.png' onclick='addRibbon(" + i + ");' class='clickable'><img src='assets/subtract.png' onclick='subtractRibbon(" + i + ");' class='clickable'> </div> </div> </div>"
newelement.innerHTML = "<div id='ribbons-selector'> <div class='ribbon-card "+ribbon_name[i]+" mdl-card mdl-shadow--2dp'> <div class='mdl-card__title'> <h2 class='mdl-card__title-text'>" + ribbon_name[i] + "<br>&nbsp</h2> </div> <div class='mdl-card__media'> <img src='assets/ribbons/" + ribbon_filename[i] + ".gif' width='154px' height='42px' border='0' alt='' style='padding:10px;'> </div> <div class='mdl-card__supporting-text'> <img src='assets/add.png' onclick='addRibbon(" + i + ");' class='clickable'><img src='assets/subtract.png' onclick='subtractRibbon(" + i + ");' class='clickable'> </div> </div> </div>"
} else {
newelement.innerHTML = "<div id='ribbons-selector'> <div class='ribbon-card mdl-card mdl-shadow--2dp'> <div class='mdl-card__title'> <h2 class='mdl-card__title-text'>" + ribbon_name[i] + "<br>" + ribbon_filename[i] + "</h2> </div> <div class='mdl-card__media'> <img src='assets/ribbons/" + ribbon_filename[i] + ".gif' width='154px' height='42px' border='0' alt='' style='padding:10px;'> </div> <div class='mdl-card__supporting-text'> <img src='assets/add.png' onclick='addRibbon(" + i + ");' class='clickable'><img src='assets/subtract.png' onclick='subtractRibbon(" + i + ");' class='clickable'> </div> </div> </div>"
}
@@ -47,6 +47,7 @@ function updatePage() {
img.setAttribute("src", "assets/ribbons/" + ribbon_filename[i] + ".gif");
img.setAttribute("width", "33%");
img.setAttribute("class", "ribbons")
var ribbbonselector = document.getElementById()
if (ribbons <= 3) {
console.log(rows)
img.setAttribute("id",ribbons)