Delete Client before Merge from Test
parent
05d033c96d
commit
36264886e1
|
|
@ -1,61 +0,0 @@
|
|||
{
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"project": {
|
||||
"name": "client"
|
||||
},
|
||||
"apps": [
|
||||
{
|
||||
"root": "src",
|
||||
"outDir": "../Server/www",
|
||||
"assets": [
|
||||
"assets",
|
||||
"favicon.ico",
|
||||
"web-app-files"
|
||||
],
|
||||
"index": "index.html",
|
||||
"main": "main.ts",
|
||||
"polyfills": "polyfills.ts",
|
||||
"test": "test.ts",
|
||||
"tsconfig": "tsconfig.app.json",
|
||||
"testTsconfig": "tsconfig.spec.json",
|
||||
"prefix": "app",
|
||||
"styles": [
|
||||
"styles.css"
|
||||
],
|
||||
"scripts": [],
|
||||
"environmentSource": "environments/environment.ts",
|
||||
"environments": {
|
||||
"dev": "environments/environment.ts",
|
||||
"prod": "environments/environment.prod.ts"
|
||||
}
|
||||
}
|
||||
],
|
||||
"e2e": {
|
||||
"protractor": {
|
||||
"config": "./protractor.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": [
|
||||
{
|
||||
"project": "src/tsconfig.app.json",
|
||||
"exclude": "**/node_modules/**"
|
||||
},
|
||||
{
|
||||
"project": "src/tsconfig.spec.json",
|
||||
"exclude": "**/node_modules/**"
|
||||
},
|
||||
{
|
||||
"project": "e2e/tsconfig.e2e.json",
|
||||
"exclude": "**/node_modules/**"
|
||||
}
|
||||
],
|
||||
"test": {
|
||||
"karma": {
|
||||
"config": "./karma.conf.js"
|
||||
}
|
||||
},
|
||||
"defaults": {
|
||||
"styleExt": "css",
|
||||
"component": {}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# Editor configuration, see http://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
max_line_length = off
|
||||
trim_trailing_whitespace = false
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
# compiled output
|
||||
/dist
|
||||
/tmp
|
||||
/out-tsc
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
|
||||
# IDEs and editors
|
||||
/.idea
|
||||
.project
|
||||
.classpath
|
||||
.c9/
|
||||
*.launch
|
||||
.settings/
|
||||
*.sublime-workspace
|
||||
|
||||
# IDE - VSCode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
# misc
|
||||
/.sass-cache
|
||||
/connect.lock
|
||||
/coverage
|
||||
/libpeerconnection.log
|
||||
npm-debug.log
|
||||
testem.log
|
||||
/typings
|
||||
yarn-error.log
|
||||
|
||||
# e2e
|
||||
/e2e/*.js
|
||||
/e2e/*.map
|
||||
|
||||
# System Files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
# Client
|
||||
|
||||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.2.7.
|
||||
|
||||
## Development server
|
||||
|
||||
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
|
||||
|
||||
## Code scaffolding
|
||||
|
||||
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
|
||||
|
||||
## Build
|
||||
|
||||
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
||||
|
||||
## Running end-to-end tests
|
||||
|
||||
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
|
||||
Before running the tests make sure you are serving the app via `ng serve`.
|
||||
|
||||
## Further help
|
||||
|
||||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
import { ClientPage } from './app.po';
|
||||
|
||||
describe('client App', () => {
|
||||
let page: ClientPage;
|
||||
|
||||
beforeEach(() => {
|
||||
page = new ClientPage();
|
||||
});
|
||||
|
||||
it('should display welcome message', () => {
|
||||
page.navigateTo();
|
||||
expect(page.getParagraphText()).toEqual('Welcome to app!');
|
||||
});
|
||||
});
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
import { browser, by, element } from 'protractor';
|
||||
|
||||
export class ClientPage {
|
||||
navigateTo() {
|
||||
return browser.get('/');
|
||||
}
|
||||
|
||||
getParagraphText() {
|
||||
return element(by.css('app-root h1')).getText();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../out-tsc/e2e",
|
||||
"baseUrl": "./",
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"types": [
|
||||
"jasmine",
|
||||
"jasminewd2",
|
||||
"node"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
// Karma configuration file, see link for more information
|
||||
// https://karma-runner.github.io/0.13/config/configuration-file.html
|
||||
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: '',
|
||||
frameworks: ['jasmine', '@angular/cli'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-jasmine-html-reporter'),
|
||||
require('karma-coverage-istanbul-reporter'),
|
||||
require('@angular/cli/plugins/karma')
|
||||
],
|
||||
client:{
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
coverageIstanbulReporter: {
|
||||
reports: [ 'html', 'lcovonly' ],
|
||||
fixWebpackSourcePaths: true
|
||||
},
|
||||
angularCli: {
|
||||
environment: 'dev'
|
||||
},
|
||||
reporters: ['progress', 'kjhtml'],
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['Chrome'],
|
||||
singleRun: false
|
||||
});
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,55 +0,0 @@
|
|||
{
|
||||
"name": "client",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"servehelena": "ng serve -host 192.168.43.144",
|
||||
"servebutte": "ng serve -host 192.168.2.8",
|
||||
"servebutteprod": "ng serve -host 192.168.2.8 --prod",
|
||||
"start": "ng serve",
|
||||
"build": "ng build",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint",
|
||||
"e2e": "ng e2e"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^5.0.1",
|
||||
"@angular/cdk": "^5.0.0-rc0",
|
||||
"@angular/common": "^5.0.1",
|
||||
"@angular/compiler": "^5.0.1",
|
||||
"@angular/core": "^5.0.1",
|
||||
"@angular/forms": "^5.0.1",
|
||||
"@angular/http": "^5.0.1",
|
||||
"@angular/material": "^5.0.0-rc0",
|
||||
"@angular/platform-browser": "^5.0.1",
|
||||
"@angular/platform-browser-dynamic": "^5.0.1",
|
||||
"@angular/router": "^5.0.1",
|
||||
"core-js": "^2.4.1",
|
||||
"hammerjs": "^2.0.8",
|
||||
"rxjs": "^5.5.2",
|
||||
"zone.js": "^0.8.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/cli": "1.5.0",
|
||||
"@angular/compiler-cli": "^5.0.1",
|
||||
"@angular/language-service": "^5.0.1",
|
||||
"@types/jasmine": "~2.5.53",
|
||||
"@types/jasminewd2": "~2.0.2",
|
||||
"@types/node": "~6.0.60",
|
||||
"codelyzer": "~3.2.0",
|
||||
"jasmine-core": "~2.6.2",
|
||||
"jasmine-spec-reporter": "~4.1.0",
|
||||
"karma": "~1.7.0",
|
||||
"karma-chrome-launcher": "~2.1.1",
|
||||
"karma-cli": "~1.0.1",
|
||||
"karma-coverage-istanbul-reporter": "^1.2.1",
|
||||
"karma-jasmine": "~1.1.0",
|
||||
"karma-jasmine-html-reporter": "^0.2.2",
|
||||
"protractor": "~5.1.2",
|
||||
"ts-node": "~3.2.0",
|
||||
"tslint": "~5.7.0",
|
||||
"typescript": "~2.4.2"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
// Protractor configuration file, see link for more information
|
||||
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
||||
|
||||
const { SpecReporter } = require('jasmine-spec-reporter');
|
||||
|
||||
exports.config = {
|
||||
allScriptsTimeout: 11000,
|
||||
specs: [
|
||||
'./e2e/**/*.e2e-spec.ts'
|
||||
],
|
||||
capabilities: {
|
||||
'browserName': 'chrome'
|
||||
},
|
||||
directConnect: true,
|
||||
baseUrl: 'http://localhost:4200/',
|
||||
framework: 'jasmine',
|
||||
jasmineNodeOpts: {
|
||||
showColors: true,
|
||||
defaultTimeoutInterval: 30000,
|
||||
print: function() {}
|
||||
},
|
||||
onPrepare() {
|
||||
require('ts-node').register({
|
||||
project: 'e2e/tsconfig.e2e.json'
|
||||
});
|
||||
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
|
||||
}
|
||||
};
|
||||
|
|
@ -1,178 +0,0 @@
|
|||
import { EventService } from './services/event.service';
|
||||
import { GoogleAnalyticsService } from './services/google-analytics.service';
|
||||
import { WindowRefService } from './services/window-ref.service';
|
||||
import { EmailService } from './services/email.service';
|
||||
import { SermonService } from './services/sermon.service';
|
||||
import { LoginService } from './services/login.service';
|
||||
import { ProgressService } from './services/xhr-progress.service';
|
||||
import { ProgressXhr } from './extensions/xhr-progress.extension';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { NgModule, Component } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { HttpModule, BrowserXhr } from '@angular/http';
|
||||
import { MatButtonModule,
|
||||
MatInputModule,
|
||||
MatSliderModule,
|
||||
MatSnackBarModule,
|
||||
MatDialogModule } from '@angular/material';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import 'hammerjs';
|
||||
|
||||
//Components
|
||||
import { AppComponent } from './components/app/app.component';
|
||||
import { MenuComponent } from './components/menu/menu.component';
|
||||
import { IconButtonComponent } from './components/icon-button/icon-button.component';
|
||||
import { HomeComponent } from './components/home/home.component';
|
||||
import { WhoWeAreComponent } from './components/whoweare/whoweare.component';
|
||||
import { ServicesComponent } from './components/services/services.component';
|
||||
import { SecondaryPageComponent } from './components/secondary-page/secondary-page.component';
|
||||
import { RecentSermonsComponent } from './components/recent-sermons/recent-sermons.component';
|
||||
import { SermonSmallComponent } from './components/sermon-small/sermon-small.component';
|
||||
import { DateComponent } from './components/date/date.component';
|
||||
import { UpcomingEventsComponent } from './components/upcoming-events/upcoming-events.component';
|
||||
import { EventComponent } from './components/event/event.component';
|
||||
import { SermonsComponent } from './components/sermons/sermons.component';
|
||||
import { AudioPlayerComponent } from './components/audio-player/audio-player.component';
|
||||
import { LocationComponent } from './components/location/location.component';
|
||||
import { SermonLargeComponent } from './components/sermon-large/sermon-large.component';
|
||||
import { AddSermonPopupComponent } from './components/popups/add-sermon-popup/add-sermon-popup.component';
|
||||
import { LoginPopupComponent } from './components/popups/login-popup/login-popup.component';
|
||||
import { InputPopupComponent } from './components/popups/input-popup/input-popup.component';
|
||||
import { EventsPageComponent } from './components/events-page/events-page.component';
|
||||
import { AddEventPopupComponent } from './components/popups/add-event-popup/add-event-popup.component';
|
||||
import { OkPopupComponent } from './components/popups/ok-popup/ok-popup.component';
|
||||
import { YesNoPopupComponent } from './components/popups/yes-no-popup/yes-no-popup.component';
|
||||
import { UpdateSermonPopupComponent } from './components/popups/update-sermon-popup/update-sermon-popup.component';
|
||||
import { ContactPageComponent } from './components/contact-page/contact-page.component';
|
||||
import { SharePopupComponent } from './components/popups/share-popup/share-popup.component';
|
||||
import { EventLargeComponent } from './components/event-large/event-large.component';
|
||||
import { SalvationPageComponent } from './components/salvation-page/salvation-page.component';
|
||||
|
||||
//Directives
|
||||
import { FadeInOnScrollDirective } from './directives/fade-in-on-scroll.directive';
|
||||
import { IconDirective } from './directives/icon.directive';
|
||||
|
||||
//Pipes
|
||||
import { DurationPipe } from './pipes/duration.pipe';
|
||||
import { SafeUrlPipe } from './pipes/safe-url.pipe';
|
||||
import { OfbDatePipe } from './pipes/ofb-date.pipe';
|
||||
|
||||
|
||||
const Routes =
|
||||
[
|
||||
{
|
||||
path: '',
|
||||
redirectTo: '/home',
|
||||
pathMatch: 'full'
|
||||
},{
|
||||
path: 'home',
|
||||
component: HomeComponent
|
||||
},
|
||||
{
|
||||
path: 'whoweare',
|
||||
component: WhoWeAreComponent
|
||||
},
|
||||
{
|
||||
path: 'services',
|
||||
component: ServicesComponent
|
||||
},
|
||||
{
|
||||
path: 'contact',
|
||||
component: ContactPageComponent
|
||||
},
|
||||
{
|
||||
path: 'sermons',
|
||||
component: SermonsComponent
|
||||
},
|
||||
{
|
||||
path: 'sermons/:id',
|
||||
component: SermonsComponent
|
||||
},
|
||||
{
|
||||
path: 'location',
|
||||
component: LocationComponent
|
||||
},
|
||||
{
|
||||
path: 'events',
|
||||
component: EventsPageComponent
|
||||
},
|
||||
{
|
||||
path: 'events/:id',
|
||||
component: EventsPageComponent
|
||||
},
|
||||
{
|
||||
path: 'salvation',
|
||||
component: SalvationPageComponent
|
||||
}
|
||||
]
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
MenuComponent,
|
||||
IconButtonComponent,
|
||||
HomeComponent,
|
||||
WhoWeAreComponent,
|
||||
ServicesComponent,
|
||||
FadeInOnScrollDirective,
|
||||
IconDirective,
|
||||
SecondaryPageComponent,
|
||||
RecentSermonsComponent,
|
||||
SermonSmallComponent,
|
||||
DateComponent,
|
||||
UpcomingEventsComponent,
|
||||
EventComponent,
|
||||
SermonsComponent,
|
||||
AudioPlayerComponent,
|
||||
DurationPipe,
|
||||
LocationComponent,
|
||||
SermonLargeComponent,
|
||||
AddSermonPopupComponent,
|
||||
LoginPopupComponent,
|
||||
OkPopupComponent,
|
||||
InputPopupComponent,
|
||||
YesNoPopupComponent,
|
||||
UpdateSermonPopupComponent,
|
||||
ContactPageComponent,
|
||||
SharePopupComponent,
|
||||
SafeUrlPipe,
|
||||
EventsPageComponent,
|
||||
AddEventPopupComponent,
|
||||
EventLargeComponent,
|
||||
OfbDatePipe,
|
||||
SalvationPageComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
FormsModule,
|
||||
HttpModule,
|
||||
BrowserAnimationsModule,
|
||||
//Angular Material Components
|
||||
MatButtonModule,
|
||||
MatInputModule,
|
||||
MatSliderModule,
|
||||
MatSnackBarModule,
|
||||
MatDialogModule,
|
||||
RouterModule.forRoot(Routes)
|
||||
|
||||
],
|
||||
providers: [LoginService,GoogleAnalyticsService,SermonService,EventService,ProgressService,EmailService,WindowRefService,{provide:BrowserXhr,useClass:ProgressXhr}],
|
||||
entryComponents: [AddSermonPopupComponent,
|
||||
LoginPopupComponent,
|
||||
OkPopupComponent,
|
||||
InputPopupComponent,
|
||||
YesNoPopupComponent,
|
||||
UpdateSermonPopupComponent,
|
||||
SharePopupComponent,
|
||||
AddEventPopupComponent],
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
|
||||
export class AppModule {
|
||||
public routes = Routes;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,140 +0,0 @@
|
|||
|
||||
|
||||
header{
|
||||
position:fixed;
|
||||
top:0;
|
||||
left:0;
|
||||
width:100%;
|
||||
height: 50px;
|
||||
color: white;
|
||||
vertical-align: middle;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
#header-background{
|
||||
background-color: rgb(0, 188, 212);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.24);
|
||||
}
|
||||
|
||||
#logo{
|
||||
margin-left: -5px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#main-menu-button{
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.hideOnMobile{
|
||||
display:inline-block;
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.header-button, .header-button-home{
|
||||
height: 100%;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
|
||||
.content{
|
||||
margin-top: 50px;
|
||||
min-height: 100%;
|
||||
margin-bottom: -140px;
|
||||
padding-bottom: 140px;
|
||||
}
|
||||
|
||||
footer{
|
||||
background-color: rgb(50,50,50);
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
color: white;
|
||||
font-size: 16px;
|
||||
height: 140px;
|
||||
}
|
||||
|
||||
#footer-content{
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.footer-panel{
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
width: calc(33% - 20px);
|
||||
margin: 10px;
|
||||
min-height: 100px;
|
||||
}
|
||||
|
||||
|
||||
@media(max-width: 900px){
|
||||
.header-button, .hideOnMobile{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: 800px){
|
||||
footer{
|
||||
height: 380px;
|
||||
}
|
||||
.footer-panel{
|
||||
display: block;
|
||||
width: calc(100% - 20px);
|
||||
}
|
||||
.content{
|
||||
margin-bottom: -380px;
|
||||
padding-bottom: 380px;
|
||||
}
|
||||
}
|
||||
|
||||
.copyright{
|
||||
font-size: 18px;
|
||||
width: auto;
|
||||
height: auto;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
a{
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
a:visited{
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.audio-player-filler{
|
||||
height: 70px;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.audio-player{
|
||||
position: fixed;
|
||||
bottom: -65px;
|
||||
width: 100%;
|
||||
height: 65px;
|
||||
text-align: center;
|
||||
background-color: rgb(100,100,100);
|
||||
box-shadow: 0 -2px 5px 0 rgba(0,0,0,0.24);
|
||||
background-color: rgb(100,100,100);
|
||||
color: white;
|
||||
transition: .5s ease-in-out bottom;
|
||||
}
|
||||
|
||||
.audio-player-slide-up{
|
||||
bottom:0;
|
||||
}
|
||||
|
||||
audio-player-component{
|
||||
width: 100%;
|
||||
max-width: 1000px;
|
||||
margin: auto;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
|
||||
|
||||
<header>
|
||||
<div id="header-background" [ngStyle]="{'opacity':headerOpacity}"></div>
|
||||
<button mat-button class="header-button-home" routerLink="/home"><img id="logo" src="assets/images/tiny/logo.png" height="30" alt="logo"> Old Fashion Baptist</button>
|
||||
<span class="hideOnMobile"></span>
|
||||
<button mat-button class="header-button" routerLink="/whoweare">Who We Are</button>
|
||||
<button mat-button class="header-button" routerLink="/services">Service Times</button>
|
||||
<button mat-button class="header-button" routerLink="/location">Location</button>
|
||||
<button mat-button class="header-button" routerLink="/sermons">Sermons</button>
|
||||
<button mat-icon-button id="main-menu-button"
|
||||
(click)="mainMenuClick()">
|
||||
<i ofbicon class="example-icon" style="line-height:20px;">menu</i>
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<div class="content">
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div id="footer-content">
|
||||
<div id="footer-contact-content" class="footer-panel">
|
||||
<a target="_blank" href="https://www.google.com/maps/place/Old+Fashion+Baptist+Church/@45.9814004,-112.5320574,11.87z/data=!4m12!1m6!3m5!1s0x535b078c3c74ea33:0xac299097142c5894!2sOld+Fashion+Baptist+Church!8m2!3d45.951287!4d-112.511978!3m4!1s0x535b078c3c74ea33:0xac299097142c5894!8m2!3d45.951287!4d-112.511978">
|
||||
<p>5003 Wynne Ave</p>
|
||||
<p>Butte, MT 59701</p>
|
||||
</a>
|
||||
<p><a href="tel:+1-406-494-5028" class="phone">(406) 494 - 5028</a></p>
|
||||
<p>Pastor Ron Derksen</p>
|
||||
<p>Associate Pastor Derek Loewen</p>
|
||||
</div>
|
||||
<div id="footer-services-content" class="footer-panel">
|
||||
<p>Sunday School: 10AM</p>
|
||||
<p>Sunday Worship: 11AM</p>
|
||||
<p>Sunday Evening: 7PM</p>
|
||||
<p>Wednesday Evening: 7PM</p>
|
||||
<br>
|
||||
</div>
|
||||
<div id="footer-website-content" class="footer-panel">
|
||||
<p><i ofbicon class="copyright">copyright</i> Copyright {{copyrightYear}}</p>
|
||||
<p>Old Fashion Baptist</p>
|
||||
<p><a routerLink="/home">ofbbutte.com</a></p>
|
||||
<p>Powered by God</p>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="audio-player-filler" [hidden]="!showAudioPlayer" ></div>
|
||||
</footer>
|
||||
|
||||
<div class="audio-player" [class.audio-player-slide-up]="showAudioPlayer">
|
||||
<audio-player-component (closed)="audioPlayerClosed()" (started)="audioPlayerStarted()"></audio-player-component>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<menu-component [menuOpen]="menuOpen" (closed)="mainMenuClick()"></menu-component>
|
||||
|
||||
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
/* tslint:disable:no-unused-variable */
|
||||
|
||||
import { TestBed, async } from '@angular/core/testing';
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
describe('AppComponent', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
});
|
||||
TestBed.compileComponents();
|
||||
});
|
||||
|
||||
it('should create the app', async(() => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.debugElement.componentInstance;
|
||||
expect(app).toBeTruthy();
|
||||
}));
|
||||
|
||||
it(`should have as title 'app works!'`, async(() => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.debugElement.componentInstance;
|
||||
expect(app.title).toEqual('app works!');
|
||||
}));
|
||||
|
||||
it('should render title in a h1 tag', async(() => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
fixture.detectChanges();
|
||||
const compiled = fixture.debugElement.nativeElement;
|
||||
expect(compiled.querySelector('h1').textContent).toContain('app works!');
|
||||
}));
|
||||
});
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
import { GoogleAnalyticsService } from './../../services/google-analytics.service';
|
||||
import { Component, Inject, Injectable, HostListener } from '@angular/core';
|
||||
import { Router, NavigationEnd, Event } from '@angular/router';
|
||||
import { EventService } from '../../services/event.service';
|
||||
import { AudioPlayerService } from '../../services/audio-player.service';
|
||||
import { BibleVerseService } from '../../services/bible-verse.service';
|
||||
|
||||
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.css'],
|
||||
providers:[EventService, AudioPlayerService, BibleVerseService]
|
||||
})
|
||||
export class AppComponent {
|
||||
title = 'app works w!';
|
||||
menuOpen: boolean = false;
|
||||
headerOpacity: number = 0;
|
||||
fadeHeader: boolean = true;
|
||||
copyrightYear: number = (new Date()).getUTCFullYear();
|
||||
lastRoute: string = '';
|
||||
currRoute: string = '';
|
||||
lastScrollPos: number = 0;
|
||||
showAudioPlayer: boolean = false;
|
||||
|
||||
constructor(private router: Router,
|
||||
private audioPlayerService: AudioPlayerService,
|
||||
private googleAnalyticsService: GoogleAnalyticsService){
|
||||
this.router.events.subscribe((event:Event) => {
|
||||
if(event instanceof NavigationEnd) {
|
||||
this.lastRoute = this.currRoute;
|
||||
this.currRoute = event.urlAfterRedirects;
|
||||
|
||||
|
||||
let doc = document.documentElement;
|
||||
let scrollPos = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
|
||||
|
||||
let url = event.urlAfterRedirects;
|
||||
|
||||
if (url === '/home'){
|
||||
this.fadeHeader = true;
|
||||
this.headerOpacity = 0;
|
||||
} else {
|
||||
this.fadeHeader = false;
|
||||
this.headerOpacity = 1;
|
||||
}
|
||||
if (this.lastRoute === event.url){
|
||||
window.scrollTo(0,this.lastScrollPos);
|
||||
} else {
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
this.lastRoute = event.url;
|
||||
this.lastScrollPos = scrollPos;
|
||||
// Google Analytics
|
||||
googleAnalyticsService.pageView(url.substr(1),url);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
mainMenuClick(){
|
||||
this.menuOpen = !this.menuOpen;
|
||||
}
|
||||
|
||||
audioPlayerClosed(): void{
|
||||
this.showAudioPlayer = false;
|
||||
this.audioPlayerService.updateAudioPlayerOpen(this.showAudioPlayer);
|
||||
}
|
||||
|
||||
audioPlayerStarted(): void{
|
||||
this.showAudioPlayer = true;
|
||||
this.audioPlayerService.updateAudioPlayerOpen(this.showAudioPlayer);
|
||||
}
|
||||
|
||||
@HostListener('window:scroll', ['$event'])
|
||||
onScroll(event){
|
||||
if (!this.fadeHeader){
|
||||
return;
|
||||
}
|
||||
//this.scrollElement = event.target.documentElement || event.target.body || window;
|
||||
let scrollTop = event.target.documentElement.scrollTop || event.target.body.scrollTop || window.pageYOffset;
|
||||
let allIn = 100;
|
||||
this.headerOpacity = scrollTop / allIn;
|
||||
this.headerOpacity = this.headerOpacity > 1 ? 1 : this.headerOpacity;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
.wrapper{
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.audio-control-button{
|
||||
font-size: 40px;
|
||||
margin: 10px;
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.padding5{
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.duration{
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.audio-control-button:hover{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.audio-control-button-c{
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.slider{
|
||||
width: 100%;
|
||||
max-width: 1000px;
|
||||
display: table;
|
||||
}
|
||||
|
||||
.slider-control{
|
||||
width: 100%;
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.text{
|
||||
text-align: center;
|
||||
margin-top: -15px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
<div class="wrapper">
|
||||
<div class="slider">
|
||||
<span [ngSwitch]="audioState" >
|
||||
<span *ngSwitchDefault><i ofbicon class="audio-control-button">slow_motion_video</i></span>
|
||||
<span *ngSwitchCase="audioStates.Loading"><i ofbicon class="audio-control-button padding5">slow_motion_video</i></span>
|
||||
<span *ngSwitchCase="audioStates.Paused"><i ofbicon (click)="play()" class="audio-control-button padding5">play_arrow</i></span>
|
||||
<span *ngSwitchCase="audioStates.Playing"><i ofbicon (click)="pause()" class="audio-control-button padding5">pause</i></span>
|
||||
<span *ngSwitchCase="audioStates.Error"><i ofbicon (click)="play()" class="audio-control-button padding5">play_arrow</i></span>
|
||||
</span>
|
||||
<mat-slider class="slider-control padding5" min="0" [max]="audioDuration" [value]="currentTime" (change)="changeTime($event)"></mat-slider>
|
||||
<span class="duration padding5">{{ currentTime | duration:audioDuration }}</span>
|
||||
<span><i ofbicon class="audio-control-button padding5" (click)="close()">close</i></span>
|
||||
</div>
|
||||
<div [ngSwitch]="audioState" class="text">
|
||||
<div *ngSwitchCase="audioStates.Loading">
|
||||
Loading...
|
||||
</div>
|
||||
<div *ngSwitchCase="audioStates.Paused">
|
||||
{{ audioFileTitle }}
|
||||
</div>
|
||||
<div *ngSwitchCase="audioStates.Playing">
|
||||
{{ audioFileTitle }}
|
||||
</div>
|
||||
<div *ngSwitchCase="audioStates.Error">
|
||||
Error Playing... {{ errorMessage }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
import { GoogleAnalyticsService } from './../../services/google-analytics.service';
|
||||
import { Component, OnInit, OnDestroy, Output, EventEmitter } from '@angular/core';
|
||||
import { AudioPlayerService } from '../../services/audio-player.service';
|
||||
import { AudioStates } from '../../enum/audio-states';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'audio-player-component',
|
||||
templateUrl: './audio-player.component.html',
|
||||
styleUrls: ['./audio-player.component.css'],
|
||||
})
|
||||
export class AudioPlayerComponent implements OnInit, OnDestroy {
|
||||
audioStates = AudioStates; //Store reference to enum so we can access it in the template
|
||||
audioState: AudioStates;
|
||||
|
||||
audioFileId: number;
|
||||
audioFileTitle: string;
|
||||
audioFileAuthor: string;
|
||||
audioDuration: number;
|
||||
currentTime: number;
|
||||
|
||||
primarySourceUrl: string = '';
|
||||
errorMessage: string = 'Unknown Error';
|
||||
private interval: any;
|
||||
|
||||
onStateChangedSubscription: any;
|
||||
|
||||
@Output()
|
||||
closed: EventEmitter<string> = new EventEmitter();
|
||||
@Output()
|
||||
started: EventEmitter<string> = new EventEmitter();
|
||||
|
||||
constructor(private audioPlayerService: AudioPlayerService,
|
||||
private googleAnalyticsService: GoogleAnalyticsService){
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void{
|
||||
this.onStateChangedSubscription = this.audioPlayerService.onStateChanged().subscribe(({metaData,state,error})=>{
|
||||
this.parseMetaData(metaData);
|
||||
this.audioState = state;
|
||||
this.errorMessage = error;
|
||||
this.audioDuration = this.audioPlayerService.getDuration();
|
||||
this.currentTime = this.audioPlayerService.getCurrentTime();
|
||||
if (this.audioState == AudioStates.Loading){
|
||||
this.started.emit("loading");
|
||||
}
|
||||
if (this.audioState == AudioStates.Playing){
|
||||
this.started.emit("playing");
|
||||
this.interval = setInterval(()=>{
|
||||
this.audioDuration = this.audioPlayerService.getDuration();
|
||||
this.currentTime = this.audioPlayerService.getCurrentTime();
|
||||
},1000);
|
||||
} else {
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
this.sendGoogleAnalytics(state,error);
|
||||
});
|
||||
}
|
||||
|
||||
sendGoogleAnalytics(state: AudioStates, error: any){
|
||||
switch (state) {
|
||||
case AudioStates.Error:
|
||||
this.googleAnalyticsService.audioError(this.audioFileId, this.audioFileTitle, error)
|
||||
break;
|
||||
|
||||
case AudioStates.Loading:
|
||||
this.googleAnalyticsService.loadingSermon(this.audioFileId,this.audioFileTitle);
|
||||
break;
|
||||
|
||||
case AudioStates.Paused:
|
||||
this.googleAnalyticsService.pauseSermon(this.audioFileId,this.audioFileTitle,this.audioPlayerService.getCurrentTime())
|
||||
break;
|
||||
|
||||
case AudioStates.Playing:
|
||||
this.googleAnalyticsService.playSermon(this.audioFileId,this.audioFileTitle,this.audioPlayerService.getCurrentTime())
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
play(): void{
|
||||
this.audioPlayerService.resume();
|
||||
}
|
||||
|
||||
pause(): void{
|
||||
this.audioPlayerService.pause();
|
||||
}
|
||||
|
||||
close(): void{
|
||||
this.audioPlayerService.stop();
|
||||
this.closed.emit("closed");
|
||||
}
|
||||
|
||||
changeTime(event){
|
||||
this.audioPlayerService.setPosition(event.value);
|
||||
}
|
||||
|
||||
ngOnDestroy(): void{
|
||||
this.onStateChangedSubscription.unsubscribe();
|
||||
}
|
||||
|
||||
private parseMetaData(metaData): void{
|
||||
this.audioFileId = metaData.id;
|
||||
this.audioFileTitle = metaData.title;
|
||||
this.audioFileAuthor = metaData.author;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
.full-width{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.hide{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.errorMessages{
|
||||
color: white;
|
||||
background-color: rgb(255,90,90);
|
||||
padding: 10px;
|
||||
border-radius: 3px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<secondary-page-component [hideSideBarOnMobile]="true" >
|
||||
<div mainContent>
|
||||
<br>
|
||||
<div *ngIf="!formSubmitted">
|
||||
<form class="form" #contactForm="ngForm" (ngSubmit)="onSubmit()">
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput type="text" placeholder="Name" required value="" [(ngModel)]="name" name="name" >
|
||||
</mat-form-field>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput type="email" placeholder="Email" required value="" [(ngModel)]="email" name="email" pattern="^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$">
|
||||
</mat-form-field>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput type="tel" placeholder="Phone" value="" [(ngModel)]="phone" name="phone">
|
||||
</mat-form-field>
|
||||
<mat-form-field class="full-width">
|
||||
<textarea matInput type="text" placeholder="Message" required value="" [(ngModel)]="body" name="body" rows="5" ></textarea>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="hide">
|
||||
<input matInput type="text" placeholder="hp" required value="" [(ngModel)]="hp" name="subject">
|
||||
</mat-form-field>
|
||||
<div class="errorMessages" *ngIf="errorMessages.length > 0">
|
||||
<p *ngFor="let error of errorMessages">{{error}}</p>
|
||||
</div>
|
||||
<button mat-raised-button type="submit" [disabled]="!contactForm.form.valid || submitButtonDisabled">{{submitButtonText}}</button>
|
||||
</form>
|
||||
</div>
|
||||
<div *ngIf="formSubmitted">
|
||||
<p><b>Thank You!</b></p>
|
||||
<p>Your message has been sent.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div sideBar ofbFadeInOnScroll>
|
||||
|
||||
</div>
|
||||
</secondary-page-component>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ContactPageComponent } from './contact-page.component';
|
||||
|
||||
describe('ContactPageComponent', () => {
|
||||
let component: ContactPageComponent;
|
||||
let fixture: ComponentFixture<ContactPageComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ContactPageComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ContactPageComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
import { Router } from '@angular/router';
|
||||
import { MatDialogConfig } from '@angular/material';
|
||||
import { OkPopupComponent } from './../popups/ok-popup/ok-popup.component';
|
||||
import { EmailService } from './../../services/email.service';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material';
|
||||
|
||||
@Component({
|
||||
selector: 'app-contact-page',
|
||||
templateUrl: './contact-page.component.html',
|
||||
styleUrls: ['./contact-page.component.css']
|
||||
})
|
||||
export class ContactPageComponent implements OnInit {
|
||||
public submitButtonText: string = "Submit";
|
||||
public submitButtonDisabled: boolean = false;
|
||||
public formSubmitted: boolean = false;
|
||||
|
||||
public name: string;
|
||||
public email: string;
|
||||
public phone: string;
|
||||
public body: string;
|
||||
public hp: string = ".";
|
||||
|
||||
public errorMessages: string[] = [];
|
||||
|
||||
|
||||
constructor(private emailService: EmailService,
|
||||
private MatDialog: MatDialog,
|
||||
private router: Router) { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
onSubmit(){
|
||||
this.errorMessages = [];
|
||||
if (this.name == null || this.name == ""){
|
||||
this.errorMessages.push("Please enter a name");
|
||||
}
|
||||
if (this.email == null || this.email == ""){
|
||||
this.errorMessages.push("Please enter an email address");
|
||||
}
|
||||
if (this.body == null || this.body == ""){
|
||||
this.errorMessages.push("Please enter a message");
|
||||
}
|
||||
if (this.errorMessages.length > 0){ return; }
|
||||
|
||||
this.submitButtonText = "Please Wait...";
|
||||
this.submitButtonDisabled = true;
|
||||
this.emailService.sendEmail(this.name,
|
||||
this.email,
|
||||
this.phone,
|
||||
this.body,
|
||||
this.hp)
|
||||
.subscribe(
|
||||
success => {this.emailSuccess();},
|
||||
error => {this.emailError();});
|
||||
}
|
||||
|
||||
private emailSuccess(){
|
||||
let opts = new MatDialogConfig;
|
||||
opts.data = { title:'Email Sent','message':'Thank You! Your message has been sent.' };
|
||||
let popup = this.MatDialog.open(OkPopupComponent,opts);
|
||||
this.submitButtonText = "Submit";
|
||||
this.submitButtonDisabled = false;
|
||||
popup.afterClosed().subscribe(()=>{
|
||||
this.formSubmitted = true;
|
||||
});
|
||||
}
|
||||
|
||||
private emailError(){
|
||||
console.error("error");
|
||||
let opts = new MatDialogConfig;
|
||||
opts.data = { title:'Email Error','message':'Please make sure that you have entered a valid email address.' };
|
||||
let popup = this.MatDialog.open(OkPopupComponent,opts);
|
||||
this.submitButtonText = "Submit";
|
||||
this.submitButtonDisabled = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { MONTHS } from '../../constants/months';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'date-component',
|
||||
template: '<div class="wrapper"><div class="month">{{ month }}</div><div class="day">{{ day }}</div></div>',
|
||||
styles: ['.month{ color:white; background-color:red; width:40px; font-size: .75rem; text-align:center; } .day{ text-align:center; background:linear-gradient(to bottom, #ededed 0%,#ffffff 100%); }'],
|
||||
})
|
||||
export class DateComponent implements OnInit {
|
||||
@Input()
|
||||
date: Date = new Date();
|
||||
month: number;
|
||||
day: number;
|
||||
|
||||
constructor(){
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void{
|
||||
let monthNum = this.date.getMonth();
|
||||
this.month = MONTHS[monthNum];
|
||||
this.day = this.date.getDate();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
.wrapper{
|
||||
box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12);
|
||||
}
|
||||
|
||||
.photo{
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
max-width: 100px;
|
||||
margin: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.fade{
|
||||
text-align: center;
|
||||
vertical-align: bottom;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 20px;
|
||||
padding-bottom: 2px;
|
||||
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#ffffff+0,ffffff+100&0+0,0.8+100 */
|
||||
background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 100%); /* FF3.6-15 */
|
||||
background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,0.8) 100%); /* Chrome10-25,Safari5.1-6 */
|
||||
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,0.8) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ccffffff',GradientType=0 ); /* IE6-9 */
|
||||
}
|
||||
|
||||
.photo button{
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
button img{
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.info{
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
padding: 2px 2px 8px 5px;
|
||||
box-sizing: border-box;
|
||||
width: calc(100% - 100px);
|
||||
overflow-y: hidden;
|
||||
position: relative;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.title{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.date, .author{
|
||||
font-style: italic;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.description{
|
||||
font-size: 14px;
|
||||
color: darkgray;
|
||||
word-wrap: none;
|
||||
border-top: 0px solid lightgray;
|
||||
padding-top:6px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
.expanded{
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.expanded-content{
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.buttons, .buttons-edit{
|
||||
background-color: lightgray;
|
||||
}
|
||||
|
||||
.buttons button, .buttons .filler{
|
||||
display: inline-block;
|
||||
width: 33.33333%;
|
||||
}
|
||||
|
||||
.border{
|
||||
margin: 0px 5px 0px 5px;
|
||||
border-top: 1px inset lightgray;
|
||||
}
|
||||
|
||||
.buttons-edit button{
|
||||
display: inline-block;
|
||||
width: 50%;
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<div class="wrapper" [@inout]="startFadeIn">
|
||||
<div class="photo">
|
||||
<button mat-button (click)="toggleState()">
|
||||
<img src="{{imgSrc}}" />
|
||||
</button>
|
||||
</div><!--
|
||||
--><div class="info" (click)="toggleState()">
|
||||
<span class="title">{{ title }}</span>
|
||||
<br>
|
||||
<span class="date">{{ startDate | ofbDate:true }}</span>
|
||||
<br>
|
||||
<p class="description" [@toggleAnimationFade]="state">
|
||||
{{ description }}
|
||||
</p>
|
||||
<div class="fade"><i ofbicon *ngIf="state === 'closed'">arrow_drop_down</i><i ofbicon *ngIf="state === 'open'">arrow_drop_up</i></div>
|
||||
</div>
|
||||
<div class="expanded" [@toggleAnimation]="state" (click)="toggleState()">
|
||||
<p class="expanded-content">
|
||||
{{ description }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<span class="action pct10 filler"></span><!--
|
||||
--><span class="action pct10 filler"></span><!--
|
||||
--><button mat-button class="action pct10" (click)="share()" ><i ofbicon>share</i> Share</button>
|
||||
</div>
|
||||
<div class="buttons-edit" *ngIf="loggedIn">
|
||||
<div class="border"></div>
|
||||
<span class="action filler"></span><!--
|
||||
--><button mat-button class="action" (click)="delete()" ><i ofbicon>delete_forever</i> Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EventLargeComponent } from './event-large.component';
|
||||
|
||||
describe('EventLargeComponent', () => {
|
||||
let component: EventLargeComponent;
|
||||
let fixture: ComponentFixture<EventLargeComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EventLargeComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EventLargeComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,109 +0,0 @@
|
|||
import { Component, AfterContentInit, Input, Inject } from '@angular/core';
|
||||
import { MatDialog, MatDialogConfig } from '@angular/material';
|
||||
import { trigger, state, style, transition, animate } from '@angular/animations';
|
||||
import { EventService } from './../../services/event.service';
|
||||
|
||||
import { SharePopupComponent } from './../popups/share-popup/share-popup.component';
|
||||
import { YesNoPopupComponent } from './../popups/yes-no-popup/yes-no-popup.component';
|
||||
|
||||
import { MONTHS_FULL } from '../../constants/months';
|
||||
|
||||
@Component({
|
||||
selector: 'event-large-component',
|
||||
templateUrl: './event-large.component.html',
|
||||
styleUrls: ['./event-large.component.css'],
|
||||
animations:[
|
||||
trigger("inout",[
|
||||
state("1", style({ opacity: '1' })),
|
||||
state("0",style({ opacity: '0' })),
|
||||
transition('* => 1',[
|
||||
animate('500ms ease-in-out')
|
||||
]),
|
||||
transition(':enter',[
|
||||
animate('0ms')
|
||||
])
|
||||
]),
|
||||
trigger('toggleAnimation', [
|
||||
state('open', style({
|
||||
height: '*',
|
||||
})),
|
||||
state('closed', style({
|
||||
height: '0px',
|
||||
})),
|
||||
transition('open <=> closed', animate('500ms ease-in-out'))
|
||||
]),
|
||||
trigger('toggleAnimationFade', [
|
||||
state('open', style({
|
||||
opacity: 0,
|
||||
})),
|
||||
state('closed', style({
|
||||
opacity: 1,
|
||||
})),
|
||||
transition('open <=> closed', animate('500ms ease-in-out'))
|
||||
])
|
||||
]
|
||||
})
|
||||
export class EventLargeComponent implements AfterContentInit {
|
||||
|
||||
public state: string = 'closed';
|
||||
@Input()
|
||||
public loggedIn: boolean;
|
||||
|
||||
@Input()
|
||||
id: number;
|
||||
@Input()
|
||||
title: string;
|
||||
@Input()
|
||||
description: string;
|
||||
@Input()
|
||||
startDate: Date;
|
||||
@Input()
|
||||
endDate: Date;
|
||||
public startFadeIn: boolean = false;
|
||||
@Input()
|
||||
public delayFadeIn: number = 100;
|
||||
|
||||
public _imgSrc: string;
|
||||
public get imgSrc(): string{
|
||||
var monthNum = this.startDate.getMonth();
|
||||
var monthName = '';
|
||||
monthName = MONTHS_FULL[monthNum];
|
||||
return "/api2/cim/" + monthName + "/" + this.startDate.getDate();
|
||||
}
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private eventService: EventService){
|
||||
}
|
||||
|
||||
ngAfterContentInit(): void{
|
||||
setTimeout(() => this.startFadeIn = true, this.delayFadeIn);
|
||||
}
|
||||
|
||||
toggleState(){
|
||||
this.state = this.state === 'open' ? 'closed' : 'open'
|
||||
}
|
||||
|
||||
share(){
|
||||
let opts = new MatDialogConfig;
|
||||
opts.data = { prefix: 'e', id: this.id, title: this.title, description: this.description };
|
||||
let dialog = this.dialog.open(SharePopupComponent, opts);
|
||||
}
|
||||
|
||||
delete(){
|
||||
let opts = new MatDialogConfig;
|
||||
opts.data = { title:'Delete','message':'Are you sure you want to delete "' + this.title + '"?' };
|
||||
let dialog = this.dialog.open(YesNoPopupComponent, opts);
|
||||
|
||||
dialog.afterClosed().subscribe(s => {
|
||||
s = s as boolean;
|
||||
if (s === true){
|
||||
this.eventService.deleteEvent(this.id).subscribe(
|
||||
success => { },
|
||||
error => { console.error(error); }
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
.inner-wrapper{
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.title{
|
||||
display: table;
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
.title-text{
|
||||
vertical-align: middle;
|
||||
display: table-cell;
|
||||
padding-left: 10px;
|
||||
font-size: .95rem;
|
||||
}
|
||||
|
||||
a{
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<div class="wrapper" [@inout]="startFadeIn">
|
||||
<div class="inner-wrapper">
|
||||
<div class="title">
|
||||
<a></a>
|
||||
<date-component class="title-date" [date]="startDate"></date-component>
|
||||
<span class="title-text">{{ title }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
import { Component, AfterContentInit, Input } from '@angular/core';
|
||||
import { trigger, state, style, transition, animate } from '@angular/animations';
|
||||
|
||||
@Component({
|
||||
selector: 'event-component',
|
||||
templateUrl: './event.component.html',
|
||||
styleUrls: ['./event.component.css'],
|
||||
animations:[
|
||||
trigger("inout",[
|
||||
state("1", style({ opacity: '1', transform:'translateX(0)' })),
|
||||
state("0",style({ opacity: '0', transform:'translateX(5%)' })),
|
||||
transition('* => 1',[
|
||||
animate('500ms ease-in-out')
|
||||
]),
|
||||
transition(':enter',[
|
||||
animate('0ms')
|
||||
])
|
||||
])
|
||||
]
|
||||
})
|
||||
export class EventComponent implements AfterContentInit {
|
||||
@Input()
|
||||
title: string;
|
||||
@Input()
|
||||
description: string;
|
||||
@Input()
|
||||
startDate: Date;
|
||||
@Input()
|
||||
endDate: Date;
|
||||
public startFadeIn: boolean = false;
|
||||
@Input()
|
||||
public delayFadeIn: number = 100;
|
||||
|
||||
constructor(){
|
||||
}
|
||||
|
||||
ngAfterContentInit(): void{
|
||||
setTimeout(() => this.startFadeIn = true, this.delayFadeIn);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
|
||||
ul{
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
li{
|
||||
margin: 40px 0px 40px 0px; /* top right bottom left */
|
||||
}
|
||||
|
||||
li:first-child{
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
li:last-child{
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.side-bar{
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
.width100{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fab-buttons{
|
||||
display: none;
|
||||
}
|
||||
|
||||
#showAllButton{
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#audio-player-filler{
|
||||
height: 60px;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
@media(max-width:800px){
|
||||
.mobile-search{
|
||||
display: block;
|
||||
}
|
||||
.fab-buttons{
|
||||
display: inline-block;
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
<secondary-page-component [hideSideBarOnMobile]="true" >
|
||||
<div mainContent>
|
||||
<p *ngIf="loading">Loading upcoming events...</p>
|
||||
<ul>
|
||||
<li *ngFor="let event of events; let i = index;">
|
||||
<event-large-component
|
||||
[id]="event.id"
|
||||
[title]="event.title"
|
||||
[startDate]="event.startDate"
|
||||
[description]="event.description"
|
||||
[delayFadeIn]="(i+1)*200"
|
||||
[loggedIn]="loggedIn"
|
||||
></event-large-component>
|
||||
</li>
|
||||
</ul>
|
||||
<button mat-button *ngIf="showAllButtonVisible" id="showAllButton" class="width100" style="text-align: center;" routerLink="/events" >
|
||||
<i ofbicon >expand_more</i><span *ngIf="!loading"> Show All</span>
|
||||
</button>
|
||||
<div class="fab-buttons" >
|
||||
<button mat-fab *ngIf="loggedIn" (click)="addEvent()"><i ofbicon>add</i></button>
|
||||
<div id="audio-player-filler" *ngIf="audioPlayerOpen"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div sideBar class="side-bar">
|
||||
<button mat-raised-button *ngIf="loggedIn" class="width100" (click)="addEvent()" >Add Event</button>
|
||||
</div>
|
||||
</secondary-page-component>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EventsPageComponent } from './events-page.component';
|
||||
|
||||
describe('EventsPageComponent', () => {
|
||||
let component: EventsPageComponent;
|
||||
let fixture: ComponentFixture<EventsPageComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EventsPageComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EventsPageComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
import { GoogleAnalyticsService } from './../../services/google-analytics.service';
|
||||
import { MatDialog, MatDialogConfig, MatSnackBar } from '@angular/material';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { EventService } from './../../services/event.service';
|
||||
import { AudioPlayerService } from './../../services/audio-player.service';
|
||||
import { AddEventPopupComponent } from './../popups/add-event-popup/add-event-popup.component';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
import { Event } from '../../interfaces/event';
|
||||
|
||||
import { LoginService } from '../../services/login.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-events-page',
|
||||
templateUrl: './events-page.component.html',
|
||||
styleUrls: ['./events-page.component.css']
|
||||
})
|
||||
export class EventsPageComponent implements OnInit {
|
||||
|
||||
private dialogConfig: MatDialogConfig;
|
||||
public loading: boolean = true;
|
||||
public events: Event[];
|
||||
public loggedIn: boolean = false;
|
||||
public showAllButtonVisible: boolean = false;
|
||||
public audioPlayerOpen: boolean = false;
|
||||
|
||||
constructor(private loginService: LoginService,
|
||||
private eventService: EventService,
|
||||
private dialog: MatDialog,
|
||||
private snackbar: MatSnackBar,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private audioPlayerService: AudioPlayerService,
|
||||
private googleAnalyticsService: GoogleAnalyticsService) {
|
||||
this.loginService.isLoggedIn(true).subscribe(is => { this.loggedIn = is; });
|
||||
this.loginService.onLogin().subscribe(is => { this.loggedIn = is.isLoggedIn; });
|
||||
this.audioPlayerService.onAudioPlayerOpenClose.subscribe(is => this.audioPlayerOpen = is);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.activatedRoute.params
|
||||
.subscribe((params: Params) =>{
|
||||
let id = +params['id'];
|
||||
id = Number.isNaN(id) ? -1 : id;
|
||||
if (id > -1){
|
||||
this.getSingleEvent(id);
|
||||
this.showAllButtonVisible = true;
|
||||
} else {
|
||||
this.getEvents(true);
|
||||
this.showAllButtonVisible = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
getEvents(clearExisting: boolean): void{
|
||||
this.loading = true;
|
||||
this.events = this.events || [];
|
||||
if (clearExisting){
|
||||
this.events = [];
|
||||
}
|
||||
this.eventService.getEvents(1).subscribe(
|
||||
events => {
|
||||
this.addEvents(events);
|
||||
this.loading = false;
|
||||
},
|
||||
error => console.error(error)
|
||||
);
|
||||
}
|
||||
|
||||
getSingleEvent(id: Number): void{
|
||||
this.events = [];
|
||||
this.loading = true;
|
||||
this.eventService.getSingleEvent(id).subscribe(event => {
|
||||
this.events.push(event);
|
||||
this.loading = false;
|
||||
this.googleAnalyticsService.shareEventConversion(event.id,event.title);
|
||||
});
|
||||
}
|
||||
|
||||
addEvents(events: Event[]): void{
|
||||
for(let i = 0; i < events.length; i++){
|
||||
this.events.push(events[i]);
|
||||
}
|
||||
}
|
||||
|
||||
addEvent(){
|
||||
let dialog = this.dialog.open(AddEventPopupComponent,this.dialogConfig);
|
||||
|
||||
dialog.afterClosed().subscribe(e => {
|
||||
e = e as Event;
|
||||
if (e != null){
|
||||
this.events.unshift(e);
|
||||
let snack = this.snackbar.open(e.title + " was added!", "Ok");
|
||||
snack.onAction().subscribe(() => {
|
||||
snack.dismiss();
|
||||
});
|
||||
setTimeout(() => { snack.dismiss(); },3000);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,173 +0,0 @@
|
|||
#content-wrapper{
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
|
||||
a{
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
a:visited{
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
|
||||
img{
|
||||
width: 70%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
img.full {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.action{
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.inline-block{
|
||||
display: inline-block;
|
||||
width: calc(60% - 10px);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.row{
|
||||
position: relative;
|
||||
vertical-align: middle;
|
||||
padding-top: 10px;
|
||||
background-color: white;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.row-background{
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
z-index: -1000;
|
||||
left: 0;
|
||||
top: -10px;
|
||||
|
||||
}
|
||||
|
||||
.row-content{
|
||||
width: 1000px;
|
||||
margin: auto;
|
||||
max-width: 100%;
|
||||
overflow: hidden; /*Keep floating children inside this element */
|
||||
}
|
||||
|
||||
.row-content-single-col{
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
padding-top: 40px;
|
||||
padding-bottom: 40px;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.row-content-col-left, .row-content-col-right{
|
||||
display: inline-block;
|
||||
width: calc(50% - 5px);
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.row-content-col-right{
|
||||
float: right;
|
||||
}
|
||||
|
||||
.row-content-header{
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
.align-top{
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#background-image{
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
z-index: -1000;
|
||||
}
|
||||
|
||||
@media(min-width:400px){
|
||||
#background-image{
|
||||
top: -15px;
|
||||
}
|
||||
}
|
||||
@media(min-width:500px){
|
||||
#background-image{
|
||||
top: -30px;
|
||||
}
|
||||
}
|
||||
@media(min-width:700px){
|
||||
#background-image{
|
||||
top: -45px;
|
||||
}
|
||||
}
|
||||
@media(min-width:900px){
|
||||
#background-image{
|
||||
top: -60px;
|
||||
}
|
||||
}
|
||||
@media(min-width:1100px){
|
||||
#background-image{
|
||||
top: -75px;
|
||||
}
|
||||
}
|
||||
@media(min-width:1300px){
|
||||
#background-image{
|
||||
top: -100px;
|
||||
}
|
||||
}
|
||||
|
||||
#filler{
|
||||
width: 100%;
|
||||
padding-bottom: 35%;
|
||||
}
|
||||
|
||||
.center{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
.tint{
|
||||
background-color: rgb(240,240,240);
|
||||
border-top: 1px solid rgb(200,200,200);
|
||||
border-bottom: 1px solid rgb(220,220,220);
|
||||
}
|
||||
|
||||
.see-through{
|
||||
background-color: rgba(0,0,0,.8);
|
||||
}
|
||||
|
||||
.see-through-light{
|
||||
background-color: rgba(0,0,0,.3);
|
||||
}
|
||||
|
||||
|
||||
.verse{
|
||||
font-style: italic;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@media(max-width: 850px){
|
||||
.row-content-col-left, .row-content-col-right{
|
||||
display: block;
|
||||
width: 100%;
|
||||
float:none;
|
||||
text-align: center;
|
||||
}
|
||||
img.full {
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,143 +0,0 @@
|
|||
|
||||
<img id="background-image" src="assets/images/home-images/tiny/sunset_b.jpg" alt="background image" width="100%">
|
||||
|
||||
<div id="filler">
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content-wrapper">
|
||||
|
||||
<div class="row tint" *ngIf="showSpecial" >
|
||||
<div class="row-content">
|
||||
<div class="row-content-col-left">
|
||||
<a href="assets/images/champ_flyer.jpg" download="champ_flyer.jpg"><img class="full" ofbFadeInOnScroll src="assets/images/home-images/tiny/champ.jpg" height="300"></a>
|
||||
</div>
|
||||
<div class="row-content-col-right align-top center">
|
||||
<p ofbFadeInOnScroll class="row-content-header">Champ the Smiling Trick Horse</p>
|
||||
<p ofbFadeInOnScroll>
|
||||
Come join us for this special event happening September 5th and 6th at Old Fashion Baptist!
|
||||
</p>
|
||||
<br>
|
||||
<p ofbFadeInOnScroll>
|
||||
<b>Wednesday, September 5 @ 7 PM</b>
|
||||
<br>
|
||||
Bible Preaching & Bluegrass Gospel Music
|
||||
</p>
|
||||
<br>
|
||||
<p ofbFadeInOnScroll>
|
||||
<b>Thursday, September 6 @ 5:30 PM</b>
|
||||
<br>
|
||||
Food, Games, Music & Preaching
|
||||
</p>
|
||||
<br>
|
||||
<p ofbFadeInOnScroll>
|
||||
<a href="assets/images/champ_flyer.jpg" download="champ_flyer.jpg"><b>Click here to download the flyer</b></a>
|
||||
</p>
|
||||
<br>
|
||||
<p ofbFadeInOnScroll class="action">
|
||||
<i ofbicon>phone</i> <a href="tel:+1-406-494-5028" class="align-top">406-494-5028</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="row-content">
|
||||
<div class="row-content-col-left align-top">
|
||||
<p ofbFadeInOnScroll class="row-content-header">...that ye also may have fellowship with us...</p>
|
||||
<p ofbFadeInOnScroll>It is exciting to gather together in the name of the Lord and
|
||||
we sincerily hope that YOU will join us. Guests are always welcome at Old Fashion
|
||||
Baptist and we look forward to seeing you!</p>
|
||||
<p class="verse" ofbFadeInOnScroll>For where two or three are gathered together in my name, there am I in the midst of them. - Matthew 18:20</p>
|
||||
<p ofbFadeInOnScroll class="action"><i ofbicon>info_outline</i> <a href="#" routerLink="/whoweare" class="align-top">Learn more about us</a></p>
|
||||
</div>
|
||||
<div class="row-content-col-right">
|
||||
<!-- <img ofbFadeInOnScroll src="assets/images/home-images/2-church-color.png"> -->
|
||||
<a routerLink="/whoweare"><img ofbFadeInOnScroll src="assets/images/home-images/tiny/family.jpg"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row tint">
|
||||
<div class="row-content">
|
||||
<div class="row-content-single-col">
|
||||
<p ofbFadeInOnScroll ofbGrowWhenCenter class="verse">O give thanks unto the Lord; for he is good: because his mercy endureth for ever. - Psalm 118:1</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="row-content">
|
||||
<div class="row-content-col-right align-top">
|
||||
<p ofbFadeInOnScroll class="row-content-header">Need a ride?</p>
|
||||
<p ofbFadeInOnScroll>
|
||||
Want to come but don't have a way to get here? We would be happy
|
||||
to pick you up! Give us a call to schedule a ride on Sunday Morning.
|
||||
</p>
|
||||
<br>
|
||||
<p ofbFadeInOnScroll class="action">
|
||||
<i ofbicon>phone</i> <a href="tel:+1-406-494-5028" class="align-top">406-494-5028</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="row-content-col-left">
|
||||
<a href="tel:+1-406-494-5028"><img ofbFadeInOnScroll src="assets/images/home-images/tiny/bus2.jpg" height="200"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row tint">
|
||||
<div class="row-content">
|
||||
<div class="row-content-single-col">
|
||||
<p ofbFadeInOnScroll class="verse">The fear of the LORD is the beginning of wisdom: and the knowledge of the holy is understanding. - Proverbs 9:10</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="row-content">
|
||||
<div class="row-content-col-left align-top">
|
||||
<p ofbFadeInOnScroll class="row-content-header">The Holy Bible</p>
|
||||
<div ofbFadeInOnScroll>
|
||||
Here at Old Fashion Baptist Church we love the Word of God!
|
||||
<p class="verse">
|
||||
But he answered and said, <span class="red">It is written, Man shall not live by bread alone, but by every word that proceedeth out of the mouth of God.</span> - Matthew 4:4</p>
|
||||
We encourage you to come and join as as we study, teach and preach Gods Word!
|
||||
<br><br>
|
||||
<p class="action">
|
||||
<i ofbicon>directions</i> <a target="_blank" class="align-top" href="https://www.google.com/maps/place/Old+Fashion+Baptist+Church/@45.9814004,-112.5320574,11.87z/data=!4m12!1m6!3m5!1s0x535b078c3c74ea33:0xac299097142c5894!2sOld+Fashion+Baptist+Church!8m2!3d45.951287!4d-112.511978!3m4!1s0x535b078c3c74ea33:0xac299097142c5894!8m2!3d45.951287!4d-112.511978">Get Directions</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-content-col-right">
|
||||
<a target="_blank" class="align-top" href="https://www.google.com/maps/place/Old+Fashion+Baptist+Church/@45.9814004,-112.5320574,11.87z/data=!4m12!1m6!3m5!1s0x535b078c3c74ea33:0xac299097142c5894!2sOld+Fashion+Baptist+Church!8m2!3d45.951287!4d-112.511978!3m4!1s0x535b078c3c74ea33:0xac299097142c5894!8m2!3d45.951287!4d-112.511978"><img ofbFadeInOnScroll src="assets/images/home-images/tiny/bible.jpg"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row tint">
|
||||
<div class="row-content">
|
||||
<div class="row-content-single-col">
|
||||
<p ofbFadeInOnScroll class="verse">Not forsaking the assembling of ourselves together, as the manner of some is; but exhorting one another: and so much the more, as ye see the day approaching. - Hebrews 10:25</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="row-content">
|
||||
<div class="row-content-col-right align-top">
|
||||
<p ofbFadeInOnScroll class="row-content-header">Listen Online</p>
|
||||
<p ofbFadeInOnScroll>
|
||||
Many of our sermons are posted online. It is our prayer that these would be helpful and would encourage you in your walk with the Lord.
|
||||
</p>
|
||||
<br>
|
||||
<p ofbFadeInOnScroll class="action">
|
||||
<i ofbicon>headset</i> <a routerLink="/sermons" class="align-top">Click here to listen online</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="row-content-col-left">
|
||||
<a routerLink="/sermons"><img ofbFadeInOnScroll src="assets/images/home-images/tiny/headphones.png" height="200"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
import { Component, HostListener } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'home-component',
|
||||
templateUrl: './home.component.html',
|
||||
styleUrls: ['./home.component.css'],
|
||||
})
|
||||
export class HomeComponent {
|
||||
backgroundTop: string = "0px";
|
||||
public get showSpecial() : boolean {
|
||||
let maxDate = new Date(2018,8,6); // September 6th 2018 -- Set the month one month behind since JavaScript dates are 0 based
|
||||
let now = new Date();
|
||||
if (now.getFullYear() > maxDate.getFullYear()) return false;
|
||||
if (now.getFullYear() == maxDate.getFullYear()) {
|
||||
if (now.getMonth() > maxDate.getMonth()) return false;
|
||||
if (now.getMonth() == maxDate.getMonth()) {
|
||||
if (now.getDate() > maxDate.getDate()) return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@HostListener('window:scroll', ['$event'])
|
||||
onScroll(event){
|
||||
let scrollTop = event.target.documentElement.scrollTop || event.target.body.scrollTop || window.pageYOffset;
|
||||
//this.backgroundTop = Math.min((scrollTop * .30),100) * -1 + "px";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
import { Component, OnChanges, SimpleChanges, Input } from '@angular/core';
|
||||
import { trigger, transition, state, style, animate } from '@angular/animations';
|
||||
|
||||
@Component({
|
||||
selector: 'icon-button-component',
|
||||
template: `<button mat-button *ngIf="routerLink" [@menuOpened]="menuOpened" class="width100" style="text-align: left;" routerLink="{{routerLink}}"><i ofbicon [iconName]="icon"></i> {{text}}</button>
|
||||
<button mat-button *ngIf="!routerLink" [@menuOpened]="menuOpened" class="width100" style="text-align: left;"><i ofbicon [iconName]="icon"></i> {{text}}</button>`,
|
||||
styles: ['.width100{width: 100%;}button{font-size: 16px;margin-bottom: 10px;}'],
|
||||
animations: [trigger(
|
||||
'menuOpened',
|
||||
[
|
||||
state('1',style({transform:'translateX(0)'})),
|
||||
state('0',style({transform: 'translateX(80%)'})),
|
||||
transition("0 => 1", [
|
||||
animate('400ms ease-in-out')
|
||||
]),
|
||||
transition("1 => 0", [
|
||||
animate('300ms ease-in-out')
|
||||
])
|
||||
])]
|
||||
})
|
||||
export class IconButtonComponent implements OnChanges {
|
||||
@Input()
|
||||
public routerLink: string;
|
||||
@Input()
|
||||
public icon: string;
|
||||
@Input()
|
||||
public text: string;
|
||||
@Input()
|
||||
public menuOpen: boolean = true;
|
||||
public menuOpened: boolean = false;
|
||||
@Input()
|
||||
public animationDelay: number = 100;
|
||||
|
||||
ngOnChanges(changes: SimpleChanges){
|
||||
var self = this;
|
||||
if(changes.hasOwnProperty("menuOpen")){
|
||||
if (self.menuOpen === true){
|
||||
setTimeout(function(){ self.menuOpened = self.menuOpen; },self.animationDelay);
|
||||
} else {
|
||||
setTimeout(function(){ self.menuOpened = self.menuOpen; },self.animationDelay);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
.map{
|
||||
width: 100%;
|
||||
height: 450px;
|
||||
}
|
||||
|
||||
#verseFrame{
|
||||
display: block;
|
||||
border: none;
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<secondary-page-component [hideSideBarOnMobile]="true" >
|
||||
<div mainContent class="mapWrapper">
|
||||
<p *ngIf="mapLoading">Loading Google Map...</p>
|
||||
<iframe class="map" (load)="mapLoaded()" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2773.999802164379!2d-112.51416668494458!3d45.951286979109824!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x535b078c3c74ea33%3A0xac299097142c5894!2sOld+Fashion+Baptist+Church!5e0!3m2!1sen!2sus!4v1493451790286" frameborder="0" style="border:0" allowfullscreen></iframe>
|
||||
</div>
|
||||
<div sideBar ofbFadeInOnScroll>
|
||||
We are located South West of the Copper King hotel in Butte, Montana just off of Motor View Road.
|
||||
<br><br><br>
|
||||
Trust in the LORD with all thine heart; and lean not unto thine own understanding.
|
||||
In all thy ways acknowledge him, and he shall direct thy paths. <a href="https://www.kingjamesbibleonline.org/Proverbs-3-5_3-6/">(Proverbs 3:5 - 6)</a>
|
||||
</div>
|
||||
</secondary-page-component>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { LocationComponent } from './location.component';
|
||||
|
||||
describe('LocationComponent', () => {
|
||||
let component: LocationComponent;
|
||||
let fixture: ComponentFixture<LocationComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ LocationComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(LocationComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
import { BibleVerseService } from './../../services/bible-verse.service';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'location-component',
|
||||
templateUrl: './location.component.html',
|
||||
styleUrls: ['./location.component.css']
|
||||
})
|
||||
export class LocationComponent implements OnInit {
|
||||
public mapLoading: boolean = true;
|
||||
|
||||
constructor(private bibleVerseService: BibleVerseService) { }
|
||||
|
||||
ngOnInit() {
|
||||
// this.bibleVerseService.randomVerse().subscribe(
|
||||
// verse => {
|
||||
|
||||
// },
|
||||
// error => console.log(error) );
|
||||
}
|
||||
|
||||
mapLoaded(){
|
||||
this.mapLoading = false;
|
||||
}
|
||||
|
||||
verseLoaded(){
|
||||
console.log("DONE");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
|
||||
|
||||
#menu-background{
|
||||
position:fixed;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0,0,0,.7);
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
.width100{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#close-button{
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
|
||||
#header-menu{
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
bottom: 0px;
|
||||
right: 0px;
|
||||
width: 160px;
|
||||
overflow-y: auto;
|
||||
background-color: rgba(50,50,50,1);
|
||||
color: white;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
|
||||
|
||||
<div id="menu-background" [@backgroundMenuOpen]="menuOpen" (click)="menuClick($event)">
|
||||
<div id="header-menu" [@menuOpen]="menuOpen">
|
||||
<ul class="width100">
|
||||
<button mat-icon-button id="close-button" (click)="menuClick($event)"><i ofbicon>close</i></button>
|
||||
<li class="width100"><icon-button-component [menuOpen]="menuOpen" animationDelay="0" icon="help_outline" routerLink="/whoweare" text="Who We Are"></icon-button-component></li>
|
||||
<li class="width100"><icon-button-component [menuOpen]="menuOpen" animationDelay="50" icon="access_time" routerLink="/services" text="Service Times"></icon-button-component></li>
|
||||
<li class="width100"><icon-button-component [menuOpen]="menuOpen" animationDelay="100" icon="place" routerLink="/location" text="Location"></icon-button-component></li>
|
||||
<li class="width100"><icon-button-component [menuOpen]="menuOpen" animationDelay="150" icon="headset" routerLink="/sermons" text="Sermons"></icon-button-component></li>
|
||||
<li class="width100"><icon-button-component [menuOpen]="menuOpen" animationDelay="200" icon="event" routerLink="/events" text="Events"></icon-button-component></li>
|
||||
<li class="width100"><icon-button-component [menuOpen]="menuOpen" animationDelay="250" icon="mail_outline" routerLink="/contact" text="Contact"></icon-button-component></li>
|
||||
<li class="width100"><icon-button-component [menuOpen]="menuOpen" animationDelay="300" icon="input" (click)="showLogin($event)" text="Login"></icon-button-component></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
import { Component,
|
||||
Input,
|
||||
Output,
|
||||
EventEmitter } from '@angular/core';
|
||||
import { trigger,
|
||||
state,
|
||||
style,
|
||||
transition,
|
||||
animate } from '@angular/animations';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { LoginPopupComponent } from '../popups/login-popup/login-popup.component';
|
||||
|
||||
@Component({
|
||||
selector: 'menu-component',
|
||||
templateUrl: './menu.component.html',
|
||||
styleUrls: ['./menu.component.css'],
|
||||
animations: [
|
||||
trigger('menuOpen', [
|
||||
state('1', style({transform: 'translateX(0)'})),
|
||||
state('0', style({transform: 'translateX(100%)'})),
|
||||
transition('0 => 1', [
|
||||
animate('400ms ease-in-out', style({transform: 'translateX(0)'}))
|
||||
]),
|
||||
transition('1 => 0', [
|
||||
animate('400ms 100ms ease-in-out', style({transform: 'translateX(100%)'}))
|
||||
])
|
||||
]),
|
||||
trigger('backgroundMenuOpen', [
|
||||
state('1', style({opacity: '1'})),
|
||||
state('0', style({opacity: '0', display:'none'})),
|
||||
transition('0 => 1', [
|
||||
animate('400ms ease-in-out', style({opacity: '1'}))
|
||||
]),
|
||||
transition('1 => 0', [
|
||||
animate('400ms 100ms ease-in-out', style({opacity: '0'}))
|
||||
])
|
||||
])]
|
||||
})
|
||||
export class MenuComponent {
|
||||
@Input()
|
||||
menuOpen: boolean = false;
|
||||
@Output()
|
||||
closed: EventEmitter<boolean> = new EventEmitter<boolean>();
|
||||
|
||||
constructor(private MatDialog: MatDialog){
|
||||
|
||||
}
|
||||
|
||||
menuClick(event): void{
|
||||
event.stopPropagation();
|
||||
this.menuOpen = !this.menuOpen;
|
||||
this.closed.emit(this.menuOpen);
|
||||
}
|
||||
|
||||
showLogin(event){
|
||||
event.preventDefault();
|
||||
let dialog = this.MatDialog.open(LoginPopupComponent);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
.full-width{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
form{
|
||||
margin-top: 7px;
|
||||
}
|
||||
|
||||
button{
|
||||
margin: 20px 0px 20px 20px;
|
||||
}
|
||||
|
||||
.first{
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
<div md-dialog-title>
|
||||
<p>Add Event</p>
|
||||
</div>
|
||||
<div md-dialog-content>
|
||||
<form #addEventForm="ngForm" (ngSubmit)="onSubmit()">
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput placeholder="Title" required [(ngModel)]="eventTitle" name="title" >
|
||||
</mat-form-field>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput placeholder="Start Date" required [ngModel]="eventStartDate | date:'yyyy-MM-ddTHH:mm'" (ngModelChange)="eventStartDate = $event" name="startDate" type="datetime-local">
|
||||
</mat-form-field>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput placeholder="End Date" required [ngModel]="eventEndDate | date:'yyyy-MM-ddTHH:mm'" (ngModelChange)="eventEndDate = $event" name="endDate" type="datetime-local">
|
||||
</mat-form-field>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput placeholder="Description" required [(ngModel)]="eventDescription" name="description" >
|
||||
</mat-form-field>
|
||||
|
||||
<br><br>
|
||||
<div *ngIf="errorMessages.length > 0" class="errorMessages">
|
||||
<p *ngFor="let error of errorMessages">
|
||||
{{error}}
|
||||
</p>
|
||||
</div>
|
||||
<button mat-raised-button class="first" (click)="cancel($event)" >Cancel</button><!--
|
||||
--><button mat-raised-button type="submit" [disabled]="!addEventForm.form.valid || addEventButtonDisabled">{{ addEventButtonText }}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AddEventPopupComponent } from './add-event-popup.component';
|
||||
|
||||
describe('AddEventPopupComponent', () => {
|
||||
let component: AddEventPopupComponent;
|
||||
let fixture: ComponentFixture<AddEventPopupComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AddEventPopupComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AddEventPopupComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,114 +0,0 @@
|
|||
import { EventService } from './../../../services/event.service';
|
||||
import { OkPopupComponent } from './../ok-popup/ok-popup.component';
|
||||
import { LoginPopupComponent } from './../login-popup/login-popup.component';
|
||||
import { MatDialog, MatDialogRef, MatSnackBar } from '@angular/material';
|
||||
import { Event } from './../../../interfaces/event';
|
||||
import { LoginService } from './../../../services/login.service';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-add-event-popup',
|
||||
templateUrl: './add-event-popup.component.html',
|
||||
styleUrls: ['./add-event-popup.component.css']
|
||||
})
|
||||
export class AddEventPopupComponent implements OnInit {
|
||||
public addEventButtonText: string = "Add Event";
|
||||
public addEventButtonDisabled: boolean = false;
|
||||
|
||||
public eventTitle: string;
|
||||
public eventStartDate: Date = new Date();
|
||||
private _eventEndDate: Date = new Date();
|
||||
public get eventEndDate(): Date{
|
||||
if (new Date(this.eventStartDate).getTime() > new Date(this._eventEndDate).getTime()){
|
||||
this._eventEndDate = this.eventStartDate;
|
||||
}
|
||||
return this._eventEndDate;
|
||||
}
|
||||
public set eventEndDate(val: Date){
|
||||
this._eventEndDate = val;
|
||||
}
|
||||
public eventDescription: string;
|
||||
|
||||
|
||||
public errorMessages: string[] = [];
|
||||
|
||||
constructor(private MatDialog: MatDialog, private MatDialogRef: MatDialogRef<AddEventPopupComponent>, private loginService: LoginService, private eventService: EventService) { }
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
}
|
||||
|
||||
onSubmit(){
|
||||
this.updateAddButton(false);
|
||||
|
||||
//First check to see if we are logged in
|
||||
this.loginService.isLoggedIn(true).subscribe(is => {
|
||||
if (is === true){
|
||||
this.addEvent();
|
||||
} else {
|
||||
let popup = this.MatDialog.open(LoginPopupComponent);
|
||||
popup.afterClosed().subscribe(r => {
|
||||
if (r === true){
|
||||
this.addEvent();
|
||||
} else {
|
||||
this.updateAddButton(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
error =>{
|
||||
this.updateAddButton(true);
|
||||
let errorDialog = this.MatDialog.open(OkPopupComponent,{data:{title:'Error',message:'There was an error adding the event\n' + error}});
|
||||
});
|
||||
}
|
||||
|
||||
updateAddButton(enable: boolean){
|
||||
if (enable){
|
||||
this.addEventButtonText = "Add Event";
|
||||
} else {
|
||||
this.addEventButtonText = "Please Wait...";
|
||||
}
|
||||
this.addEventButtonDisabled = !enable;
|
||||
}
|
||||
|
||||
private addEvent(): void {
|
||||
//Check fields
|
||||
this.errorMessages = [];
|
||||
if (this.eventTitle == null || this.eventTitle == ""){
|
||||
this.errorMessages.push("Please enter a title");
|
||||
}
|
||||
if (this.eventStartDate == null){
|
||||
this.errorMessages.push("Please enter a event start date");
|
||||
}
|
||||
if (this.eventEndDate == null){
|
||||
this.errorMessages.push("Please enter a event end date");
|
||||
}
|
||||
if (this.eventDescription == null || this.eventDescription == ""){
|
||||
this.errorMessages.push("Please enter a description");
|
||||
}
|
||||
if (this.errorMessages.length > 0){ this.updateAddButton(true); return; }
|
||||
|
||||
let e = new Event();
|
||||
e.title = this.eventTitle;
|
||||
e.startDate = this.eventStartDate;
|
||||
e.endDate = this.eventEndDate;
|
||||
e.description = this.eventDescription;
|
||||
|
||||
this.eventService.addEvent(e).subscribe(
|
||||
data=>{
|
||||
this.updateAddButton(true);
|
||||
this.MatDialogRef.close(data.sermon);
|
||||
},
|
||||
error => {
|
||||
this.updateAddButton(true);
|
||||
let errorDialog = this.MatDialog.open(OkPopupComponent,{data:{title:'Upload Error',message:'There was an error uploading the sermon\n' + error}});
|
||||
});
|
||||
}
|
||||
|
||||
cancel(evt){
|
||||
evt.preventDefault();
|
||||
this.MatDialogRef.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
.full-width{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
form{
|
||||
margin-top: 7px;
|
||||
}
|
||||
|
||||
.progressPct{
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.progressBar{
|
||||
width: calc(100% - 100px);
|
||||
}
|
||||
|
||||
button{
|
||||
margin: 20px 0px 20px 20px;
|
||||
}
|
||||
|
||||
.first{
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.errorMessages{
|
||||
color: white;
|
||||
background-color: rgb(255,90,90);
|
||||
padding: 10px;
|
||||
border-radius: 3px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<div md-dialog-title>
|
||||
Add Sermon<br>
|
||||
<div *ngIf="monitorProgress">
|
||||
<span class="progressPct">{{ uploadProgress/uploadTotal | percent:'1.0-2' }}</span>
|
||||
<mat-slider class="progressBar" min="0" [max]="uploadTotal" step="1" [value]="uploadProgress"></mat-slider>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div md-dialog-content>
|
||||
|
||||
<form #addSermonForm="ngForm" (ngSubmit)="onSubmit()">
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput placeholder="Title" required [(ngModel)]="sermonTitle" name="title" >
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Date" required [ngModel]="sermonDate | date:'yyyy-MM-ddTHH:mm'" (ngModelChange)="sermonDate = $event" name="date" type="datetime-local">
|
||||
</mat-form-field>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput placeholder="Speaker" required [(ngModel)]="sermonSpeaker" name="speaker" >
|
||||
</mat-form-field>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput placeholder="Description" required [(ngModel)]="sermonDescription" name="description" >
|
||||
</mat-form-field>
|
||||
|
||||
<input type="file" (change)="onFileChange($event)" placeholder="Choose File" accept=".mp3,audio/mpeg3" >
|
||||
<br><br>
|
||||
<div *ngIf="errorMessages.length > 0" class="errorMessages">
|
||||
<p *ngFor="let error of errorMessages">
|
||||
{{error}}
|
||||
</p>
|
||||
</div>
|
||||
<button mat-raised-button class="first" (click)="cancel($event)" >Cancel</button><!--
|
||||
--><button mat-raised-button type="submit" [disabled]="!addSermonForm.form.valid || addSermonButtonDisabled">{{ addSermonButtonText }}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AddSermonPopupComponent } from './add-sermon-popup.component';
|
||||
|
||||
describe('AddSermonPopupComponent', () => {
|
||||
let component: AddSermonPopupComponent;
|
||||
let fixture: ComponentFixture<AddSermonPopupComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AddSermonPopupComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AddSermonPopupComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
import { OkPopupComponent } from './../ok-popup/ok-popup.component';
|
||||
import { Observable, Subscription } from 'rxjs';
|
||||
import { ProgressService } from './../../../services/xhr-progress.service';
|
||||
import { LoginPopupComponent } from './../login-popup/login-popup.component';
|
||||
import { MatDialog, MatDialogRef, MatSnackBar } from '@angular/material';
|
||||
import { Sermon } from './../../../interfaces/sermon';
|
||||
import { SermonService } from './../../../services/sermon.service';
|
||||
import { LoginService } from './../../../services/login.service';
|
||||
import { Component, OnInit, OnDestroy } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-add-sermon-popup',
|
||||
templateUrl: './add-sermon-popup.component.html',
|
||||
styleUrls: ['./add-sermon-popup.component.css']
|
||||
})
|
||||
export class AddSermonPopupComponent implements OnInit, OnDestroy {
|
||||
public addSermonButtonText: string = "Add Sermon";
|
||||
public addSermonButtonDisabled: boolean = false;
|
||||
|
||||
public sermonTitle: string;
|
||||
public sermonDate: Date = new Date();
|
||||
public sermonSpeaker: string;
|
||||
public sermonDescription: string;
|
||||
public sermonFile: File;
|
||||
|
||||
public errorMessages: string[] = [];
|
||||
|
||||
private _uploadTotal: number = 100;
|
||||
private _uploadProgress: number = 25;
|
||||
public uploadTotal: number = 100;
|
||||
public uploadProgress: number = 0;
|
||||
public monitorProgress: boolean;
|
||||
|
||||
private progressSubscription: Subscription;
|
||||
|
||||
constructor(private progressService: ProgressService, private MatDialog: MatDialog, private MatDialogRef: MatDialogRef<AddSermonPopupComponent>, private loginService: LoginService, private sermonService: SermonService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.progressSubscription = this.progressService.uploadProgress.subscribe(evt => {
|
||||
this._uploadTotal = evt.total;
|
||||
this._uploadProgress = evt.loaded;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy(){
|
||||
this.progressSubscription.unsubscribe();
|
||||
}
|
||||
|
||||
onSubmit(){
|
||||
this.updateAddButton(false);
|
||||
|
||||
//First check to see if we are logged in
|
||||
this.loginService.isLoggedIn(true).subscribe(is => {
|
||||
if (is === true){
|
||||
this.addSermon();
|
||||
} else {
|
||||
let popup = this.MatDialog.open(LoginPopupComponent);
|
||||
popup.afterClosed().subscribe(r => {
|
||||
if (r === true){
|
||||
this.addSermon();
|
||||
} else {
|
||||
this.updateAddButton(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
error =>{
|
||||
this.updateAddButton(true);
|
||||
let errorDialog = this.MatDialog.open(OkPopupComponent,{data:{title:'Upload Error',message:'There was an error uploading the sermon\n' + error}});
|
||||
});
|
||||
}
|
||||
|
||||
updateAddButton(enable: boolean){
|
||||
if (enable){
|
||||
this.addSermonButtonText = "Add Sermon";
|
||||
} else {
|
||||
this.addSermonButtonText = "Please Wait...";
|
||||
}
|
||||
this.addSermonButtonDisabled = !enable;
|
||||
}
|
||||
|
||||
private addSermon(): void {
|
||||
//Check fields
|
||||
this.errorMessages = [];
|
||||
if (this.sermonTitle == null || this.sermonTitle == ""){
|
||||
this.errorMessages.push("Please enter a title");
|
||||
}
|
||||
if (this.sermonDate == null){
|
||||
this.errorMessages.push("Please enter a sermon date");
|
||||
}
|
||||
if (this.sermonSpeaker == null || this.sermonSpeaker == ""){
|
||||
this.errorMessages.push("Please enter a speaker");
|
||||
}
|
||||
if (this.sermonDescription == null || this.sermonDescription == ""){
|
||||
this.errorMessages.push("Please enter a description");
|
||||
}
|
||||
if (this.sermonFile == null){
|
||||
this.errorMessages.push("Please add a sermon MP3 file");
|
||||
}
|
||||
if (this.sermonFile != null && this.sermonFile.type != 'audio/mp3'){
|
||||
this.errorMessages.push("File must be a MP3");
|
||||
}
|
||||
if (this.errorMessages.length > 0){ this.updateAddButton(true); return; }
|
||||
|
||||
let s = new Sermon();
|
||||
s.title = this.sermonTitle;
|
||||
s.author = this.sermonSpeaker;
|
||||
s.description = this.sermonDescription;
|
||||
s.sermonDate = this.sermonDate;
|
||||
|
||||
//Start monitoring Progress
|
||||
this.monitorProgress = true;
|
||||
let timer = setInterval(()=>{
|
||||
this.uploadTotal = this._uploadTotal;
|
||||
this.uploadProgress = this._uploadProgress;
|
||||
},500);
|
||||
this.sermonService.addSermon(s,this.sermonFile).subscribe(
|
||||
data=>{
|
||||
this.updateAddButton(true);
|
||||
this.monitorProgress = false;
|
||||
clearInterval(timer);
|
||||
this.MatDialogRef.close(data.sermon);
|
||||
},
|
||||
error => {
|
||||
alert(error);
|
||||
this.updateAddButton(true);
|
||||
this.monitorProgress = false;
|
||||
clearInterval(timer);
|
||||
let errorDialog = this.MatDialog.open(OkPopupComponent,{data:{title:'Upload Error',message:'There was an error uploading the sermon\n' + error}});
|
||||
});
|
||||
}
|
||||
|
||||
onFileChange(event){
|
||||
this.sermonFile = event.srcElement.files[0];
|
||||
}
|
||||
|
||||
cancel(evt){
|
||||
evt.preventDefault();
|
||||
this.MatDialogRef.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
.align-right{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.display-block{
|
||||
display: block;
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<div md-dialog-title>{{title}}</div>
|
||||
<div md-dialog-content>
|
||||
{{message}}<br>
|
||||
<mat-form-field>
|
||||
<input matInput [(ngModel)]="searchTerm" (keyup.enter)="onEnter()" name="search" placeholder="Search">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div md-dialog-actions class="align-right display-block">
|
||||
<button mat-raised-button (click)="ok()" class="display-inline">OK</button>
|
||||
</div>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { InputPopupComponent } from './input-popup.component';
|
||||
|
||||
describe('InputPopupComponent', () => {
|
||||
let component: InputPopupComponent;
|
||||
let fixture: ComponentFixture<InputPopupComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ InputPopupComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(InputPopupComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
import { MatDialogRef } from '@angular/material';
|
||||
import { MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-input-popup',
|
||||
templateUrl: './input-popup.component.html',
|
||||
styleUrls: ['./input-popup.component.css']
|
||||
})
|
||||
export class InputPopupComponent implements OnInit {
|
||||
|
||||
public title: string;
|
||||
public message: string;
|
||||
public searchTerm: string = "";
|
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) public data: any, private MatDialogRef: MatDialogRef<InputPopupComponent>) {
|
||||
this.title = data.title;
|
||||
this.message = data.message;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
ok(){
|
||||
this.MatDialogRef.close(this.searchTerm);
|
||||
}
|
||||
|
||||
onEnter(){
|
||||
this.MatDialogRef.close(this.searchTerm);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
|
||||
|
||||
.input-container{
|
||||
display: block;
|
||||
padding: 10px 0px 10px 0px;
|
||||
}
|
||||
|
||||
button{
|
||||
margin: 20px 0px 20px 20px;
|
||||
}
|
||||
|
||||
.first{
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<div md-dialog-title>
|
||||
Login
|
||||
</div>
|
||||
<div md-dialog-content>
|
||||
<form class="form" #loginForm="ngForm" (ngSubmit)="onSubmit()">
|
||||
<mat-form-field class="input-container">
|
||||
<input matInput placeholder="Username" required value="" [(ngModel)]="username" name="username">
|
||||
</mat-form-field>
|
||||
<mat-form-field class="input-container">
|
||||
<input type="password" matInput placeholder="Password" required value="" [(ngModel)]="password" name="password">
|
||||
</mat-form-field>
|
||||
<button mat-raised-button type="button" class="first" (click)="cancel()">Cancel</button><!--
|
||||
--><button mat-raised-button type="submit" [disabled]="!loginForm.form.valid || loginButtonDisabled">{{loginButtonText}}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { LoginPopupComponent } from './login-popup.component';
|
||||
|
||||
describe('LoginPopupComponent', () => {
|
||||
let component: LoginPopupComponent;
|
||||
let fixture: ComponentFixture<LoginPopupComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ LoginPopupComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(LoginPopupComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
import { OkPopupComponent } from './../ok-popup/ok-popup.component';
|
||||
import { MatSnackBar, MatDialogRef, MatDialog, MatDialogConfig } from '@angular/material';
|
||||
import { LoginService } from './../../../services/login.service';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-login-popup',
|
||||
templateUrl: './login-popup.component.html',
|
||||
styleUrls: ['./login-popup.component.css']
|
||||
})
|
||||
export class LoginPopupComponent implements OnInit {
|
||||
public loginButtonText: string = 'Login';
|
||||
public loginButtonDisabled: boolean = false;
|
||||
public username: string;
|
||||
public password: string;
|
||||
|
||||
constructor(private MatDialog: MatDialog, private MatDialogRef: MatDialogRef<LoginPopupComponent>, private loginService: LoginService, private snackbar: MatSnackBar) { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
onSubmit(){
|
||||
this.loginButtonText = 'Please Wait...';
|
||||
this.loginButtonDisabled = true;
|
||||
this.loginService.login(this.username,this.password).subscribe(
|
||||
data => {
|
||||
if (data.message === 'Logged In'){
|
||||
this.MatDialogRef.close(true);
|
||||
let s = this.snackbar.open("Logged In","OK");
|
||||
s.onAction().subscribe(()=>{ s.dismiss(); });
|
||||
s.afterOpened().subscribe(()=>{ setTimeout(()=>{ s.dismiss(); },3000); });
|
||||
} else {
|
||||
this.showLoginError(data.message);
|
||||
}
|
||||
this.loginButtonText = 'Login';
|
||||
this.loginButtonDisabled = false;
|
||||
},
|
||||
error => {
|
||||
console.error(error);
|
||||
this.showLoginError(error);
|
||||
this.loginButtonText = 'Login';
|
||||
this.loginButtonDisabled = false;
|
||||
});
|
||||
}
|
||||
|
||||
showLoginError(message: string){
|
||||
let opts = new MatDialogConfig;
|
||||
opts.data = { title:'Login Error','message':message };
|
||||
let popup = this.MatDialog.open(OkPopupComponent,opts);
|
||||
}
|
||||
|
||||
cancel(){
|
||||
this.MatDialogRef.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<div md-dialog-title>{{title}}</div>
|
||||
<div md-dialog-content>{{message}}</div>
|
||||
<div md-dialog-actions>
|
||||
<button mat-raised-button (click)="close()">OK</button>
|
||||
</div>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { OkPopupComponent } from './ok-popup.component';
|
||||
|
||||
describe('OkPopupComponent', () => {
|
||||
let component: OkPopupComponent;
|
||||
let fixture: ComponentFixture<OkPopupComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ OkPopupComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(OkPopupComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
import { MatDialogRef } from '@angular/material';
|
||||
import { MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-ok-popup',
|
||||
templateUrl: './ok-popup.component.html',
|
||||
styleUrls: ['./ok-popup.component.css']
|
||||
})
|
||||
export class OkPopupComponent implements OnInit {
|
||||
|
||||
public title: string;
|
||||
public message: string;
|
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) public data: any, private MatDialogRef: MatDialogRef<OkPopupComponent>) {
|
||||
this.title = data.title;
|
||||
this.message = data.message;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
close(){
|
||||
this.MatDialogRef.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
.width100{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.shareHeader{
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.social-wrapper{
|
||||
box-sizing: border-box;
|
||||
width: calc(100% - 10px);
|
||||
text-align: center;
|
||||
color: white;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.social-wrapper:hover{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.social-wrapper > span{
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.facebook{
|
||||
background-color: #3B5998;
|
||||
}
|
||||
|
||||
.facebook:hover{
|
||||
background-color: #3B5998;
|
||||
}
|
||||
|
||||
.twitter{
|
||||
background-color: #55acee;
|
||||
}
|
||||
|
||||
.copy{
|
||||
background-color: #7d7d7d;
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<div md-dialog-title>Share</div>
|
||||
<div md-dialog-content>
|
||||
<a (click)="facebookShare()" [href]="facebookIframeUrl | safeUrl" target="_blank">
|
||||
<div class="social-wrapper facebook" data-network="facebook" draggable="false" style="display: inline-block;">
|
||||
<svg fill="#fff" preserveAspectRatio="xMidYMid meet" height="1.2em" width="1.2em" viewBox="0 0 40 40">
|
||||
<g>
|
||||
<path d="m21.7 16.7h5v5h-5v11.6h-5v-11.6h-5v-5h5v-2.1c0-2 0.6-4.5 1.8-5.9 1.3-1.3 2.8-2 4.7-2h3.5v5h-3.5c-0.9 0-1.5 0.6-1.5 1.5v3.5z"></path>
|
||||
</g>
|
||||
</svg>
|
||||
<span class="st-label">Share</span>
|
||||
</div>
|
||||
</a>
|
||||
<a (click)="twitterShare()" [href]="twitterUrl | safeUrl" target="_blank">
|
||||
<div class="social-wrapper twitter" data-network="facebook" draggable="false" style="display: inline-block;">
|
||||
<svg fill="#fff" preserveAspectRatio="xMidYMid meet" height="1.2em" width="1.2em" viewBox="0 0 40 40">
|
||||
<g>
|
||||
<path d="m31.5 11.7c1.3-0.8 2.2-2 2.7-3.4-1.4 0.7-2.7 1.2-4 1.4-1.1-1.2-2.6-1.9-4.4-1.9-1.7 0-3.2 0.6-4.4 1.8-1.2 1.2-1.8 2.7-1.8 4.4 0 0.5 0.1 0.9 0.2 1.3-5.1-0.1-9.4-2.3-12.7-6.4-0.6 1-0.9 2.1-0.9 3.1 0 2.2 1 3.9 2.8 5.2-1.1-0.1-2-0.4-2.8-0.8 0 1.5 0.5 2.8 1.4 4 0.9 1.1 2.1 1.8 3.5 2.1-0.5 0.1-1 0.2-1.6 0.2-0.5 0-0.9 0-1.1-0.1 0.4 1.2 1.1 2.3 2.1 3 1.1 0.8 2.3 1.2 3.6 1.3-2.2 1.7-4.7 2.6-7.6 2.6-0.7 0-1.2 0-1.5-0.1 2.8 1.9 6 2.8 9.5 2.8 3.5 0 6.7-0.9 9.4-2.7 2.8-1.8 4.8-4.1 6.1-6.7 1.3-2.6 1.9-5.3 1.9-8.1v-0.8c1.3-0.9 2.3-2 3.1-3.2-1.1 0.5-2.3 0.8-3.5 1z"></path>
|
||||
</g>
|
||||
</svg>
|
||||
<span class="st-label">Tweet</span>
|
||||
</div>
|
||||
</a>
|
||||
<a (click)="copyLink(shareText)">
|
||||
<div class="social-wrapper copy" data-network="facebook" draggable="false" style="display: inline-block;">
|
||||
<svg fill="#fff" preserveAspectRatio="xMidYMid meet" height="1.2em" width="1.2em" viewBox="0 0 40 40">
|
||||
<g>
|
||||
<path d="m30 26.8c2.7 0 4.8 2.2 4.8 4.8s-2.1 5-4.8 5-4.8-2.3-4.8-5c0-0.3 0-0.7 0-1.1l-11.8-6.8c-0.9 0.8-2.1 1.3-3.4 1.3-2.7 0-5-2.3-5-5s2.3-5 5-5c1.3 0 2.5 0.5 3.4 1.3l11.8-6.8c-0.1-0.4-0.2-0.8-0.2-1.1 0-2.8 2.3-5 5-5s5 2.2 5 5-2.3 5-5 5c-1.3 0-2.5-0.6-3.4-1.4l-11.8 6.8c0.1 0.4 0.2 0.8 0.2 1.2s-0.1 0.8-0.2 1.2l11.9 6.8c0.9-0.7 2.1-1.2 3.3-1.2z"></path>
|
||||
</g>
|
||||
</svg>
|
||||
<span class="st-label">Copy Link</span>
|
||||
</div>
|
||||
</a>
|
||||
<mat-form-field class="width100">
|
||||
<input matInput #shareText value="{{shareUrl}}">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div md-dialog-actions>
|
||||
<button mat-raised-button (click)="close()">OK</button>
|
||||
</div>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SharePopupComponent } from './share-popup.component';
|
||||
|
||||
describe('SharePopupComponent', () => {
|
||||
let component: SharePopupComponent;
|
||||
let fixture: ComponentFixture<SharePopupComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SharePopupComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SharePopupComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
import { GoogleAnalyticsService } from './../../../services/google-analytics.service';
|
||||
import { MatDialogRef, MatSnackBar } from '@angular/material';
|
||||
import { DOCUMENT } from '@angular/platform-browser';
|
||||
import { MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-share-popup',
|
||||
templateUrl: './share-popup.component.html',
|
||||
styleUrls: ['./share-popup.component.css']
|
||||
})
|
||||
export class SharePopupComponent implements OnInit {
|
||||
//private urlPartA: string = "https://www.facebook.com/plugins/share_button.php?href=";
|
||||
//private urlPartB: string = "&layout=button_count&size=large&mobile_iframe=true&width=106&height=28&appId";
|
||||
private urlPartA: string = "https://www.facebook.com/sharer/sharer.php?kid_directed_site=0&u=";
|
||||
private urlPartB: string = "&display=popup&ref=plugin&src=share_button";
|
||||
private twitterPartA: string = "https://twitter.com/intent/tweet?text=";
|
||||
private twitterPartB: string = "https://twitter.com/intent/tweet?text=ShareThis&url=http%3A%2F%2Fwww.sharethis.com%2F";
|
||||
public twitterUrl: string;
|
||||
private id: string;
|
||||
public facebookIframeUrl: string;
|
||||
private shareBaseUrl: string = "/api2/share/";
|
||||
public shareUrl: string;
|
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) public data: any,
|
||||
@Inject(DOCUMENT) private document,
|
||||
private MatDialogRef: MatDialogRef<SharePopupComponent>,
|
||||
private snackbar: MatSnackBar,
|
||||
private googleAnalyticsService: GoogleAnalyticsService) {
|
||||
this.id = data.id;
|
||||
let port = this.document.location.port ? ":"+this.document.location.port : "";
|
||||
this.shareUrl = this.document.location.protocol +'//'+ this.document.location.hostname + port + this.shareBaseUrl + data.prefix + this.id;
|
||||
this.facebookIframeUrl = this.urlPartA + this.shareUrl + this.urlPartB;
|
||||
this.twitterUrl = this.twitterPartA + data.title + " - " + data.description + "&url=" + this.shareUrl;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
close(){
|
||||
this.MatDialogRef.close();
|
||||
}
|
||||
|
||||
copyLink(target){
|
||||
target.select();
|
||||
try {
|
||||
var successful = document.execCommand('copy');
|
||||
var msg = successful ? 'successful' : 'unsuccessful';
|
||||
target.blur();
|
||||
let s = this.snackbar.open("Link Copied","OK");
|
||||
s.onAction().subscribe(()=>{ s.dismiss(); });
|
||||
s.afterOpened().subscribe(()=>{ setTimeout(()=>{ s.dismiss(); },3000); });
|
||||
this.share("link");
|
||||
} catch (err) {
|
||||
console.error('Oops, unable to copy');
|
||||
}
|
||||
}
|
||||
|
||||
share(method: string){
|
||||
if (this.data.prefix === 's'){
|
||||
this.googleAnalyticsService.shareSermon(Number(this.id),this.data.title,method);
|
||||
} else if (this.data.prefix === 'e'){
|
||||
this.googleAnalyticsService.shareEvent(Number(this.id),this.data.title,method);
|
||||
}
|
||||
}
|
||||
|
||||
facebookShare(){
|
||||
this.share('facebook');
|
||||
}
|
||||
|
||||
twitterShare(){
|
||||
this.share('twitter');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
|
||||
|
||||
mat-form-field{
|
||||
display:block;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
button{
|
||||
margin: 20px 0px 20px 20px;
|
||||
}
|
||||
|
||||
.first{
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<div md-dialog-title>
|
||||
Add Sermon
|
||||
</div>
|
||||
<div md-dialog-content>
|
||||
|
||||
<form #updateSermonForm="ngForm" (ngSubmit)="onSubmit()">
|
||||
<mat-form-field class="example-full-width">
|
||||
<input matInput required [(ngModel)]="sermonTitle" name="title" placeholder="Title">
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput required [ngModel]="sermonDate | date:'yyyy-MM-ddTHH:mm'" (ngModelChange)="sermonDate = $event" name="date" type="datetime-local" placeholder="Choose a date">
|
||||
</mat-form-field>
|
||||
<mat-form-field class="example-full-width">
|
||||
<input matInput required [(ngModel)]="sermonSpeaker" name="speaker" placeholder="Speaker">
|
||||
</mat-form-field>
|
||||
<mat-form-field class="example-full-width">
|
||||
<input matInput required [(ngModel)]="sermonDescription" name="description" placeholder="Description">
|
||||
</mat-form-field>
|
||||
|
||||
<button mat-raised-button class="first" type="button" (click)="cancel()" >Cancel</button><!--
|
||||
--><button mat-raised-button type="submit" [disabled]="!updateSermonForm.form.valid || updateSermonButtonDisabled">{{ updateSermonButtonText }}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { UpdateSermonPopupComponent } from './update-sermon-popup.component';
|
||||
|
||||
describe('UpdateSermonPopupComponent', () => {
|
||||
let component: UpdateSermonPopupComponent;
|
||||
let fixture: ComponentFixture<UpdateSermonPopupComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ UpdateSermonPopupComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(UpdateSermonPopupComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
import { LoginPopupComponent } from './../login-popup/login-popup.component';
|
||||
import { OkPopupComponent } from './../ok-popup/ok-popup.component';
|
||||
import { Sermon } from './../../../interfaces/sermon';
|
||||
import { SermonService } from './../../../services/sermon.service';
|
||||
import { LoginService } from './../../../services/login.service';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-update-sermon-popup',
|
||||
templateUrl: './update-sermon-popup.component.html',
|
||||
styleUrls: ['./update-sermon-popup.component.css']
|
||||
})
|
||||
export class UpdateSermonPopupComponent implements OnInit {
|
||||
public updateSermonButtonText: string = "Update Sermon";
|
||||
public updateSermonButtonDisabled: boolean = false;
|
||||
|
||||
public sermonId: number;
|
||||
public sermonTitle: string;
|
||||
public sermonDate: Date = new Date();
|
||||
public sermonSpeaker: string;
|
||||
public sermonDescription: string;
|
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) private data: any,
|
||||
private MatDialog: MatDialog,
|
||||
private MatDialogRef: MatDialogRef<UpdateSermonPopupComponent>,
|
||||
private loginService: LoginService,
|
||||
private sermonService: SermonService) {
|
||||
|
||||
this.sermonId = this.data.id;
|
||||
this.sermonTitle = this.data.title;
|
||||
this.sermonDate = this.data.date;
|
||||
this.sermonSpeaker = this.data.author;
|
||||
this.sermonDescription = this.data.description;
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
onSubmit(){
|
||||
this.updateButton(false);
|
||||
|
||||
//First check to see if we are logged in
|
||||
this.loginService.isLoggedIn(true).subscribe(is => {
|
||||
if (is === true){
|
||||
this.updateSermon();
|
||||
} else {
|
||||
let popup = this.MatDialog.open(LoginPopupComponent);
|
||||
popup.afterClosed().subscribe(r => {
|
||||
if (r === true){
|
||||
this.updateSermon();
|
||||
} else {
|
||||
this.updateButton(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
error =>{
|
||||
this.updateButton(true);
|
||||
let errorDialog = this.MatDialog.open(OkPopupComponent,{data:{title:'Upload Error',message:'There was an error uploading the sermon\n' + error}});
|
||||
});
|
||||
}
|
||||
|
||||
private updateSermon(): void {
|
||||
let s = new Sermon;
|
||||
s.id = this.sermonId;
|
||||
s.title = this.sermonTitle;
|
||||
s.author = this.sermonSpeaker;
|
||||
s.description = this.sermonDescription;
|
||||
s.sermonDate = this.sermonDate;
|
||||
|
||||
//Start monitoring Progress
|
||||
this.sermonService.updateSermon(s).subscribe(
|
||||
data=>{
|
||||
this.MatDialogRef.close(data.sermon);
|
||||
},
|
||||
error => {
|
||||
this.updateButton(true);
|
||||
let errorDialog = this.MatDialog.open(OkPopupComponent,{data:{title:'Update Error',message:'There was an error updating the sermon\n' + error}});
|
||||
});
|
||||
}
|
||||
|
||||
updateButton(enable: boolean){
|
||||
if (enable){
|
||||
this.updateSermonButtonText = "Update Sermon";
|
||||
} else {
|
||||
this.updateSermonButtonText = "Please Wait...";
|
||||
}
|
||||
this.updateSermonButtonDisabled = !enable;
|
||||
}
|
||||
|
||||
cancel(){
|
||||
this.MatDialogRef.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<div md-dialog-title>{{title}}</div>
|
||||
<div md-dialog-content>{{message}}</div>
|
||||
<div md-dialog-actions>
|
||||
<button mat-raised-button (click)="yes()">YES</button>
|
||||
<button mat-raised-button (click)="no()">NO</button>
|
||||
</div>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { YesNoPopupComponent } from './yes-no-popup.component';
|
||||
|
||||
describe('YesNoPopupComponent', () => {
|
||||
let component: YesNoPopupComponent;
|
||||
let fixture: ComponentFixture<YesNoPopupComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ YesNoPopupComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(YesNoPopupComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
import { MatDialogRef } from '@angular/material';
|
||||
import { MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-yes-no-popup',
|
||||
templateUrl: './yes-no-popup.component.html',
|
||||
styleUrls: ['./yes-no-popup.component.css']
|
||||
})
|
||||
export class YesNoPopupComponent implements OnInit {
|
||||
|
||||
public title: string;
|
||||
public message: string;
|
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) public data: any, private MatDialogRef: MatDialogRef<YesNoPopupComponent>) {
|
||||
this.title = data.title;
|
||||
this.message = data.message;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
yes(){
|
||||
this.MatDialogRef.close(true);
|
||||
}
|
||||
|
||||
no(){
|
||||
this.MatDialogRef.close(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
|
||||
.sermon-header{
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid gray;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
ul{
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
li{
|
||||
padding: 5px;
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<div class="sermon-container">
|
||||
<p class="sermon-header" >Recent Sermons</p>
|
||||
<p *ngIf="loading">Loading...</p>
|
||||
<ul class="sermons">
|
||||
<li *ngFor="let sermon of sermons; let i = index;">
|
||||
<sermon-small-component
|
||||
[title]="sermon.title"
|
||||
[date]="sermon.sermonDate"
|
||||
[delayFadeIn]="(i+1)*200"
|
||||
[url]="sermon.url"
|
||||
[id]="sermon.id"
|
||||
></sermon-small-component>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Sermon } from '../../interfaces/sermon';
|
||||
import { SermonService } from '../../services/sermon.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'recent-sermons-component',
|
||||
templateUrl: './recent-sermons.component.html',
|
||||
styleUrls: ['./recent-sermons.component.css']
|
||||
})
|
||||
export class RecentSermonsComponent implements OnInit {
|
||||
sermons: Sermon[];
|
||||
loading: boolean = false;
|
||||
@Input()
|
||||
numberOfSermonsToShow = 3;
|
||||
|
||||
constructor(private sermonService: SermonService){
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.getSermons();
|
||||
}
|
||||
|
||||
getSermons(): void{
|
||||
this.sermons = [];
|
||||
this.loading = true;
|
||||
this.sermonService.getSermons(this.numberOfSermonsToShow).subscribe(sermons => {
|
||||
this.sermons = sermons;
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
.section-header{
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid gray;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
a{
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
a:visited{
|
||||
color: inherit;
|
||||
}
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
<secondary-page-component [hideSideBarOnMobile]="true">
|
||||
<div mainContent>
|
||||
<p ofbFadeInOnScroll class="section-header">Salvation</p>
|
||||
<p ofbFadeInOnScroll class="section-paragraph">
|
||||
Salvation put simply means being saved from sin, from Satan and from Hell. The truth is that
|
||||
we are all sinners and we have fallen short. The punishment or wage for our sin is eternal death
|
||||
and seperation from God. So, how does someone receive salvation?
|
||||
</p>
|
||||
|
||||
<br><br>
|
||||
<p ofbFadeInOnScroll class="section-header">God says we won't arrive</p>
|
||||
<div ofbFadeInOnScroll class="section-paragraph">
|
||||
<div class="verse">"For all have sinned and come short of the glory of God." <a href="https://www.kingjamesbibleonline.org/Romans-3-23/">Romans 3:23</a></div>
|
||||
<br>
|
||||
We are all sinners and <a href="https://www.kingjamesbibleonline.org/Romans-6-23/">Romans 6:23</a> tells us that the consequence of our sin is death.
|
||||
<br>
|
||||
<div class="verse">"For the wages of sin is death;..." <a href="https://www.kingjamesbibleonline.org/Romans-6-23/">Romans 6:23</a></div>
|
||||
<br>
|
||||
We have all sinned, we have all earned death and eternal seperation from God. The outlook
|
||||
for us is not too good when we consider our position. God, knowing all about our helpless situation, has made
|
||||
a way for every individual to avoid death, to be set free and receive the gift of eternal life.
|
||||
The second half of <a href="https://www.kingjamesbibleonline.org/Romans-6-23/">Romans 6:23</a> says:
|
||||
<div class="verse">"...but the gift of God is eternal life through Jesus Christ our Lord." <a href="https://www.kingjamesbibleonline.org/Romans-6-23/">Romans 6:23</a></div>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
<p ofbFadeInOnScroll class="section-header">God says the road ends</p>
|
||||
<div ofbFadeInOnScroll class="section-paragraph">
|
||||
<div class="verse">"There is a way that seemeth right unto a man, but the end thereof are the ways of
|
||||
death." <a href="https://www.kingjamesbibleonline.org/Proverbs-16-25/">Proverbs 16:25</a></div>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
<b></b>
|
||||
<p ofbFadeInOnScroll class="section-header">God says that we need to turn around</p>
|
||||
<div ofbFadeInOnScroll class="section-paragraph">
|
||||
<div class="verse">"But, except ye repent, ye shall all likewise perish." <a href="https://www.kingjamesbibleonline.org/Luke-13-3/">Luke 13:3</a></div>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
<p ofbFadeInOnScroll class="section-header">God says there is only one way</p>
|
||||
<div ofbFadeInOnScroll class="section-paragraph">
|
||||
<div class="verse">"Jesus says, <span class="red">I am the way, the truth, and the life: no man cometh unto the Father,
|
||||
but by me.</span>" <a href="https://www.kingjamesbibleonline.org/John-14-6/">John 11:6</a></div>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
<p ofbFadeInOnScroll class="section-header">God says we need to change drivers</p>
|
||||
<div ofbFadeInOnScroll class="section-paragraph">
|
||||
<div class="verse">"But as many as received him to them gave he power to become the sons of God,
|
||||
even to them that believe on His name." <a href="https://www.kingjamesbibleonline.org/John-1-12/">John 1:12</a></div>
|
||||
<br><br>
|
||||
Salvation is when we realize our own sin and because of that realization we repent of our wrong doing
|
||||
and turn to Christ asking Him to save us and by faith receiving Jesus Christ as our personal living Saviour.
|
||||
Each individual has the choice to reject or accept the gift of eternal life. What will your choice be?
|
||||
If you understand that you are a sinner and the need to repent, you can do so right now. Pray to God, repent
|
||||
of your sin and ask Him to come into your life.
|
||||
<br><br>
|
||||
If you would like more information or if you have put your faith in Jesus alone for salvation and would like further
|
||||
guidance please click <a routerLink="/contact">here to contact us.</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div sideBar class="side-bar">
|
||||
|
||||
</div>
|
||||
</secondary-page-component>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SalvationPageComponent } from './salvation-page.component';
|
||||
|
||||
describe('SalvationPageComponent', () => {
|
||||
let component: SalvationPageComponent;
|
||||
let fixture: ComponentFixture<SalvationPageComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SalvationPageComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SalvationPageComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-salvation-page',
|
||||
templateUrl: './salvation-page.component.html',
|
||||
styleUrls: ['./salvation-page.component.css']
|
||||
})
|
||||
export class SalvationPageComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
|
||||
#content{
|
||||
margin: auto;
|
||||
width: 100%;
|
||||
max-width: 1000px;
|
||||
display: table;
|
||||
}
|
||||
|
||||
.main-content{
|
||||
width: 70%;
|
||||
display: table-cell;
|
||||
padding: 20px 10px 10px 10px;
|
||||
}
|
||||
|
||||
.side-bar{
|
||||
width: 30%;
|
||||
display: table-cell;
|
||||
height: 100%;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.align-top{
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
@media(max-width:800px){
|
||||
.side-bar{
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
.hide-on-mobile{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-content{
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<div id="content-wrapper">
|
||||
<div id="content">
|
||||
<div class="main-content align-top">
|
||||
<ng-content select="[mainContent]"></ng-content>
|
||||
</div><!--
|
||||
--><div class="side-bar align-top" [class.hide-on-mobile]="hideSideBarOnMobile">
|
||||
<ng-content select="[sideBar]"></ng-content>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
import { Component, Input, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'secondary-page-component',
|
||||
templateUrl: './secondary-page.component.html',
|
||||
styleUrls: ['./secondary-page.component.css'],
|
||||
})
|
||||
export class SecondaryPageComponent implements OnInit {
|
||||
@Input()
|
||||
public hideSideBarOnMobile: boolean;
|
||||
|
||||
constructor(){
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(){
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
.wrapper{
|
||||
box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12);
|
||||
}
|
||||
|
||||
.photo{
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
max-width: 100px;
|
||||
margin: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.fade{
|
||||
text-align: center;
|
||||
vertical-align: bottom;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 20px;
|
||||
padding-bottom: 2px;
|
||||
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#ffffff+0,ffffff+100&0+0,0.8+100 */
|
||||
background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 100%); /* FF3.6-15 */
|
||||
background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,0.8) 100%); /* Chrome10-25,Safari5.1-6 */
|
||||
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,0.8) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ccffffff',GradientType=0 ); /* IE6-9 */
|
||||
}
|
||||
|
||||
.photo button{
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
button img{
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.info{
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
padding: 2px 2px 8px 5px;
|
||||
box-sizing: border-box;
|
||||
width: calc(100% - 100px);
|
||||
overflow-y: hidden;
|
||||
position: relative;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.title{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.date, .author{
|
||||
font-style: italic;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.description{
|
||||
font-size: 14px;
|
||||
color: darkgray;
|
||||
word-wrap: none;
|
||||
border-top: 0px solid lightgray;
|
||||
padding-top:6px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
.expanded{
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.expanded-content{
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.buttons, .buttons-edit{
|
||||
background-color: lightgray;
|
||||
}
|
||||
|
||||
.buttons button{
|
||||
display: inline-block;
|
||||
width: 33.33333%;
|
||||
}
|
||||
|
||||
.border{
|
||||
margin: 0px 5px 0px 5px;
|
||||
border-top: 1px inset lightgray;
|
||||
}
|
||||
|
||||
.buttons-edit button{
|
||||
display: inline-block;
|
||||
width: 50%;
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<div class="wrapper" [@inout]="startFadeIn">
|
||||
<div class="photo">
|
||||
<button mat-button (click)="play()">
|
||||
<img src="../../assets/images/tiny/facebookplay.png" />
|
||||
</button>
|
||||
</div><!--
|
||||
--><div class="info" (click)="toggleState()">
|
||||
<span class="title">{{ title }}</span>
|
||||
<br>
|
||||
<span class="date">{{ date |ofbDate:false }}</span> | <span class="author">{{ author }}</span>
|
||||
<br>
|
||||
<p class="description" [@toggleAnimationFade]="state">
|
||||
{{ description }}
|
||||
</p>
|
||||
<div class="fade"><i ofbicon *ngIf="state === 'closed'">arrow_drop_down</i><i ofbicon *ngIf="state === 'open'">arrow_drop_up</i></div>
|
||||
</div>
|
||||
<div class="expanded" [@toggleAnimation]="state" (click)="toggleState()">
|
||||
<p class="expanded-content">
|
||||
{{ description }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<button mat-button class="action pct40" (click)="play()" ><i ofbicon>headset</i> Listen</button><!--
|
||||
--><button mat-button class="action pct50" (click)="download()" ><i ofbicon>file_download</i> Download</button><!--
|
||||
--><button mat-button class="action pct10" (click)="share()" ><i ofbicon>share</i> Share</button>
|
||||
</div>
|
||||
<div class="buttons-edit" *ngIf="loggedIn">
|
||||
<div class="border"></div>
|
||||
<button mat-button class="action" (click)="edit()" ><i ofbicon>edit</i> Edit</button><!--
|
||||
--><button mat-button class="action" (click)="delete()" ><i ofbicon>delete_forever</i> Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
|
||||
.inner-wrapper{
|
||||
position:relative;
|
||||
|
||||
padding: 0px 0px 10px 0px;
|
||||
padding: 10px;
|
||||
box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12);
|
||||
}
|
||||
|
||||
.title{
|
||||
display: inline-block;
|
||||
font-size: 1.15em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
.action-buttons{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.speaker-date{
|
||||
font-style: italic;
|
||||
color: darkslategray;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.description{
|
||||
margin: 15px 0px 15px 0px;
|
||||
}
|
||||
|
||||
@media(max-width:700px){
|
||||
.speaker-date{
|
||||
float: none;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
<div class="wrapper" [@inout]="startFadeIn">
|
||||
<div class="inner-wrapper">
|
||||
<p class="title">{{ title }}</p>
|
||||
<div class="speaker-date">
|
||||
<p>{{ author }} | {{ date |date:'yyyy-MM-dd' }}</p>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="description">{{ description }}</div><!--
|
||||
--><div class="action-buttons">
|
||||
<button mat-button class="action pct40" (click)="play()" ><i ofbicon>headset</i> Listen</button><!--
|
||||
--><button mat-button class="action pct50" (click)="download()" ><i ofbicon>file_download</i> Download</button><!--
|
||||
--><button mat-button class="action pct10" (click)="share()" ><i ofbicon>share</i> Share</button>
|
||||
</div><!--
|
||||
--><div class="action-buttons" *ngIf="loggedIn">
|
||||
<button mat-button class="action" (click)="edit()" ><i ofbicon>edit</i> Edit</button><!--
|
||||
--><button mat-button class="action" (click)="delete()" ><i ofbicon>delete_forever</i> Delete</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SermonLargeComponent } from './sermon-large.component';
|
||||
|
||||
describe('SermonLargeComponent', () => {
|
||||
let component: SermonLargeComponent;
|
||||
let fixture: ComponentFixture<SermonLargeComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SermonLargeComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SermonLargeComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,126 +0,0 @@
|
|||
import { SharePopupComponent } from './../popups/share-popup/share-popup.component';
|
||||
import { Sermon } from './../../interfaces/sermon';
|
||||
import { UpdateSermonPopupComponent } from './../popups/update-sermon-popup/update-sermon-popup.component';
|
||||
import { SermonService } from './../../services/sermon.service';
|
||||
import { YesNoPopupComponent } from './../popups/yes-no-popup/yes-no-popup.component';
|
||||
import { MatDialog, MatDialogConfig, MatSnackBar } from '@angular/material';
|
||||
import { Component, OnInit, Input, AfterContentInit } from '@angular/core';
|
||||
import { trigger, state, style, transition, animate } from '@angular/animations';
|
||||
import { SermonSmallComponent } from '../sermon-small/sermon-small.component';
|
||||
import { AudioPlayerService } from '../../services/audio-player.service';
|
||||
import { SERMON_DOWNLOAD_URL } from '../../constants/urls';
|
||||
|
||||
@Component({
|
||||
selector: 'sermon-large-component',
|
||||
templateUrl: './sermon-large-pic.component.html',
|
||||
styleUrls: ['./sermon-large-pic.component.css'],
|
||||
animations:[
|
||||
trigger("inout",[
|
||||
state("1", style({ opacity: '1' })),
|
||||
state("0",style({ opacity: '0' })),
|
||||
transition('* => 1',[
|
||||
animate('500ms ease-in-out')
|
||||
]),
|
||||
transition(':enter',[
|
||||
animate('0ms')
|
||||
])
|
||||
]),
|
||||
trigger('toggleAnimation', [
|
||||
state('open', style({
|
||||
height: '*',
|
||||
})),
|
||||
state('closed', style({
|
||||
height: '0px',
|
||||
})),
|
||||
transition('open <=> closed', animate('500ms ease-in-out'))
|
||||
]),
|
||||
trigger('toggleAnimationFade', [
|
||||
state('open', style({
|
||||
opacity: 0,
|
||||
})),
|
||||
state('closed', style({
|
||||
opacity: 1,
|
||||
})),
|
||||
transition('open <=> closed', animate('500ms ease-in-out'))
|
||||
])
|
||||
]
|
||||
})
|
||||
export class SermonLargeComponent extends SermonSmallComponent implements OnInit, AfterContentInit {
|
||||
|
||||
public state: string = 'closed';
|
||||
|
||||
@Input()
|
||||
public loggedIn: boolean;
|
||||
|
||||
constructor(private aplayer: AudioPlayerService
|
||||
,private dialog: MatDialog
|
||||
,private sermonService: SermonService
|
||||
,private snackbar: MatSnackBar) {
|
||||
super(aplayer);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
toggleState(){
|
||||
this.state = this.state === 'open' ? 'closed' : 'open'
|
||||
}
|
||||
|
||||
download(){
|
||||
window.location.href = SERMON_DOWNLOAD_URL + this.id;
|
||||
}
|
||||
|
||||
share(){
|
||||
let opts = new MatDialogConfig;
|
||||
opts.data = { prefix: 's', id: this.id, title: this.title, description: this.description };
|
||||
let dialog = this.dialog.open(SharePopupComponent, opts);
|
||||
}
|
||||
|
||||
edit(){
|
||||
let config = new MatDialogConfig();
|
||||
config.data = {
|
||||
id: this.id,
|
||||
title: this.title,
|
||||
description: this.description,
|
||||
date: this.date,
|
||||
author: this.author
|
||||
};
|
||||
let dialog = this.dialog.open(UpdateSermonPopupComponent,config);
|
||||
|
||||
dialog.afterClosed().subscribe(s => {
|
||||
s = s as Sermon;
|
||||
if (s){
|
||||
this.title = s.title;
|
||||
this.description = s.description;
|
||||
this.author = s.author;
|
||||
this.date = s.date;
|
||||
|
||||
let snack = this.snackbar.open(s.title + " was updated!", "Ok");
|
||||
snack.onAction().subscribe(()=>{
|
||||
snack.dismiss();
|
||||
});
|
||||
setTimeout(()=>{snack.dismiss();},3000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
delete(){
|
||||
let opts = new MatDialogConfig;
|
||||
opts.data = { title:'Delete','message':'Are you sure you want to delete "' + this.title + '"?' };
|
||||
let dialog = this.dialog.open(YesNoPopupComponent, opts);
|
||||
|
||||
dialog.afterClosed().subscribe(s => {
|
||||
s = s as boolean;
|
||||
if (s === true){
|
||||
this.sermonService.deleteSermon(this.id).subscribe(
|
||||
success => { },
|
||||
error => { console.error(error); }
|
||||
);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
|
||||
|
||||
.inner-wrapper{
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.title{
|
||||
display: table;
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
.title-text{
|
||||
vertical-align: middle;
|
||||
display: table-cell;
|
||||
padding-left: 10px;
|
||||
font-size: .95rem;
|
||||
}
|
||||
|
||||
button{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
ofb-button{
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<div class="wrapper" [@inout]="startFadeIn">
|
||||
<div class="inner-wrapper">
|
||||
<div class="title">
|
||||
<button mat-button (click)="play()"></button>
|
||||
<date-component class="title-date" [date]="date"></date-component>
|
||||
<span class="title-text">{{ title }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
import { Component, AfterContentInit, Input } from '@angular/core';
|
||||
import { trigger, state, style, transition, animate } from '@angular/animations';
|
||||
import { AudioPlayerService } from '../../services/audio-player.service';
|
||||
|
||||
@Component({
|
||||
selector: 'sermon-small-component',
|
||||
templateUrl: './sermon-small.component.html',
|
||||
styleUrls: ['./sermon-small.component.css'],
|
||||
animations:[
|
||||
trigger("inout",[
|
||||
state("1", style({ opacity: '1', transform:'translateX(0)' })),
|
||||
state("0",style({ opacity: '0', transform:'translateX(5%)' })),
|
||||
transition('* => 1',[
|
||||
animate('500ms ease-in-out')
|
||||
]),
|
||||
transition(':enter',[
|
||||
animate('0ms')
|
||||
])
|
||||
])
|
||||
]
|
||||
})
|
||||
export class SermonSmallComponent implements AfterContentInit {
|
||||
@Input()
|
||||
id: number;
|
||||
@Input()
|
||||
title: string;
|
||||
@Input()
|
||||
description: string;
|
||||
@Input()
|
||||
date: Date;
|
||||
@Input()
|
||||
author: string;
|
||||
@Input()
|
||||
url: string;
|
||||
public startFadeIn: boolean = false;
|
||||
@Input()
|
||||
public delayFadeIn: number = 100;
|
||||
|
||||
constructor(private audioPlayer: AudioPlayerService){
|
||||
|
||||
}
|
||||
|
||||
play(): void{
|
||||
if (this.audioPlayer.getIsPlaying() == true && this.audioPlayer.getMetaData() != null && this.audioPlayer.getMetaData().id == this.id){
|
||||
this.audioPlayer.pause();
|
||||
} else {
|
||||
if (this.audioPlayer.getMetaData() != null && this.audioPlayer.getMetaData().id == this.id){
|
||||
this.audioPlayer.resume();
|
||||
} else {
|
||||
this.audioPlayer.play(this.url,{id:this.id,title:this.title,author:this.author});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ngAfterContentInit(): void{
|
||||
setTimeout(() => this.startFadeIn = true, this.delayFadeIn);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
|
||||
ul{
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
li{
|
||||
margin: 40px 0px 40px 0px; /* top right bottom left */
|
||||
}
|
||||
|
||||
li:first-child{
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
li:last-child{
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.side-bar{
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
.width100{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mobile-search{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.fab-buttons{
|
||||
display: none;
|
||||
}
|
||||
|
||||
#audio-player-filler{
|
||||
height: 60px;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
@media(max-width:800px){
|
||||
.mobile-search{
|
||||
display: block;
|
||||
}
|
||||
.fab-buttons{
|
||||
display: inline-block;
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<secondary-page-component [hideSideBarOnMobile]="true" >
|
||||
<div mainContent>
|
||||
<div class="mobile-search">
|
||||
<mat-form-field class="width100">
|
||||
<input #searchMobile matInput placeholder="Search Sermons" [value]="searchTerm" (keyup)="searchChange(searchMobile.value)">
|
||||
</mat-form-field>
|
||||
<br><br>
|
||||
</div>
|
||||
<ul>
|
||||
<li *ngFor="let sermon of sermons; let i = index;">
|
||||
<sermon-large-component
|
||||
[id]="sermon.id"
|
||||
[title]="sermon.title"
|
||||
[date]="sermon.sermonDate"
|
||||
[description]="sermon.description"
|
||||
[author]="sermon.author"
|
||||
[delayFadeIn]="(i-((((sermons.length*10)/10)-10) > 0 ? (((sermons.length*10)/10)-10) : 0))*200"
|
||||
[url]="sermon.url"
|
||||
[loggedIn]="loggedIn"
|
||||
></sermon-large-component>
|
||||
</li>
|
||||
<button mat-button [disabled]="loading" class="width100" style="text-align: center;" (click)="loadMoreSermonsClick()">
|
||||
<i ofbicon *ngIf="loading">access_time</i><span *ngIf="loading"> Loading...</span>
|
||||
<i ofbicon *ngIf="!loading">expand_more</i><span *ngIf="!loading"> Load More</span>
|
||||
</button>
|
||||
</ul>
|
||||
<div class="fab-buttons" >
|
||||
<button mat-fab (click)="searchFabClick()"><i ofbicon>search</i></button>
|
||||
<button mat-fab *ngIf="loggedIn" (click)="addSermon()"><i ofbicon>add</i></button>
|
||||
<div id="audio-player-filler" *ngIf="audioPlayerOpen"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div sideBar class="side-bar">
|
||||
<div class="search-bar">
|
||||
<mat-form-field class="width100">
|
||||
<input #search matInput placeholder="Search Sermons" [value]="searchTerm" (keyup)="searchChange(search.value)">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<button mat-raised-button *ngIf="loggedIn" class="width100" (click)="addSermon()" >Add Sermon</button>
|
||||
</div>
|
||||
</secondary-page-component>
|
||||
|
|
@ -1,143 +0,0 @@
|
|||
import { InputPopupComponent } from './../popups/input-popup/input-popup.component';
|
||||
import { AudioPlayerService } from './../../services/audio-player.service';
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { Location } from '@angular/common';
|
||||
import { SermonService } from '../../services/sermon.service';
|
||||
import { LoginService } from '../../services/login.service';
|
||||
import { Sermon } from '../../interfaces/sermon';
|
||||
import { MatSnackBar, MatDialog, MatDialogConfig } from '@angular/material';
|
||||
|
||||
import { AddSermonPopupComponent } from '../popups/add-sermon-popup/add-sermon-popup.component';
|
||||
|
||||
import 'rxjs/add/operator/switchMap';
|
||||
|
||||
@Component({
|
||||
selector: 'sermons-component',
|
||||
templateUrl: './sermons.component.html',
|
||||
styleUrls: ['./sermons.component.css'],
|
||||
})
|
||||
export class SermonsComponent implements OnInit {
|
||||
|
||||
|
||||
public sermons: Sermon[];
|
||||
public loading: boolean = false;
|
||||
public page: number = 1;
|
||||
public searchTerm: string = '';
|
||||
public loggedIn: boolean = false;
|
||||
public audioPlayerOpen: boolean;
|
||||
private searchWait: any;
|
||||
private dialogConfig: MatDialogConfig;
|
||||
|
||||
|
||||
constructor(private loginService: LoginService,
|
||||
private snackbar: MatSnackBar,
|
||||
private dialog: MatDialog,
|
||||
private sermonService: SermonService,
|
||||
private route: ActivatedRoute,
|
||||
private location: Location,
|
||||
private audioPlayerService: AudioPlayerService){
|
||||
|
||||
this.loginService.isLoggedIn(true).subscribe(is => { this.loggedIn = is; });
|
||||
this.loginService.onLogin().subscribe(is => { this.loggedIn = is.isLoggedIn; });
|
||||
this.audioPlayerService.onAudioPlayerOpenClose.subscribe(is => { this.audioPlayerOpen = is; });
|
||||
}
|
||||
|
||||
|
||||
ngOnInit(): void{
|
||||
this.route.params
|
||||
// (+) converts string 'id' to a number
|
||||
.subscribe((params: Params) => {
|
||||
let id = +params['id'];
|
||||
id = Number.isNaN(id) ? -1 : id;
|
||||
if (id > -1){
|
||||
this.page = 0;
|
||||
this.getSingleSermon(id);
|
||||
} else {
|
||||
this.getSermons(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
searchChange(searchTerm): void{
|
||||
this.searchTerm = searchTerm;
|
||||
if (this.searchWait) clearTimeout(this.searchWait);
|
||||
this.searchWait = setTimeout(()=>this.getSermons(true),400);
|
||||
}
|
||||
|
||||
loadMoreSermonsClick(): void{
|
||||
this.page++;
|
||||
//this.location.go("/sermons/" + this.page);
|
||||
this.getSermons(false);
|
||||
}
|
||||
|
||||
getSingleSermon(id: number){
|
||||
this.loading = true;
|
||||
this.sermons = this.sermons || [];
|
||||
this.sermons = [];
|
||||
|
||||
this.sermonService.getSermonById(id).subscribe(
|
||||
sermons => {
|
||||
this.sermons.push(sermons)
|
||||
this.loading = false;
|
||||
},
|
||||
error => {
|
||||
this.getSermons(true);
|
||||
} );
|
||||
}
|
||||
|
||||
getSermons(clearExisting): void{
|
||||
this.loading = true;
|
||||
this.sermons = this.sermons || [];
|
||||
if (clearExisting) {
|
||||
this.sermons = [];
|
||||
this.page = 1;
|
||||
}
|
||||
this.sermonService.searchSermons(this.searchTerm,this.page).subscribe(
|
||||
sermons => {
|
||||
this.addSermons(sermons);
|
||||
this.loading = false;
|
||||
},
|
||||
error => console.error(error) );
|
||||
}
|
||||
|
||||
addSermons(sermons: Sermon[]): void{
|
||||
for(let i = 0; i < sermons.length; i++){
|
||||
this.sermons.push(sermons[i]);
|
||||
}
|
||||
}
|
||||
|
||||
addSermon(){
|
||||
let dialog = this.dialog.open(AddSermonPopupComponent,this.dialogConfig);
|
||||
|
||||
dialog.afterClosed().subscribe(s => {
|
||||
s = s as Sermon;
|
||||
if (s){
|
||||
this.sermons.unshift(s);
|
||||
let snack = this.snackbar.open(s.title + " was added!", "Ok");
|
||||
snack.onAction().subscribe(()=>{
|
||||
snack.dismiss();
|
||||
});
|
||||
setTimeout(()=>{snack.dismiss();},3000);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
searchFabClick(){
|
||||
let opts = new MatDialogConfig;
|
||||
opts.data = { title:'Search','message':'' };
|
||||
|
||||
let dialog = this.dialog.open(InputPopupComponent,opts);
|
||||
|
||||
dialog.afterClosed().subscribe(search => {
|
||||
if (typeof search !== 'undefined' && this.searchTerm != search){
|
||||
this.searchTerm = search;
|
||||
this.searchChange(this.searchTerm);
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue