FIX: Updated Ionic to newest revisions

This commit is contained in:
jason.wall 2016-09-12 13:12:25 -04:00
parent ad639f0b3b
commit aba7058e17
22 changed files with 283 additions and 3401 deletions

View File

@ -0,0 +1,17 @@
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

View File

@ -1,40 +1,48 @@
import {App, IonicApp, Platform, MenuController} from 'ionic-angular'; import {Component, ViewChild} from '@angular/core';
import {StatusBar} from 'ionic-native'; import {ionicBootstrap, Platform, MenuController, Nav} from 'ionic-angular';
import {SearchPage} from './pages/search/search'; import {StatusBar} from 'ionic-native';
import {SearchPage} from './pages/search/search';
@App({
templateUrl: 'build/app.html',
config: {} // http://ionicframework.com/docs/v2/api/config/Config/ @Component({
}) templateUrl: 'build/app.html'
class MyApp { })
// make HelloIonicPage the root (or first) page class MyApp
rootPage: any = SearchPage; {
pages: Array<{title: string, component: any}>; @ViewChild(Nav) nav: Nav;
constructor( // make HelloIonicPage the root (or first) page
private app: IonicApp, rootPage: any = SearchPage;
private platform: Platform, pages: Array<{ title: string, component: any }>;
private menu: MenuController
) { constructor(
this.initializeApp(); public platform: Platform,
public menu: MenuController
// set our app's pages )
this.pages = []; {
} this.initializeApp();
initializeApp() { // set our app's pages
this.platform.ready().then(() => { this.pages = [];
// Okay, so the platform is ready and our plugins are available. }
// Here you can do any higher level native things you might need.
StatusBar.styleDefault(); initializeApp()
}); {
} this.platform.ready().then(() =>
{
openPage(page) { // Okay, so the platform is ready and our plugins are available.
// close the menu when clicking a link from the menu // Here you can do any higher level native things you might need.
this.menu.close(); StatusBar.styleDefault();
// navigate to the new page if it is not the current page });
let nav = this.app.getComponent('nav'); }
nav.setRoot(page.component);
} openPage(page)
} {
// close the menu when clicking a link from the menu
this.menu.close();
// navigate to the new page if it is not the current page
this.nav.setRoot(page.component);
}
}
ionicBootstrap(MyApp);

View File

@ -1,73 +1,86 @@
import { Injectable } from 'angular2/core'; /// <reference path="../typings/browser/ambient/jquery/index.d.ts" />
/// <reference path="types.ts" />
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import { Http, Response } from 'angular2/http'; import { Http, Response } from '@angular/http';
/// <reference path="../../../typings/browser/ambient/jquery/jquery.d.ts" />
/// <reference path="../../types.ts"/>
@Injectable() @Injectable()
export class BibleService { export class BibleService
chapters: BiblePassage[]; {
result: BiblePassageResult; chapters: BiblePassage[];
count: number = 0; result: BiblePassageResult;
count: number = 0;
constructor(private http: Http) constructor(private http: Http)
{ {
} }
getPassage(section: Section): BiblePassageResult { getPassage(section: Section): BiblePassageResult
try { {
var self = this; try
{
var self = this;
this.chapters = []; // the verses from the chapter. this.chapters = []; // the verses from the chapter.
this.result = { this.result = {
cs: [], cs: [],
testament: "", testament: "",
ref: "" ref: "",
id: 0
}; };
this.count = Number(section.end.chapter) - Number(section.start.chapter)+1; this.count = Number(section.end.chapter) - Number(section.start.chapter) + 1;
for (let i = Number(section.start.chapter); i <= Number(section.end.chapter); i++) { for (let i = Number(section.start.chapter); i <= Number(section.end.chapter); i++)
{
let url = "data/bibles/kjv_strongs/" + section.start.book + "-" + i + ".json"; let url = "data/bibles/kjv_strongs/" + section.start.book + "-" + i + ".json";
jQuery.ajax({ jQuery.ajax({
async: false, async: false,
type: "GET", type: "GET",
url: url, url: url,
dataType: "json", dataType: "json",
success: function (d: BiblePassage, t, x) { success: function (d: BiblePassage, t, x)
{
self.chapters.push(d); self.chapters.push(d);
}, },
error: function (request, status, error) { error: function (request, status, error)
{
//Util.HandleError(error); //Util.HandleError(error);
} }
}); });
} }
for (let j = 0; j < this.chapters.length; j++) { for (let j = 0; j < this.chapters.length; j++)
{
let vss: BibleVerse[] = []; let vss: BibleVerse[] = [];
let start; let start;
let end; let end;
// figure out the start verse. // figure out the start verse.
if (j == 0) { if (j == 0)
{
start = section.start.verse; start = section.start.verse;
} else { } else
{
start = 1; start = 1;
} }
// figure out the end verse // figure out the end verse
if ((j + 1) == this.chapters.length) { if ((j + 1) == this.chapters.length)
{
end = section.end.verse; end = section.end.verse;
} else { } else
{
end = "*"; end = "*";
} }
// get the verses requested. // get the verses requested.
let tvs = this.chapters[j].vss.length; let tvs = this.chapters[j].vss.length;
if (end == "*" || end > tvs) { if (end == "*" || end > tvs)
{
end = tvs; end = tvs;
} }
for (let i = start; i <= end; i++) { for (let i = start; i <= end; i++)
{
// we're using c based indexes here, so the index is 1 less than the verse #. // we're using c based indexes here, so the index is 1 less than the verse #.
vss.push(this.chapters[j].vss[i - 1]); vss.push(this.chapters[j].vss[i - 1]);
} }
@ -78,13 +91,16 @@ export class BibleService {
}); });
} }
if (section.start.book >= 40) { if (section.start.book >= 40)
{
this.result.testament = "new"; this.result.testament = "new";
} else { } else
{
this.result.testament = "old"; this.result.testament = "old";
} }
return this.result; return this.result;
} catch (err) { } catch (err)
{
//Util.HandleError(err); //Util.HandleError(err);
} }
return null; return null;

View File

@ -1,38 +1,30 @@
<ion-navbar *navbar> <ion-header>
<button menuToggle> <ion-navbar>
<ion-icon name="menu"></ion-icon> <button menuToggle>
</button> <ion-icon name="menu"></ion-icon>
<ion-searchbar [(ngmodel)]="searchQuery" (search)="getItems($event)" (input)="setQuery($event)"></ion-searchbar> </button>
</ion-navbar> <ion-searchbar [(ngmodel)]="searchQuery" (search)="getItems($event)" (input)="setQuery($event)"></ion-searchbar>
</ion-navbar>
</ion-header>
<ion-content padding class="getting-started"> <ion-content padding class="search-card">
<ion-card *ngFor="let item of items" (swipe)="removeItem(item)">
<ion-card *ngFor="#item of items"> <ion-card-title class="title" padding>{{item.ref}}</ion-card-title>
<ion-card-content>
<ion-item> <div *ngFor="let ch of item.cs">
<h1>{{item.ref}}</h1> <br>
</ion-item> <h2 *ngIf="item.cs.length > 1"><b>Chapter {{ch.ch}}</b></h2>
<span *ngFor="let vs of ch.vss"><b>{{vs.v}}.</b> <span *ngFor="let w of vs.w">{{w.t}}</span><br></span>
<ion-card-content> </div>
<br> </ion-card-content>
<div *ngFor="#ch of item.cs"> <ion-item>
<h2 *ngIf="item.cs.length > 1"><b>Chapter {{ch.ch}}</b></h2> <button primary clear item-left (click)="removeItem(item)">
<span *ngFor="#vs of ch.vss"><b>{{vs.v}}.</b> <span *ngFor="#w of vs.w">{{w.t}}</span><br></span> <ion-icon name="close-circle"></ion-icon>
</div> <div>Close</div>
</ion-card-content> </button>
<button primary clear item-left>
<ion-item> <ion-icon name="text"></ion-icon>
<button primary clear item-left> <div>4 Comments</div>
<ion-icon name="thumbs-up"></ion-icon> </button>
<div>12 Likes</div> </ion-item>
</button> </ion-card>
<button primary clear item-left>
<ion-icon name="text"></ion-icon>
<div>4 Comments</div>
</button>
</ion-item>
</ion-card>
</ion-content> </ion-content>

View File

@ -1,4 +1,4 @@
.getting-started { .search-card {
p { p {
margin: 20px 0; margin: 20px 0;
@ -7,3 +7,7 @@
} }
} }
.title{
background-color:gainsboro;
}

View File

@ -1,31 +1,43 @@
import {Injectable} from 'angular2/core'; /// <reference path="../../types.ts" />
import {Page} from 'ionic-angular'; import {Injectable} from '@angular/core';
import {Reference} from '../../Reference'; import {Reference} from '../../Reference';
import {BibleService} from '../../bible-service'; import {BibleService} from '../../bible-service';
/// <reference path="../../Types.ts"/> import {Component} from '@angular/core';
import { LoadingController } from 'ionic-angular';
@Page({
@Component({
templateUrl: 'build/pages/search/search.html', templateUrl: 'build/pages/search/search.html',
providers: [BibleService] providers: [BibleService]
}) })
export class SearchPage { export class SearchPage {
searchQuery: string = ''; searchQuery: string = '';
items: BiblePassageResult[]; items: BiblePassageResult[];
last: number;
constructor(private bibleService: BibleService) { constructor(private bibleService: BibleService, public loadingCtrl: LoadingController) {
this.initializeItems(); this.initializeItems();
} }
initializeItems() { initializeItems() {
this.items = []; this.items = [];
this.last = 0;
} }
setQuery(searchbar) { setQuery(searchbar) {
this.searchQuery = searchbar.value; this.searchQuery = searchbar.target.value;
}
removeItem(item) {
let idx = this.items.indexOf(item);
this.items.splice(idx, 1);
} }
getItems(searchbar) { getItems(searchbar) {
try { try
{
let loader = this.loadingCtrl.create({
content: "Retrieving passage...",
dismissOnPageChange: true
});
loader.present();
let qs = this.searchQuery.split(";"); let qs = this.searchQuery.split(";");
for (let x in qs) { for (let x in qs) {
let q = qs[x].trim(); let q = qs[x].trim();
@ -66,11 +78,12 @@ export class SearchPage {
let myref = new Reference(q.trim()); let myref = new Reference(q.trim());
let r = this.bibleService.getPassage(myref.Section); let r = this.bibleService.getPassage(myref.Section);
r.ref = myref.toString(); r.ref = myref.toString();
this.items.unshift(r); r.id = this.last++;
this.items.push(r);
//CurrentReferences[myref.toString().toLowerCase()] = true; //CurrentReferences[myref.toString().toLowerCase()] = true;
} }
} }
loader.dismiss();
} }
} }

View File

@ -16,7 +16,8 @@ type BibleVerse = {
type BiblePassageResult = { type BiblePassageResult = {
cs: BiblePassage[], cs: BiblePassage[],
testament: string, testament: string,
ref: string ref: string,
id: number
} }

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.ionicframework.dynamicbible337302" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <widget id="com.ionicframework.test117969" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>DynamicBible</name> <name>test</name>
<description>An Ionic Framework and Cordova project.</description> <description>An Ionic Framework and Cordova project.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author> <author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html"/> <content src="index.html"/>
@ -23,6 +23,8 @@
<preference name="DisallowOverscroll" value="true"/> <preference name="DisallowOverscroll" value="true"/>
<preference name="android-minSdkVersion" value="16"/> <preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/> <preference name="BackupWebStorage" value="none"/>
<preference name="SplashScreenDelay" value="2000"/>
<preference name="FadeSplashScreenDuration" value="2000"/>
<feature name="StatusBar"> <feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar"/> <param name="ios-package" onload="true" value="CDVStatusBar"/>
</feature> </feature>
@ -31,5 +33,5 @@
<plugin name="cordova-plugin-whitelist" spec="~1.2.2"/> <plugin name="cordova-plugin-whitelist" spec="~1.2.2"/>
<plugin name="cordova-plugin-splashscreen" spec="~3.2.2"/> <plugin name="cordova-plugin-splashscreen" spec="~3.2.2"/>
<plugin name="cordova-plugin-statusbar" spec="~2.1.3"/> <plugin name="cordova-plugin-statusbar" spec="~2.1.3"/>
<plugin name="ionic-plugin-keyboard" spec="~2.2.0"/> <plugin name="ionic-plugin-keyboard" spec="~2.2.1"/>
</widget> </widget>

View File

@ -32,6 +32,7 @@ var buildSass = require('ionic-gulp-sass-build');
var copyHTML = require('ionic-gulp-html-copy'); var copyHTML = require('ionic-gulp-html-copy');
var copyFonts = require('ionic-gulp-fonts-copy'); var copyFonts = require('ionic-gulp-fonts-copy');
var copyScripts = require('ionic-gulp-scripts-copy'); var copyScripts = require('ionic-gulp-scripts-copy');
var tslint = require('ionic-gulp-tslint');
var isRelease = argv.indexOf('--release') > -1; var isRelease = argv.indexOf('--release') > -1;
@ -70,3 +71,4 @@ gulp.task('scripts', copyScripts);
gulp.task('clean', function(){ gulp.task('clean', function(){
return del('www/build'); return del('www/build');
}); });
gulp.task('lint', tslint);

View File

@ -1,11 +1,9 @@
{ {
"name": "DynamicBible", "name": "test",
"app_id": "", "app_id": "",
"v2": true, "v2": true,
"typescript": true,
"watchPatterns": [ "watchPatterns": [
"www/**", "www/**",
"!www/data/**", "!www/data/**"
"!www/lib/**"
] ]
} }

View File

@ -1,25 +1,35 @@
{ {
"dependencies": { "dependencies": {
"angular2": "2.0.0-beta.15", "@angular/common": "2.0.0-rc.4",
"es6-shim": "^0.35.0", "@angular/compiler": "2.0.0-rc.4",
"ionic-angular": "2.0.0-beta.6", "@angular/core": "2.0.0-rc.4",
"ionic-native": "^1.1.0", "@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/http": "2.0.0-rc.4",
"@angular/forms": "0.2.0",
"es6-shim": "0.35.1",
"ionic-angular": "2.0.0-beta.11",
"ionic-native": "1.3.10",
"ionicons": "3.0.0", "ionicons": "3.0.0",
"rxjs": "5.0.0-beta.2" "reflect-metadata": "0.1.8",
"rxjs": "5.0.0-beta.6",
"zone.js": "0.6.12"
}, },
"devDependencies": { "devDependencies": {
"del": "2.2.0", "del": "2.2.0",
"gulp": "3.9.1", "gulp": "3.9.1",
"gulp-watch": "4.3.5", "gulp-watch": "4.3.5",
"ionic-gulp-browserify-typescript": "^1.1.0", "ionic-gulp-browserify-typescript": "2.0.0",
"ionic-gulp-fonts-copy": "^1.0.0", "ionic-gulp-fonts-copy": "^1.0.0",
"ionic-gulp-html-copy": "^1.0.0", "ionic-gulp-html-copy": "^1.0.0",
"ionic-gulp-sass-build": "^1.0.0", "ionic-gulp-sass-build": "^1.0.0",
"ionic-gulp-scripts-copy": "^1.0.1", "ionic-gulp-scripts-copy": "^2.0.0",
"ionic-gulp-tslint": "^1.0.0",
"tslint-ionic-rules": "0.0.4",
"run-sequence": "1.1.5" "run-sequence": "1.1.5"
}, },
"name": "dynamicbible", "name": "test",
"description": "DynamicBible: A Bible App made for study.", "description": "test: An Ionic project",
"cordovaPlugins": [ "cordovaPlugins": [
"cordova-plugin-device", "cordova-plugin-device",
"cordova-plugin-console", "cordova-plugin-console",

View File

@ -11,8 +11,8 @@
], ],
"exclude": [ "exclude": [
"node_modules", "node_modules",
"typings/main", "typings/global",
"typings/main.d.ts" "typings/global.d.ts"
], ],
"compileOnSave": false, "compileOnSave": false,
"atom": { "atom": {

View File

@ -0,0 +1,6 @@
{
"extends": "tslint-ionic-rules",
"rules" : {
}
}

View File

@ -1,8 +1,7 @@
{ {
"dependencies": {}, "dependencies": {},
"devDependencies": {}, "devDependencies": {},
"ambientDependencies": { "globalDependencies": {
"es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654", "es6-shim": "registry:dt/es6-shim#0.31.2+20160602141504"
"jquery": "registry:dt/jquery#1.10.0+20160417213236"
} }
} }

View File

@ -1,10 +1,5 @@
// Generated by typings // Generated by typings
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/es6-shim/es6-shim.d.ts // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/9807d9b701f58be068cb07833d2b24235351d052/es6-shim/es6-shim.d.ts
// Type definitions for es6-shim v0.31.2
// Project: https://github.com/paulmillr/es6-shim
// Definitions by: Ron Buckton <http://github.com/rbuckton>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare type PropertyKey = string | number | symbol; declare type PropertyKey = string | number | symbol;
interface IteratorResult<T> { interface IteratorResult<T> {
@ -584,6 +579,7 @@ interface Set<T> {
entries(): IterableIteratorShim<[T, T]>; entries(): IterableIteratorShim<[T, T]>;
keys(): IterableIteratorShim<T>; keys(): IterableIteratorShim<T>;
values(): IterableIteratorShim<T>; values(): IterableIteratorShim<T>;
'_es6-shim iterator_'(): IterableIteratorShim<T>;
} }
interface SetConstructor { interface SetConstructor {

View File

@ -0,0 +1,8 @@
{
"resolution": "main",
"tree": {
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/9807d9b701f58be068cb07833d2b24235351d052/es6-shim/es6-shim.d.ts",
"raw": "registry:dt/es6-shim#0.31.2+20160602141504",
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/9807d9b701f58be068cb07833d2b24235351d052/es6-shim/es6-shim.d.ts"
}
}

1
DynamicBibleIonic/typings/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
/// <reference path="globals/es6-shim/index.d.ts" />

View File

@ -1,2 +0,0 @@
/// <reference path="main/ambient/es6-shim/index.d.ts" />
/// <reference path="main/ambient/jquery/index.d.ts" />

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,38 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title>Ionic</title> <title>Ionic</title>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link ios-href="build/css/app.ios.css" rel="stylesheet"> <link rel="manifest" href="manifest.json">
<link md-href="build/css/app.md.css" rel="stylesheet">
<link wp-href="build/css/app.wp.css" rel="stylesheet"> <!-- un-comment this code to enable service worker
</head> <script>
<body> if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js')
<ion-app></ion-app> .then(() => console.log('service worker installed'))
.catch(err => console.log('Error', err));
<!-- cordova.js required for cordova apps --> }
<script src="cordova.js"></script> </script>-->
<!-- Polyfill needed for platforms without Promise and Collection support -->
<script src="build/js/es6-shim.min.js"></script> <link ios-href="build/css/app.ios.css" rel="stylesheet">
<!-- Zone.js and Reflect-metadata --> <link md-href="build/css/app.md.css" rel="stylesheet">
<script src="build/js/angular2-polyfills.js"></script> <link wp-href="build/css/app.wp.css" rel="stylesheet">
<!-- the bundle which is built from the app's source code --> </head>
<script src="build/js/app.bundle.js"></script> <body>
<script src="lib/jquery.min.js"></script>
</body> <ion-app></ion-app>
</html>
<!-- cordova.js required for cordova apps -->
<script src="cordova.js"></script>
<!-- Polyfill needed for platforms without Promise and Collection support -->
<script src="build/js/es6-shim.min.js"></script>
<!-- Zone.js and Reflect-metadata -->
<script src="build/js/Reflect.js"></script>
<script src="build/js/zone.js"></script>
<!-- the bundle which is built from the app's source code -->
<script src="build/js/app.bundle.js"></script>
<script src="lib/jquery.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,11 @@
{
"name": "My Ionic App",
"short_name": "My Ionic App",
"start_url": "index.html",
"display": "standalone",
"icons": [{
"src": "icon.png",
"sizes": "512x512",
"type": "image/png"
}]
}

View File

@ -0,0 +1,11 @@
self.addEventListener('activate', function (event) {
});
self.addEventListener('fetch', function (event) {
});
self.addEventListener('push', function (event) {
});