Browse Source

upload image avatar works now

master
arnaucode 7 years ago
parent
commit
3cf45d915d
4 changed files with 60 additions and 50 deletions
  1. +44
    -44
      config.xml
  2. +2
    -1
      www/js/app.js
  3. +12
    -3
      www/js/editUser.js
  4. +2
    -2
      www/js/travel.js

+ 44
- 44
config.xml

@ -1,49 +1,49 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.ionicframework.app751563" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <widget id="com.ionicframework.app751563" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>CarsInCommon</name>
<description>
<name>CarsInCommon</name>
<description>
CarSharing app, for collective use. CarSharing app, for collective use.
</description> </description>
<author email="mail@mail.com" href="http://arnaucode.com/">
<author email="mail@mail.com" href="http://arnaucode.com/">
ArnauCode ArnauCode
</author> </author>
<content src="index.html"/>
<access origin="*"/>
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="SplashScreenDelay" value="3000"/>
<preference name="FadeSplashScreenDuration" value="500"/>
<preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashScreen" value="screen"/>
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar"/>
</feature>
<platform name="android">
<icon src="resources/android/icon/drawable-ldpi-icon.png" density="ldpi"/>
<icon src="resources/android/icon/drawable-mdpi-icon.png" density="mdpi"/>
<icon src="resources/android/icon/drawable-hdpi-icon.png" density="hdpi"/>
<icon src="resources/android/icon/drawable-xhdpi-icon.png" density="xhdpi"/>
<icon src="resources/android/icon/drawable-xxhdpi-icon.png" density="xxhdpi"/>
<icon src="resources/android/icon/drawable-xxxhdpi-icon.png" density="xxxhdpi"/>
<splash src="resources/android/splash/drawable-land-ldpi-screen.png" density="land-ldpi"/>
<splash src="resources/android/splash/drawable-land-mdpi-screen.png" density="land-mdpi"/>
<splash src="resources/android/splash/drawable-land-hdpi-screen.png" density="land-hdpi"/>
<splash src="resources/android/splash/drawable-land-xhdpi-screen.png" density="land-xhdpi"/>
<splash src="resources/android/splash/drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/>
<splash src="resources/android/splash/drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/>
<splash src="resources/android/splash/drawable-port-ldpi-screen.png" density="port-ldpi"/>
<splash src="resources/android/splash/drawable-port-mdpi-screen.png" density="port-mdpi"/>
<splash src="resources/android/splash/drawable-port-hdpi-screen.png" density="port-hdpi"/>
<splash src="resources/android/splash/drawable-port-xhdpi-screen.png" density="port-xhdpi"/>
<splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/>
<splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>
</platform>
<plugin name="cordova-plugin-whitelist" spec="~1.3.1"/>
<plugin name="cordova-plugin-device" spec="~1.1.4"/>
<plugin name="cordova-plugin-splashscreen" spec="~4.0.1"/>
<plugin name="cordova-plugin-console" spec="~1.0.5"/>
<plugin name="ionic-plugin-keyboard" spec="~2.2.1"/>
<icon src="resources/android/icon/drawable-xhdpi-icon.png"/>
</widget>
<content src="index.html" />
<access origin="*" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="SplashScreenDelay" value="3000" />
<preference name="FadeSplashScreenDuration" value="500" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashScreen" value="screen" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<platform name="android">
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
<splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
<splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
<splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
<splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
<splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
<splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
<splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
<splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
</platform>
<plugin name="cordova-plugin-whitelist" spec="~1.3.1" />
<plugin name="cordova-plugin-device" spec="~1.1.4" />
<plugin name="cordova-plugin-splashscreen" spec="~4.0.1" />
<plugin name="cordova-plugin-console" spec="~1.0.5" />
<plugin name="ionic-plugin-keyboard" spec="~2.2.1" />
<icon src="resources/android/icon/drawable-xhdpi-icon.png" />
</widget>

+ 2
- 1
www/js/app.js

@ -6,7 +6,8 @@
// 'starter.controllers' is found in controllers.js // 'starter.controllers' is found in controllers.js
var urlapi = "http://localhost:3000/api/";
//var urlapi = "http://localhost:3000/api/";
var urlapi = "http://192.168.1.36:3000/api/";
//var urlapi = "http://51.255.193.106:3000/api/"; //var urlapi = "http://51.255.193.106:3000/api/";
angular.module('starter', [ angular.module('starter', [

+ 12
- 3
www/js/editUser.js

@ -11,19 +11,27 @@ angular.module('app.editUser', ['pascalprecht.translate'])
destinationType: Camera.DestinationType.DATA_URL, destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.sourceType, sourceType: Camera.sourceType,
allowEdit: true, allowEdit: true,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 100,
targetHeight: 100,
encodingType: Camera.EncodingType.PNG,
targetWidth: 500,
targetHeight: 500,
popoverOptions: CameraPopoverOptions, popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: false, saveToPhotoAlbum: false,
correctOrientation:true correctOrientation:true
}; };
$cordovaCamera.getPicture(options).then(function(imageData) { $cordovaCamera.getPicture(options).then(function(imageData) {
//$scope.user.newAvatar = "data:image/jpeg;base64," + imageData;
$scope.user.avatar = "data:image/jpeg;base64," + imageData; $scope.user.avatar = "data:image/jpeg;base64," + imageData;
$scope.user.newAvatar = imageData;
}, function(err) { }, function(err) {
console.log(err); console.log(err);
}); });
/*$cordovaCamera.getPicture(options).then(function(imageURI) {
$scope.user.avatar = imageURI;
$scope.user.newAvatar = imageURI;
}, function(err) {
console.log(err);
});*/
}; };
$scope.selectFaircoinPublicKey = function(){ $scope.selectFaircoinPublicKey = function(){
console.log("img"); console.log("img");
@ -42,6 +50,7 @@ angular.module('app.editUser', ['pascalprecht.translate'])
$cordovaCamera.getPicture(options).then(function(imageData) { $cordovaCamera.getPicture(options).then(function(imageData) {
$scope.user.faircoin = "data:image/jpeg;base64," + imageData; $scope.user.faircoin = "data:image/jpeg;base64," + imageData;
$scope.user.newFaircoin = imageData;
}, function(err) { }, function(err) {
console.log(err); console.log(err);
}); });

+ 2
- 2
www/js/travel.js

@ -64,9 +64,9 @@ angular.module('app.travel', ['pascalprecht.translate', 'ui-leaflet'])
confirmPopup.then(function(res) { confirmPopup.then(function(res) {
if(res) { if(res) {
console.log('You are sure'); console.log('You are sure');
console.log("delete travel: " + $stateParams.travelId);
console.log("delete travel: " + $stateParams.travelid);
$http({ $http({
url: urlapi + 'travels/' + $stateParams.travelId,
url: urlapi + '/travels/id/modify/' + $stateParams.travelid,
method: "DELETE" method: "DELETE"
}) })
.then(function(response) { .then(function(response) {

Loading…
Cancel
Save