2017-08-24 10:54:15 -04:00
|
|
|
/// <reference path="../../../typings/globals/jquery/index.d.ts" />
|
2016-12-02 13:00:55 -05:00
|
|
|
import { Component } from '@angular/core';
|
2017-01-21 00:15:00 -05:00
|
|
|
import { NavController, AlertController } from 'ionic-angular';
|
2016-12-02 13:00:55 -05:00
|
|
|
import { Storage } from '@ionic/storage';
|
2017-11-22 18:30:09 -06:00
|
|
|
|
|
|
|
import { ProfileService, SavedPage } from '../../services/profile-service';
|
2016-12-02 13:00:55 -05:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'settings',
|
2017-11-22 18:30:09 -06:00
|
|
|
templateUrl: 'settings.html',
|
2016-12-02 13:00:55 -05:00
|
|
|
})
|
2016-12-27 21:10:00 -05:00
|
|
|
export class SettingsPage
|
|
|
|
{
|
2017-01-21 00:15:00 -05:00
|
|
|
constructor(
|
|
|
|
public navCtrl: NavController
|
2017-11-22 18:30:09 -06:00
|
|
|
, private alertCtrl: AlertController
|
|
|
|
, public profileService: ProfileService
|
|
|
|
) {}
|
2016-12-02 13:00:55 -05:00
|
|
|
|
2016-12-31 18:12:50 -05:00
|
|
|
textSizeChanged()
|
2016-12-27 21:10:00 -05:00
|
|
|
{
|
2017-11-22 18:30:09 -06:00
|
|
|
this.profileService.textSizeChanged();
|
2016-12-31 18:12:50 -05:00
|
|
|
this.save();
|
2016-12-02 13:00:55 -05:00
|
|
|
}
|
|
|
|
|
2016-12-31 18:12:50 -05:00
|
|
|
save()
|
2016-12-27 21:10:00 -05:00
|
|
|
{
|
2017-11-22 18:30:09 -06:00
|
|
|
this.profileService.save()
|
2016-12-27 21:10:00 -05:00
|
|
|
}
|
|
|
|
|
2016-12-31 18:12:50 -05:00
|
|
|
reset()
|
2016-12-27 21:10:00 -05:00
|
|
|
{
|
2017-11-22 18:30:09 -06:00
|
|
|
this.profileService.reset()
|
2016-12-02 13:00:55 -05:00
|
|
|
}
|
2017-01-18 17:51:06 -05:00
|
|
|
|
|
|
|
removePage(page: SavedPage)
|
|
|
|
{
|
2017-01-21 00:15:00 -05:00
|
|
|
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: () =>
|
|
|
|
{
|
2017-11-22 18:30:09 -06:00
|
|
|
this.profileService.removePage(page);
|
2017-01-21 00:15:00 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
alert.present();
|
2017-01-18 17:51:06 -05:00
|
|
|
}
|
2017-11-22 18:30:09 -06:00
|
|
|
}
|