From 399e5e68f819087da9f877706a9039f1a159a4db Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Tue, 19 Dec 2017 19:48:38 -0800 Subject: [PATCH] Enable share post button, issue #13 --- config.xml | 2 + package.json | 128 +++++++++++++++++++------------------ src/pages/stream/stream.ts | 12 +++- 3 files changed, 78 insertions(+), 64 deletions(-) diff --git a/config.xml b/config.xml index b25f593..735b167 100644 --- a/config.xml +++ b/config.xml @@ -92,4 +92,6 @@ + + diff --git a/package.json b/package.json index 0e60d98..d085edc 100644 --- a/package.json +++ b/package.json @@ -1,65 +1,67 @@ { - "name": "Goober", - "version": "0.0.1", - "author": "Ionic Framework", - "homepage": "http://ionicframework.com/", - "private": true, - "scripts": { - "clean": "ionic-app-scripts clean", - "build": "ionic-app-scripts build", - "lint": "ionic-app-scripts lint", - "ionic:build": "ionic-app-scripts build", - "ionic:serve": "ionic-app-scripts serve" - }, - "dependencies": { - "@angular/common": "4.1.2", - "@angular/compiler": "4.1.2", - "@angular/compiler-cli": "4.1.2", - "@angular/core": "4.1.2", - "@angular/forms": "4.1.2", - "@angular/http": "4.1.2", - "@angular/platform-browser": "4.1.2", - "@angular/platform-browser-dynamic": "4.1.2", - "@ionic-native/core": "3.10.2", - "@ionic-native/splash-screen": "3.10.2", - "@ionic-native/status-bar": "3.10.2", - "@ionic/storage": "2.0.1", - "cordova-android": "^6.2.3", - "cordova-plugin-console": "^1.0.5", - "cordova-plugin-device": "^1.1.4", - "cordova-plugin-inappbrowser": "^1.7.1", - "cordova-plugin-splashscreen": "^4.0.3", - "cordova-plugin-statusbar": "^2.2.2", - "cordova-plugin-whitelist": "^1.3.1", - "ionic-angular": "3.3.0", - "ionic-plugin-keyboard": "^2.2.1", - "ionicons": "3.0.0", - "moment": "^2.18.1", - "ng2-cordova-oauth": "0.0.8", - "pnut-butter": "^0.16.0", - "run": "^1.4.0", - "rxjs": "5.1.1", - "sw-toolbox": "3.6.0", - "zone.js": "0.8.11" - }, - "devDependencies": { - "@ionic/app-scripts": "1.3.7", - "ionic": "3.9.2", - "typescript": "2.3.3" - }, - "description": "An Ionic project", - "cordova": { - "plugins": { - "cordova-plugin-console": {}, - "cordova-plugin-device": {}, - "cordova-plugin-splashscreen": {}, - "cordova-plugin-statusbar": {}, - "cordova-plugin-whitelist": {}, - "ionic-plugin-keyboard": {}, - "cordova-plugin-inappbrowser": {} + "name": "Goober", + "version": "0.0.1", + "author": "Ionic Framework", + "homepage": "http://ionicframework.com/", + "private": true, + "scripts": { + "clean": "ionic-app-scripts clean", + "build": "ionic-app-scripts build", + "lint": "ionic-app-scripts lint", + "ionic:build": "ionic-app-scripts build", + "ionic:serve": "ionic-app-scripts serve" }, - "platforms": [ - "android" - ] - } -} + "dependencies": { + "@angular/common": "4.1.2", + "@angular/compiler": "4.1.2", + "@angular/compiler-cli": "4.1.2", + "@angular/core": "4.1.2", + "@angular/forms": "4.1.2", + "@angular/http": "4.1.2", + "@angular/platform-browser": "4.1.2", + "@angular/platform-browser-dynamic": "4.1.2", + "@ionic-native/core": "3.10.2", + "@ionic-native/splash-screen": "3.10.2", + "@ionic-native/status-bar": "3.10.2", + "@ionic/storage": "2.0.1", + "cordova-android": "^6.2.3", + "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", + "ionic-angular": "3.3.0", + "ionic-plugin-keyboard": "^2.2.1", + "ionicons": "3.0.0", + "moment": "^2.18.1", + "ng2-cordova-oauth": "0.0.8", + "pnut-butter": "^0.16.0", + "run": "^1.4.0", + "rxjs": "5.1.1", + "sw-toolbox": "3.6.0", + "zone.js": "0.8.11" + }, + "devDependencies": { + "@ionic/app-scripts": "1.3.7", + "ionic": "3.9.2", + "typescript": "2.3.3" + }, + "description": "An Ionic project", + "cordova": { + "plugins": { + "cordova-plugin-console": {}, + "cordova-plugin-device": {}, + "cordova-plugin-splashscreen": {}, + "cordova-plugin-statusbar": {}, + "cordova-plugin-whitelist": {}, + "ionic-plugin-keyboard": {}, + "cordova-plugin-inappbrowser": {}, + "cordova-plugin-share-content": {} + }, + "platforms": [ + "android" + ] + } +} \ No newline at end of file diff --git a/src/pages/stream/stream.ts b/src/pages/stream/stream.ts index f916cbf..d1589be 100644 --- a/src/pages/stream/stream.ts +++ b/src/pages/stream/stream.ts @@ -426,7 +426,7 @@ export class NewPostModal { @Component({ template: ` - + ` @@ -444,6 +444,16 @@ export class PostMenu { } } + share() { + (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);