Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Wheatley committed Apr 1, 2016
0 parents commit 0e89d3e
Show file tree
Hide file tree
Showing 80 changed files with 31,147 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
Empty file added README.md
Empty file.
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
13 changes: 13 additions & 0 deletions app/.meteor/.finished-upgraders
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file contains information which helps Meteor properly upgrade your
# app when you run 'meteor update'. You should check it into version control
# with your project.

notices-for-0.9.0
notices-for-0.9.1
0.9.4-platform-file
notices-for-facebook-graph-api-2
1.2.0-standard-minifiers-package
1.2.0-meteor-platform-split
1.2.0-cordova-changes
1.2.0-breaking-changes
1.3.0-split-minifiers-package
1 change: 1 addition & 0 deletions app/.meteor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
local
7 changes: 7 additions & 0 deletions app/.meteor/.id
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file contains a token that is unique to your project.
# Check it into your repository along with the rest of this directory.
# It can be used for purposes such as:
# - ensuring you don't accidentally deploy one app on top of another
# - providing package authors with aggregated statistics

1mmlnwm1ngku6g1td71xu
24 changes: 24 additions & 0 deletions app/.meteor/packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

meteor-base # Packages every Meteor app needs to have
mongo # The database Meteor supports right now
session # Client-side reactive dictionary for your app
jquery # Helpful client-side library
tracker # Meteor's client-side reactive programming library

es5-shim # ECMAScript 5 compatibility for older browsers.
# Removed mobile-experience package to fix conflict between fastclick and ionic2
# Re-addeding other packages from mobile-experience
#mobile-experience
launch-screen
mobile-status-bar

standard-minifier-css
standard-minifier-js
angular2-compilers@0.5.4
modules
barbatus:angular2-runtime
2 changes: 2 additions & 0 deletions app/.meteor/platforms
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
server
browser
1 change: 1 addition & 0 deletions app/.meteor/release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
METEOR@1.3
69 changes: 69 additions & 0 deletions app/.meteor/versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
allow-deny@1.0.2
angular2-compilers@0.5.4
angular2-html-templates@0.5.0
autoupdate@1.2.6
babel-compiler@6.5.2
babel-runtime@0.1.6
barbatus:angular2-runtime@0.2.2
barbatus:typescript@0.2.0
barbatus:typescript-compiler@0.5.0-beta.15
barbatus:typescript-runtime@0.1.0-beta.1
base64@1.0.6
binary-heap@1.0.6
blaze@2.1.5
blaze-tools@1.0.6
boilerplate-generator@1.0.6
caching-compiler@1.0.2
callback-hook@1.0.6
check@1.1.2
ddp@1.2.3
ddp-client@1.2.3
ddp-common@1.2.3
ddp-server@1.2.4
deps@1.0.10
diff-sequence@1.0.3
ecmascript@0.4.1
ecmascript-runtime@0.2.8
ejson@1.0.9
es5-shim@4.5.8
geojson-utils@1.0.6
hot-code-push@1.0.2
html-tools@1.0.7
htmljs@1.0.7
http@1.1.3
id-map@1.0.5
jquery@1.11.6
launch-screen@1.0.8
livedata@1.0.16
logging@1.0.10
meteor@1.1.12
meteor-base@1.0.2
minifier-css@1.1.9
minifier-js@1.1.9
minimongo@1.0.12
mobile-status-bar@1.0.10
modules@0.5.1
modules-runtime@0.6.1
mongo@1.1.5
mongo-id@1.0.2
npm-mongo@1.4.41
observe-sequence@1.0.9
ordered-dict@1.0.5
promise@0.6.5
random@1.0.7
reactive-dict@1.1.5
reactive-var@1.0.7
reload@1.1.6
retry@1.0.5
routepolicy@1.0.8
session@1.1.3
spacebars@1.0.9
spacebars-compiler@1.0.9
standard-minifier-css@1.0.4
standard-minifier-js@1.0.4
tracker@1.0.11
ui@1.0.9
underscore@1.0.6
url@1.0.7
webapp@1.2.6
webapp-hashing@1.0.7
1 change: 1 addition & 0 deletions app/client/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

17 changes: 17 additions & 0 deletions app/client/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<ion-menu id="leftMenu" [content]="content">

<ion-toolbar primary>
<ion-title>{{appName}}</ion-title>
</ion-toolbar>

<ion-content>
<ion-list>
<button ion-item *ngFor="#page of pages" (click)="openPage(page)">
{{page.title | translate}}
</button>
</ion-list>
</ion-content>

</ion-menu>

<ion-nav id="nav" [root]="rootPage" #content swipe-back-enabled="false"></ion-nav>
131 changes: 131 additions & 0 deletions app/client/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
import {MeteorComponent} from 'angular2-meteor';
import {App, IonicApp, Platform} from 'ionic-framework/index';
import {Component, NgZone, provide} from 'angular2/core';
import {Http, HTTP_PROVIDERS} from 'angular2/http';
import {TranslateService, TranslatePipe, TranslateLoader, TranslateStaticLoader} from 'ng2-translate/ng2-translate';

/*********/
/* Pages */
import {HomePage} from './pages/home/home';

declare var Session;

@App({
templateUrl: '/client/app.html',
config: { // http://ionicframework.com/docs/v2/api/config/Config/
//mode: 'md',
//pageTransition: 'ios',
//swipeBackEnabled: false,
//tabbarPlacement: 'top'
},
providers: [
HTTP_PROVIDERS,
provide(TranslateLoader, {
useFactory: (http:Http) => new TranslateStaticLoader(http, '/i18n', '.json'),
deps: [Http]
}),
TranslateService
],
pipes: [TranslatePipe]
})
class MyApp extends MeteorComponent {
// Set the root (or first) page
rootPage:any;
pages:Array<{icon?: string, title: string, component: any}>;
appName:string;
//user:Meteor.User;

constructor(private app:IonicApp,
private platform:Platform,
private zone:NgZone,
private translate:TranslateService) {
super();
this.translate = translate;
this.initializeApp();

// set the root (or first) page
//if (Meteor.user()) {
this.rootPage = HomePage;
//} else {
// this.rootPage = LoginPage;
//}

// set the nav menu title to the application name from settings.json
this.appName = Meteor.settings.public.appName;

// set our app's pages
this.pages = [
{icon: "home", title: 'home.title', component: HomePage},
];

Tracker.autorun(() => zone.run(() => {
// Use this to update component variables based on reactive sources.
// (i.e. Monogo collections or Session variables)
}));
}

initializeApp() {
this.platform.ready().then(() => {
// The platform is now ready. Note: if this callback fails to fire, follow
// the Troubleshooting guide for a number of possible solutions:
//
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
//
// First, let's hide the keyboard accessory bar (only works natively) since
// that's a better default:
//
// Keyboard.setAccessoryBarVisible(false);
//
// For example, we might change the StatusBar color. This one below is
// good for dark backgrounds and light text:
// StatusBar.setStyle(StatusBar.LIGHT_CONTENT)


this.initializeTranslateServiceConfig();
});
}

initializeTranslateServiceConfig() {
var prefix = '/i18n/';
var suffix = '.json';

var userLang = navigator.language.split('-')[0];
userLang = /(en|es)/gi.test(userLang) ? userLang : 'en';

this.translate.setDefaultLang('en');
let langPref = Session.get('language');
if (langPref) {
userLang = langPref;
}
Session.set('language', userLang);
this.translate.use(userLang);
}

openPage(page) {
let setRoot = false;
if (page.component === HomePage) {
setRoot = true;
}
this.navigate({page: page.component, setRoot: setRoot});
}

logout():void {
Meteor.logout();
//this.navigate({page: LoginPage, setRoot: true});
}

navigate(location:{page:any, setRoot:boolean}):void {
// close the menu when clicking a link from the menu
// getComponent selector is the component id attribute
this.app.getComponent('leftMenu').close();
// navigate to the new page if it is not the current page
let nav = this.app.getComponent('nav');
if (location.setRoot) {
//nav.setRoot(location.page);
nav.popToRoot();
} else {
nav.push(location.page);
}
}
}
1 change: 1 addition & 0 deletions app/client/collections/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

12 changes: 12 additions & 0 deletions app/client/components/welcome-header/welcome-header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<ion-card>
<ion-card-header>
{{"welcome-header.welcome" | translate}}
</ion-card-header>
<ion-card-content>
<p>This start project is to help you get a Meteor application, styled using Ionic 2, up and running in record
time.</p>
<p>
Continue by follow along on the tutorial section of the Ionic docs!
</p>
</ion-card-content>
</ion-card>
20 changes: 20 additions & 0 deletions app/client/components/welcome-header/welcome-header.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Created by mjwheatley on 3/2/16.
*/
import {Component} from 'angular2/core';
import {IONIC_DIRECTIVES} from 'ionic-framework/index';
import {TranslateService, TranslatePipe} from 'ng2-translate/ng2-translate';

@Component({
selector: 'welcome-header',
templateUrl: '/client/components/welcome-header/welcome-header.html',
directives: [IONIC_DIRECTIVES],
pipes: [TranslatePipe]
})
export class WelcomeHeaderComponent {
constructor(
private translate:TranslateService
) {
this.translate = translate;
}
}
3 changes: 3 additions & 0 deletions app/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<body>
<ion-app></ion-app>
</body>
1 change: 1 addition & 0 deletions app/client/lib/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

17 changes: 17 additions & 0 deletions app/client/pages/home/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<ion-navbar *navbar primary>
<button menuToggle (click)="menuClick()">
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>{{"home.title" | translate}}</ion-title>
</ion-navbar>


<ion-content>
<welcome-header></welcome-header>
<ion-card>
<ion-list-header>i18n</ion-list-header>
<ion-card-content>
This application also features support for internationalization using the ng2-translate node module.
</ion-card-content>
</ion-card>
</ion-content>
21 changes: 21 additions & 0 deletions app/client/pages/home/home.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {Page, NavController} from 'ionic-framework/index';
import {TranslateService, TranslatePipe} from 'ng2-translate/ng2-translate';
import {WelcomeHeaderComponent} from '../../components/welcome-header/welcome-header';

@Page({
templateUrl: '/client/pages/home/home.html',
pipes: [TranslatePipe],
directives: [WelcomeHeaderComponent]
})
export class HomePage {
constructor(private nav:NavController,
private translate:TranslateService
) {
this.nav = nav;
this.translate = translate;
}

menuClick(){
console.log("Clicked on the menu button.");
}
}
1 change: 1 addition & 0 deletions app/client/stylesheets/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading

0 comments on commit 0e89d3e

Please sign in to comment.