|
@@ -1,7 +1,12 @@
|
|
|
-import { Component } from '@angular/core';
|
|
|
-import { IonicPage, NavController, NavParams, AlertController } from 'ionic-angular';
|
|
|
-import { FormBuilder, Validators, FormGroup } from '@angular/forms';
|
|
|
-import { TwitterApiProvider } from '../../providers/twitter-api/twitter-api';
|
|
|
+import { Component } from "@angular/core";
|
|
|
+import {
|
|
|
+ IonicPage,
|
|
|
+ NavController,
|
|
|
+ NavParams,
|
|
|
+ AlertController
|
|
|
+} from "ionic-angular";
|
|
|
+import { FormBuilder, Validators, FormGroup } from "@angular/forms";
|
|
|
+import { TwitterApiProvider } from "../../providers/twitter-api/twitter-api";
|
|
|
|
|
|
/**
|
|
|
* Generated class for the WriteTweetPage page.
|
|
@@ -12,11 +17,10 @@ import { TwitterApiProvider } from '../../providers/twitter-api/twitter-api';
|
|
|
|
|
|
@IonicPage()
|
|
|
@Component({
|
|
|
- selector: 'page-write-tweet',
|
|
|
- templateUrl: 'write-tweet.html',
|
|
|
+ selector: "page-write-tweet",
|
|
|
+ templateUrl: "write-tweet.html"
|
|
|
})
|
|
|
export class WriteTweetPage {
|
|
|
-
|
|
|
tweet: FormGroup;
|
|
|
|
|
|
constructor(
|
|
@@ -27,14 +31,12 @@ export class WriteTweetPage {
|
|
|
private alertCtrl: AlertController
|
|
|
) {
|
|
|
this.tweet = this.formBuilder.group({
|
|
|
- text: ['', Validators.maxLength(140)],
|
|
|
+ text: ["", Validators.maxLength(140)],
|
|
|
p2p: [false]
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- ionViewDidLoad() {
|
|
|
-
|
|
|
- }
|
|
|
+ ionViewDidLoad() {}
|
|
|
|
|
|
get tweetCharProgress() {
|
|
|
let progress = 1 - this.tweet.value["text"].length / 140;
|
|
@@ -44,18 +46,19 @@ export class WriteTweetPage {
|
|
|
}
|
|
|
|
|
|
submitTweet() {
|
|
|
-
|
|
|
if (this.tweet.value.p2p) {
|
|
|
- this.alertCtrl.create({
|
|
|
- title: 'Private Mode',
|
|
|
- subTitle: 'Your tweet will be encrypted and send to the private network. TODO!',
|
|
|
- buttons: ['OK']
|
|
|
- }).present();
|
|
|
+ this.alertCtrl
|
|
|
+ .create({
|
|
|
+ title: "Private Mode",
|
|
|
+ subTitle:
|
|
|
+ "Your tweet will be encrypted and send to the private network. TODO!",
|
|
|
+ buttons: ["OK"]
|
|
|
+ })
|
|
|
+ .present();
|
|
|
} else {
|
|
|
this.twitter.tweet(this.tweet.value["text"]);
|
|
|
}
|
|
|
|
|
|
this.navCtrl.pop();
|
|
|
}
|
|
|
-
|
|
|
}
|