mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-27 01:19:52 -04:00
FEATURE: Added icons, Update page with current results, current page label
* fixed colors, some bugs * moved saved pages action to actions menu * updated settings with nicer buttons/layout
This commit is contained in:
parent
1947ab51a2
commit
002a64106f
@ -28,14 +28,15 @@
|
|||||||
"@angular/platform-server": "2.2.1",
|
"@angular/platform-server": "2.2.1",
|
||||||
"@ionic/storage": "1.1.7",
|
"@ionic/storage": "1.1.7",
|
||||||
"@types/jasmine": "^2.5.38",
|
"@types/jasmine": "^2.5.38",
|
||||||
"ionic-angular": "2.0.0-rc.4",
|
"ionic-angular": "2.0.0-rc.5",
|
||||||
"ionic-native": "2.2.11",
|
"ionic-native": "2.2.11",
|
||||||
"ionicons": "3.0.0",
|
"ionicons": "3.0.0",
|
||||||
"rxjs": "5.0.0-beta.12",
|
"rxjs": "5.0.0-beta.12",
|
||||||
"zone.js": "0.6.26"
|
"zone.js": "0.6.26",
|
||||||
|
"sw-toolbox": "3.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@ionic/app-scripts": "0.0.47",
|
"@ionic/app-scripts": "1.0.0",
|
||||||
"@types/jasmine": "2.5.38",
|
"@types/jasmine": "2.5.38",
|
||||||
"@types/node": "6.0.42",
|
"@types/node": "6.0.42",
|
||||||
"angular-cli": "1.0.0-beta.24",
|
"angular-cli": "1.0.0-beta.24",
|
||||||
@ -53,7 +54,7 @@
|
|||||||
"ts-node": "1.7.2",
|
"ts-node": "1.7.2",
|
||||||
"tslint": "4.1.1",
|
"tslint": "4.1.1",
|
||||||
"tslint-eslint-rules": "3.2.0",
|
"tslint-eslint-rules": "3.2.0",
|
||||||
"typescript": "2.0.10"
|
"typescript": "2.0.9"
|
||||||
},
|
},
|
||||||
"cordovaPlugins": [
|
"cordovaPlugins": [
|
||||||
"cordova-plugin-whitelist",
|
"cordova-plugin-whitelist",
|
||||||
|
@ -38,7 +38,19 @@ export class MyApp
|
|||||||
openPage(page)
|
openPage(page)
|
||||||
{
|
{
|
||||||
// close the menu when clicking a link from the menu
|
// close the menu when clicking a link from the menu
|
||||||
this.menu.close();
|
this.menu.close('pages');
|
||||||
|
|
||||||
|
// because the actions menu is on a Page component, and you swap the SearchPage out,
|
||||||
|
// the menu get registered multiple times. to avoid some pages not opening the menu because
|
||||||
|
// multiple menus with the same id exist and the first one in the list is returned (which happens
|
||||||
|
// be disabled when another of the same id is added) it won't show. because not enabled.
|
||||||
|
// ---
|
||||||
|
// unregistering the actions menu whenever a new page is opened fixes the problem, because the menu
|
||||||
|
// will get reregistered when SearchPage loads. Also, if you go to a non SearchPage, the actions
|
||||||
|
// menu won't be there, but the unregister function doesn't fail if a non existent id is given,
|
||||||
|
// so thats ok.
|
||||||
|
this.menu.unregister(this.menu.get('actions'));
|
||||||
|
|
||||||
// navigate to the new page if it is not the current page
|
// navigate to the new page if it is not the current page
|
||||||
this.nav.setRoot(page.component, page.params);
|
this.nav.setRoot(page.component, page.params);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<ion-menu [content]="content">
|
<ion-menu [content]="content" id="pages">
|
||||||
<ion-header>
|
<ion-header>
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-title>Pages</ion-title>
|
<ion-title>Pages</ion-title>
|
||||||
@ -7,7 +7,7 @@
|
|||||||
<ion-content>
|
<ion-content>
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<button ion-item *ngFor="let p of pagesSvc.getMainPages()" (click)="openPage(p)">
|
<button ion-item *ngFor="let p of pagesSvc.getMainPages()" (click)="openPage(p)">
|
||||||
{{p.title}}
|
<ion-icon name="{{p.icon}}" item-left></ion-icon> {{p.title}}
|
||||||
</button>
|
</button>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
<ion-list>
|
<ion-list>
|
||||||
@ -15,9 +15,10 @@
|
|||||||
Saved Pages
|
Saved Pages
|
||||||
</ion-list-header>
|
</ion-list-header>
|
||||||
<button ion-item *ngFor="let p of pagesSvc.getSavedPages()" (click)="openPage(p)">
|
<button ion-item *ngFor="let p of pagesSvc.getSavedPages()" (click)="openPage(p)">
|
||||||
{{p.title}}
|
<ion-icon name="bookmark" item-left></ion-icon> {{p.title}}
|
||||||
</button>
|
</button>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
</ion-menu>
|
</ion-menu>
|
||||||
|
|
||||||
<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
|
<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
|
@ -1,5 +1,5 @@
|
|||||||
<ion-item class="title passage-title">
|
<ion-item class="title passage-title">
|
||||||
{{item.ref}}
|
<ion-icon name="book" item-left></ion-icon> {{item.ref}}
|
||||||
<button ion-button icon-only item-right large clear (click)="close()">
|
<button ion-button icon-only item-right large clear (click)="close()">
|
||||||
<ion-icon name="close-circle"></ion-icon>
|
<ion-icon name="close-circle"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
.passage-title {
|
passage .button-clear-md {
|
||||||
background-color: #c3cce4;
|
color: #3D5699;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.passage-title {
|
||||||
|
background-color: #c3cce4;
|
||||||
|
}
|
||||||
|
|
||||||
passage .passage-text {
|
passage .passage-text {
|
||||||
padding-bottom: 12px;
|
padding-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.passage-text + .passage-text
|
.passage-text + .passage-text {
|
||||||
{
|
|
||||||
border-top: 1px dotted #808080;
|
border-top: 1px dotted #808080;
|
||||||
padding-top: 12px;
|
padding-top: 12px;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<ion-header>
|
<ion-header>
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-title>
|
<ion-title>
|
||||||
Strongs: {{item.prefix}}{{item.sn}}
|
<ion-icon name="paper" item-left></ion-icon> Strongs: {{item.prefix}}{{item.sn}}
|
||||||
</ion-title>
|
</ion-title>
|
||||||
<ion-buttons start>
|
<ion-buttons start>
|
||||||
<button ion-button (click)="dismiss()" large>
|
<button ion-button (click)="dismiss()" large>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<ion-item class="title strongs-title" padding>
|
<ion-item class="title strongs-title" padding>
|
||||||
{{item.prefix}}{{item.sn}}
|
<ion-icon name="paper" item-left></ion-icon> {{item.prefix}}{{item.sn}}
|
||||||
<button ion-button icon-only item-right large clear (click)="close()">
|
<button ion-button icon-only item-right large clear (click)="close()">
|
||||||
<ion-icon name="close-circle"></ion-icon>
|
<ion-icon name="close-circle"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<ion-item class="title words-title" padding>
|
<ion-item class="title words-title" padding>
|
||||||
{{item.refs.length}} results for {{item.word}}
|
<ion-icon name="grid" item-left></ion-icon> {{item.refs.length}} results for {{item.word}}
|
||||||
<button ion-button icon-only item-right large clear (click)="close()">
|
<button ion-button icon-only item-right large clear (click)="close()">
|
||||||
<ion-icon name="close-circle"></ion-icon>
|
<ion-icon name="close-circle"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
|
@ -1,31 +1,38 @@
|
|||||||
|
<ion-menu side="right" [content]="searchcontent" id="actions">
|
||||||
|
<ion-header>
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title>Actions</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content>
|
||||||
|
<ion-list>
|
||||||
|
<button ion-item menuClose="actions" (click)="addPage()">
|
||||||
|
<ion-icon name="bookmarks" item-left></ion-icon>Save Current Results as Page
|
||||||
|
</button>
|
||||||
|
<button ion-item menuClose="actions" (click)="updatePage()">
|
||||||
|
<ion-icon name="arrow-up" item-left></ion-icon>Update Page with current Results
|
||||||
|
</button>
|
||||||
|
</ion-list>
|
||||||
|
</ion-content>
|
||||||
|
</ion-menu>
|
||||||
|
|
||||||
<ion-header>
|
<ion-header>
|
||||||
<ion-navbar>
|
<ion-navbar>
|
||||||
<button ion-button icon-only menuToggle left>
|
<button ion-button icon-only menuToggle left>
|
||||||
<ion-icon name="menu" large></ion-icon>
|
<ion-icon name="menu" large></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
<ion-searchbar (search)="getQuery($event)" (input)="setQuery($event)" [showCancelButton]="true"></ion-searchbar>
|
<ion-searchbar (search)="getQuery($event)" (input)="setQuery($event)" [showCancelButton]="true"></ion-searchbar>
|
||||||
|
<ion-buttons right>
|
||||||
|
<button ion-button icon-only secondary (click)="actionsMenu()">
|
||||||
|
<ion-icon name="apps" large></ion-icon>
|
||||||
|
</button>
|
||||||
|
</ion-buttons>
|
||||||
</ion-navbar>
|
</ion-navbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<ion-content padding class="search-card">
|
<ion-content #searchcontent padding class="search-card">
|
||||||
<ion-card>
|
<span style="font-size: .8em; color: #555;">CURRENT PAGE: {{title}}</span>
|
||||||
<ion-grid>
|
|
||||||
<ion-row>
|
|
||||||
<ion-col style="width: 95px;">
|
|
||||||
<button ion-button right small (click)="addPage()">
|
|
||||||
<ion-icon name="cloud-upload"></ion-icon><div> Save</div>
|
|
||||||
</button>
|
|
||||||
</ion-col>
|
|
||||||
<ion-col style="flex-grow: 100 !important">
|
|
||||||
<ion-item>
|
|
||||||
<ion-input type="text" placeholder="Saved Results Title goes here" [(ngModel)]="saved_results_title"></ion-input>
|
|
||||||
</ion-item>
|
|
||||||
</ion-col>
|
|
||||||
|
|
||||||
</ion-row>
|
|
||||||
</ion-grid>
|
|
||||||
</ion-card>
|
|
||||||
|
|
||||||
<ion-card *ngFor="let item of userProfile.user.items">
|
<ion-card *ngFor="let item of userProfile.user.items">
|
||||||
<error *ngIf="isError(item.type)" [cardItem]="item" [item]="item.data" (onClose)="removeItem($event)"></error>
|
<error *ngIf="isError(item.type)" [cardItem]="item" [item]="item.data" (onClose)="removeItem($event)"></error>
|
||||||
<passage *ngIf="isPassage(item.type)" [cardItem]="item" [item]="item.data" (onClose)="removeItem($event)" [dict]="item.dict" (onItemClicked)="getItemsNextToCard($event)"></passage>
|
<passage *ngIf="isPassage(item.type)" [cardItem]="item" [item]="item.data" (onClose)="removeItem($event)" [dict]="item.dict" (onItemClicked)="getItemsNextToCard($event)"></passage>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
a {
|
a {
|
||||||
color: black;
|
color: black;
|
||||||
border-bottom: 1px dotted gainsboro;
|
border-bottom: 1px dotted #ccc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,3 +37,7 @@ body {
|
|||||||
.item-md.item-block .item-inner {
|
.item-md.item-block .item-inner {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item-md ion-icon[item-left] + .item-inner {
|
||||||
|
margin-left: 6px;
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
import { Type, Component } from '@angular/core';
|
import { Type, Component } from '@angular/core';
|
||||||
import { Loading, LoadingController, ModalController, NavParams } from 'ionic-angular';
|
import { Loading, LoadingController, ModalController, NavParams, AlertController, MenuController } from 'ionic-angular';
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
|
|
||||||
import { StrongsModal } from '../../components/strongs-modal/strongs-modal';
|
import { StrongsModal } from '../../components/strongs-modal/strongs-modal';
|
||||||
@ -23,17 +23,19 @@ export class SearchPage
|
|||||||
userProfile: UserProfile;
|
userProfile: UserProfile;
|
||||||
last: CardItem;
|
last: CardItem;
|
||||||
loader: Loading;
|
loader: Loading;
|
||||||
saved_results_title: string = "";
|
title: string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private strongsService: StrongsService
|
private strongsService: StrongsService
|
||||||
,private bibleService: BibleService
|
, private bibleService: BibleService
|
||||||
,private wordService: WordService
|
, private wordService: WordService
|
||||||
,private pagesService: PagesService
|
, private pagesService: PagesService
|
||||||
,public loadingCtrl: LoadingController
|
, private alertCtrl: AlertController
|
||||||
,public modalCtrl: ModalController
|
, private menu: MenuController
|
||||||
,public local: Storage
|
, public loadingCtrl: LoadingController
|
||||||
,public params: NavParams
|
, public modalCtrl: ModalController
|
||||||
|
, public local: Storage
|
||||||
|
, public params: NavParams
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.userProfile = new UserProfile(UserProfile.createDefaultUser());
|
this.userProfile = new UserProfile(UserProfile.createDefaultUser());
|
||||||
@ -55,12 +57,53 @@ export class SearchPage
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actionsMenu()
|
||||||
|
{
|
||||||
|
this.menu.open('actions');
|
||||||
|
}
|
||||||
|
|
||||||
addPage()
|
addPage()
|
||||||
{
|
{
|
||||||
let p = { queries: this.userProfile.user.items.slice(), title: this.saved_results_title };
|
let alert = this.alertCtrl.create({
|
||||||
this.userProfile.user.saved_pages.push(p);
|
title: 'Save Search as Page',
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: 'title',
|
||||||
|
placeholder: 'Page Title'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
text: 'Cancel',
|
||||||
|
role: 'cancel',
|
||||||
|
handler: data =>
|
||||||
|
{
|
||||||
|
console.log('Cancel clicked');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Save',
|
||||||
|
handler: data =>
|
||||||
|
{
|
||||||
|
let p = { queries: this.userProfile.user.items.slice(), title: data.title };
|
||||||
|
this.userProfile.user.saved_pages.push(p);
|
||||||
|
this.userProfile.save(this.local);
|
||||||
|
this.pagesService.addPage(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
alert.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
updatePage()
|
||||||
|
{
|
||||||
|
let page = this.userProfile.user.saved_pages.find(
|
||||||
|
i=>
|
||||||
|
i.title == this.params.data.title
|
||||||
|
);
|
||||||
|
page.queries = this.userProfile.user.items.slice();
|
||||||
this.userProfile.save(this.local);
|
this.userProfile.save(this.local);
|
||||||
this.pagesService.addPage(p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeItems(u: UserProfile)
|
initializeItems(u: UserProfile)
|
||||||
@ -69,6 +112,10 @@ export class SearchPage
|
|||||||
this.pagesService.initializePages(u.user.saved_pages);
|
this.pagesService.initializePages(u.user.saved_pages);
|
||||||
if (this.params.data.queries !== undefined)
|
if (this.params.data.queries !== undefined)
|
||||||
this.userProfile.user.items = this.params.data.queries.slice();
|
this.userProfile.user.items = this.params.data.queries.slice();
|
||||||
|
if (this.params.data.title === undefined)
|
||||||
|
this.title = "Search";
|
||||||
|
else
|
||||||
|
this.title = this.params.data.title;
|
||||||
}
|
}
|
||||||
|
|
||||||
presentStrongsModal(strongs: StrongsResult)
|
presentStrongsModal(strongs: StrongsResult)
|
||||||
|
@ -8,17 +8,7 @@
|
|||||||
</ion-header>
|
</ion-header>
|
||||||
<ion-content padding>
|
<ion-content padding>
|
||||||
<template [ngIf]="userProfile.user">
|
<template [ngIf]="userProfile.user">
|
||||||
<ion-list>
|
<h4>Search Settings</h4>
|
||||||
<ion-list-header>
|
|
||||||
Adjust Text
|
|
||||||
</ion-list-header>
|
|
||||||
<ion-item>
|
|
||||||
<ion-range min="6" max="20" step="1" snaps="true" [(ngModel)]="userProfile.user.font_size" (ionChange)="textSizeChanged()">
|
|
||||||
<ion-label range-left class="small-text">A</ion-label>
|
|
||||||
<ion-label range-right>A</ion-label>
|
|
||||||
</ion-range>
|
|
||||||
</ion-item>
|
|
||||||
</ion-list>
|
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label>Show Strongs as Modal</ion-label>
|
<ion-label>Show Strongs as Modal</ion-label>
|
||||||
<ion-toggle color="dark" [(ngModel)]="userProfile.user.strongs_modal" (ionChange)="save()"></ion-toggle>
|
<ion-toggle color="dark" [(ngModel)]="userProfile.user.strongs_modal" (ionChange)="save()"></ion-toggle>
|
||||||
@ -39,14 +29,24 @@
|
|||||||
<button ion-button (click)="reset()">Reset Settings</button>
|
<button ion-button (click)="reset()">Reset Settings</button>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
||||||
|
<h4>Adjust Text</h4>
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-list-header>Manage Pages</ion-list-header>
|
<ion-item>
|
||||||
<div *ngFor="let p of userProfile.user.saved_pages">
|
<ion-range min="6" max="20" step="1" snaps="true" [(ngModel)]="userProfile.user.font_size" (ionChange)="textSizeChanged()">
|
||||||
<ion-item>
|
<ion-label range-left class="small-text">A</ion-label>
|
||||||
{{p.title}}
|
<ion-label range-right>A</ion-label>
|
||||||
<button ion-button round (click)="removePage(p)"><ion-icon name="trash"></ion-icon></button>
|
</ion-range>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</div>
|
</ion-list>
|
||||||
|
|
||||||
|
<h4>Manage Pages</h4>
|
||||||
|
<ion-list>
|
||||||
|
<ion-item *ngFor="let p of userProfile.user.saved_pages">
|
||||||
|
{{p.title}}
|
||||||
|
<button ion-button item-right outline icon-right (click)="removePage(p)">
|
||||||
|
Delete Page <ion-icon name="trash"></ion-icon>
|
||||||
|
</button>
|
||||||
|
</ion-item>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
</template>
|
</template>
|
||||||
</ion-content>
|
</ion-content>
|
@ -1,6 +1,6 @@
|
|||||||
/// <reference path="../../../typings/browser/ambient/jquery/index.d.ts" />
|
/// <reference path="../../../typings/browser/ambient/jquery/index.d.ts" />
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { NavController } from 'ionic-angular';
|
import { NavController, AlertController } from 'ionic-angular';
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
import { SavedPage, UserProfile } from '../../libs/UserProfile';
|
import { SavedPage, UserProfile } from '../../libs/UserProfile';
|
||||||
|
|
||||||
@ -13,7 +13,10 @@ export class SettingsPage
|
|||||||
textSize: number = 0;
|
textSize: number = 0;
|
||||||
userProfile: UserProfile;
|
userProfile: UserProfile;
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, public local: Storage)
|
constructor(
|
||||||
|
public navCtrl: NavController
|
||||||
|
, public local: Storage
|
||||||
|
, private alertCtrl: AlertController)
|
||||||
{
|
{
|
||||||
this.userProfile = new UserProfile(UserProfile.createDefaultUser());
|
this.userProfile = new UserProfile(UserProfile.createDefaultUser());
|
||||||
|
|
||||||
@ -50,10 +53,31 @@ export class SettingsPage
|
|||||||
|
|
||||||
removePage(page: SavedPage)
|
removePage(page: SavedPage)
|
||||||
{
|
{
|
||||||
let idx = this.userProfile.user.saved_pages.indexOf(page);
|
let alert = this.alertCtrl.create({
|
||||||
this.userProfile.user.saved_pages.splice(idx, 1);
|
title: 'Confirm Delete',
|
||||||
|
message: 'Do you want to delete the ' + page.title + ' page?',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
text: 'Cancel',
|
||||||
|
role: 'cancel',
|
||||||
|
handler: () =>
|
||||||
|
{
|
||||||
|
console.log('Cancel clicked');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Ok',
|
||||||
|
handler: () =>
|
||||||
|
{
|
||||||
|
let idx = this.userProfile.user.saved_pages.indexOf(page);
|
||||||
|
this.userProfile.user.saved_pages.splice(idx, 1);
|
||||||
|
|
||||||
// save the users settings.
|
// save the users settings.
|
||||||
this.userProfile.save(this.local);
|
this.userProfile.save(this.local);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
alert.present();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -7,14 +7,14 @@ import { SavedPage } from "../libs/UserProfile";
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class PagesService
|
export class PagesService
|
||||||
{
|
{
|
||||||
pages: Array<{ title: string, component: any, params: any }>;
|
pages: Array<{ title: string, component: any, params: any, icon: string }>;
|
||||||
savedPages: Array<{ title: string, component: any, params: any }>;
|
savedPages: Array<{ title: string, component: any, params: any }>;
|
||||||
|
|
||||||
constructor(public local: Storage)
|
constructor(public local: Storage)
|
||||||
{
|
{
|
||||||
this.pages = [
|
this.pages = [
|
||||||
{ title: 'Search', component: SearchPage, params: { queries: []} },
|
{ title: 'Search', component: SearchPage, params: { queries: [], title: "Search" }, icon: "search" },
|
||||||
{ title: 'Settings', component: SettingsPage, params: {} }
|
{ title: 'Settings', component: SettingsPage, params: {}, icon: "settings" }
|
||||||
];
|
];
|
||||||
this.savedPages = [];
|
this.savedPages = [];
|
||||||
}
|
}
|
||||||
@ -31,20 +31,16 @@ export class PagesService
|
|||||||
|
|
||||||
addPage(page: SavedPage)
|
addPage(page: SavedPage)
|
||||||
{
|
{
|
||||||
this.savedPages.push({ title: page.title, component: SearchPage, params: { queries: page.queries } });
|
this.savedPages.push({ title: page.title, component: SearchPage, params: { queries: page.queries, title: page.title } });
|
||||||
}
|
}
|
||||||
|
|
||||||
initializePages(page_array: SavedPage[])
|
initializePages(page_array: SavedPage[])
|
||||||
{
|
{
|
||||||
this.pages = [
|
|
||||||
{ title: 'Search', component: SearchPage, params: { queries: [] } },
|
|
||||||
{ title: 'Settings', component: SettingsPage, params: {} }
|
|
||||||
];
|
|
||||||
this.savedPages = [];
|
this.savedPages = [];
|
||||||
|
|
||||||
for (let p of page_array)
|
for (let p of page_array)
|
||||||
{
|
{
|
||||||
this.savedPages.push({ title: p.title, component: SearchPage, params: { queries: p.queries } });
|
this.savedPages.push({ title: p.title, component: SearchPage, params: { queries: p.queries, title: p.title } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user