Skip to content

Commit

Permalink
Firebase: Step 2 - Move #122
Browse files Browse the repository at this point in the history
  • Loading branch information
emilt27 committed May 11, 2018
1 parent 6699576 commit be8588d
Show file tree
Hide file tree
Showing 232 changed files with 22,387 additions and 3,307 deletions.
6 changes: 3 additions & 3 deletions src/_entrypoints/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {enableProdMode} from '@angular/core';
import {UiModule} from '../ui/_module/ui.module';
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { UiModule } from '../ui/_module/ui.module';

const build = require('build');

Expand Down
7 changes: 2 additions & 5 deletions src/_entrypoints/polyfills.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
// Polyfills

import 'ie-shim'; // Internet Explorer 9 support

import 'core-js/es6';
import 'core-js/es7';
import 'ie-shim'; // Internet Explorer 9 support

// import 'core-js/es7/reflect';
import * as WebVRPolyfill from 'webvr-polyfill';
import 'zone.js/dist/zone';
import 'zone.js/dist/long-stack-trace-zone';

import * as WebVRPolyfill from 'webvr-polyfill';

//custom browser compatibility
navigator.getUserMedia = navigator.getUserMedia || (<any>navigator).webkitGetUserMedia;
(<any>window).AudioContext = (<any>window).AudioContext || (<any>window).webkitAudioContext;
Expand Down
4 changes: 1 addition & 3 deletions src/_entrypoints/vendor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@ import 'rxjs';
import 'three';
import 'three/VRControls';
import 'three/VREffect';


//social media authentication initialization scripts
//social media authentication initialization scripts
import './social.ts';
4 changes: 2 additions & 2 deletions src/_serviceworkers/cache-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const images = [
'assets/icons/view-toggle-3d-accent.png',
'assets/icons/view-toggle-3d.png',
'assets/images/default-background.png',
'assets/images/color_ball.jpg'
'assets/images/color_ball.jpg',
];

const resources = [
Expand All @@ -40,7 +40,7 @@ const resources = [
'favicon.ico',
'polyfills.bundle.js',
'vendor.bundle.js',
'main.bundle.js'
'main.bundle.js',
];

const cacheList = images.concat(resources);
Expand Down
5 changes: 2 additions & 3 deletions src/_serviceworkers/sw.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import cacheList from './cache-list';
import {ICON_PATH} from 'ui/common/constants';

const swVersion = '001'; // TODO: generate dynamically
const CACHE_NAME = `svr-sw-${swVersion}`;
Expand All @@ -14,7 +13,7 @@ self.addEventListener('install', $event => {
(<any>$event).waitUntil(
caches.open(CACHE_NAME)
.then(cache => cache.addAll(cacheList))
.catch(error => console.log('error', error))
.catch(error => console.log('error', error)),
);
});

Expand All @@ -26,6 +25,6 @@ self.addEventListener('fetch', $event => {
(<any>$event).respondWith(
caches.match((<any>$event).request)
.then(response => response ? response : fetch(request))
.catch(error => console.log('fetch error', error))
.catch(error => console.log('fetch error', error)),
);
});
4,098 changes: 4,097 additions & 1 deletion src/assets/fonts/Nunito_Regular.json

Large diffs are not rendered by default.

4,259 changes: 4,258 additions & 1 deletion src/assets/fonts/gentilis_bold.typeface.json

Large diffs are not rendered by default.

4,259 changes: 4,258 additions & 1 deletion src/assets/fonts/gentilis_regular.typeface.json

Large diffs are not rendered by default.

1,277 changes: 1,276 additions & 1 deletion src/assets/fonts/helvetiker_bold.typeface.json

Large diffs are not rendered by default.

1,282 changes: 1,281 additions & 1 deletion src/assets/fonts/helvetiker_regular.typeface.json

Large diffs are not rendered by default.

1,349 changes: 1,348 additions & 1 deletion src/assets/fonts/optimer_bold.typeface.json

Large diffs are not rendered by default.

1,349 changes: 1,348 additions & 1 deletion src/assets/fonts/optimer_regular.typeface.json

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions src/config/environment.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
export const ENV = {
firebase: {
apiKey: "AIzaSyC5Q5Ie9To_fE2Yk8jOq1BCjIlV-9SEqQM",
authDomain: "social-vr-161302.firebaseapp.com",
databaseURL: "https://social-vr-161302.firebaseio.com",
projectId: "social-vr-161302",
storageBucket: "social-vr-161302.appspot.com",
messagingSenderId: "613942124685"
apiKey: 'AIzaSyC5Q5Ie9To_fE2Yk8jOq1BCjIlV-9SEqQM',
authDomain: 'social-vr-161302.firebaseapp.com',
databaseURL: 'https://social-vr-161302.firebaseio.com',
projectId: 'social-vr-161302',
storageBucket: 'social-vr-161302.appspot.com',
messagingSenderId: '613942124685',
},

firebaseStore: {
timestampsInSnapshots: true,
}
};
41 changes: 20 additions & 21 deletions src/core/_module/core.module.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
// external imports
import {NgModule} from '@angular/core';

// project module imports
import {DataModule} from 'data/_module/data.module';

import { NgModule } from '@angular/core';
import { AdminInteractor } from 'core/admin/adminInteractor';
import { AssetInteractor } from 'core/asset/assetInteractor';
import { ChatInteractor } from 'core/chat/chatInteractor';
import { GroupInteractor } from 'core/group/groupInteractor';
import { ProjectInteractor } from 'core/project/projectInteractor';
import { CameraInteractor } from 'core/scene/cameraInteractor';
import { MetaDataInteractor } from 'core/scene/projectMetaDataInteractor';
// internal module imports
import {SceneInteractor} from 'core/scene/sceneInteractor';
import {MetaDataInteractor} from 'core/scene/projectMetaDataInteractor';
import {CameraInteractor} from 'core/scene/cameraInteractor';
import {StorageInteractor} from 'core/storage/storageInteractor';
import {UserInteractor} from 'core/user/userInteractor';
import {ProjectInteractor} from 'core/project/projectInteractor';
import {AssetInteractor} from 'core/asset/assetInteractor';
import {VideoInteractor} from 'core/video/VideoInteractor';
import {SearchInteractor} from 'core/search/searchInteractor';
import {AdminInteractor} from 'core/admin/adminInteractor';
import {GroupInteractor} from 'core/group/groupInteractor';
import {ChatInteractor} from 'core/chat/chatInteractor';
import { SceneInteractor } from 'core/scene/sceneInteractor';
import { SearchInteractor } from 'core/search/searchInteractor';
import { StorageInteractor } from 'core/storage/storageInteractor';
import { UserInteractor } from 'core/user/userInteractor';
import { VideoInteractor } from 'core/video/VideoInteractor';
// project module imports
import { DataModule } from 'data/_module/data.module';

@NgModule({
declarations: [],
imports: [
DataModule
DataModule,
],
providers: [
SceneInteractor,
Expand All @@ -35,7 +33,8 @@ import {ChatInteractor} from 'core/chat/chatInteractor';
SearchInteractor,
AdminInteractor,
GroupInteractor,
ChatInteractor
]
ChatInteractor,
],
})
export class CoreModule {}
export class CoreModule {
}
11 changes: 6 additions & 5 deletions src/core/admin/adminInteractor.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import {Injectable} from '@angular/core';
import { Injectable } from '@angular/core';
import { ApiService } from 'data/api/apiService';

import {UserService} from 'data/user/userService';
import {ApiService} from 'data/api/apiService';
import { UserService } from 'data/user/userService';


@Injectable()
export class AdminInteractor {

constructor(
private userService: UserService,
private apiService: ApiService
) {}
private apiService: ApiService,
) {
}

isAdmin(): boolean {
return !!this.userService.getAdminGroups().length;
Expand Down
37 changes: 6 additions & 31 deletions src/core/asset/assetInteractor.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import {Observable} from 'rxjs';
import {Injectable} from '@angular/core';
import {Texture} from 'three';
import { Injectable } from '@angular/core';

import {ApiService} from 'data/api/apiService';
import {AssetService} from 'data/asset/assetService';
import {AssetManager} from 'data/asset/assetManager';
import { ApiService } from 'data/api/apiService';
import { AssetManager } from 'data/asset/assetManager';
import { AssetService } from 'data/asset/assetService';
import { Observable } from 'rxjs';
import { Texture } from 'three';

@Injectable()
export class AssetInteractor {
constructor(
private apiService: ApiService,
private assetManager: AssetManager,
private assetService: AssetService,
) {
}

Expand All @@ -30,30 +29,6 @@ export class AssetInteractor {
getAudioBufferById(id: string): AudioBuffer {
return this.assetManager.getAudioBufferById(id);
}

setUploadPolicy() {
return this.apiService.getUploadPolicy().do(response => {
this.assetService.setUploadPolicy(response);
});
}

getUploadPolicy() {
let uploadPolicy = this.assetService.getUploadPolicy();
if (!uploadPolicy) {
return this.setUploadPolicy()
.subscribe(
uploadPolicy => uploadPolicy,
error => console.error(error)
)
}
return uploadPolicy;
}

uploadMedia(key: string, file): Observable<any> {
const uploadPolicy = this.getUploadPolicy();
return this.apiService.uploadMedia(key, file, uploadPolicy);
}

}

export class AssetModel {
Expand Down
13 changes: 7 additions & 6 deletions src/core/chat/chatInteractor.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import { Injectable } from '@angular/core';

import {ChatService} from 'data/chat/chatService';
import {UserService} from 'data/user/userService';
import { ChatService } from 'data/chat/chatService';
import { UserService } from 'data/user/userService';
import { Observable } from 'rxjs/Observable';

@Injectable()
export class ChatInteractor {

constructor(
private chatService: ChatService,
private userService: UserService
) {}
private userService: UserService,
) {
}

createRoom(roomName: string, userName: string, userId: string): Observable<any> {
return this.chatService.createRoom(roomName, userName, userId);
Expand Down
11 changes: 5 additions & 6 deletions src/core/group/groupInteractor.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import {Injectable} from '@angular/core';
import { Injectable } from '@angular/core';

import {ApiService} from 'data/api/apiService';

import {Observable} from 'rxjs/Observable';
import { ApiService } from 'data/api/apiService';

@Injectable()
export class GroupInteractor {

constructor(
private apiService: ApiService
) {}
private apiService: ApiService,
) {
}

getGroup(groupId: string) {
return this.apiService.getGroup(groupId);
Expand Down
Loading

0 comments on commit be8588d

Please sign in to comment.