Enable share post button, issue #13
This commit is contained in:
parent
12e7c24a3d
commit
399e5e68f8
3 changed files with 78 additions and 64 deletions
|
@ -92,4 +92,6 @@
|
||||||
<plugin name="cordova-plugin-statusbar" spec="^2.2.2" />
|
<plugin name="cordova-plugin-statusbar" spec="^2.2.2" />
|
||||||
<plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
|
<plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
|
||||||
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
|
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
|
||||||
|
<plugin name="cordova-plugin-share-content" spec="^1.0.0" />
|
||||||
|
<allow-navigation href="http://169.254.225.150:8100" />
|
||||||
</widget>
|
</widget>
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
"cordova-plugin-console": "^1.0.5",
|
"cordova-plugin-console": "^1.0.5",
|
||||||
"cordova-plugin-device": "^1.1.4",
|
"cordova-plugin-device": "^1.1.4",
|
||||||
"cordova-plugin-inappbrowser": "^1.7.1",
|
"cordova-plugin-inappbrowser": "^1.7.1",
|
||||||
|
"cordova-plugin-share-content": "^1.0.0",
|
||||||
"cordova-plugin-splashscreen": "^4.0.3",
|
"cordova-plugin-splashscreen": "^4.0.3",
|
||||||
"cordova-plugin-statusbar": "^2.2.2",
|
"cordova-plugin-statusbar": "^2.2.2",
|
||||||
"cordova-plugin-whitelist": "^1.3.1",
|
"cordova-plugin-whitelist": "^1.3.1",
|
||||||
|
@ -56,7 +57,8 @@
|
||||||
"cordova-plugin-statusbar": {},
|
"cordova-plugin-statusbar": {},
|
||||||
"cordova-plugin-whitelist": {},
|
"cordova-plugin-whitelist": {},
|
||||||
"ionic-plugin-keyboard": {},
|
"ionic-plugin-keyboard": {},
|
||||||
"cordova-plugin-inappbrowser": {}
|
"cordova-plugin-inappbrowser": {},
|
||||||
|
"cordova-plugin-share-content": {}
|
||||||
},
|
},
|
||||||
"platforms": [
|
"platforms": [
|
||||||
"android"
|
"android"
|
||||||
|
|
|
@ -426,7 +426,7 @@ export class NewPostModal {
|
||||||
@Component({
|
@Component({
|
||||||
template: `
|
template: `
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<button ion-item disabled (click)="close()">Share</button>
|
<button ion-item (click)="share()">Share</button>
|
||||||
<button ion-item *ngIf="showDelBtn" (click)="delete()">Delete</button>
|
<button ion-item *ngIf="showDelBtn" (click)="delete()">Delete</button>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
`
|
`
|
||||||
|
@ -444,6 +444,16 @@ export class PostMenu {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
share() {
|
||||||
|
(<any>window).shareContentPlugin.share(this.navParams.data.post.content.text, function(e) {
|
||||||
|
console.log('sharing post:');
|
||||||
|
console.log(JSON.stringify(e));
|
||||||
|
}, function(e) {
|
||||||
|
console.log('sharing failed:');
|
||||||
|
console.log(JSON.stringify(e));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
delete() {
|
delete() {
|
||||||
pnut.deletePost(this.navParams.data.post.id).then(res => {
|
pnut.deletePost(this.navParams.data.post.id).then(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
|
|
Reference in a new issue