mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-29 02:29:50 -04:00

* fixed ton of bugs... apparently i didn't push up the work i did on the mac... and i don't have that anymore.
67 lines
1.7 KiB
TypeScript
67 lines
1.7 KiB
TypeScript
import { Injectable } from '@angular/core';
|
|
import { Storage } from '@ionic/storage';
|
|
import { SearchPage } from '../pages/search/search';
|
|
import { SavedPage } from './profile-service';
|
|
import { PageTitles } from '../libs/Constants';
|
|
import { SettingsModal } from '../components/settings-modal/settings-modal';
|
|
import { AboutModal } from '../components/about-modal/about-modal';
|
|
|
|
|
|
@Injectable()
|
|
export class PagesService
|
|
{
|
|
pages: Array<Page>;
|
|
savedPages: Array<Page>;
|
|
|
|
constructor(public local: Storage)
|
|
{
|
|
this.pages = [
|
|
{ title: PageTitles.Search, component: SearchPage, params: { queries: [], title: PageTitles.Search }, icon: 'search' },
|
|
{ title: PageTitles.Settings, component: SettingsModal, params: {}, icon: 'settings' },
|
|
{ title: PageTitles.Help, component: AboutModal, params: {}, icon: 'help-circle' }
|
|
];
|
|
this.savedPages = [];
|
|
}
|
|
|
|
getMainPages(): Array<Page>
|
|
{
|
|
return this.pages;
|
|
}
|
|
|
|
getSavedPages(): Array<Page>
|
|
{
|
|
return this.savedPages;
|
|
}
|
|
|
|
addPage(page: SavedPage)
|
|
{
|
|
this.savedPages.push({
|
|
title: page.title,
|
|
component: SearchPage,
|
|
params: { queries: page.queries, title: page.title }
|
|
});
|
|
}
|
|
|
|
initializePages(page_array: SavedPage[])
|
|
{
|
|
this.savedPages = [];
|
|
|
|
for (let p of page_array)
|
|
{
|
|
this.savedPages.push({
|
|
title: p.title,
|
|
component: SearchPage,
|
|
params: { queries: p.queries, title: p.title }
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
export class Page
|
|
{
|
|
title: string;
|
|
component: any;
|
|
params: any;
|
|
icon?: string;
|
|
}
|