removed files
attempting commit with fewer files; these are the ones removed
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
<template>
|
||||
<require from="bootstrap/css/bootstrap.css"></require>
|
||||
<require from="./styles.css"></require>
|
||||
|
||||
<nav class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a route-href="route: home" class="navbar-brand">myPrayerJournal</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li if.bind="!isAuthenticated()" click.delegate="logon()">Log On</li>
|
||||
<li if.bind="isAuthenticated()" click.delegate="logoff()">Log Off</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<loading-indicator loading.bind="router.isNavigating || api.isRequesting"></loading-indicator>
|
||||
<div class="container body-content">
|
||||
<div class="row">
|
||||
<h2 class.bind="'mpj-page-title' + ('' === pageTitle ? ' hidden' : '')" textcontent.bind="pageTitle"></h2>
|
||||
<router-view class="col-xs-12" swap-order="with"></router-view>
|
||||
</div>
|
||||
<div class="row">
|
||||
<footer class="mpj-footer">
|
||||
<p class="text-right">myPrayerJournal v0.8.1</p>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,80 +0,0 @@
|
||||
import {Router, RouterConfiguration} from "aurelia-router"
|
||||
import {EventAggregator} from "aurelia-event-aggregator"
|
||||
import {inject} from "aurelia-framework"
|
||||
import {HttpClient} from "aurelia-fetch-client"
|
||||
import {PageTitle} from "./messages"
|
||||
import {Auth0Lock} from "auth0-lock"
|
||||
|
||||
@inject(EventAggregator, HttpClient)
|
||||
export class App {
|
||||
router: Router;
|
||||
pageTitle: string;
|
||||
|
||||
lock = new Auth0Lock('Of2s0RQCQ3mt3dwIkOBY5h85J9sXbF2n', 'djs-consulting.auth0.com', {
|
||||
oidcConformant: true,
|
||||
autoclose: true,
|
||||
auth: {
|
||||
redirectUrl: "http://localhost:8080/user/log-on",
|
||||
responseType: 'token id_token',
|
||||
audience: `https://djs-consulting.auth0.com/userinfo`,
|
||||
params: {
|
||||
scope: 'openid'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
private setSession(authResult): void {
|
||||
// Set the time that the access token will expire at
|
||||
const expiresAt = JSON.stringify((authResult.expiresIn * 1000) + new Date().getTime())
|
||||
localStorage.setItem('access_token', authResult.accessToken)
|
||||
localStorage.setItem('id_token', authResult.idToken)
|
||||
localStorage.setItem('expires_at', expiresAt)
|
||||
}
|
||||
|
||||
public logoff(): void {
|
||||
// Remove tokens and expiry time from localStorage
|
||||
localStorage.removeItem('access_token')
|
||||
localStorage.removeItem('id_token')
|
||||
localStorage.removeItem('expires_at')
|
||||
// Go back to the home route
|
||||
this.router.navigateToRoute("")
|
||||
}
|
||||
|
||||
public isAuthenticated(): boolean {
|
||||
// Check whether the current time is past the
|
||||
// access token's expiry time
|
||||
const expiresAt = JSON.parse(localStorage.getItem('expires_at'))
|
||||
return new Date().getTime() < expiresAt
|
||||
}
|
||||
|
||||
constructor(private ea: EventAggregator, private http: HttpClient) {
|
||||
this.ea.subscribe(PageTitle, msg => this.pageTitle = msg.title)
|
||||
var self = this
|
||||
this.lock.on('authenticated', (authResult) => {
|
||||
if (authResult && authResult.accessToken && authResult.idToken) {
|
||||
this.setSession(authResult)
|
||||
this.router.navigateToRoute("")
|
||||
}
|
||||
});
|
||||
this.lock.on('authorization_error', (err) => {
|
||||
this.router.navigateToRoute("")
|
||||
console.log(err)
|
||||
alert(`Error: ${err.error}. Check the console for further details.`)
|
||||
});
|
||||
}
|
||||
|
||||
configureRouter(config: RouterConfiguration, router: Router){
|
||||
config.title = "myPrayerJournal"
|
||||
config.options.pushState = true
|
||||
config.options.root = "/"
|
||||
config.map([
|
||||
{ route: "", moduleId: "home", name: "home", title: "Welcome" }
|
||||
])
|
||||
|
||||
this.router = router
|
||||
}
|
||||
|
||||
public logon() {
|
||||
this.lock.show()
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
export default {
|
||||
debug: true,
|
||||
testing: true
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
<template>
|
||||
<p>
|
||||
myPrayerJournal is a place where individuals can record their prayer requests, record that they prayed for them,
|
||||
update them as God moves in the situation, and record a final answer received on that request. It will also allow
|
||||
individuals to review their answered prayers.
|
||||
</p>
|
||||
<p>
|
||||
This site is currently in very limited alpha, as it is being developed with a core group of test users. If this is
|
||||
something you are interested in using, check back around mid-June 2017 to check on the development progress.
|
||||
</p>
|
||||
</template>
|
||||
@@ -1,10 +0,0 @@
|
||||
import {inject} from 'aurelia-framework';
|
||||
import {EventAggregator} from "aurelia-event-aggregator"
|
||||
import {PageTitle} from "./messages"
|
||||
|
||||
@inject(EventAggregator)
|
||||
export class Home {
|
||||
constructor(private ea: EventAggregator) {
|
||||
this.ea.publish(new PageTitle("Welcome to myPrayerJournal"));
|
||||
}
|
||||
}
|
||||
10
src/app/src/lib/lock.min.js
vendored
10
src/app/src/lib/lock.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,18 +0,0 @@
|
||||
import {Aurelia} from 'aurelia-framework'
|
||||
import environment from './environment';
|
||||
|
||||
export function configure(aurelia: Aurelia) {
|
||||
aurelia.use
|
||||
.standardConfiguration()
|
||||
.feature('resources');
|
||||
|
||||
if (environment.debug) {
|
||||
aurelia.use.developmentLogging();
|
||||
}
|
||||
|
||||
if (environment.testing) {
|
||||
aurelia.use.plugin('aurelia-testing');
|
||||
}
|
||||
|
||||
aurelia.start().then(() => aurelia.setRoot());
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
export class PageTitle {
|
||||
constructor(public title: string) { }
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import * as nprogress from 'nprogress';
|
||||
import {bindable, noView} from 'aurelia-framework';
|
||||
|
||||
@noView(['nprogress/nprogress.css'])
|
||||
export class LoadingIndicator {
|
||||
@bindable loading = false;
|
||||
|
||||
loadingChanged(newValue) {
|
||||
if (newValue) {
|
||||
nprogress.start();
|
||||
} else {
|
||||
nprogress.done();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import {FrameworkConfiguration} from 'aurelia-framework';
|
||||
|
||||
export function configure(config: FrameworkConfiguration) {
|
||||
config.globalResources(['./elements/loading-indicator']);
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
body {
|
||||
padding-top: 70px;
|
||||
padding-bottom: 20px;
|
||||
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
|
||||
}
|
||||
|
||||
/* Wrapping element */
|
||||
/* Set some basic padding to keep content from hitting the edges */
|
||||
.body-content {
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
.material-icons.md-18 {
|
||||
font-size: 18px;
|
||||
}
|
||||
.material-icons.md-24 {
|
||||
font-size: 24px;
|
||||
}
|
||||
.material-icons.md-36 {
|
||||
font-size: 36px;
|
||||
}
|
||||
.material-icons.md-48 {
|
||||
font-size: 48px;
|
||||
}
|
||||
.material-icons {
|
||||
vertical-align: middle;
|
||||
}
|
||||
.mpj-page-title {
|
||||
border-bottom: solid 1px lightgray;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.mpj-footer {
|
||||
border-top: solid 1px lightgray;
|
||||
margin-top: 20px;
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
export function areEqual(obj1, obj2) {
|
||||
return Object.keys(obj1).every((key) => obj2.hasOwnProperty(key) && (obj1[key] === obj2[key]));
|
||||
};
|
||||
Reference in New Issue
Block a user