google ass

This commit is contained in:
Sivert V. Sæther 2020-03-18 03:00:22 +01:00
parent ce76064917
commit cfbd1f35be
9 changed files with 75 additions and 17 deletions

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Simple firebase logon</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" crossorigin="anonymous">
<script type="text/javascript" src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
</head>
<bod>
<iframe id="navbar" width="100%" height="60px" src="navbar.html" style="border: 0px"></iframe>
<h3>Works!</h3>
</bod>
</html>

View File

@ -0,0 +1,4 @@
db = init().firestore()
bibliotekcoll = db.collection("bibliotek")

17
it1/bibliotek/index.html Normal file
View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<title>Simple firebase logon</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" crossorigin="anonymous">
<script defer src="https://www.gstatic.com/firebasejs/7.11.0/firebase-app.js"></script>
<script defer src="https://www.gstatic.com/firebasejs/7.11.0/firebase-firestore.js"></script>
<script type="text/javascript" src="/it1/init-firebase.js"></script>
</head>
<bod>
<iframe id="navbar" width="100%" height="60px" src="/it1/navbar.html" style="border: 0px"></iframe>
<div id="content">
<form></form>
</div>
<script type="text/javascript" src="/it1/bibliotek/bibliotek.js"></script>
</bod>
</html>

21
it1/index.html Normal file
View File

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<title>Simple firebase logon</title>
<link rel="stylesheet" href="/it1/main.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" crossorigin="anonymous">
<!--
<script defer src="https://www.gstatic.com/firebasejs/7.11.0/firebase-app.js"></script>
<script defer src="https://www.gstatic.com/firebasejs/7.11.0/firebase-auth.js"></script>
<script defer src="https://www.gstatic.com/firebasejs/7.11.0/firebase-firestore.js"></script>
-->
<script type="text/javascript" src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
</head>
<bod>
<iframe id="navbar" width="100%" height="60px" src="/it1/navbar.html" style="border: 0px"></iframe>
<div id="content">
<h3 style="margin: 3vh">Klikk oppgaver i menyen for å se hva jeg har laget med firebase i IT1!</h3>
</div>
<script type="text/javasctipt" src="/it1/main.js"></script>
</bod>
</html>

13
it1/init-firebase.js Normal file
View File

@ -0,0 +1,13 @@
var init = function() {
var firebaseConfig = {
apiKey: "AIzaSyAhU3F-De17VAsUgpRjj25f48QiXycorD4",
authDomain: "it1-heimdal-vgs.firebaseapp.com",
databaseURL: "https://it1-heimdal-vgs.firebaseio.com",
projectId: "it1-heimdal-vgs",
storageBucket: "it1-heimdal-vgs.appspot.com",
messagingSenderId: "206703382262",
appId: "1:206703382262:web:be48f32d11a15fa28f26d7"
}
return firebase.initializeApp(firebaseConfig)
}

12
it1/main.js Normal file
View File

@ -0,0 +1,12 @@
var ocontent = $("#content").html()
function reset() {
$("#content").html(ocontent)
}
function oppgaver() {
$("#content").html(`
<h3><a href="/it1/bibliotek/index.html">Bibliotek</a></h3>
`)
}

View File

@ -7,15 +7,18 @@
</head>
<body>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<a class="navbar-brand" href="/">IT firebase stuff</a>
<a class="navbar-brand" onclick="reset()">IT firebase stuff</a> <!-- href="/it1/index.html" -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/about">About</a>
<a class="nav-link" onclick="oppgaver()">Oppgaver</a>
</li>
<li class="nav-item right">
<a class="nav-link" href="/it1/about.html">About</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<!-- <ul class="navbar-nav ml-auto">
<li class="nav-item right">
<a>Simple login here later</a>
<a class="nav-link">Simple login here later</a>
</li>
<li class="nav-item right" style="visibility: hidden">
<a class="nav-link" href="/logout">Logout</a>
@ -26,7 +29,7 @@
<li class="nav-item right" id="login-btn">
<a class="nav-link" href="/login">Login</a>
</li>
</ul>
</ul> -->
</nav>
</body>
</html>