├── .editorconfig
├── README.md
├── config.xml
├── hooks
├── README.md
└── after_prepare
│ └── 010_add_platform_class.js
├── ionic.config.json
├── package-lock.json
├── package.json
├── resources
├── README.md
├── android
│ ├── icon
│ │ ├── drawable-hdpi-icon.png
│ │ ├── drawable-ldpi-icon.png
│ │ ├── drawable-mdpi-icon.png
│ │ ├── drawable-xhdpi-icon.png
│ │ ├── drawable-xxhdpi-icon.png
│ │ └── drawable-xxxhdpi-icon.png
│ └── splash
│ │ ├── drawable-land-hdpi-screen.png
│ │ ├── drawable-land-ldpi-screen.png
│ │ ├── drawable-land-mdpi-screen.png
│ │ ├── drawable-land-xhdpi-screen.png
│ │ ├── drawable-land-xxhdpi-screen.png
│ │ ├── drawable-land-xxxhdpi-screen.png
│ │ ├── drawable-port-hdpi-screen.png
│ │ ├── drawable-port-ldpi-screen.png
│ │ ├── drawable-port-mdpi-screen.png
│ │ ├── drawable-port-xhdpi-screen.png
│ │ ├── drawable-port-xxhdpi-screen.png
│ │ └── drawable-port-xxxhdpi-screen.png
├── icon.png
├── ios
│ ├── icon
│ │ ├── icon-1024.png
│ │ ├── icon-40.png
│ │ ├── icon-40@2x.png
│ │ ├── icon-40@3x.png
│ │ ├── icon-50.png
│ │ ├── icon-50@2x.png
│ │ ├── icon-60.png
│ │ ├── icon-60@2x.png
│ │ ├── icon-60@3x.png
│ │ ├── icon-72.png
│ │ ├── icon-72@2x.png
│ │ ├── icon-76.png
│ │ ├── icon-76@2x.png
│ │ ├── icon-83.5@2x.png
│ │ ├── icon-small.png
│ │ ├── icon-small@2x.png
│ │ ├── icon-small@3x.png
│ │ ├── icon.png
│ │ └── icon@2x.png
│ └── splash
│ │ ├── Default-568h@2x~iphone.png
│ │ ├── Default-667h.png
│ │ ├── Default-736h.png
│ │ ├── Default-Landscape-736h.png
│ │ ├── Default-Landscape@2x~ipad.png
│ │ ├── Default-Landscape@~ipadpro.png
│ │ ├── Default-Landscape~ipad.png
│ │ ├── Default-Portrait@2x~ipad.png
│ │ ├── Default-Portrait@~ipadpro.png
│ │ ├── Default-Portrait~ipad.png
│ │ ├── Default@2x~iphone.png
│ │ ├── Default@2x~universal~anyany.png
│ │ └── Default~iphone.png
└── splash.png
├── src
├── app
│ ├── app.component.ts
│ ├── app.html
│ ├── app.module.ts
│ ├── app.scss
│ └── main.ts
├── assets
│ ├── icon
│ │ └── favicon.ico
│ ├── img
│ │ ├── advance-card-bttf.png
│ │ ├── bjork-live.jpg
│ │ └── marty-avatar.png
│ └── manifest.json
├── config.ts
├── index.html
├── manifest.json
├── pages
│ ├── components
│ │ ├── actionsheet
│ │ │ ├── components.actionsheet.html
│ │ │ └── components.actionsheet.page.ts
│ │ ├── alerts
│ │ │ ├── components.alerts.html
│ │ │ └── components.alerts.page.ts
│ │ ├── badges
│ │ │ ├── components.badges.html
│ │ │ └── components.badges.page.ts
│ │ ├── buttons
│ │ │ ├── components.buttons.html
│ │ │ └── components.buttons.page.ts
│ │ ├── cards
│ │ │ ├── components.cards.html
│ │ │ └── components.cards.page.ts
│ │ ├── checkbox
│ │ │ ├── components.checkbox.html
│ │ │ └── components.checkbox.page.ts
│ │ ├── components.module.ts
│ │ ├── floating-action-buttons
│ │ │ ├── components.floating-action-buttons.html
│ │ │ └── components.floating-action-buttons.page.ts
│ │ ├── gestures
│ │ │ ├── components.gestures.html
│ │ │ └── components.gestures.page.ts
│ │ ├── grid
│ │ │ ├── components.grid.html
│ │ │ └── components.grid.page.ts
│ │ ├── icons
│ │ │ ├── components.icons.html
│ │ │ └── components.icons.page.ts
│ │ ├── inputs
│ │ │ ├── components.inputs-list.html
│ │ │ ├── components.inputs-list.page.ts
│ │ │ ├── fixed-labels
│ │ │ │ ├── components.inputs.fixed-labels.html
│ │ │ │ └── components.inputs.fixed-labels.page.ts
│ │ │ ├── floating-labels
│ │ │ │ ├── components.inputs.floating-labels.html
│ │ │ │ └── components.inputs.floating-labels.page.ts
│ │ │ ├── inline-labels
│ │ │ │ ├── components.inputs.inline-labels.html
│ │ │ │ └── components.inputs.inline-labels.page.ts
│ │ │ ├── inset-labels
│ │ │ │ ├── components.inputs.inset-labels.html
│ │ │ │ └── components.inputs.inset-labels.page.ts
│ │ │ ├── placeholder-labels
│ │ │ │ ├── components.inputs.placeholder-labels.html
│ │ │ │ └── components.inputs.placeholder-labels.page.ts
│ │ │ └── stacked-labels
│ │ │ │ ├── components.inputs.stacked-labels.html
│ │ │ │ └── components.inputs.stacked-labels.page.ts
│ │ └── list
│ │ │ ├── components.list.html
│ │ │ └── components.list.page.ts
│ ├── google-maps
│ │ ├── google-maps.html
│ │ ├── google-maps.module.ts
│ │ ├── google-maps.page.ts
│ │ └── interfaces.ts
│ ├── home
│ │ ├── home-data.ts
│ │ ├── home.html
│ │ ├── home.module.ts
│ │ ├── home.page.ts
│ │ ├── home.scss
│ │ └── models
│ │ │ └── tile.model.ts
│ ├── login
│ │ ├── login.html
│ │ ├── login.module.ts
│ │ ├── login.scss
│ │ └── login.ts
│ ├── signup
│ │ ├── signup.html
│ │ ├── signup.module.ts
│ │ ├── signup.scss
│ │ └── signup.ts
│ ├── slide-box
│ │ ├── slide-box.html
│ │ ├── slide-box.module.ts
│ │ └── slide-box.page.ts
│ └── wordpress
│ │ ├── item
│ │ ├── wordpress.item.html
│ │ └── wordpress.item.page.ts
│ │ ├── list
│ │ ├── wordpress.list.html
│ │ └── wordpress.list.page.ts
│ │ ├── models
│ │ └── post.model.ts
│ │ ├── wordpress.module.ts
│ │ └── wordpress.service.ts
├── pipes
│ ├── pipes.module.ts
│ ├── trim-html.pipe.ts
│ └── truncate.pipe.ts
├── service-worker.js
├── services
│ ├── auth.service.ts
│ ├── call.service.ts
│ ├── email.service.ts
│ ├── in-app-browser.service.ts
│ └── maps.service.ts
└── theme
│ └── variables.scss
├── tsconfig.json
├── tslint.json
└── www
├── assets
├── fonts
│ ├── ionicons.eot
│ ├── ionicons.scss
│ ├── ionicons.svg
│ ├── ionicons.ttf
│ ├── ionicons.woff
│ ├── ionicons.woff2
│ ├── noto-sans-bold.ttf
│ ├── noto-sans-bold.woff
│ ├── noto-sans-regular.ttf
│ ├── noto-sans-regular.woff
│ ├── noto-sans.scss
│ ├── roboto-bold.ttf
│ ├── roboto-bold.woff
│ ├── roboto-bold.woff2
│ ├── roboto-light.ttf
│ ├── roboto-light.woff
│ ├── roboto-light.woff2
│ ├── roboto-medium.ttf
│ ├── roboto-medium.woff
│ ├── roboto-medium.woff2
│ ├── roboto-regular.ttf
│ ├── roboto-regular.woff
│ ├── roboto-regular.woff2
│ └── roboto.scss
├── icon
│ └── favicon.ico
├── img
│ ├── advance-card-bttf.png
│ ├── bjork-live.jpg
│ └── marty-avatar.png
└── manifest.json
├── build
├── 0.js
├── 0.js.map
├── main.css
├── main.css.map
├── main.js
├── main.js.map
├── polyfills.js
├── sw-toolbox.js
├── vendor.js
└── vendor.js.map
├── index.html
├── manifest.json
└── service-worker.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
2 | # editorconfig.org
3 |
4 | root = true
5 |
6 | [*]
7 | indent_style = space
8 | indent_size = 2
9 |
10 | # We recommend you to keep these unchanged
11 | end_of_line = lf
12 | charset = utf-8
13 | trim_trailing_whitespace = true
14 | insert_final_newline = true
15 |
16 | [*.md]
17 | trim_trailing_whitespace = false
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ionic3-firebase-auth
2 | An Ionic 3 application based on the Supermodular2 starter. This project is the source code of the tutorial on "How To Authenticate with Firebase and Ionic 3 - Email/Password and Google Sign-In", originally published at http://appseed.io/blog/how-authenticate-firebase-and-ionic-3-emailpassword-and-google-sign
3 |
Project's Home: https://github.com/appseed-io/supermodular2
4 |
5 |
6 | To find many more features and make the most of Firebase for your Ionic 3 mobile app, check out Ionic 3 Toolkit Firebase .
7 |
8 |
9 | Dependecies, Run and Build
10 | NodeJS
11 |
12 | First, make sure that NodeJS is installed on your computer. If NodeJS is not installed, please install the latest LTS version of NodeJS.
13 | Git
14 |
15 | Git should be installed in your computer. Follow the instructions for your platform to install it:
16 |
17 | https://git-scm.com/downloads
18 |
19 | Sass
20 |
21 | This application uses SASS, a CSS preprocessor. Follow the instructions for your platform to install it:
22 |
23 | http://sass-lang.com/install
24 |
25 | Cordova and Ionic
26 |
27 | This is an Ionic Cordova based application, so Ionic and Cordova CLIs, should be installed on your computer for this application to run.
28 | In order to install Ionic and Cordova CLIs, run the command:
29 |
30 | $ npm install -g cordova ionic
31 |
32 | Run the app
33 |
34 | Use ionic serve -l
to run the app in browser and watch for changes in code
35 |
36 | or
37 |
38 | use ionic serve
to just run the app for a browser preview
39 |
40 | or
41 |
42 | use ionic serve --lab
to run the app in a browser on two platforms at the same time.
43 | Add a platform
44 |
45 | $ ionic platform add < platform>
46 |
47 | Supported Cordova platforms:
48 |
49 | $ ionic platform add ios
50 | $ ionic platform add android
51 |
52 | Build the app
53 |
54 | $ ionic build
55 |
56 | Εmulate the app on simulator
57 |
58 | iOS:
59 |
60 | $ ionic emulate ios
61 |
62 | Android:
63 |
64 | $ ionic emulate android
65 |
66 | Credits
67 |
68 |
69 |
70 |
71 | Third Party Licenses
72 |
73 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | MyApp
4 | An awesome Ionic/Cordova app.
5 | Ionic Framework Team
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/hooks/README.md:
--------------------------------------------------------------------------------
1 |
21 | # Cordova Hooks
22 |
23 | Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. Hook scripts could be defined by adding them to the special predefined folder (`/hooks`) or via configuration files (`config.xml` and `plugin.xml`) and run serially in the following order:
24 | * Application hooks from `/hooks`;
25 | * Application hooks from `config.xml`;
26 | * Plugin hooks from `plugins/.../plugin.xml`.
27 |
28 | __Remember__: Make your scripts executable.
29 |
30 | __Note__: `.cordova/hooks` directory is also supported for backward compatibility, but we don't recommend using it as it is deprecated.
31 |
32 | ## Supported hook types
33 | The following hook types are supported:
34 |
35 | after_build/
36 | after_compile/
37 | after_docs/
38 | after_emulate/
39 | after_platform_add/
40 | after_platform_rm/
41 | after_platform_ls/
42 | after_plugin_add/
43 | after_plugin_ls/
44 | after_plugin_rm/
45 | after_plugin_search/
46 | after_plugin_install/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being installed
47 | after_prepare/
48 | after_run/
49 | after_serve/
50 | before_build/
51 | before_compile/
52 | before_docs/
53 | before_emulate/
54 | before_platform_add/
55 | before_platform_rm/
56 | before_platform_ls/
57 | before_plugin_add/
58 | before_plugin_ls/
59 | before_plugin_rm/
60 | before_plugin_search/
61 | before_plugin_install/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being installed
62 | before_plugin_uninstall/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being uninstalled
63 | before_prepare/
64 | before_run/
65 | before_serve/
66 | pre_package/ <-- Windows 8 and Windows Phone only.
67 |
68 | ## Ways to define hooks
69 | ### Via '/hooks' directory
70 | To execute custom action when corresponding hook type is fired, use hook type as a name for a subfolder inside 'hooks' directory and place you script file here, for example:
71 |
72 | # script file will be automatically executed after each build
73 | hooks/after_build/after_build_custom_action.js
74 |
75 |
76 | ### Config.xml
77 |
78 | Hooks can be defined in project's `config.xml` using `` elements, for example:
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 | ...
89 |
90 |
91 |
92 |
93 |
94 |
95 | ...
96 |
97 |
98 | ### Plugin hooks (plugin.xml)
99 |
100 | As a plugin developer you can define hook scripts using `` elements in a `plugin.xml` like that:
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 | ...
109 |
110 |
111 | `before_plugin_install`, `after_plugin_install`, `before_plugin_uninstall` plugin hooks will be fired exclusively for the plugin being installed/uninstalled.
112 |
113 | ## Script Interface
114 |
115 | ### Javascript
116 |
117 | If you are writing hooks in Javascript you should use the following module definition:
118 | ```javascript
119 | module.exports = function(context) {
120 | ...
121 | }
122 | ```
123 |
124 | You can make your scipts async using Q:
125 | ```javascript
126 | module.exports = function(context) {
127 | var Q = context.requireCordovaModule('q');
128 | var deferral = new Q.defer();
129 |
130 | setTimeout(function(){
131 | console.log('hook.js>> end');
132 | deferral.resolve();
133 | }, 1000);
134 |
135 | return deferral.promise;
136 | }
137 | ```
138 |
139 | `context` object contains hook type, executed script full path, hook options, command-line arguments passed to Cordova and top-level "cordova" object:
140 | ```json
141 | {
142 | "hook": "before_plugin_install",
143 | "scriptLocation": "c:\\script\\full\\path\\appBeforePluginInstall.js",
144 | "cmdLine": "The\\exact\\command\\cordova\\run\\with arguments",
145 | "opts": {
146 | "projectRoot":"C:\\path\\to\\the\\project",
147 | "cordova": {
148 | "platforms": ["wp8"],
149 | "plugins": ["com.plugin.withhooks"],
150 | "version": "0.21.7-dev"
151 | },
152 | "plugin": {
153 | "id": "com.plugin.withhooks",
154 | "pluginInfo": {
155 | ...
156 | },
157 | "platform": "wp8",
158 | "dir": "C:\\path\\to\\the\\project\\plugins\\com.plugin.withhooks"
159 | }
160 | },
161 | "cordova": {...}
162 | }
163 |
164 | ```
165 | `context.opts.plugin` object will only be passed to plugin hooks scripts.
166 |
167 | You can also require additional Cordova modules in your script using `context.requireCordovaModule` in the following way:
168 | ```javascript
169 | var Q = context.requireCordovaModule('q');
170 | ```
171 |
172 | __Note__: new module loader script interface is used for the `.js` files defined via `config.xml` or `plugin.xml` only.
173 | For compatibility reasons hook files specified via `/hooks` folders are run via Node child_process spawn, see 'Non-javascript' section below.
174 |
175 | ### Non-javascript
176 |
177 | Non-javascript scripts are run via Node child_process spawn from the project's root directory and have the root directory passes as the first argument. All other options are passed to the script using environment variables:
178 |
179 | * CORDOVA_VERSION - The version of the Cordova-CLI.
180 | * CORDOVA_PLATFORMS - Comma separated list of platforms that the command applies to (e.g.: android, ios).
181 | * CORDOVA_PLUGINS - Comma separated list of plugin IDs that the command applies to (e.g.: org.apache.cordova.file, org.apache.cordova.file-transfer)
182 | * CORDOVA_HOOK - Path to the hook that is being executed.
183 | * CORDOVA_CMDLINE - The exact command-line arguments passed to cordova (e.g.: cordova run ios --emulate)
184 |
185 | If a script returns a non-zero exit code, then the parent cordova command will be aborted.
186 |
187 | ## Writing hooks
188 |
189 | We highly recommend writing your hooks using Node.js so that they are
190 | cross-platform. Some good examples are shown here:
191 |
192 | [http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/)
193 |
194 | Also, note that even if you are working on Windows, and in case your hook scripts aren't bat files (which is recommended, if you want your scripts to work in non-Windows operating systems) Cordova CLI will expect a shebang line as the first line for it to know the interpreter it needs to use to launch the script. The shebang line should match the following example:
195 |
196 | #!/usr/bin/env [name_of_interpreter_executable]
197 |
--------------------------------------------------------------------------------
/hooks/after_prepare/010_add_platform_class.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | // Add Platform Class
4 | // v1.0
5 | // Automatically adds the platform class to the body tag
6 | // after the `prepare` command. By placing the platform CSS classes
7 | // directly in the HTML built for the platform, it speeds up
8 | // rendering the correct layout/style for the specific platform
9 | // instead of waiting for the JS to figure out the correct classes.
10 |
11 | var fs = require('fs');
12 | var path = require('path');
13 |
14 | var rootdir = process.argv[2];
15 |
16 | function addPlatformBodyTag(indexPath, platform) {
17 | // add the platform class to the body tag
18 | try {
19 | var platformClass = 'platform-' + platform;
20 | var cordovaClass = 'platform-cordova platform-webview';
21 |
22 | var html = fs.readFileSync(indexPath, 'utf8');
23 |
24 | var bodyTag = findBodyTag(html);
25 | if(!bodyTag) return; // no opening body tag, something's wrong
26 |
27 | if(bodyTag.indexOf(platformClass) > -1) return; // already added
28 |
29 | var newBodyTag = bodyTag;
30 |
31 | var classAttr = findClassAttr(bodyTag);
32 | if(classAttr) {
33 | // body tag has existing class attribute, add the classname
34 | var endingQuote = classAttr.substring(classAttr.length-1);
35 | var newClassAttr = classAttr.substring(0, classAttr.length-1);
36 | newClassAttr += ' ' + platformClass + ' ' + cordovaClass + endingQuote;
37 | newBodyTag = bodyTag.replace(classAttr, newClassAttr);
38 |
39 | } else {
40 | // add class attribute to the body tag
41 | newBodyTag = bodyTag.replace('>', ' class="' + platformClass + ' ' + cordovaClass + '">');
42 | }
43 |
44 | html = html.replace(bodyTag, newBodyTag);
45 |
46 | fs.writeFileSync(indexPath, html, 'utf8');
47 |
48 | process.stdout.write('add to body class: ' + platformClass + '\n');
49 | } catch(e) {
50 | process.stdout.write(e);
51 | }
52 | }
53 |
54 | function findBodyTag(html) {
55 | // get the body tag
56 | try{
57 | return html.match(/])(.*?)>/gi)[0];
58 | }catch(e){}
59 | }
60 |
61 | function findClassAttr(bodyTag) {
62 | // get the body tag's class attribute
63 | try{
64 | return bodyTag.match(/ class=["|'](.*?)["|']/gi)[0];
65 | }catch(e){}
66 | }
67 |
68 | if (rootdir) {
69 |
70 | // go through each of the platform directories that have been prepared
71 | var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
72 |
73 | for(var x=0; x {
48 | this.statusBar.styleDefault();
49 | });
50 |
51 | this.auth.afAuth.authState
52 | .subscribe(
53 | user => {
54 | if (user) {
55 | this.rootPage = HomePage;
56 | } else {
57 | this.rootPage = LoginPage;
58 | }
59 | },
60 | () => {
61 | this.rootPage = LoginPage;
62 | }
63 | );
64 | }
65 |
66 | login() {
67 | this.menu.close();
68 | this.auth.signOut();
69 | this.nav.setRoot(LoginPage);
70 | }
71 |
72 | logout() {
73 | this.menu.close();
74 | this.auth.signOut();
75 | this.nav.setRoot(HomePage);
76 | }
77 |
78 | openPage(page) {
79 | this.menu.close();
80 | this.nav.setRoot(page.component);
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/src/app/app.html:
--------------------------------------------------------------------------------
1 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { AgmCoreModule } from '@agm/core';
2 | import { ErrorHandler, NgModule } from '@angular/core';
3 | import { HttpModule } from '@angular/http';
4 | import { NgxErrorsModule } from '@ultimate/ngxerrors';
5 | import { BrowserModule } from '@angular/platform-browser';
6 | import { StatusBar } from '@ionic-native/status-bar';
7 | import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
8 | import { Config } from '../config';
9 |
10 | import { ComponentsModule } from '../pages/components/components.module';
11 | import { GoogleMapsModule } from '../pages/google-maps/google-maps.module';
12 | import { HomeModule } from '../pages/home/home.module';
13 | import { SlideBoxModule } from '../pages/slide-box/slide-box.module';
14 | import { WordpressModule } from '../pages/wordpress/wordpress.module';
15 | import { MyApp } from './app.component';
16 | import { AngularFireModule } from 'angularfire2';
17 | import { AngularFireAuth } from 'angularfire2/auth';
18 | import { firebaseConfig } from '../config';
19 | import { LoginPage } from '../pages/login/login';
20 | import { AuthService } from '../services/auth.service';
21 | import { SignupPage } from '../pages/signup/signup';
22 |
23 | @NgModule({
24 | declarations: [
25 | MyApp,
26 | LoginPage,
27 | SignupPage
28 | ],
29 | imports: [
30 | BrowserModule,
31 | HttpModule,
32 | IonicModule.forRoot(MyApp),
33 | AgmCoreModule.forRoot(),
34 |
35 | AngularFireModule.initializeApp(firebaseConfig.fire),
36 |
37 | ComponentsModule,
38 | NgxErrorsModule,
39 | GoogleMapsModule,
40 | HomeModule,
41 | SlideBoxModule,
42 | WordpressModule
43 | ],
44 | bootstrap: [IonicApp],
45 | entryComponents: [
46 | MyApp,
47 | LoginPage,
48 | SignupPage
49 | ],
50 | providers: [
51 | Config,
52 | StatusBar,
53 | {provide: ErrorHandler, useClass: IonicErrorHandler},
54 | AngularFireAuth,
55 | AuthService
56 | ]
57 | })
58 | export class AppModule {
59 | }
60 |
--------------------------------------------------------------------------------
/src/app/app.scss:
--------------------------------------------------------------------------------
1 | // http://ionicframework.com/docs/v2/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 element in the app.
17 |
18 | @media (min-width: 768px) {
19 | .ion-page {
20 | margin-left: 30%;
21 | width: 70%;
22 | }
23 |
24 | ion-menu {
25 | width: 30%;
26 | display: block;
27 | }
28 |
29 | .bar-button-menutoggle {
30 | display: none;
31 | }
32 |
33 | ion-menu ion-backdrop {
34 | display: none;
35 | }
36 |
37 | ion-content {
38 | border-left: none;
39 | }
40 |
41 | ion-menu[type=overlay] .menu-inner {
42 | -webkit-transform: translateX(0px) !important;
43 | transform: translateX(0px) !important;
44 | box-shadow: none;
45 | width: 100%;
46 | }
47 | }
48 |
49 | /*
50 | * Components Cards page style
51 | */
52 | .card-background-page {
53 | ion-card {
54 | position: relative;
55 | text-align: center;
56 | }
57 |
58 | .card-title {
59 | position: absolute;
60 | top: 36%;
61 | font-size: 2.0em;
62 | width: 100%;
63 | font-weight: bold;
64 | color: #fff;
65 | }
66 |
67 | .card-subtitle {
68 | font-size: 1.0em;
69 | position: absolute;
70 | top: 52%;
71 | width: 100%;
72 | color: #fff;
73 | }
74 | }
75 |
76 | h1.as-header-icon {
77 | text-align: center;
78 | }
79 |
80 | h1.as-header-icon ion-icon{
81 | font-size: 6em;
82 | }
83 |
84 | /*
85 | * Components Grid page style
86 | */
87 | .grid-page {
88 | ion-col div {
89 | background-color: #F9FAFB;
90 | padding: 5px;
91 | border: 1px solid #ddd;
92 | border-radius: 2px;
93 | text-align: center;
94 | }
95 | }
96 |
97 | /*
98 | * Components Icons page style
99 | */
100 | .icons-page {
101 | ion-icon {
102 | font-size: 50px;
103 | }
104 |
105 | ion-row {
106 | height: 100%;
107 | flex-wrap: wrap;
108 | }
109 |
110 | ion-col {
111 | flex: 0 0 25%;
112 | max-width: 25%;
113 | text-align: center;
114 | padding: 10px 5px;
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/src/app/main.ts:
--------------------------------------------------------------------------------
1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2 |
3 | import 'rxjs/add/operator/map';
4 |
5 | import { AppModule } from './app.module';
6 |
7 | platformBrowserDynamic().bootstrapModule(AppModule);
8 |
--------------------------------------------------------------------------------
/src/assets/icon/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/src/assets/icon/favicon.ico
--------------------------------------------------------------------------------
/src/assets/img/advance-card-bttf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/src/assets/img/advance-card-bttf.png
--------------------------------------------------------------------------------
/src/assets/img/bjork-live.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/src/assets/img/bjork-live.jpg
--------------------------------------------------------------------------------
/src/assets/img/marty-avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/src/assets/img/marty-avatar.png
--------------------------------------------------------------------------------
/src/assets/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Ionic",
3 | "short_name": "Ionic",
4 | "start_url": "index.html",
5 | "display": "standalone",
6 | "icons": [{
7 | "src": "assets/imgs/logo.png",
8 | "sizes": "512x512",
9 | "type": "image/png"
10 | }],
11 | "background_color": "#4e8ef7",
12 | "theme_color": "#4e8ef7"
13 | }
--------------------------------------------------------------------------------
/src/config.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | @Injectable()
4 | export class Config {
5 | public wordpressApiUrl = 'http://demo.titaniumtemplates.com/wordpress/?json=1';
6 | }
7 |
8 | export const firebaseConfig = {
9 | fire: {
10 | apiKey: "AIzaSyDW6woVw3gDQVvKtreZ4g9igRW92knq4Sg",
11 | authDomain: "supermodular-c9b81.firebaseapp.com",
12 | databaseURL: "https://supermodular-c9b81.firebaseio.com",
13 | projectId: "supermodular-c9b81",
14 | storageBucket: "supermodular-c9b81.appspot.com",
15 | messagingSenderId: "374150420031"
16 | }
17 | };
18 |
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Ionic App
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/src/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Ionic",
3 | "short_name": "Ionic",
4 | "start_url": "index.html",
5 | "display": "standalone",
6 | "icons": [{
7 | "src": "assets/imgs/logo.png",
8 | "sizes": "512x512",
9 | "type": "image/png"
10 | }],
11 | "background_color": "#4e8ef7",
12 | "theme_color": "#4e8ef7"
13 | }
--------------------------------------------------------------------------------
/src/pages/components/actionsheet/components.actionsheet.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Action Sheet
4 |
5 |
6 |
7 |
8 |
9 | Show Action Sheet
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/pages/components/actionsheet/components.actionsheet.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { Platform, ActionSheetController } from 'ionic-angular';
3 |
4 | @Component({
5 | templateUrl: 'components.actionsheet.html'
6 | })
7 |
8 | export class ComponentsActionSheetPage {
9 | constructor(
10 | public platform: Platform,
11 | public actionsheetCtrl: ActionSheetController
12 | ) {
13 | }
14 |
15 | openActionSheet() {
16 | let actionSheet = this.actionsheetCtrl.create({
17 | title: 'Select an action',
18 | buttons: [
19 | {
20 | text: 'Delete',
21 | role: 'destructive',
22 | icon: !this.platform.is('ios') ? 'trash' : null,
23 | handler: () => {
24 | console.log('Delete clicked');
25 | }
26 | },
27 | {
28 | text: 'Share',
29 | icon: !this.platform.is('ios') ? 'share' : null,
30 | handler: () => {
31 | console.log('Share clicked');
32 | }
33 | },
34 | {
35 | text: 'Play',
36 | icon: !this.platform.is('ios') ? 'arrow-dropright-circle' : null,
37 | handler: () => {
38 | console.log('Play clicked');
39 | }
40 | },
41 | {
42 | text: 'Favorite',
43 | icon: !this.platform.is('ios') ? 'heart-outline' : null,
44 | handler: () => {
45 | console.log('Favorite clicked');
46 | }
47 | },
48 | {
49 | text: 'Cancel',
50 | role: 'cancel', // will always sort to be on the bottom
51 | icon: !this.platform.is('ios') ? 'close' : null,
52 | handler: () => {
53 | console.log('Cancel clicked');
54 | }
55 | }
56 | ]
57 | });
58 | actionSheet.present();
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/pages/components/alerts/components.alerts.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Alerts
4 |
5 |
6 |
7 |
8 |
9 | Show Basic Alert
10 |
11 |
12 | Show Prompt Alert
13 |
14 |
15 | Show Confirmation Alert
16 |
17 |
18 | Show Radio Alert
19 |
20 |
21 | Show Checkbox Alert
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/pages/components/alerts/components.alerts.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { AlertController } from 'ionic-angular';
3 |
4 | @Component({
5 | templateUrl: 'components.alerts.html'
6 | })
7 | export class ComponentsAlertsPage {
8 | testRadioOpen: boolean;
9 | testRadioResult;
10 | testCheckboxOpen: boolean;
11 | testCheckboxResult;
12 |
13 | constructor(
14 | public alertCtrl: AlertController
15 | ) {
16 | }
17 |
18 | doAlert() {
19 | let alert = this.alertCtrl.create({
20 | title: 'Alert!',
21 | message: 'This is some important information!',
22 | buttons: ['Ok']
23 | });
24 | alert.present();
25 | }
26 |
27 | doPrompt() {
28 | let prompt = this.alertCtrl.create({
29 | title: 'Password',
30 | message: 'Enter your password to login',
31 | inputs: [
32 | {
33 | name: 'password',
34 | placeholder: 'Password'
35 | },
36 | ],
37 | buttons: [
38 | {
39 | text: 'Cancel',
40 | handler: data => {
41 | console.log('Cancel clicked');
42 | }
43 | },
44 | {
45 | text: 'Login',
46 | handler: data => {
47 | console.log('Login clicked');
48 | }
49 | }
50 | ]
51 | });
52 | prompt.present();
53 | }
54 |
55 | doConfirmation() {
56 | let confirmation = this.alertCtrl.create({
57 | title: 'Confirmation',
58 | message: 'Are you sure you want to delete this item?',
59 | buttons: [
60 | {
61 | text: 'No',
62 | handler: () => {
63 | console.log('No clicked');
64 | }
65 | },
66 | {
67 | text: 'Yes',
68 | handler: () => {
69 | console.log('Yes clicked');
70 | }
71 | }
72 | ]
73 | });
74 | confirmation.present();
75 | }
76 |
77 | doRadioAlert() {
78 | let radioAlert = this.alertCtrl.create();
79 | radioAlert.setTitle('Select color');
80 |
81 | radioAlert.addInput({
82 | type: 'radio',
83 | label: 'Blue',
84 | value: 'blue',
85 | checked: true
86 | });
87 |
88 | radioAlert.addInput({
89 | type: 'radio',
90 | label: 'Green',
91 | value: 'green'
92 | });
93 |
94 | radioAlert.addInput({
95 | type: 'radio',
96 | label: 'Red',
97 | value: 'red'
98 | });
99 |
100 | radioAlert.addInput({
101 | type: 'radio',
102 | label: 'Yellow',
103 | value: 'yellow'
104 | });
105 |
106 | radioAlert.addInput({
107 | type: 'radio',
108 | label: 'Purple',
109 | value: 'purple'
110 | });
111 |
112 | radioAlert.addInput({
113 | type: 'radio',
114 | label: 'White',
115 | value: 'white'
116 | });
117 |
118 | radioAlert.addInput({
119 | type: 'radio',
120 | label: 'Black',
121 | value: 'black'
122 | });
123 |
124 | radioAlert.addButton('Cancel');
125 | radioAlert.addButton({
126 | text: 'Ok',
127 | handler: data => {
128 | console.log('Radio data:', data);
129 | this.testRadioOpen = false;
130 | this.testRadioResult = data;
131 | }
132 | });
133 |
134 | radioAlert.present().then(() => {
135 | this.testRadioOpen = true;
136 | });
137 | }
138 |
139 | doCheckboxAlert() {
140 | let checkboxAlert = this.alertCtrl.create();
141 | checkboxAlert.setTitle('Which fruits you like?');
142 |
143 | checkboxAlert.addInput({
144 | type: 'checkbox',
145 | label: 'Apple',
146 | value: 'apple',
147 | checked: true
148 | });
149 |
150 | checkboxAlert.addInput({
151 | type: 'checkbox',
152 | label: 'Banana',
153 | value: 'banana'
154 | });
155 |
156 | checkboxAlert.addInput({
157 | type: 'checkbox',
158 | label: 'Kiwi',
159 | value: 'kiwi'
160 | });
161 |
162 | checkboxAlert.addInput({
163 | type: 'checkbox',
164 | label: 'Strawberry',
165 | value: 'strawberry'
166 | });
167 |
168 | checkboxAlert.addInput({
169 | type: 'checkbox',
170 | label: 'Pineapple',
171 | value: 'pineapple'
172 | });
173 |
174 | checkboxAlert.addButton('Cancel');
175 | checkboxAlert.addButton({
176 | text: 'Okay',
177 | handler: data => {
178 | console.log('Checkbox data:', data);
179 | this.testCheckboxOpen = false;
180 | this.testCheckboxResult = data;
181 | }
182 | });
183 | checkboxAlert.present().then(() => {
184 | this.testCheckboxOpen = true;
185 | });
186 | }
187 | }
188 |
--------------------------------------------------------------------------------
/src/pages/components/badges/components.badges.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Badges
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | Björk
16 |
17 |
18 | Björk first came to prominence as one of the lead vocalists of the avant pop Icelandic sextet the
19 | Sugarcubes, but when...
20 |
21 |
22 |
23 |
24 |
25 | Albums
26 | 9
27 |
28 |
29 |
30 |
31 | Followers
32 | 260k
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/pages/components/badges/components.badges.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | templateUrl: 'components.badges.html'
5 | })
6 |
7 | export class ComponentsBadgesPage {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/pages/components/buttons/components.buttons.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Buttons
4 |
5 |
6 |
7 |
8 |
9 | Light
10 |
11 |
12 | Default
13 |
14 |
15 | Secondary
16 |
17 |
18 | Danger
19 |
20 |
21 | Dark
22 |
23 |
24 | Light
25 |
26 |
27 | Default
28 |
29 |
30 | Secondary
31 |
32 |
33 | Danger
34 |
35 |
36 | Dark
37 |
38 |
39 | Light
40 |
41 |
42 | Default
43 |
44 |
45 | Secondary
46 |
47 |
48 | Danger
49 |
50 |
51 | Dark
52 |
53 |
54 | Light
55 |
56 |
57 | Default
58 |
59 |
60 | Secondary
61 |
62 |
63 | Danger
64 |
65 |
66 | Dark
67 |
68 |
69 | Light
70 |
71 |
72 | Default
73 |
74 |
75 | Secondary
76 |
77 |
78 | Danger
79 |
80 |
81 | Dark
82 |
83 |
84 | Light
85 |
86 |
87 | Default
88 |
89 |
90 | Secondary
91 |
92 |
93 | Danger
94 |
95 |
96 | Dark
97 |
98 |
99 | Light Small
100 |
101 |
102 | Default Small
103 |
104 |
105 | Secondary Medium
106 |
107 |
108 | Danger Medium
109 |
110 |
111 | Dark Large
112 |
113 |
114 |
115 |
116 | Tools
117 |
118 |
119 |
120 |
121 |
122 |
123 |
--------------------------------------------------------------------------------
/src/pages/components/buttons/components.buttons.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | templateUrl: 'components.buttons.html'
5 | })
6 |
7 | export class ComponentsButtonsPage {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/pages/components/cards/components.cards.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Cards
4 |
5 |
6 |
7 |
8 |
9 |
10 | This is just your basic card with some text to boot.
11 |
12 |
13 |
14 |
15 |
16 | Header
17 |
18 |
19 | This is a card with some text and a header.
20 |
21 |
22 |
23 |
24 |
25 | List In Card
26 |
27 |
28 |
29 |
30 |
31 | Shopping
32 |
33 |
34 |
35 |
36 | Hospital
37 |
38 |
39 |
40 |
41 | Cafe
42 |
43 |
44 |
45 |
46 | Dog Park
47 |
48 |
49 |
50 |
51 | Pub
52 |
53 |
54 |
55 |
56 | Space
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | Björk
66 |
67 |
68 | Björk first came to prominence as one of the lead vocalists of the avant pop Icelandic sextet the
69 | Sugarcubes, but when...
70 |
71 |
72 |
73 |
74 |
75 |
76 | Favorite
77 |
78 |
79 |
80 |
81 |
82 | Listen
83 |
84 |
85 |
86 |
87 |
88 | Share
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | Björk
97 | 9 Albums
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 | Marty McFly
106 | November 5, 1955
107 |
108 |
109 |
110 |
111 |
112 | Wait a minute. Wait a minute, Doc. Uhhh... Are you telling me that you built a time machine... out of a
113 | DeLorean?! Whoa. This is heavy.
114 |
115 |
116 |
117 |
118 |
119 |
120 | 12 Likes
121 |
122 |
123 |
124 |
125 |
126 | 4 Comments
127 |
128 |
129 |
130 |
131 | 11h ago
132 |
133 |
134 |
135 |
136 |
137 |
--------------------------------------------------------------------------------
/src/pages/components/cards/components.cards.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | templateUrl: 'components.cards.html'
5 | })
6 |
7 | export class ComponentsCardsPage {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/pages/components/checkbox/components.checkbox.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Checkbox
4 |
5 |
6 |
7 |
8 |
9 |
10 | Items List
11 |
12 |
13 |
14 | Item 1
15 |
16 |
17 |
18 |
19 | Item 2
20 |
21 |
22 |
23 |
24 | Item 3
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/pages/components/checkbox/components.checkbox.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | templateUrl: 'components.checkbox.html'
5 | })
6 |
7 | export class ComponentsCheckboxPage {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/pages/components/components.module.ts:
--------------------------------------------------------------------------------
1 | import { IonicModule } from 'ionic-angular';
2 | import { NgModule } from '@angular/core';
3 | import { ComponentsInputsStackedLabelsPage } from './inputs/stacked-labels/components.inputs.stacked-labels.page';
4 | import { ComponentsInputsPlaceholderLabelsPage } from './inputs/placeholder-labels/components.inputs.placeholder-labels.page';
5 | import { ComponentsInputsInsetLabelsPage } from './inputs/inset-labels/components.inputs.inset-labels.page';
6 | import { ComponentsInputsInlineLabelsPage } from './inputs/inline-labels/components.inputs.inline-labels.page';
7 | import { ComponentsInputsFloatingLabelsPage } from './inputs/floating-labels/components.inputs.floating-labels.page';
8 | import { ComponentsInputsFixedLabelsPage } from './inputs/fixed-labels/components.inputs.fixed-labels.page';
9 | import { ComponentsInputsListPage } from './inputs/components.inputs-list.page';
10 | import { ComponentsIconsPage } from './icons/components.icons.page';
11 | import { ComponentsGridPage } from './grid/components.grid.page';
12 | import { ComponentsGesturesPage } from './gestures/components.gestures.page';
13 | import { ComponentsFloatingActionButtonsPage } from './floating-action-buttons/components.floating-action-buttons.page';
14 | import { ComponentsCheckboxPage } from './checkbox/components.checkbox.page';
15 | import { ComponentsCardsPage } from './cards/components.cards.page';
16 | import { ComponentsButtonsPage } from './buttons/components.buttons.page';
17 | import { ComponentsBadgesPage } from './badges/components.badges.page';
18 | import { ComponentsAlertsPage } from './alerts/components.alerts.page';
19 | import { ComponentsActionSheetPage } from './actionsheet/components.actionsheet.page';
20 | import { ComponentsListPage } from './list/components.list.page';
21 |
22 | @NgModule({
23 | imports: [IonicModule],
24 | declarations: [
25 | ComponentsListPage,
26 | ComponentsActionSheetPage,
27 | ComponentsAlertsPage,
28 | ComponentsBadgesPage,
29 | ComponentsButtonsPage,
30 | ComponentsCardsPage,
31 | ComponentsCheckboxPage,
32 | ComponentsFloatingActionButtonsPage,
33 | ComponentsGesturesPage,
34 | ComponentsGridPage,
35 | ComponentsIconsPage,
36 | ComponentsInputsListPage,
37 | ComponentsInputsFixedLabelsPage,
38 | ComponentsInputsFloatingLabelsPage,
39 | ComponentsInputsInlineLabelsPage,
40 | ComponentsInputsInsetLabelsPage,
41 | ComponentsInputsPlaceholderLabelsPage,
42 | ComponentsInputsStackedLabelsPage
43 | ],
44 | entryComponents: [
45 | ComponentsListPage,
46 | ComponentsActionSheetPage,
47 | ComponentsAlertsPage,
48 | ComponentsBadgesPage,
49 | ComponentsButtonsPage,
50 | ComponentsCardsPage,
51 | ComponentsCheckboxPage,
52 | ComponentsFloatingActionButtonsPage,
53 | ComponentsGesturesPage,
54 | ComponentsGridPage,
55 | ComponentsIconsPage,
56 | ComponentsInputsListPage,
57 | ComponentsInputsFixedLabelsPage,
58 | ComponentsInputsFloatingLabelsPage,
59 | ComponentsInputsInlineLabelsPage,
60 | ComponentsInputsInsetLabelsPage,
61 | ComponentsInputsPlaceholderLabelsPage,
62 | ComponentsInputsStackedLabelsPage
63 | ]
64 | })
65 | export class ComponentsModule {
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/src/pages/components/floating-action-buttons/components.floating-action-buttons.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | FABs
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
--------------------------------------------------------------------------------
/src/pages/components/floating-action-buttons/components.floating-action-buttons.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | templateUrl: 'components.floating-action-buttons.html'
5 | })
6 |
7 | export class ComponentsFloatingActionButtonsPage {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/pages/components/gestures/components.gestures.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Gestures
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Tapped: {{tap}} times
12 |
13 |
14 |
15 |
16 |
17 | Pressed: {{press}} times
18 |
19 |
20 |
21 |
22 |
23 | Panned: {{pan}} times
24 |
25 |
26 |
27 |
28 |
29 | Swiped: {{swipe}} times
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/pages/components/gestures/components.gestures.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 |
4 | @Component({
5 | templateUrl: 'components.gestures.html'
6 | })
7 | export class ComponentsGesturesPage {
8 |
9 | public press: number = 0;
10 | public pan: number = 0;
11 | public swipe: number = 0;
12 | public tap: number = 0;
13 |
14 | pressEvent(e) {
15 | this.press++;
16 | }
17 |
18 | panEvent(e) {
19 | this.pan++;
20 | }
21 |
22 | swipeEvent(e) {
23 | this.swipe++;
24 | }
25 |
26 | tapEvent(e) {
27 | this.tap++;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/pages/components/grid/components.grid.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Grid
4 |
5 |
6 |
7 |
8 |
9 |
10 | col
11 |
12 |
13 | col
14 |
15 |
16 | col
17 |
18 |
19 |
20 | col
21 | 3 lines
22 | of text
23 |
24 |
25 |
26 |
27 |
28 |
29 | col
30 |
31 |
32 | col
33 |
34 |
35 | col
36 |
37 |
38 |
39 | col
40 | 3 lines
41 | center
42 |
43 |
44 |
45 |
46 |
47 |
48 | col
49 |
50 |
51 | col
52 |
53 |
54 |
55 | col
56 | 3 lines
57 | center
58 |
59 |
60 |
61 |
62 |
63 |
64 | col
65 |
66 |
67 |
68 | col
69 | 3 lines
70 | baseline
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | col
79 | 2 lines
80 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/src/pages/components/grid/components.grid.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 |
4 | @Component({
5 | templateUrl: 'components.grid.html'
6 | })
7 | export class ComponentsGridPage {
8 | }
9 |
--------------------------------------------------------------------------------
/src/pages/components/icons/components.icons.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Icons
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
--------------------------------------------------------------------------------
/src/pages/components/icons/components.icons.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 |
4 | @Component({
5 | templateUrl: 'components.icons.html'
6 | })
7 | export class ComponentsIconsPage {
8 | }
9 |
--------------------------------------------------------------------------------
/src/pages/components/inputs/components.inputs-list.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Inputs
4 |
5 |
6 |
7 |
8 |
9 |
10 | Fixed Labels
11 |
12 |
13 | Floating Labels
14 |
15 |
16 | Inline Labels
17 |
18 |
19 | Inset Labels
20 |
21 |
22 | Placeholder Labels
23 |
24 |
25 | Stacked Labels
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/pages/components/inputs/components.inputs-list.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { NavController } from 'ionic-angular';
3 | import { ComponentsInputsFixedLabelsPage } from './fixed-labels/components.inputs.fixed-labels.page';
4 | import { ComponentsInputsFloatingLabelsPage } from './floating-labels/components.inputs.floating-labels.page';
5 | import { ComponentsInputsInlineLabelsPage } from './inline-labels/components.inputs.inline-labels.page';
6 | import { ComponentsInputsInsetLabelsPage } from './inset-labels/components.inputs.inset-labels.page';
7 | import { ComponentsInputsPlaceholderLabelsPage } from './placeholder-labels/components.inputs.placeholder-labels.page';
8 | import { ComponentsInputsStackedLabelsPage } from './stacked-labels/components.inputs.stacked-labels.page';
9 |
10 | @Component({
11 | templateUrl: 'components.inputs-list.html'
12 | })
13 | export class ComponentsInputsListPage {
14 | constructor(
15 | private navCtrl: NavController
16 | ) {
17 | }
18 |
19 | public fixedLabelsTapped() {
20 | this.navCtrl.push(ComponentsInputsFixedLabelsPage);
21 | }
22 |
23 | public floatingLabelsTapped() {
24 | this.navCtrl.push(ComponentsInputsFloatingLabelsPage);
25 | }
26 |
27 | public inlineLabelsTapped() {
28 | this.navCtrl.push(ComponentsInputsInlineLabelsPage);
29 | }
30 |
31 | public insetLabelsTapped() {
32 | this.navCtrl.push(ComponentsInputsInsetLabelsPage);
33 | }
34 |
35 | public placeholderLabelsTapped() {
36 | this.navCtrl.push(ComponentsInputsPlaceholderLabelsPage);
37 | }
38 |
39 | public stackedLabelsTapped() {
40 | this.navCtrl.push(ComponentsInputsStackedLabelsPage);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/pages/components/inputs/fixed-labels/components.inputs.fixed-labels.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Fixed Labels
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Username
13 |
14 |
15 |
16 |
17 | Password
18 |
19 |
20 |
21 |
22 |
23 |
24 | Sign In
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/pages/components/inputs/fixed-labels/components.inputs.fixed-labels.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | templateUrl: 'components.inputs.fixed-labels.html'
5 | })
6 |
7 | export class ComponentsInputsFixedLabelsPage {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/pages/components/inputs/floating-labels/components.inputs.floating-labels.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Floating Labels
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Username
13 |
14 |
15 |
16 |
17 | Password
18 |
19 |
20 |
21 |
22 |
23 |
24 | Sign In
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/pages/components/inputs/floating-labels/components.inputs.floating-labels.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 |
4 | @Component({
5 | templateUrl: 'components.inputs.floating-labels.html'
6 | })
7 | export class ComponentsInputsFloatingLabelsPage {
8 | }
9 |
--------------------------------------------------------------------------------
/src/pages/components/inputs/inline-labels/components.inputs.inline-labels.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Inline Labels
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Username
13 |
14 |
15 |
16 |
17 | Password
18 |
19 |
20 |
21 |
22 |
23 |
24 | Sign In
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/pages/components/inputs/inline-labels/components.inputs.inline-labels.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 |
4 | @Component({
5 | templateUrl: 'components.inputs.inline-labels.html'
6 | })
7 | export class ComponentsInputsInlineLabelsPage {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/pages/components/inputs/inset-labels/components.inputs.inset-labels.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Inset Labels
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Username
12 |
13 |
14 |
15 |
16 | Password
17 |
18 |
19 |
20 |
21 |
22 |
23 | Sign In
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/pages/components/inputs/inset-labels/components.inputs.inset-labels.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 |
4 | @Component({
5 | templateUrl: 'components.inputs.inset-labels.html'
6 | })
7 | export class ComponentsInputsInsetLabelsPage {
8 | }
9 |
--------------------------------------------------------------------------------
/src/pages/components/inputs/placeholder-labels/components.inputs.placeholder-labels.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Placeholder Labels
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | Sign In
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/pages/components/inputs/placeholder-labels/components.inputs.placeholder-labels.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 |
4 | @Component({
5 | templateUrl: 'components.inputs.placeholder-labels.html'
6 | })
7 | export class ComponentsInputsPlaceholderLabelsPage {
8 | }
9 |
--------------------------------------------------------------------------------
/src/pages/components/inputs/stacked-labels/components.inputs.stacked-labels.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Stacked Labels
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Username
12 |
13 |
14 |
15 |
16 | Password
17 |
18 |
19 |
20 |
21 |
22 |
23 | Sign In
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/pages/components/inputs/stacked-labels/components.inputs.stacked-labels.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 |
4 | @Component({
5 | templateUrl: 'components.inputs.stacked-labels.html'
6 | })
7 | export class ComponentsInputsStackedLabelsPage {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/pages/components/list/components.list.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Components
7 |
8 |
9 |
10 |
11 |
12 |
13 | Action Sheet
14 |
15 |
16 | Alerts
17 |
18 |
19 | Badges
20 |
21 |
22 | Buttons
23 |
24 |
25 | Cards
26 |
27 |
28 | Checkbox
29 |
30 |
31 | Floating Action Buttons
32 |
33 |
34 | Gestures
35 |
36 |
37 | Grid
38 |
39 |
40 | Icons
41 |
42 |
43 | Inputs
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/src/pages/components/list/components.list.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { NavController } from 'ionic-angular';
3 | import { ComponentsActionSheetPage } from '../actionsheet/components.actionsheet.page';
4 | import { ComponentsAlertsPage } from '../alerts/components.alerts.page';
5 | import { ComponentsBadgesPage } from '../badges/components.badges.page';
6 | import { ComponentsButtonsPage } from '../buttons/components.buttons.page';
7 | import { ComponentsCardsPage } from '../cards/components.cards.page';
8 | import { ComponentsCheckboxPage } from '../checkbox/components.checkbox.page';
9 | import { ComponentsFloatingActionButtonsPage } from '../floating-action-buttons/components.floating-action-buttons.page';
10 | import { ComponentsGesturesPage } from '../gestures/components.gestures.page';
11 | import { ComponentsGridPage } from '../grid/components.grid.page';
12 | import { ComponentsIconsPage } from '../icons/components.icons.page';
13 | import { ComponentsInputsListPage } from '../inputs/components.inputs-list.page';
14 |
15 | @Component({
16 | templateUrl: 'components.list.html'
17 | })
18 | export class ComponentsListPage {
19 | constructor(
20 | private navCtrl: NavController
21 | ) {
22 | }
23 |
24 | public actionsheetTapped() {
25 | this.navCtrl.push(ComponentsActionSheetPage);
26 | }
27 |
28 | public alertsTapped() {
29 | this.navCtrl.push(ComponentsAlertsPage);
30 | }
31 |
32 | public badgesTapped() {
33 | this.navCtrl.push(ComponentsBadgesPage);
34 | }
35 |
36 | public buttonsTapped() {
37 | this.navCtrl.push(ComponentsButtonsPage);
38 | }
39 |
40 | public cardsTapped() {
41 | this.navCtrl.push(ComponentsCardsPage);
42 | }
43 |
44 | public checkboxTapped() {
45 | this.navCtrl.push(ComponentsCheckboxPage);
46 | }
47 |
48 | public floatingActionButtonsTapped() {
49 | this.navCtrl.push(ComponentsFloatingActionButtonsPage);
50 | }
51 |
52 | public gesturesTapped() {
53 | this.navCtrl.push(ComponentsGesturesPage);
54 | }
55 |
56 | public gridTapped() {
57 | this.navCtrl.push(ComponentsGridPage);
58 | }
59 |
60 | public iconsTapped() {
61 | this.navCtrl.push(ComponentsIconsPage);
62 | }
63 |
64 | public inputsTapped() {
65 | this.navCtrl.push(ComponentsInputsListPage);
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/pages/google-maps/google-maps.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Google maps
7 |
8 |
9 |
10 |
11 |
15 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/pages/google-maps/google-maps.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicModule } from 'ionic-angular';
3 |
4 | import { GoogleMapsPage } from './google-maps.page';
5 | import { AgmCoreModule } from '@agm/core';
6 |
7 | @NgModule({
8 | declarations: [GoogleMapsPage],
9 | entryComponents: [GoogleMapsPage],
10 | imports: [IonicModule, AgmCoreModule]
11 | })
12 | export class GoogleMapsModule {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/pages/google-maps/google-maps.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | import { IMarker, IPoint } from './interfaces';
4 |
5 | @Component({
6 | templateUrl: 'google-maps.html'
7 | })
8 | export class GoogleMapsPage {
9 | public markers: IMarker[];
10 | public origin: IPoint;
11 | public zoom: number;
12 |
13 | constructor() {
14 | this.initMarkers();
15 | this.origin = {
16 | lat: 51.673858,
17 | lng: 7.815982
18 | };
19 | this.zoom = 8;
20 | }
21 |
22 | public clickedMarker(label: string) {
23 | window.alert(`clicked the marker: ${label || ''}`);
24 | }
25 |
26 | private initMarkers(): void {
27 | this.markers = [{
28 | lat: 51.673858,
29 | lng: 7.815982,
30 | label: 'A'
31 | }, {
32 | lat: 51.373858,
33 | lng: 7.215982,
34 | label: 'B'
35 | }, {
36 | lat: 51.723858,
37 | lng: 7.895982,
38 | label: 'C'
39 | }];
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/pages/google-maps/interfaces.ts:
--------------------------------------------------------------------------------
1 | export interface IPoint {
2 | lat: number;
3 | lng: number;
4 | }
5 |
6 | export interface IMarker extends IPoint {
7 | label?: string;
8 | }
--------------------------------------------------------------------------------
/src/pages/home/home-data.ts:
--------------------------------------------------------------------------------
1 | export const data = {
2 | facebook: 'https://www.facebook.com/ionicframework',
3 | phoneNumber: '+306973216110',
4 | email: {
5 | to: 'skounis@gmail.com',
6 | subject: 'Cordova Icons',
7 | body: 'How are you? Nice greetings from Leipzig'
8 | },
9 | officeLocation: '37.7736854,-122.421034'
10 | };
--------------------------------------------------------------------------------
/src/pages/home/home.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Supermodular 2
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
ABC Corp Inc.
16 | 50 Market Street, San Francisco, California 94103, United States
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | {{tile.title}}
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | Call us
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | Send us and Email
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | Find us / Get directions
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 | Visit us on Facebook
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/src/pages/home/home.module.ts:
--------------------------------------------------------------------------------
1 | import { IonicModule } from 'ionic-angular';
2 | import { NgModule } from '@angular/core';
3 | import { EmailService } from '../../services/email.service';
4 | import { CallService } from '../../services/call.service';
5 | import { HomePage } from './home.page';
6 | import { InAppBrowserService } from '../../services/in-app-browser.service';
7 | import { MapsService } from '../../services/maps.service';
8 |
9 | @NgModule({
10 | imports: [IonicModule],
11 | declarations: [HomePage],
12 | entryComponents: [HomePage],
13 | providers: [
14 | EmailService,
15 | CallService,
16 | InAppBrowserService,
17 | MapsService
18 | ]
19 | })
20 | export class HomeModule {
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/pages/home/home.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { Nav } from 'ionic-angular';
3 |
4 | import { WordpressListPage } from '../wordpress/list/wordpress.list.page';
5 | import { SlideBoxPage } from '../slide-box/slide-box.page';
6 | import { GoogleMapsPage } from '../google-maps/google-maps.page';
7 |
8 | import { Tile } from './models/tile.model';
9 | import { EmailService } from '../../services/email.service';
10 | import { CallService } from '../../services/call.service';
11 | import { MapsService } from '../../services/maps.service';
12 | import { InAppBrowserService } from '../../services/in-app-browser.service';
13 | import { data } from './home-data';
14 |
15 | @Component({
16 | templateUrl: 'home.html',
17 | providers: []
18 | })
19 | export class HomePage {
20 | public tiles: Tile[][];
21 |
22 | private emailService: EmailService;
23 | private callService: CallService;
24 | private mapsService: MapsService;
25 | private browserService: InAppBrowserService;
26 | private nav: Nav;
27 |
28 | constructor(
29 | emailService: EmailService,
30 | callService: CallService,
31 | mapsService: MapsService,
32 | browserService: InAppBrowserService,
33 | nav: Nav
34 | ) {
35 | this.emailService = emailService;
36 | this.callService = callService;
37 | this.mapsService = mapsService;
38 | this.browserService = browserService;
39 | this.nav = nav;
40 | this.initTiles();
41 | }
42 |
43 | public navigateTo(tile) {
44 | this.nav.setRoot(tile.component);
45 | }
46 |
47 | public getDirections() {
48 | this.mapsService.openMapsApp(data.officeLocation);
49 | }
50 |
51 | public sendEmail() {
52 | this.emailService.sendEmail(data.email);
53 | }
54 |
55 | public openFacebookPage() {
56 | this.browserService.open(data.facebook);
57 | }
58 |
59 | public callUs() {
60 | this.callService.call(data.phoneNumber);
61 | }
62 |
63 | private initTiles(): void {
64 | this.tiles = [[{
65 | title: 'Wordpress',
66 | path: 'wordpress-articles',
67 | icon: 'logo-wordpress',
68 | component: WordpressListPage
69 | }, {
70 | title: 'Slides',
71 | path: 'slides',
72 | icon: 'swap',
73 | component: SlideBoxPage
74 | }], [{
75 | title: 'Map',
76 | path: 'map',
77 | icon: 'map',
78 | component: GoogleMapsPage
79 | }]];
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/src/pages/home/home.scss:
--------------------------------------------------------------------------------
1 | .getting-started {
2 | .home-hello {
3 | position: relative;
4 |
5 | .hello-title {
6 | position: absolute;
7 | left: 0;
8 | right: 0;
9 | bottom: 0;
10 | margin: 0;
11 | border: 0;
12 | background: rgba(255, 255, 255, 0.6);
13 | padding: 10px;
14 | }
15 |
16 | h1 {
17 | margin-top: 0;
18 | }
19 | }
20 |
21 | .tile {
22 | .item {
23 | padding: 0;
24 | }
25 |
26 | .item-inner {
27 | padding: 0;
28 | }
29 |
30 | h2 {
31 | text-align: center;
32 | }
33 |
34 | h1 {
35 | text-align: center;
36 | padding-bottom: 10px;
37 | }
38 | }
39 |
40 | ion-item-content {
41 | margin: 0;
42 | }
43 |
44 | .quick-action {
45 | width: 100%;
46 | ion-icon {
47 | font-size: 2em;
48 | width: 20px;
49 | }
50 | span {
51 | font-size: 1.6rem;
52 | padding-left: 10px;
53 | padding-top: -3px;
54 | vertical-align: text-bottom;
55 | }
56 | }
57 | }
--------------------------------------------------------------------------------
/src/pages/home/models/tile.model.ts:
--------------------------------------------------------------------------------
1 | export class Tile {
2 | public title: string;
3 | public path: string;
4 | public icon: string;
5 | public component: any;
6 | }
--------------------------------------------------------------------------------
/src/pages/login/login.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Log in
7 |
8 |
9 |
10 |
11 |
56 |
57 |
--------------------------------------------------------------------------------
/src/pages/login/login.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { LoginPage } from './login';
4 |
5 | @NgModule({
6 | declarations: [
7 | LoginPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(LoginPage),
11 | ],
12 | })
13 | export class LoginPageModule {}
14 |
--------------------------------------------------------------------------------
/src/pages/login/login.scss:
--------------------------------------------------------------------------------
1 | page-login {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/pages/login/login.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { FormGroup, FormBuilder, Validators } from '@angular/forms';
3 | import { NavController } from 'ionic-angular';
4 | import { HomePage } from '../home/home.page';
5 | import { AuthService } from '../../services/auth.service';
6 | import { SignupPage } from '../signup/signup';
7 |
8 | @IonicPage()
9 | @Component({
10 | selector: 'page-login',
11 | templateUrl: 'login.html',
12 | })
13 | export class LoginPage {
14 | loginForm: FormGroup;
15 | loginError: string;
16 |
17 | constructor(
18 | private navCtrl: NavController,
19 | private auth: AuthService,
20 | fb: FormBuilder
21 | ) {
22 | this.loginForm = fb.group({
23 | email: ['', Validators.compose([Validators.required, Validators.email])],
24 | password: ['', Validators.compose([Validators.required, Validators.minLength(6)])]
25 | });
26 | }
27 |
28 | login() {
29 | let data = this.loginForm.value;
30 |
31 | if (!data.email) {
32 | return;
33 | }
34 |
35 | let credentials = {
36 | email: data.email,
37 | password: data.password
38 | };
39 | this.auth.signInWithEmail(credentials)
40 | .then(
41 | () => this.navCtrl.setRoot(HomePage),
42 | error => this.loginError = error.message
43 | );
44 | }
45 |
46 | signup(){
47 | this.navCtrl.push(SignupPage);
48 | }
49 |
50 | loginWithGoogle() {
51 | this.auth.signInWithGoogle()
52 | .then(
53 | () => this.navCtrl.setRoot(HomePage),
54 | error => console.log(error.message)
55 | );
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/src/pages/signup/signup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Sign up
4 |
5 |
6 |
7 |
8 |
9 |
35 |
36 |
--------------------------------------------------------------------------------
/src/pages/signup/signup.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { SignupPage } from './signup';
4 |
5 | @NgModule({
6 | declarations: [
7 | SignupPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(SignupPage),
11 | ],
12 | })
13 | export class SignupPageModule {}
14 |
--------------------------------------------------------------------------------
/src/pages/signup/signup.scss:
--------------------------------------------------------------------------------
1 | page-signup {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/pages/signup/signup.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { FormBuilder, FormGroup, Validators } from '@angular/forms';
3 | import { NavController } from 'ionic-angular';
4 | import { HomePage } from '../home/home.page';
5 | import { AuthService } from '../../services/auth.service';
6 |
7 | @Component({
8 | selector: 'as-page-signup',
9 | templateUrl: './signup.html'
10 | })
11 | export class SignupPage {
12 | signupError: string;
13 | form: FormGroup;
14 |
15 | constructor(
16 | fb: FormBuilder,
17 | private navCtrl: NavController,
18 | private auth: AuthService
19 | ) {
20 | this.form = fb.group({
21 | email: ['', Validators.compose([Validators.required, Validators.email])],
22 | password: ['', Validators.compose([Validators.required, Validators.minLength(6)])]
23 | });
24 | }
25 |
26 | signup() {
27 | let data = this.form.value;
28 | let credentials = {
29 | email: data.email,
30 | password: data.password
31 | };
32 | this.auth.signUp(credentials).then(
33 | () => this.navCtrl.setRoot(HomePage),
34 | error => this.signupError = error.message
35 | );
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/pages/slide-box/slide-box.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Slides
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/pages/slide-box/slide-box.module.ts:
--------------------------------------------------------------------------------
1 | import { IonicModule } from 'ionic-angular';
2 | import { NgModule } from '@angular/core';
3 |
4 | import { SlideBoxPage } from './slide-box.page';
5 |
6 | @NgModule({
7 | imports: [IonicModule],
8 | declarations: [SlideBoxPage],
9 | entryComponents: [SlideBoxPage]
10 | })
11 | export class SlideBoxModule {
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/src/pages/slide-box/slide-box.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | templateUrl: 'slide-box.html'
5 | })
6 | export class SlideBoxPage {
7 | public items: any[];
8 |
9 | constructor() {
10 | this.items = this.generateItems(7);
11 | }
12 |
13 | private generateItems(n: number): any {
14 | let items = [];
15 | for (let i = 0; i < n; i++) {
16 | items.push({
17 | image: 'http://lorempixel.com/g/786/1024/city/' + i + '/'
18 | });
19 | }
20 | return items;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/pages/wordpress/item/wordpress.item.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | WP post
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | {{post.title}}
15 |
16 | {{post.author}} - {{post.date}}
17 | [{{post.tags.join(', ')}}]
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/pages/wordpress/item/wordpress.item.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { NavParams } from 'ionic-angular';
3 | import { Post } from '../models/post.model';
4 |
5 | @Component({
6 | templateUrl: 'wordpress.item.html'
7 | })
8 | export class WordpressItemPage {
9 | post: Post;
10 |
11 | constructor(navParams: NavParams) {
12 | this.post = navParams.get('item');
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/pages/wordpress/list/wordpress.list.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | WP posts
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | {{post.title}}
15 | {{post.brief | trimHtml | truncate : 140}}
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/pages/wordpress/list/wordpress.list.page.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { NavController } from 'ionic-angular';
3 | import { WordpressService } from './../wordpress.service';
4 | import { WordpressItemPage } from '../item/wordpress.item.page';
5 | import { Post } from '../models/post.model';
6 |
7 | @Component({
8 | templateUrl: 'wordpress.list.html',
9 | providers: [WordpressService]
10 | })
11 | export class WordpressListPage implements OnInit {
12 | public posts: Post[];
13 |
14 | private wordpressService: WordpressService;
15 | private nav: NavController;
16 |
17 | constructor(wordpressService: WordpressService, nav: NavController) {
18 | this.wordpressService = wordpressService;
19 | this.nav = nav;
20 | }
21 |
22 | ngOnInit(): void {
23 | this.wordpressService.getPosts()
24 | .subscribe(posts => {
25 | this.posts = posts;
26 | });
27 | }
28 |
29 | public itemTapped(item) {
30 | this.nav.push(WordpressItemPage, {
31 | item: item
32 | });
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/pages/wordpress/models/post.model.ts:
--------------------------------------------------------------------------------
1 | export class Post {
2 | public id: number;
3 | public title: string;
4 | public brief: string;
5 | public content: string;
6 | public image: string;
7 | public date: Date;
8 | public author: string;
9 | public tags: string[];
10 | public url: string;
11 | }
--------------------------------------------------------------------------------
/src/pages/wordpress/wordpress.module.ts:
--------------------------------------------------------------------------------
1 | import { IonicModule } from 'ionic-angular';
2 | import { NgModule } from '@angular/core';
3 | import { PipesModule } from '../../pipes/pipes.module';
4 |
5 | import { WordpressItemPage } from './item/wordpress.item.page';
6 | import { WordpressListPage } from './list/wordpress.list.page';
7 |
8 | @NgModule({
9 | imports: [
10 | IonicModule,
11 | PipesModule
12 | ],
13 | declarations: [
14 | WordpressItemPage,
15 | WordpressListPage
16 | ],
17 | entryComponents: [
18 | WordpressItemPage,
19 | WordpressListPage
20 | ]
21 | })
22 | export class WordpressModule {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/pages/wordpress/wordpress.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { Http } from '@angular/http';
3 | import { Config } from '../../config';
4 | import { Observable } from 'rxjs';
5 | import { Post } from './models/post.model';
6 |
7 | @Injectable()
8 | export class WordpressService {
9 | private http: Http;
10 | private config: Config;
11 | private articles: Post[];
12 |
13 | constructor(http: Http, config: Config) {
14 | this.http = http;
15 | this.config = config;
16 | }
17 |
18 | public getPosts(): Observable {
19 | return this.http.get(this.config.wordpressApiUrl)
20 | .map(x => x.json())
21 | .map(response => {
22 | this.articles = response.posts.map((item: any) => this.createArticle(item));
23 | return this.articles;
24 | });
25 | }
26 |
27 | private createArticle(item): Post {
28 | let imageUrl = item.attachments.length > 0 ? item.attachments[0].images.full.url : null;
29 | let tags = item.tags.map(x => x.title);
30 |
31 | let contentIndex = item.content.indexOf('') + 4;
32 | let content = contentIndex === -1 ? item.content : item.content.substring(contentIndex);
33 |
34 | return {
35 | id: item.id,
36 | title: item.title,
37 | brief: item.excerpt,
38 | image: imageUrl,
39 | date: item.date,
40 | content: content,
41 | author: item.author.name,
42 | tags: tags,
43 | url: this.config.wordpressApiUrl
44 | };
45 | }
46 | }
--------------------------------------------------------------------------------
/src/pipes/pipes.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { TrimHtmlPipe } from './trim-html.pipe';
3 | import { TruncatePipe } from './truncate.pipe';
4 |
5 | @NgModule({
6 | declarations: [
7 | TruncatePipe,
8 | TrimHtmlPipe
9 | ],
10 | exports: [
11 | TruncatePipe,
12 | TrimHtmlPipe
13 | ]
14 | })
15 | export class PipesModule {
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/pipes/trim-html.pipe.ts:
--------------------------------------------------------------------------------
1 | import { Pipe, PipeTransform } from '@angular/core';
2 |
3 | @Pipe({
4 | name: 'trimHtml'
5 | })
6 | export class TrimHtmlPipe implements PipeTransform {
7 | public transform(value: string): string {
8 | return this.htmlToPlainText(value);
9 | }
10 |
11 | private htmlToPlainText(html: string): string {
12 | return String(html).replace(/<[^>]+>/gm, '');
13 | }
14 | }
--------------------------------------------------------------------------------
/src/pipes/truncate.pipe.ts:
--------------------------------------------------------------------------------
1 | import { Pipe, PipeTransform } from '@angular/core';
2 |
3 | @Pipe({
4 | name: 'truncate'
5 | })
6 | export class TruncatePipe implements PipeTransform {
7 | transform(value: string, limit: number): string {
8 | return value.length > limit ? value.substring(0, limit) + '...' : value;
9 | }
10 | }
--------------------------------------------------------------------------------
/src/service-worker.js:
--------------------------------------------------------------------------------
1 | // tick this to make the cache invalidate and update
2 | const CACHE_VERSION = 1;
3 | const CURRENT_CACHES = {
4 | 'read-through': 'read-through-cache-v' + CACHE_VERSION
5 | };
6 |
7 | self.addEventListener('activate', (event) => {
8 | // Delete all caches that aren't named in CURRENT_CACHES.
9 | // While there is only one cache in this example, the same logic will handle the case where
10 | // there are multiple versioned caches.
11 | const expectedCacheNames = Object.keys(CURRENT_CACHES).map((key) => {
12 | return CURRENT_CACHES[key];
13 | });
14 |
15 | event.waitUntil(
16 | caches.keys().then((cacheNames) => {
17 | return Promise.all(
18 | cacheNames.map((cacheName) => {
19 | if (expectedCacheNames.indexOf(cacheName) === -1) {
20 | // If this cache name isn't present in the array of "expected" cache names, then delete it.
21 | console.log('Deleting out of date cache:', cacheName);
22 | return caches.delete(cacheName);
23 | }
24 | })
25 | );
26 | })
27 | );
28 | });
29 |
30 | // This sample illustrates an aggressive approach to caching, in which every valid response is
31 | // cached and every request is first checked against the cache.
32 | // This may not be an appropriate approach if your web application makes requests for
33 | // arbitrary URLs as part of its normal operation (e.g. a RSS client or a news aggregator),
34 | // as the cache could end up containing large responses that might not end up ever being accessed.
35 | // Other approaches, like selectively caching based on response headers or only caching
36 | // responses served from a specific domain, might be more appropriate for those use cases.
37 | self.addEventListener('fetch', (event) => {
38 |
39 | event.respondWith(
40 | caches.open(CURRENT_CACHES['read-through']).then((cache) => {
41 | return cache.match(event.request).then((response) => {
42 | if (response) {
43 | // If there is an entry in the cache for event.request, then response will be defined
44 | // and we can just return it.
45 |
46 | return response;
47 | }
48 |
49 | // Otherwise, if there is no entry in the cache for event.request, response will be
50 | // undefined, and we need to fetch() the resource.
51 | console.log(' No response for %s found in cache. ' +
52 | 'About to fetch from network...', event.request.url);
53 |
54 | // We call .clone() on the request since we might use it in the call to cache.put() later on.
55 | // Both fetch() and cache.put() "consume" the request, so we need to make a copy.
56 | // (see https://fetch.spec.whatwg.org/#dom-request-clone)
57 | return fetch(event.request.clone()).then((response) => {
58 |
59 | // Optional: add in extra conditions here, e.g. response.type == 'basic' to only cache
60 | // responses from the same domain. See https://fetch.spec.whatwg.org/#concept-response-type
61 | if (response.status < 400 && response.type === 'basic') {
62 | // We need to call .clone() on the response object to save a copy of it to the cache.
63 | // (https://fetch.spec.whatwg.org/#dom-request-clone)
64 | cache.put(event.request, response.clone());
65 | }
66 |
67 | // Return the original response object, which will be used to fulfill the resource request.
68 | return response;
69 | });
70 | }).catch((error) => {
71 | // This catch() will handle exceptions that arise from the match() or fetch() operations.
72 | // Note that a HTTP error response (e.g. 404) will NOT trigger an exception.
73 | // It will return a normal response object that has the appropriate error code set.
74 | console.error(' Read-through caching failed:', error);
75 |
76 | throw error;
77 | });
78 | })
79 | );
80 | });
--------------------------------------------------------------------------------
/src/services/auth.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { AngularFireAuth } from 'angularfire2/auth';
3 | import * as firebase from 'firebase/app';
4 | import AuthProvider = firebase.auth.AuthProvider;
5 |
6 | @Injectable()
7 | export class AuthService {
8 | private user: firebase.User;
9 |
10 | constructor(public afAuth: AngularFireAuth) {
11 | afAuth.authState.subscribe(user => {
12 | this.user = user;
13 | });
14 | }
15 |
16 | signInWithEmail(credentials) {
17 | console.log('Sign in with email');
18 | return this.afAuth.auth.signInWithEmailAndPassword(credentials.email,
19 | credentials.password);
20 | }
21 |
22 | signUp(credentials) {
23 | return this.afAuth.auth.createUserWithEmailAndPassword(credentials.email,credentials.password);
24 | }
25 |
26 | get authenticated(): boolean {
27 | return this.user !== null;
28 | }
29 |
30 | getEmail() {
31 | return this.user && this.user.email;
32 | }
33 |
34 | signOut(): Promise {
35 | return this.afAuth.auth.signOut();
36 | }
37 |
38 | signInWithGoogle() {
39 | console.log('Sign in with google');
40 | return this.oauthSignIn(new firebase.auth.GoogleAuthProvider());
41 | }
42 |
43 | private oauthSignIn(provider: AuthProvider) {
44 | if (!(window).cordova) {
45 | return this.afAuth.auth.signInWithPopup(provider);
46 | } else {
47 | return this.afAuth.auth.signInWithRedirect(provider)
48 | .then(() => {
49 | return this.afAuth.auth.getRedirectResult().then( result => {
50 | // This gives you a Google Access Token.
51 | // You can use it to access the Google API.
52 | let token = result.credential.accessToken;
53 | // The signed-in user info.
54 | let user = result.user;
55 | console.log(token, user);
56 | }).catch(function(error) {
57 | // Handle Errors here.
58 | alert(error.message);
59 | });
60 | });
61 | }
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/src/services/call.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | @Injectable()
4 | export class CallService {
5 | public call(phoneNumber: string): void {
6 | window.location.href = 'tel:' + phoneNumber;
7 | }
8 | }
--------------------------------------------------------------------------------
/src/services/email.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | export class Email {
4 | to: string;
5 | subject: string;
6 | body: string;
7 | }
8 |
9 | @Injectable()
10 | export class EmailService {
11 | public sendEmail(email: Email) {
12 | let plugins: any = (window).cordova.plugins;
13 | plugins.email.isAvailable(() => {
14 | plugins.email.open(email);
15 | });
16 | }
17 | }
--------------------------------------------------------------------------------
/src/services/in-app-browser.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | @Injectable()
4 | export class InAppBrowserService {
5 | public open(url: string): boolean {
6 | window.open(url, '_system', 'location=yes');
7 | return false;
8 | }
9 | }
--------------------------------------------------------------------------------
/src/services/maps.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { Platform } from 'ionic-angular';
3 |
4 | @Injectable()
5 | export class MapsService {
6 | private platform: Platform;
7 |
8 | constructor(platform: Platform) {
9 | this.platform = platform;
10 | }
11 |
12 | public openMapsApp(location: any) {
13 | let q;
14 | if (this.platform.is('android')) {
15 | q = 'geo:' + location;
16 | } else {
17 | q = 'maps://maps.apple.com/?q=' + location;
18 | }
19 | window.location.href = q;
20 | }
21 | }
--------------------------------------------------------------------------------
/src/theme/variables.scss:
--------------------------------------------------------------------------------
1 | // Ionic Variables and Theming. For more info, please see:
2 | // http://ionicframework.com/docs/v2/theming/
3 | @import "ionic.globals";
4 |
5 |
6 | // Shared Variables
7 | // --------------------------------------------------
8 | // To customize the look and feel of this app, you can override
9 | // the Sass variables found in Ionic's source scss files.
10 | // To view all the possible Ionic variables, see:
11 | // http://ionicframework.com/docs/v2/theming/overriding-ionic-variables/
12 |
13 | $text-color: #000;
14 | $background-color: #fff;
15 |
16 |
17 | // Named Color Variables
18 | // --------------------------------------------------
19 | // Named colors makes it easy to reuse colors on various components.
20 | // It's highly recommended to change the default colors
21 | // to match your app's branding. Ionic uses a Sass map of
22 | // colors so you can add, rename and remove colors as needed.
23 | // The "primary" color is the only required color in the map.
24 |
25 | $colors: (
26 | primary: #387ef5,
27 | secondary: #32db64,
28 | danger: #f53d3d,
29 | light: #f4f4f4,
30 | dark: #222,
31 | favorite: #69BB7B
32 | );
33 |
34 |
35 | // App Theme
36 | // --------------------------------------------------
37 | // Ionic apps can have different themes applied, which can
38 | // then be future customized. This import comes last
39 | // so that the above variables are used and Ionic's
40 | // default are overridden.
41 |
42 | @import "ionic.theme.default";
43 |
44 |
45 | // Ionicons
46 | // --------------------------------------------------
47 | // The premium icon font for Ionic. For more info, please see:
48 | // http://ionicframework.com/docs/v2/ionicons/
49 |
50 | $ionicons-font-path: "../assets/fonts";
51 | @import "ionic.ionicons";
52 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "sourceMap": true,
4 | "allowSyntheticDefaultImports": true,
5 | "declaration": true,
6 | "emitDecoratorMetadata": true,
7 | "experimentalDecorators": true,
8 | "lib": [
9 | "dom",
10 | "es2015"
11 | ],
12 | "module": "es2015",
13 | "moduleResolution": "node",
14 | "target": "es5"
15 | },
16 | "exclude": [
17 | "node_modules"
18 | ],
19 | "compileOnSave": false,
20 | "atom": {
21 | "rewriteTsconfig": false
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rules": {
3 | "align": [
4 | true,
5 | "parameters",
6 | "arguments",
7 | "statements"
8 | ],
9 | "ban": false,
10 | "class-name": true,
11 | "comment-format": [
12 | true,
13 | "check-space"
14 | ],
15 | "curly": true,
16 | "eofline": false,
17 | "forin": true,
18 | "indent": [
19 | true,
20 | "tabs"
21 | ],
22 | "interface-name": true,
23 | "jsdoc-format": true,
24 | "label-position": true,
25 | "max-line-length": [
26 | true,
27 | 140
28 | ],
29 | "member-access": false,
30 | "member-ordering": [
31 | true,
32 | "private-before-public",
33 | "static-before-instance",
34 | "variables-before-functions"
35 | ],
36 | "no-any": false,
37 | "no-arg": true,
38 | "no-bitwise": false,
39 | "no-conditional-assignment": true,
40 | "no-console": [
41 | true,
42 | "debug",
43 | "info",
44 | "time",
45 | "timeEnd",
46 | "trace"
47 | ],
48 | "no-construct": true,
49 | "no-constructor-vars": false,
50 | "no-debugger": true,
51 | "no-shadowed-variable": true,
52 | "no-duplicate-variable": true,
53 | "no-empty": true,
54 | "no-eval": true,
55 | "no-internal-module": true,
56 | "no-require-imports": true,
57 | "no-string-literal": true,
58 | "no-switch-case-fall-through": true,
59 | "trailing-comma": true,
60 | "no-trailing-whitespace": true,
61 | "no-unused-expression": true,
62 | "no-unused-variable": true,
63 | "no-use-before-declare": true,
64 | "no-var-keyword": true,
65 | "no-var-requires": true,
66 | "one-line": [
67 | true,
68 | "check-open-brace",
69 | "check-catch",
70 | "check-else",
71 | "check-whitespace"
72 | ],
73 | "quotemark": [
74 | true,
75 | "single"
76 | ],
77 | "radix": true,
78 | "semicolon": true,
79 | "switch-default": true,
80 | "triple-equals": [
81 | true,
82 | "allow-null-check"
83 | ],
84 | "typedef": [
85 | false,
86 | "call-signature",
87 | "parameter",
88 | "property-declaration",
89 | "variable-declaration",
90 | "member-variable-declaration"
91 | ],
92 | "typedef-whitespace": [
93 | true,
94 | {
95 | "call-signature": "nospace",
96 | "index-signature": "nospace",
97 | "parameter": "nospace",
98 | "property-declaration": "nospace",
99 | "variable-declaration": "nospace"
100 | }
101 | ],
102 | "variable-name": false,
103 | "whitespace": [
104 | true,
105 | "check-branch",
106 | "check-decl",
107 | "check-operator",
108 | "check-separator",
109 | "check-type"
110 | ]
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/www/assets/fonts/ionicons.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/ionicons.eot
--------------------------------------------------------------------------------
/www/assets/fonts/ionicons.scss:
--------------------------------------------------------------------------------
1 |
2 | // Ionicons Icon Font CSS
3 | // --------------------------
4 | // Ionicons CSS for Ionic's element
5 | // ionicons-icons.scss has the icons and their unicode characters
6 |
7 | $ionicons-font-path: $font-path !default;
8 |
9 | @import "ionicons-icons";
10 | @import "ionicons-variables";
11 |
12 |
13 | @font-face {
14 | font-family: "Ionicons";
15 | src: url("#{$ionicons-font-path}/ionicons.woff2?v=#{$ionicons-version}") format("woff2"),
16 | url("#{$ionicons-font-path}/ionicons.woff?v=#{$ionicons-version}") format("woff"),
17 | url("#{$ionicons-font-path}/ionicons.ttf?v=#{$ionicons-version}") format("truetype");
18 | font-weight: normal;
19 | font-style: normal;
20 | }
21 |
22 | ion-icon {
23 | display: inline-block;
24 |
25 | font-family: "Ionicons";
26 | -moz-osx-font-smoothing: grayscale;
27 | -webkit-font-smoothing: antialiased;
28 | font-style: normal;
29 | font-variant: normal;
30 | font-weight: normal;
31 | line-height: 1;
32 | text-rendering: auto;
33 | text-transform: none;
34 | speak: none;
35 |
36 | @include rtl() {
37 | &[aria-label^="arrow"]::before,
38 | &[flip-rtl]::before {
39 | transform: scaleX(-1);
40 | }
41 |
42 | &[unflip-rtl]::before {
43 | transform: scaleX(1);
44 | }
45 | }
46 |
47 | &::before {
48 | display: inline-block;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/www/assets/fonts/ionicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/ionicons.ttf
--------------------------------------------------------------------------------
/www/assets/fonts/ionicons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/ionicons.woff
--------------------------------------------------------------------------------
/www/assets/fonts/ionicons.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/ionicons.woff2
--------------------------------------------------------------------------------
/www/assets/fonts/noto-sans-bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/noto-sans-bold.ttf
--------------------------------------------------------------------------------
/www/assets/fonts/noto-sans-bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/noto-sans-bold.woff
--------------------------------------------------------------------------------
/www/assets/fonts/noto-sans-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/noto-sans-regular.ttf
--------------------------------------------------------------------------------
/www/assets/fonts/noto-sans-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/noto-sans-regular.woff
--------------------------------------------------------------------------------
/www/assets/fonts/noto-sans.scss:
--------------------------------------------------------------------------------
1 | // Noto Sans Font
2 | // Google
3 | // Apache License, version 2.0
4 | // http://www.apache.org/licenses/LICENSE-2.0.html
5 |
6 | $noto-sans-font-path: $font-path !default;
7 |
8 | @font-face {
9 | font-family: "Noto Sans";
10 | font-style: normal;
11 | font-weight: 300;
12 | src: local("Noto Sans"), local("Noto-Sans-Regular"), url("#{$noto-sans-font-path}/noto-sans-regular.woff") format("woff"), url("#{$noto-sans-font-path}/noto-sans-regular.ttf") format("truetype");
13 | }
14 |
15 | @font-face {
16 | font-family: "Noto Sans";
17 | font-style: normal;
18 | font-weight: 400;
19 | src: local("Noto Sans"), local("Noto-Sans-Regular"), url("#{$noto-sans-font-path}/noto-sans-regular.woff") format("woff"), url("#{$noto-sans-font-path}/noto-sans-regular.ttf") format("truetype");
20 | }
21 |
22 | @font-face {
23 | font-family: "Noto Sans";
24 | font-style: normal;
25 | font-weight: 500;
26 | src: local("Noto Sans Bold"), local("Noto-Sans-Bold"), url("#{$noto-sans-font-path}/noto-sans-bold.woff") format("woff"), url("#{$noto-sans-font-path}/noto-sans-bold.ttf") format("truetype");
27 | }
28 |
29 | @font-face {
30 | font-family: "Noto Sans";
31 | font-style: normal;
32 | font-weight: 700;
33 | src: local("Noto Sans Bold"), local("Noto-Sans-Bold"), url("#{$noto-sans-font-path}/noto-sans-bold.woff") format("woff"), url("#{$noto-sans-font-path}/noto-sans-bold.ttf") format("truetype");
34 | }
35 |
--------------------------------------------------------------------------------
/www/assets/fonts/roboto-bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/roboto-bold.ttf
--------------------------------------------------------------------------------
/www/assets/fonts/roboto-bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/roboto-bold.woff
--------------------------------------------------------------------------------
/www/assets/fonts/roboto-bold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/roboto-bold.woff2
--------------------------------------------------------------------------------
/www/assets/fonts/roboto-light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/roboto-light.ttf
--------------------------------------------------------------------------------
/www/assets/fonts/roboto-light.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/roboto-light.woff
--------------------------------------------------------------------------------
/www/assets/fonts/roboto-light.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/roboto-light.woff2
--------------------------------------------------------------------------------
/www/assets/fonts/roboto-medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/roboto-medium.ttf
--------------------------------------------------------------------------------
/www/assets/fonts/roboto-medium.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/roboto-medium.woff
--------------------------------------------------------------------------------
/www/assets/fonts/roboto-medium.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/roboto-medium.woff2
--------------------------------------------------------------------------------
/www/assets/fonts/roboto-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/roboto-regular.ttf
--------------------------------------------------------------------------------
/www/assets/fonts/roboto-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/roboto-regular.woff
--------------------------------------------------------------------------------
/www/assets/fonts/roboto-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/fonts/roboto-regular.woff2
--------------------------------------------------------------------------------
/www/assets/fonts/roboto.scss:
--------------------------------------------------------------------------------
1 | // Roboto Font
2 | // Google
3 | // Apache License, version 2.0
4 | // http://www.apache.org/licenses/LICENSE-2.0.html
5 |
6 | $roboto-font-path: $font-path !default;
7 |
8 | @font-face {
9 | font-family: "Roboto";
10 | font-style: normal;
11 | font-weight: 300;
12 | src: local("Roboto Light"), local("Roboto-Light"), url("#{$roboto-font-path}/roboto-light.woff2") format("woff2"), url("#{$roboto-font-path}/roboto-light.woff") format("woff"), url("#{$roboto-font-path}/roboto-light.ttf") format("truetype");
13 | }
14 |
15 | @font-face {
16 | font-family: "Roboto";
17 | font-style: normal;
18 | font-weight: 400;
19 | src: local("Roboto"), local("Roboto-Regular"), url("#{$roboto-font-path}/roboto-regular.woff2") format("woff2"), url("#{$roboto-font-path}/roboto-regular.woff") format("woff"), url("#{$roboto-font-path}/roboto-regular.ttf") format("truetype");
20 | }
21 |
22 | @font-face {
23 | font-family: "Roboto";
24 | font-style: normal;
25 | font-weight: 500;
26 | src: local("Roboto Medium"), local("Roboto-Medium"), url("#{$roboto-font-path}/roboto-medium.woff2") format("woff2"), url("#{$roboto-font-path}/roboto-medium.woff") format("woff"), url("#{$roboto-font-path}/roboto-medium.ttf") format("truetype");
27 | }
28 |
29 | @font-face {
30 | font-family: "Roboto";
31 | font-style: normal;
32 | font-weight: 700;
33 | src: local("Roboto Bold"), local("Roboto-Bold"), url("#{$roboto-font-path}/roboto-bold.woff2") format("woff2"), url("#{$roboto-font-path}/roboto-bold.woff") format("woff"), url("#{$roboto-font-path}/roboto-bold.ttf") format("truetype");
34 | }
35 |
--------------------------------------------------------------------------------
/www/assets/icon/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/icon/favicon.ico
--------------------------------------------------------------------------------
/www/assets/img/advance-card-bttf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/img/advance-card-bttf.png
--------------------------------------------------------------------------------
/www/assets/img/bjork-live.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/img/bjork-live.jpg
--------------------------------------------------------------------------------
/www/assets/img/marty-avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/appseed-io/ionic3-firebase-auth/7f58be7ef13658711a8a642d4ff3d4af75e499cc/www/assets/img/marty-avatar.png
--------------------------------------------------------------------------------
/www/assets/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Ionic",
3 | "short_name": "Ionic",
4 | "start_url": "index.html",
5 | "display": "standalone",
6 | "icons": [{
7 | "src": "assets/imgs/logo.png",
8 | "sizes": "512x512",
9 | "type": "image/png"
10 | }],
11 | "background_color": "#4e8ef7",
12 | "theme_color": "#4e8ef7"
13 | }
--------------------------------------------------------------------------------
/www/build/0.js:
--------------------------------------------------------------------------------
1 | webpackJsonp([0],{
2 |
3 | /***/ 406:
4 | /***/ (function(module, __webpack_exports__, __webpack_require__) {
5 |
6 | "use strict";
7 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
8 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LoginPageModule", function() { return LoginPageModule; });
9 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
10 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(10);
11 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__login__ = __webpack_require__(125);
12 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
13 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
16 | return c > 3 && r && Object.defineProperty(target, key, r), r;
17 | };
18 |
19 |
20 |
21 | var LoginPageModule = (function () {
22 | function LoginPageModule() {
23 | }
24 | LoginPageModule = __decorate([
25 | Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["I" /* NgModule */])({
26 | declarations: [
27 | __WEBPACK_IMPORTED_MODULE_2__login__["a" /* LoginPage */],
28 | ],
29 | imports: [
30 | __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_2__login__["a" /* LoginPage */]),
31 | ],
32 | })
33 | ], LoginPageModule);
34 | return LoginPageModule;
35 | }());
36 |
37 | //# sourceMappingURL=login.module.js.map
38 |
39 | /***/ })
40 |
41 | });
42 | //# sourceMappingURL=0.js.map
--------------------------------------------------------------------------------
/www/build/0.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["../../src/pages/login/login.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAyC;AACO;AACZ;AAUpC;IAAA;IAA8B,CAAC;IAAlB,eAAe;QAR3B,uEAAQ,CAAC;YACR,YAAY,EAAE;gBACZ,yDAAS;aACV;YACD,OAAO,EAAE;gBACP,sEAAe,CAAC,QAAQ,CAAC,yDAAS,CAAC;aACpC;SACF,CAAC;OACW,eAAe,CAAG;IAAD,sBAAC;CAAA;AAAH","file":"0.js","sourcesContent":["import { NgModule } from '@angular/core';\nimport { IonicPageModule } from 'ionic-angular';\nimport { LoginPage } from './login';\n\n@NgModule({\n declarations: [\n LoginPage,\n ],\n imports: [\n IonicPageModule.forChild(LoginPage),\n ],\n})\nexport class LoginPageModule {}\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/login/login.module.ts"],"sourceRoot":""}
--------------------------------------------------------------------------------
/www/build/main.css.map:
--------------------------------------------------------------------------------
1 | null
--------------------------------------------------------------------------------
/www/build/sw-toolbox.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2016 Google Inc. All Rights Reserved.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.toolbox=e()}}(function(){return function e(t,n,r){function o(c,s){if(!n[c]){if(!t[c]){var a="function"==typeof require&&require;if(!s&&a)return a(c,!0);if(i)return i(c,!0);var u=new Error("Cannot find module '"+c+"'");throw u.code="MODULE_NOT_FOUND",u}var f=n[c]={exports:{}};t[c][0].call(f.exports,function(e){var n=t[c][1][e];return o(n?n:e)},f,f.exports,e,t,n,r)}return n[c].exports}for(var i="function"==typeof require&&require,c=0;ct.value[l]){var r=t.value[p];c.push(r),a.delete(r),t.continue()}},s.oncomplete=function(){r(c)},s.onabort=o}):Promise.resolve([])}function s(e,t){return t?new Promise(function(n,r){var o=[],i=e.transaction(h,"readwrite"),c=i.objectStore(h),s=c.index(l),a=s.count();s.count().onsuccess=function(){var e=a.result;e>t&&(s.openCursor().onsuccess=function(n){var r=n.target.result;if(r){var i=r.value[p];o.push(i),c.delete(i),e-o.length>t&&r.continue()}})},i.oncomplete=function(){n(o)},i.onabort=r}):Promise.resolve([])}function a(e,t,n,r){return c(e,n,r).then(function(n){return s(e,t).then(function(e){return n.concat(e)})})}var u="sw-toolbox-",f=1,h="store",p="url",l="timestamp",d={};t.exports={getDb:o,setTimestampForUrl:i,expireEntries:a}},{}],3:[function(e,t,n){"use strict";function r(e){var t=a.match(e.request);t?e.respondWith(t(e.request)):a.default&&"GET"===e.request.method&&0===e.request.url.indexOf("http")&&e.respondWith(a.default(e.request))}function o(e){s.debug("activate event fired");var t=u.cache.name+"$$$inactive$$$";e.waitUntil(s.renameCache(t,u.cache.name))}function i(e){return e.reduce(function(e,t){return e.concat(t)},[])}function c(e){var t=u.cache.name+"$$$inactive$$$";s.debug("install event fired"),s.debug("creating cache ["+t+"]"),e.waitUntil(s.openCache({cache:{name:t}}).then(function(e){return Promise.all(u.preCacheItems).then(i).then(s.validatePrecacheInput).then(function(t){return s.debug("preCache list: "+(t.join(", ")||"(none)")),e.addAll(t)})}))}e("serviceworker-cache-polyfill");var s=e("./helpers"),a=e("./router"),u=e("./options");t.exports={fetchListener:r,activateListener:o,installListener:c}},{"./helpers":1,"./options":4,"./router":6,"serviceworker-cache-polyfill":16}],4:[function(e,t,n){"use strict";var r;r=self.registration?self.registration.scope:self.scope||new URL("./",self.location).href,t.exports={cache:{name:"$$$toolbox-cache$$$"+r+"$$$",maxAgeSeconds:null,maxEntries:null},debug:!1,networkTimeoutSeconds:null,preCacheItems:[],successResponses:/^0|([123]\d\d)|(40[14567])|410$/}},{}],5:[function(e,t,n){"use strict";var r=new URL("./",self.location),o=r.pathname,i=e("path-to-regexp"),c=function(e,t,n,r){t instanceof RegExp?this.fullUrlRegExp=t:(0!==t.indexOf("/")&&(t=o+t),this.keys=[],this.regexp=i(t,this.keys)),this.method=e,this.options=r,this.handler=n};c.prototype.makeHandler=function(e){var t;if(this.regexp){var n=this.regexp.exec(e);t={},this.keys.forEach(function(e,r){t[e.name]=n[r+1]})}return function(e){return this.handler(e,t,this.options)}.bind(this)},t.exports=c},{"path-to-regexp":15}],6:[function(e,t,n){"use strict";function r(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var o=e("./route"),i=e("./helpers"),c=function(e,t){for(var n=e.entries(),r=n.next(),o=[];!r.done;){var i=new RegExp(r.value[0]);i.test(t)&&o.push(r.value[1]),r=n.next()}return o},s=function(){this.routes=new Map,this.routes.set(RegExp,new Map),this.default=null};["get","post","put","delete","head","any"].forEach(function(e){s.prototype[e]=function(t,n,r){return this.add(e,t,n,r)}}),s.prototype.add=function(e,t,n,c){c=c||{};var s;t instanceof RegExp?s=RegExp:(s=c.origin||self.location.origin,s=s instanceof RegExp?s.source:r(s)),e=e.toLowerCase();var a=new o(e,t,n,c);this.routes.has(s)||this.routes.set(s,new Map);var u=this.routes.get(s);u.has(e)||u.set(e,new Map);var f=u.get(e),h=a.regexp||a.fullUrlRegExp;f.has(h.source)&&i.debug('"'+t+'" resolves to same regex as existing route.'),f.set(h.source,a)},s.prototype.matchMethod=function(e,t){var n=new URL(t),r=n.origin,o=n.pathname;return this._match(e,c(this.routes,r),o)||this._match(e,[this.routes.get(RegExp)],t)},s.prototype._match=function(e,t,n){if(0===t.length)return null;for(var r=0;r0)return s[0].makeHandler(n)}}return null},s.prototype.match=function(e){return this.matchMethod(e.method,e.url)||this.matchMethod("any",e.url)},t.exports=new s},{"./helpers":1,"./route":5}],7:[function(e,t,n){"use strict";function r(e,t,n){return n=n||{},i.debug("Strategy: cache first ["+e.url+"]",n),i.openCache(n).then(function(t){return t.match(e).then(function(t){var r=n.cache||o.cache,c=Date.now();return i.isResponseFresh(t,r.maxAgeSeconds,c)?t:i.fetchAndCache(e,n)})})}var o=e("../options"),i=e("../helpers");t.exports=r},{"../helpers":1,"../options":4}],8:[function(e,t,n){"use strict";function r(e,t,n){return n=n||{},i.debug("Strategy: cache only ["+e.url+"]",n),i.openCache(n).then(function(t){return t.match(e).then(function(e){var t=n.cache||o.cache,r=Date.now();if(i.isResponseFresh(e,t.maxAgeSeconds,r))return e})})}var o=e("../options"),i=e("../helpers");t.exports=r},{"../helpers":1,"../options":4}],9:[function(e,t,n){"use strict";function r(e,t,n){return o.debug("Strategy: fastest ["+e.url+"]",n),new Promise(function(r,c){var s=!1,a=[],u=function(e){a.push(e.toString()),s?c(new Error('Both cache and network failed: "'+a.join('", "')+'"')):s=!0},f=function(e){e instanceof Response?r(e):u("No result returned")};o.fetchAndCache(e.clone(),n).then(f,u),i(e,t,n).then(f,u)})}var o=e("../helpers"),i=e("./cacheOnly");t.exports=r},{"../helpers":1,"./cacheOnly":8}],10:[function(e,t,n){t.exports={networkOnly:e("./networkOnly"),networkFirst:e("./networkFirst"),cacheOnly:e("./cacheOnly"),cacheFirst:e("./cacheFirst"),fastest:e("./fastest")}},{"./cacheFirst":7,"./cacheOnly":8,"./fastest":9,"./networkFirst":11,"./networkOnly":12}],11:[function(e,t,n){"use strict";function r(e,t,n){n=n||{};var r=n.successResponses||o.successResponses,c=n.networkTimeoutSeconds||o.networkTimeoutSeconds;return i.debug("Strategy: network first ["+e.url+"]",n),i.openCache(n).then(function(t){var s,a,u=[];if(c){var f=new Promise(function(r){s=setTimeout(function(){t.match(e).then(function(e){var t=n.cache||o.cache,c=Date.now(),s=t.maxAgeSeconds;i.isResponseFresh(e,s,c)&&r(e)})},1e3*c)});u.push(f)}var h=i.fetchAndCache(e,n).then(function(e){if(s&&clearTimeout(s),r.test(e.status))return e;throw i.debug("Response was an HTTP error: "+e.statusText,n),a=e,new Error("Bad response")}).catch(function(r){return i.debug("Network or response error, fallback to cache ["+e.url+"]",n),t.match(e).then(function(e){if(e)return e;if(a)return a;throw r})});return u.push(h),Promise.race(u)})}var o=e("../options"),i=e("../helpers");t.exports=r},{"../helpers":1,"../options":4}],12:[function(e,t,n){"use strict";function r(e,t,n){return o.debug("Strategy: network only ["+e.url+"]",n),fetch(e)}var o=e("../helpers");t.exports=r},{"../helpers":1}],13:[function(e,t,n){"use strict";var r=e("./options"),o=e("./router"),i=e("./helpers"),c=e("./strategies"),s=e("./listeners");i.debug("Service Worker Toolbox is loading"),self.addEventListener("install",s.installListener),self.addEventListener("activate",s.activateListener),self.addEventListener("fetch",s.fetchListener),t.exports={networkOnly:c.networkOnly,networkFirst:c.networkFirst,cacheOnly:c.cacheOnly,cacheFirst:c.cacheFirst,fastest:c.fastest,router:o,options:r,cache:i.cache,uncache:i.uncache,precache:i.precache}},{"./helpers":1,"./listeners":3,"./options":4,"./router":6,"./strategies":10}],14:[function(e,t,n){t.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},{}],15:[function(e,t,n){function r(e,t){for(var n,r=[],o=0,i=0,c="",s=t&&t.delimiter||"/";null!=(n=x.exec(e));){var f=n[0],h=n[1],p=n.index;if(c+=e.slice(i,p),i=p+f.length,h)c+=h[1];else{var l=e[i],d=n[2],m=n[3],g=n[4],v=n[5],w=n[6],y=n[7];c&&(r.push(c),c="");var b=null!=d&&null!=l&&l!==d,E="+"===w||"*"===w,R="?"===w||"*"===w,k=n[2]||s,$=g||v;r.push({name:m||o++,prefix:d||"",delimiter:k,optional:R,repeat:E,partial:b,asterisk:!!y,pattern:$?u($):y?".*":"[^"+a(k)+"]+?"})}}return i=46||"Chrome"===n&&r>=50)||(Cache.prototype.addAll=function(e){function t(e){this.name="NetworkError",this.code=19,this.message=e}var n=this;return t.prototype=Object.create(Error.prototype),Promise.resolve().then(function(){if(arguments.length<1)throw new TypeError;return e=e.map(function(e){return e instanceof Request?e:String(e)}),Promise.all(e.map(function(e){"string"==typeof e&&(e=new Request(e));var n=new URL(e.url).protocol;if("http:"!==n&&"https:"!==n)throw new t("Invalid scheme");return fetch(e.clone())}))}).then(function(r){if(r.some(function(e){return!e.ok}))throw new t("Incorrect response status");return Promise.all(r.map(function(t,r){return n.put(e[r],t)}))}).then(function(){})},Cache.prototype.add=function(e){return this.addAll([e])})}()},{}]},{},[13])(13)});
16 | //# sourceMappingURL=sw-toolbox.js.map
17 |
--------------------------------------------------------------------------------
/www/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 | Ionic App
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/www/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Ionic",
3 | "short_name": "Ionic",
4 | "start_url": "index.html",
5 | "display": "standalone",
6 | "icons": [{
7 | "src": "assets/imgs/logo.png",
8 | "sizes": "512x512",
9 | "type": "image/png"
10 | }],
11 | "background_color": "#4e8ef7",
12 | "theme_color": "#4e8ef7"
13 | }
--------------------------------------------------------------------------------
/www/service-worker.js:
--------------------------------------------------------------------------------
1 | // tick this to make the cache invalidate and update
2 | const CACHE_VERSION = 1;
3 | const CURRENT_CACHES = {
4 | 'read-through': 'read-through-cache-v' + CACHE_VERSION
5 | };
6 |
7 | self.addEventListener('activate', (event) => {
8 | // Delete all caches that aren't named in CURRENT_CACHES.
9 | // While there is only one cache in this example, the same logic will handle the case where
10 | // there are multiple versioned caches.
11 | const expectedCacheNames = Object.keys(CURRENT_CACHES).map((key) => {
12 | return CURRENT_CACHES[key];
13 | });
14 |
15 | event.waitUntil(
16 | caches.keys().then((cacheNames) => {
17 | return Promise.all(
18 | cacheNames.map((cacheName) => {
19 | if (expectedCacheNames.indexOf(cacheName) === -1) {
20 | // If this cache name isn't present in the array of "expected" cache names, then delete it.
21 | console.log('Deleting out of date cache:', cacheName);
22 | return caches.delete(cacheName);
23 | }
24 | })
25 | );
26 | })
27 | );
28 | });
29 |
30 | // This sample illustrates an aggressive approach to caching, in which every valid response is
31 | // cached and every request is first checked against the cache.
32 | // This may not be an appropriate approach if your web application makes requests for
33 | // arbitrary URLs as part of its normal operation (e.g. a RSS client or a news aggregator),
34 | // as the cache could end up containing large responses that might not end up ever being accessed.
35 | // Other approaches, like selectively caching based on response headers or only caching
36 | // responses served from a specific domain, might be more appropriate for those use cases.
37 | self.addEventListener('fetch', (event) => {
38 |
39 | event.respondWith(
40 | caches.open(CURRENT_CACHES['read-through']).then((cache) => {
41 | return cache.match(event.request).then((response) => {
42 | if (response) {
43 | // If there is an entry in the cache for event.request, then response will be defined
44 | // and we can just return it.
45 |
46 | return response;
47 | }
48 |
49 | // Otherwise, if there is no entry in the cache for event.request, response will be
50 | // undefined, and we need to fetch() the resource.
51 | console.log(' No response for %s found in cache. ' +
52 | 'About to fetch from network...', event.request.url);
53 |
54 | // We call .clone() on the request since we might use it in the call to cache.put() later on.
55 | // Both fetch() and cache.put() "consume" the request, so we need to make a copy.
56 | // (see https://fetch.spec.whatwg.org/#dom-request-clone)
57 | return fetch(event.request.clone()).then((response) => {
58 |
59 | // Optional: add in extra conditions here, e.g. response.type == 'basic' to only cache
60 | // responses from the same domain. See https://fetch.spec.whatwg.org/#concept-response-type
61 | if (response.status < 400 && response.type === 'basic') {
62 | // We need to call .clone() on the response object to save a copy of it to the cache.
63 | // (https://fetch.spec.whatwg.org/#dom-request-clone)
64 | cache.put(event.request, response.clone());
65 | }
66 |
67 | // Return the original response object, which will be used to fulfill the resource request.
68 | return response;
69 | });
70 | }).catch((error) => {
71 | // This catch() will handle exceptions that arise from the match() or fetch() operations.
72 | // Note that a HTTP error response (e.g. 404) will NOT trigger an exception.
73 | // It will return a normal response object that has the appropriate error code set.
74 | console.error(' Read-through caching failed:', error);
75 |
76 | throw error;
77 | });
78 | })
79 | );
80 | });
--------------------------------------------------------------------------------