@ofidj/generator-fidj 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +74 -0
- package/generators/app/index.js +200 -0
- package/generators/app/templates/app2018/.travis.yml +35 -0
- package/generators/app/templates/app2018/LICENSE +21 -0
- package/generators/app/templates/app2018/Procfile +1 -0
- package/generators/app/templates/app2018/README.md +49 -0
- package/generators/app/templates/app2018/config.xml +91 -0
- package/generators/app/templates/app2018/gulpfile.js +63 -0
- package/generators/app/templates/app2018/ionic.config.json +9 -0
- package/generators/app/templates/app2018/package.json +90 -0
- package/generators/app/templates/app2018/platforms/README.md +1 -0
- package/generators/app/templates/app2018/resources/README.md +6 -0
- package/generators/app/templates/app2018/resources/icon.png +0 -0
- package/generators/app/templates/app2018/resources/marketing-01-ipad.png +0 -0
- package/generators/app/templates/app2018/resources/marketing-01-iphone.png +0 -0
- package/generators/app/templates/app2018/resources/marketing-02-ipad.png +0 -0
- package/generators/app/templates/app2018/resources/marketing-02-iphone.png +0 -0
- package/generators/app/templates/app2018/resources/marketing-03-ipad.png +0 -0
- package/generators/app/templates/app2018/resources/marketing-03-iphone.png +0 -0
- package/generators/app/templates/app2018/resources/marketing.json +19 -0
- package/generators/app/templates/app2018/resources/splash.png +0 -0
- package/generators/app/templates/app2018/src/app/app.component.ts +88 -0
- package/generators/app/templates/app2018/src/app/app.html +19 -0
- package/generators/app/templates/app2018/src/app/app.module.ts +40 -0
- package/generators/app/templates/app2018/src/app/app.scss +16 -0
- package/generators/app/templates/app2018/src/app/main.ts +5 -0
- package/generators/app/templates/app2018/src/app/shared/card.model.ts +10 -0
- package/generators/app/templates/app2018/src/app/shared/profile.service.ts +46 -0
- package/generators/app/templates/app2018/src/app/shared/shared.module.ts +35 -0
- package/generators/app/templates/app2018/src/app/shared/storage.service.ts +11 -0
- package/generators/app/templates/app2018/src/app/shared/version.const.ts +5 -0
- package/generators/app/templates/app2018/src/assets/icon/favicon.ico +0 -0
- package/generators/app/templates/app2018/src/assets/imgs/gg.png +0 -0
- package/generators/app/templates/app2018/src/assets/imgs/github.png +0 -0
- package/generators/app/templates/app2018/src/assets/imgs/login.svg +5668 -0
- package/generators/app/templates/app2018/src/assets/imgs/logo.png +0 -0
- package/generators/app/templates/app2018/src/index.html +49 -0
- package/generators/app/templates/app2018/src/manifest.json +13 -0
- package/generators/app/templates/app2018/src/pages/home/home.html +56 -0
- package/generators/app/templates/app2018/src/pages/home/home.scss +3 -0
- package/generators/app/templates/app2018/src/pages/home/home.ts +126 -0
- package/generators/app/templates/app2018/src/pages/login/login.html +56 -0
- package/generators/app/templates/app2018/src/pages/login/login.scss +44 -0
- package/generators/app/templates/app2018/src/pages/login/login.ts +59 -0
- package/generators/app/templates/app2018/src/pages/profile/profile.html +33 -0
- package/generators/app/templates/app2018/src/pages/profile/profile.scss +3 -0
- package/generators/app/templates/app2018/src/pages/profile/profile.ts +36 -0
- package/generators/app/templates/app2018/src/service-worker.js +31 -0
- package/generators/app/templates/app2018/src/theme/variables.scss +88 -0
- package/generators/app/templates/app2018/tests/karma.unit-tests.conf.js +84 -0
- package/generators/app/templates/app2018/tests/unit/app.test.js +10 -0
- package/generators/app/templates/app2018/tsconfig.json +28 -0
- package/generators/app/templates/app2018/tslint.json +8 -0
- package/generators/app/templates/app2018/web.js +21 -0
- package/generators/app/templates/app2021/.travis.yml +32 -0
- package/generators/app/templates/app2021/LICENSE +21 -0
- package/generators/app/templates/app2021/Procfile +1 -0
- package/generators/app/templates/app2021/README.md +45 -0
- package/generators/app/templates/app2021/angular.json +188 -0
- package/generators/app/templates/app2021/browserslist +12 -0
- package/generators/app/templates/app2021/ionic.config.json +9 -0
- package/generators/app/templates/app2021/karma.conf.js +31 -0
- package/generators/app/templates/app2021/package-lock.json +5 -0
- package/generators/app/templates/app2021/package.json +77 -0
- package/generators/app/templates/app2021/platforms/README.md +1 -0
- package/generators/app/templates/app2021/resources/README.md +6 -0
- package/generators/app/templates/app2021/resources/icon.png +0 -0
- package/generators/app/templates/app2021/resources/marketing-01-ipad.png +0 -0
- package/generators/app/templates/app2021/resources/marketing-01-iphone.png +0 -0
- package/generators/app/templates/app2021/resources/marketing-02-ipad.png +0 -0
- package/generators/app/templates/app2021/resources/marketing-02-iphone.png +0 -0
- package/generators/app/templates/app2021/resources/marketing-03-ipad.png +0 -0
- package/generators/app/templates/app2021/resources/marketing-03-iphone.png +0 -0
- package/generators/app/templates/app2021/resources/marketing.json +19 -0
- package/generators/app/templates/app2021/resources/splash.png +0 -0
- package/generators/app/templates/app2021/src/app/app-routing.module.ts +25 -0
- package/generators/app/templates/app2021/src/app/app.component.html +3 -0
- package/generators/app/templates/app2021/src/app/app.component.scss +0 -0
- package/generators/app/templates/app2021/src/app/app.component.spec.ts +50 -0
- package/generators/app/templates/app2021/src/app/app.component.ts +28 -0
- package/generators/app/templates/app2021/src/app/app.module.ts +24 -0
- package/generators/app/templates/app2021/src/app/content/content-routing.module.ts +16 -0
- package/generators/app/templates/app2021/src/app/content/content.module.ts +20 -0
- package/generators/app/templates/app2021/src/app/content/content.page.html +31 -0
- package/generators/app/templates/app2021/src/app/content/content.page.scss +0 -0
- package/generators/app/templates/app2021/src/app/content/content.page.ts +26 -0
- package/generators/app/templates/app2021/src/app/explore-container/explore-container.component.html +4 -0
- package/generators/app/templates/app2021/src/app/explore-container/explore-container.component.scss +4 -0
- package/generators/app/templates/app2021/src/app/explore-container/explore-container.component.spec.ts +24 -0
- package/generators/app/templates/app2021/src/app/explore-container/explore-container.component.ts +16 -0
- package/generators/app/templates/app2021/src/app/explore-container/explore-container.module.ts +14 -0
- package/generators/app/templates/app2021/src/app/my/my-routing.module.ts +36 -0
- package/generators/app/templates/app2021/src/app/my/my.module.ts +19 -0
- package/generators/app/templates/app2021/src/app/my/my.page.html +15 -0
- package/generators/app/templates/app2021/src/app/my/my.page.scss +1 -0
- package/generators/app/templates/app2021/src/app/my/my.page.spec.ts +26 -0
- package/generators/app/templates/app2021/src/app/my/my.page.ts +25 -0
- package/generators/app/templates/app2021/src/app/profile/profile-routing.module.ts +16 -0
- package/generators/app/templates/app2021/src/app/profile/profile.module.ts +20 -0
- package/generators/app/templates/app2021/src/app/profile/profile.page.html +49 -0
- package/generators/app/templates/app2021/src/app/profile/profile.page.scss +0 -0
- package/generators/app/templates/app2021/src/app/profile/profile.page.spec.ts +25 -0
- package/generators/app/templates/app2021/src/app/profile/profile.page.ts +44 -0
- package/generators/app/templates/app2021/src/app/shared/const.ts +3 -0
- package/generators/app/templates/app2021/src/app/signin/signin-routing.module.ts +16 -0
- package/generators/app/templates/app2021/src/app/signin/signin.module.ts +18 -0
- package/generators/app/templates/app2021/src/app/signin/signin.page.html +53 -0
- package/generators/app/templates/app2021/src/app/signin/signin.page.scss +36 -0
- package/generators/app/templates/app2021/src/app/signin/signin.page.ts +69 -0
- package/generators/app/templates/app2021/src/assets/icon/favicon.png +0 -0
- package/generators/app/templates/app2021/src/assets/shapes.svg +1 -0
- package/generators/app/templates/app2021/src/environments/environment.prod.ts +3 -0
- package/generators/app/templates/app2021/src/environments/environment.ts +16 -0
- package/generators/app/templates/app2021/src/global.scss +26 -0
- package/generators/app/templates/app2021/src/index.html +26 -0
- package/generators/app/templates/app2021/src/main.ts +12 -0
- package/generators/app/templates/app2021/src/polyfills.ts +67 -0
- package/generators/app/templates/app2021/src/test.ts +20 -0
- package/generators/app/templates/app2021/src/theme/variables.scss +232 -0
- package/generators/app/templates/app2021/src/zone-flags.ts +5 -0
- package/generators/app/templates/app2021/tests/protractor.conf.js +36 -0
- package/generators/app/templates/app2021/tests/src/app.e2e-spec.ts +14 -0
- package/generators/app/templates/app2021/tests/src/app.po.ts +11 -0
- package/generators/app/templates/app2021/tests/tsconfig.json +13 -0
- package/generators/app/templates/app2021/tsconfig.app.json +18 -0
- package/generators/app/templates/app2021/tsconfig.json +23 -0
- package/generators/app/templates/app2021/tsconfig.spec.json +18 -0
- package/generators/app/templates/app2021/tslint.json +149 -0
- package/generators/app/templates/app2021/web.js +21 -0
- package/package.json +41 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"marketing": [
|
|
3
|
+
{
|
|
4
|
+
"text": "Your stories everywhere",
|
|
5
|
+
"landscape": "resources/marketing-01-ipad.png",
|
|
6
|
+
"portrait": "resources/marketing-01-iphone.png"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"text": "Manage your Poker Planning",
|
|
10
|
+
"landscape": "resources/marketing-02-ipad.png",
|
|
11
|
+
"portrait": "resources/marketing-02-iphone.png"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"text": "A free account",
|
|
15
|
+
"landscape": "resources/marketing-03-ipad.png",
|
|
16
|
+
"portrait": "resources/marketing-03-iphone.png"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {Component, OnDestroy, ViewChild} from '@angular/core';
|
|
2
|
+
import {Nav, Platform} from 'ionic-angular';
|
|
3
|
+
import {StatusBar} from '@ionic-native/status-bar';
|
|
4
|
+
import {SplashScreen} from '@ionic-native/splash-screen';
|
|
5
|
+
import {Network} from '@ionic-native/network';
|
|
6
|
+
import {Subscription} from "rxjs/Subscription";
|
|
7
|
+
|
|
8
|
+
import {HomePage} from '../pages/home/home';
|
|
9
|
+
import {ProfilePage} from "../pages/profile/profile";
|
|
10
|
+
import {FidjService} from "fidj";
|
|
11
|
+
import {LoginPage} from "../pages/login/login";
|
|
12
|
+
import {Profile} from "./shared/profile.service";
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
templateUrl: 'app.html'
|
|
16
|
+
})
|
|
17
|
+
export class MyApp implements OnDestroy {
|
|
18
|
+
@ViewChild(Nav) nav: Nav;
|
|
19
|
+
|
|
20
|
+
rootPage: any = null;
|
|
21
|
+
connected: Subscription;
|
|
22
|
+
pages: Array<{ title: string, component: any }>;
|
|
23
|
+
|
|
24
|
+
constructor(public platform: Platform,
|
|
25
|
+
public statusBar: StatusBar,
|
|
26
|
+
public splashScreen: SplashScreen,
|
|
27
|
+
private network: Network,
|
|
28
|
+
public profile: Profile,
|
|
29
|
+
private fidjService: FidjService) {
|
|
30
|
+
|
|
31
|
+
// used for an example of ngFor and navigation
|
|
32
|
+
this.pages = [
|
|
33
|
+
{title: 'Poker', component: HomePage},
|
|
34
|
+
{title: 'Player', component: ProfilePage},
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
this.initializeApp();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
initializeApp() {
|
|
41
|
+
this.platform.ready().then(() => {
|
|
42
|
+
// Okay, so the platform is ready and our plugins are available.
|
|
43
|
+
// Here you can do any higher level native things you might need.
|
|
44
|
+
this.statusBar.styleDefault();
|
|
45
|
+
this.initFidj();
|
|
46
|
+
// this.nav.setRoot(LoginPage);
|
|
47
|
+
this.splashScreen.hide();
|
|
48
|
+
|
|
49
|
+
this.connected = this.network.onConnect().subscribe(data => {
|
|
50
|
+
this.initFidj();
|
|
51
|
+
}, error => console.error(error));
|
|
52
|
+
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
ngOnDestroy() {
|
|
57
|
+
this.connected.unsubscribe();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
initFidj() {
|
|
61
|
+
|
|
62
|
+
this.fidjService.init('getYourFidjId')
|
|
63
|
+
.then(() => {
|
|
64
|
+
this.connected.unsubscribe();
|
|
65
|
+
this.profile.readyForSync.next(true);
|
|
66
|
+
if (this.fidjService.isLoggedIn()) {
|
|
67
|
+
this.nav.setRoot(HomePage);
|
|
68
|
+
} else {
|
|
69
|
+
this.nav.setRoot(LoginPage);
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
.catch((err) => {
|
|
73
|
+
alert(JSON.stringify(err));
|
|
74
|
+
this.profile.readyForSync.next(false);
|
|
75
|
+
if (this.fidjService.isLoggedIn()) {
|
|
76
|
+
this.nav.setRoot(HomePage);
|
|
77
|
+
} else {
|
|
78
|
+
this.nav.setRoot(LoginPage);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
openPage(page) {
|
|
84
|
+
// Reset the content nav to have just this page
|
|
85
|
+
// we wouldn't want the back button to show in this scenario
|
|
86
|
+
this.nav.setRoot(page.component);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<ion-menu [content]="content" *ngIf="profile.readyForSync | async">
|
|
2
|
+
<ion-header>
|
|
3
|
+
<ion-toolbar>
|
|
4
|
+
<ion-title>Menu</ion-title>
|
|
5
|
+
</ion-toolbar>
|
|
6
|
+
</ion-header>
|
|
7
|
+
|
|
8
|
+
<ion-content>
|
|
9
|
+
<ion-list>
|
|
10
|
+
<button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
|
|
11
|
+
{{p.title}}
|
|
12
|
+
</button>
|
|
13
|
+
</ion-list>
|
|
14
|
+
</ion-content>
|
|
15
|
+
|
|
16
|
+
</ion-menu>
|
|
17
|
+
|
|
18
|
+
<!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
|
|
19
|
+
<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {ErrorHandler, NgModule} from '@angular/core';
|
|
2
|
+
import {IonicApp, IonicErrorHandler, IonicModule, Refresher} from 'ionic-angular';
|
|
3
|
+
import {StatusBar} from '@ionic-native/status-bar';
|
|
4
|
+
import {Network} from "@ionic-native/network";
|
|
5
|
+
import {SplashScreen} from '@ionic-native/splash-screen';
|
|
6
|
+
|
|
7
|
+
import {MyApp} from './app.component';
|
|
8
|
+
import {HomePage} from '../pages/home/home';
|
|
9
|
+
import {SharedModule} from "./shared/shared.module";
|
|
10
|
+
import {ProfilePage} from "../pages/profile/profile";
|
|
11
|
+
import {LoginPage} from "../pages/login/login";
|
|
12
|
+
|
|
13
|
+
@NgModule({
|
|
14
|
+
declarations: [
|
|
15
|
+
MyApp,
|
|
16
|
+
HomePage,
|
|
17
|
+
ProfilePage,
|
|
18
|
+
LoginPage
|
|
19
|
+
],
|
|
20
|
+
imports: [
|
|
21
|
+
SharedModule,
|
|
22
|
+
IonicModule.forRoot(MyApp)
|
|
23
|
+
],
|
|
24
|
+
bootstrap: [IonicApp],
|
|
25
|
+
entryComponents: [
|
|
26
|
+
MyApp,
|
|
27
|
+
HomePage,
|
|
28
|
+
ProfilePage,
|
|
29
|
+
LoginPage
|
|
30
|
+
],
|
|
31
|
+
providers: [
|
|
32
|
+
StatusBar,
|
|
33
|
+
SplashScreen,
|
|
34
|
+
Network,
|
|
35
|
+
Refresher,
|
|
36
|
+
{provide: ErrorHandler, useClass: IonicErrorHandler}
|
|
37
|
+
]
|
|
38
|
+
})
|
|
39
|
+
export class AppModule {
|
|
40
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// <%= appHomepage %>docs/theming/
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// App Global Sass
|
|
5
|
+
// --------------------------------------------------
|
|
6
|
+
// Put style rules here that you want to apply globally. These
|
|
7
|
+
// styles are for the entire app and not just one component.
|
|
8
|
+
// Additionally, this file can be also used as an entry point
|
|
9
|
+
// to import other Sass files to be included in the output CSS.
|
|
10
|
+
//
|
|
11
|
+
// Shared Sass variables, which can be used to adjust Ionic's
|
|
12
|
+
// default Sass variables, belong in "theme/variables.scss".
|
|
13
|
+
//
|
|
14
|
+
// To declare rules for a specific mode, create a child rule
|
|
15
|
+
// for the .md, .ios, or .wp mode classes. The mode class is
|
|
16
|
+
// automatically applied to the <body> element in the app.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {Injectable} from "@angular/core";
|
|
2
|
+
import {Storage} from "./storage.service";
|
|
3
|
+
// import {Observable} from "rxjs/Observable";
|
|
4
|
+
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
|
|
5
|
+
import {Observable} from "rxjs/Observable";
|
|
6
|
+
|
|
7
|
+
@Injectable()
|
|
8
|
+
export class Profile {
|
|
9
|
+
|
|
10
|
+
private email: string;
|
|
11
|
+
private roles : Array<string>;
|
|
12
|
+
public readyForSync: BehaviorSubject<boolean>;
|
|
13
|
+
|
|
14
|
+
constructor(private _storage: Storage) {
|
|
15
|
+
console.log('Profile service');
|
|
16
|
+
this.email = this._storage.get('email') || null;
|
|
17
|
+
this.readyForSync = new BehaviorSubject<boolean>(false);
|
|
18
|
+
this.roles = [];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
getEmail() {
|
|
22
|
+
return this.email;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
setEmail(email: string) {
|
|
26
|
+
this.email = email;
|
|
27
|
+
this._storage.set('email', this.email);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
logout() {
|
|
31
|
+
this._storage.remove('email');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
isReady() : Observable<boolean> {
|
|
35
|
+
return this.readyForSync.asObservable();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
getRoles() : Array<string> {
|
|
39
|
+
return this.roles;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
setRoles(roles : Array<string> ) : void {
|
|
43
|
+
this.roles = roles;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {BrowserModule} from '@angular/platform-browser';
|
|
2
|
+
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
|
3
|
+
import {CommonModule, NgStyle} from '@angular/common';
|
|
4
|
+
import {NgModule} from '@angular/core';
|
|
5
|
+
import {IonicModule} from 'ionic-angular';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
FidjModule
|
|
9
|
+
} from "fidj";
|
|
10
|
+
|
|
11
|
+
import {Profile} from "./profile.service";
|
|
12
|
+
import {Storage} from "./storage.service";
|
|
13
|
+
|
|
14
|
+
@NgModule({
|
|
15
|
+
declarations: [],
|
|
16
|
+
imports: [
|
|
17
|
+
CommonModule,
|
|
18
|
+
IonicModule,
|
|
19
|
+
FidjModule,
|
|
20
|
+
],
|
|
21
|
+
providers: [
|
|
22
|
+
Profile,
|
|
23
|
+
Storage
|
|
24
|
+
],
|
|
25
|
+
exports: [
|
|
26
|
+
CommonModule,
|
|
27
|
+
BrowserModule,
|
|
28
|
+
BrowserAnimationsModule,
|
|
29
|
+
IonicModule,
|
|
30
|
+
FidjModule,
|
|
31
|
+
NgStyle
|
|
32
|
+
]
|
|
33
|
+
})
|
|
34
|
+
export class SharedModule {
|
|
35
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|