mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-25 16:29:49 -04:00
62 lines
1.6 KiB
TypeScript
62 lines
1.6 KiB
TypeScript
/// <reference path="../../../typings/globals/jquery/index.d.ts" />
|
|
import { Component } from '@angular/core';
|
|
import { NavController, AlertController } from 'ionic-angular';
|
|
import { Storage } from '@ionic/storage';
|
|
|
|
import { ProfileService, SavedPage } from '../../services/profile-service';
|
|
|
|
@Component({
|
|
selector: 'settings',
|
|
templateUrl: 'settings.html',
|
|
})
|
|
export class SettingsPage
|
|
{
|
|
constructor(
|
|
public navCtrl: NavController
|
|
, private alertCtrl: AlertController
|
|
, public profileService: ProfileService
|
|
) {}
|
|
|
|
textSizeChanged()
|
|
{
|
|
this.profileService.textSizeChanged();
|
|
this.profileService.localSave();
|
|
}
|
|
|
|
fontFamilyChanged()
|
|
{
|
|
this.profileService.fontFamilyChanged();
|
|
this.profileService.localSave();
|
|
}
|
|
reset()
|
|
{
|
|
this.profileService.reset()
|
|
}
|
|
|
|
removePage(page: SavedPage)
|
|
{
|
|
let alert = this.alertCtrl.create({
|
|
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: () =>
|
|
{
|
|
this.profileService.removePage(page);
|
|
}
|
|
}
|
|
]
|
|
});
|
|
alert.present();
|
|
}
|
|
}
|