Commit 399e5e68 authored by Morgan McMillian's avatar Morgan McMillian

Enable share post button, issue #13

parent 12e7c24a
......@@ -92,4 +92,6 @@
<plugin name="cordova-plugin-statusbar" spec="^2.2.2" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.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>
......@@ -28,6 +28,7 @@
"cordova-plugin-console": "^1.0.5",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-inappbrowser": "^1.7.1",
"cordova-plugin-share-content": "^1.0.0",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.2.2",
"cordova-plugin-whitelist": "^1.3.1",
......@@ -56,7 +57,8 @@
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {},
"cordova-plugin-inappbrowser": {}
"cordova-plugin-inappbrowser": {},
"cordova-plugin-share-content": {}
},
"platforms": [
"android"
......
......@@ -426,7 +426,7 @@ export class NewPostModal {
@Component({
template: `
<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>
</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() {
pnut.deletePost(this.navParams.data.post.id).then(res => {
console.log(res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment