root / src / app / upgrade / upgrade.component.ts @ f92119fc
Historique | Voir | Annoter | Télécharger (1,51 ko)
1 | f3d5fa3b | Eric Seigne | import { Component, OnInit } from "@angular/core"; |
---|---|---|---|
2 | import { RadSideDrawer } from "nativescript-ui-sidedrawer"; |
||
3 | import * as app from "tns-core-modules/application"; |
||
4 | import { isAndroid, isIOS, device, screen } from "tns-core-modules/platform"; |
||
5 | 54800558 | Eric Seigne | import { getString, setString, hasKey, remove, clear } from "tns-core-modules/application-settings"; |
6 | f3d5fa3b | Eric Seigne | |
7 | @Component({ |
||
8 | selector: "Upgrade", |
||
9 | templateUrl: "./upgrade.component.html" |
||
10 | }) |
||
11 | export class UpgradeComponent implements OnInit { |
||
12 | 54800558 | Eric Seigne | private changelog: string; |
13 | private message: string; |
||
14 | private upgradeuri: string; |
||
15 | public serverJSON: JSON; |
||
16 | f3d5fa3b | Eric Seigne | |
17 | constructor() { |
||
18 | // Use the component constructor to inject providers. |
||
19 | 54800558 | Eric Seigne | this.changelog = ""; |
20 | this.message = ""; |
||
21 | this.upgradeuri = ""; |
||
22 | f3d5fa3b | Eric Seigne | } |
23 | |||
24 | ngOnInit(): void { |
||
25 | // Init your component properties here. |
||
26 | 54800558 | Eric Seigne | this.serverJSON = JSON.parse(getString("serverJSON")); |
27 | this.changelog = this.serverJSON['APPchangelog']; |
||
28 | f3d5fa3b | Eric Seigne | } |
29 | |||
30 | onDrawerButtonTap(): void { |
||
31 | const sideDrawer = <RadSideDrawer>app.getRootView(); |
||
32 | sideDrawer.showDrawer(); |
||
33 | } |
||
34 | |||
35 | onUpgradeTap(): void { |
||
36 | var utilityModule = require("utils/utils"); |
||
37 | if (isIOS) { |
||
38 | f92119fc | Eric Seigne | utilityModule.openUrl(this.serverJSON['APPupgradeiTunes']); |
39 | f3d5fa3b | Eric Seigne | } |
40 | else { |
||
41 | f92119fc | Eric Seigne | utilityModule.openUrl(this.serverJSON['APPupgradeGooglePlay']); |
42 | f3d5fa3b | Eric Seigne | } |
43 | } |
||
44 | |||
45 | onWebsiteTap(): void { |
||
46 | var utilityModule = require("utils/utils"); |
||
47 | utilityModule.openUrl("https://clicalbum.abuledu.net"); |
||
48 | } |
||
49 | |||
50 | |||
51 | } |