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 {StatusBar} from 'ionic-native';
import {SearchPage} from './pages/search/search';
@App({
templateUrl: 'build/app.html',
config: {} // http://ionicframework.com/docs/v2/api/config/Config/
})
class MyApp {
// make HelloIonicPage the root (or first) page
rootPage: any = SearchPage;
pages: Array<{title: string, component: any}>;
constructor(
private app: IonicApp,
private platform: Platform,
private menu: MenuController
) {
this.initializeApp();
// set our app's pages
this.pages = [];
}
initializeApp() {
this.platform.ready().then(() => {
// 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();
});
}
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
let nav = this.app.getComponent('nav');
nav.setRoot(page.component);
}
}
import {Component, ViewChild} from '@angular/core';
import {ionicBootstrap, Platform, MenuController, Nav} from 'ionic-angular';
import {StatusBar} from 'ionic-native';
import {SearchPage} from './pages/search/search';
@Component({
templateUrl: 'build/app.html'
})
class MyApp
{
@ViewChild(Nav) nav: Nav;
// make HelloIonicPage the root (or first) page
rootPage: any = SearchPage;
pages: Array<{ title: string, component: any }>;
constructor(
public platform: Platform,
public menu: MenuController
)
{
this.initializeApp();
// set our app's pages
this.pages = [];
}
initializeApp()
{
this.platform.ready().then(() =>
{
// 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();
});
}
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 { Http, Response } from 'angular2/http';
/// <reference path="../../../typings/browser/ambient/jquery/jquery.d.ts" />
/// <reference path="../../types.ts"/>
import { Http, Response } from '@angular/http';
@Injectable()
export class BibleService {
chapters: BiblePassage[];
result: BiblePassageResult;
count: number = 0;
export class BibleService
{
chapters: BiblePassage[];
result: BiblePassageResult;
count: number = 0;
constructor(private http: Http)
{
}
constructor(private http: Http)
{
}
getPassage(section: Section): BiblePassageResult {
try {
var self = this;
getPassage(section: Section): BiblePassageResult
{
try
{
var self = this;
this.chapters = []; // the verses from the chapter.
this.result = {
cs: [],
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";
jQuery.ajax({
jQuery.ajax({
async: false,
type: "GET",
url: url,
dataType: "json",
success: function (d: BiblePassage, t, x) {
success: function (d: BiblePassage, t, x)
{
self.chapters.push(d);
},
error: function (request, status, error) {
error: function (request, status, 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 start;
let end;
// figure out the start verse.
if (j == 0) {
if (j == 0)
{
start = section.start.verse;
} else {
} else
{
start = 1;
}
// figure out the end verse
if ((j + 1) == this.chapters.length) {
if ((j + 1) == this.chapters.length)
{
end = section.end.verse;
} else {
} else
{
end = "*";
}
// get the verses requested.
let tvs = this.chapters[j].vss.length;
if (end == "*" || end > tvs) {
if (end == "*" || 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 #.
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";
} else {
} else
{
this.result.testament = "old";
}
return this.result;
} catch (err) {
} catch (err)
{
//Util.HandleError(err);
}
return null;

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
<?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">
<name>DynamicBible</name>
<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>test</name>
<description>An Ionic Framework and Cordova project.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html"/>
@ -23,6 +23,8 @@
<preference name="DisallowOverscroll" value="true"/>
<preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashScreenDelay" value="2000"/>
<preference name="FadeSplashScreenDuration" value="2000"/>
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar"/>
</feature>
@ -31,5 +33,5 @@
<plugin name="cordova-plugin-whitelist" spec="~1.2.2"/>
<plugin name="cordova-plugin-splashscreen" spec="~3.2.2"/>
<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>

View File

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

View File

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

View File

@ -1,25 +1,35 @@
{
"dependencies": {
"angular2": "2.0.0-beta.15",
"es6-shim": "^0.35.0",
"ionic-angular": "2.0.0-beta.6",
"ionic-native": "^1.1.0",
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@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",
"rxjs": "5.0.0-beta.2"
"reflect-metadata": "0.1.8",
"rxjs": "5.0.0-beta.6",
"zone.js": "0.6.12"
},
"devDependencies": {
"del": "2.2.0",
"gulp": "3.9.1",
"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-html-copy": "^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"
},
"name": "dynamicbible",
"description": "DynamicBible: A Bible App made for study.",
"name": "test",
"description": "test: An Ionic project",
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",

View File

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

View File

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

View File

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

View File

@ -1,10 +1,5 @@
// Generated by typings
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/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
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/9807d9b701f58be068cb07833d2b24235351d052/es6-shim/es6-shim.d.ts
declare type PropertyKey = string | number | symbol;
interface IteratorResult<T> {
@ -584,6 +579,7 @@ interface Set<T> {
entries(): IterableIteratorShim<[T, T]>;
keys(): IterableIteratorShim<T>;
values(): IterableIteratorShim<T>;
'_es6-shim iterator_'(): IterableIteratorShim<T>;
}
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>
<html lang="en">
<head>
<title>Ionic</title>
<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">
<link ios-href="build/css/app.ios.css" rel="stylesheet">
<link md-href="build/css/app.md.css" rel="stylesheet">
<link wp-href="build/css/app.wp.css" rel="stylesheet">
</head>
<body>
<ion-app></ion-app>
<!-- 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/angular2-polyfills.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>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Ionic</title>
<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">
<link rel="manifest" href="manifest.json">
<!-- un-comment this code to enable service worker
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js')
.then(() => console.log('service worker installed'))
.catch(err => console.log('Error', err));
}
</script>-->
<link ios-href="build/css/app.ios.css" rel="stylesheet">
<link md-href="build/css/app.md.css" rel="stylesheet">
<link wp-href="build/css/app.wp.css" rel="stylesheet">
</head>
<body>
<ion-app></ion-app>
<!-- 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) {
});