diff --git a/www/css/angular-image-crop.css b/www/css/angular-image-crop.css new file mode 100644 index 0000000000000000000000000000000000000000..2da5e010667905e2e2e5b8f62a25e73a2c8bd9b6 --- /dev/null +++ b/www/css/angular-image-crop.css @@ -0,0 +1,69 @@ +/* Some of these styles you can override, things like colors, + * however some styles are required for the structure, and are critical to this module behaving properly! + */ + +/* Core component styles */ +.ng-image-crop { + text-align: center; + margin: 0 auto; + position: relative; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; +} +/* Each of the 3 steps in the process are contained within sections */ +.ng-image-crop > section { + background: #ccc; +} +/* The cropping button */ +.ng-image-crop button { + margin-top: 10px; +} +/* The dashed cropping guideline */ +.ng-image-crop .cropping-guide { + display: block; + background: rgba(255, 255, 255, .3); + border: 2px dashed white; + position: absolute; + pointer-events: none; +} +/* The circular themed cropping guideline */ +.ng-image-crop--circle .cropping-guide { + border-radius: 50%; + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + -ms-border-radius: 50%; + -o-border-radius: 50%; +} +/* The canvas where the user positions the image via dragging and zooming */ +.ng-image-crop .cropping-canvas { + background: rgba(255, 255, 255, .3); + margin: 0 auto; + cursor: move; +} +/* The overlayed draggable zoom handle in the corner of the module */ +.ng-image-crop .zoom-handle { + display: block; + position: absolute; + bottom: 1px; + left: 1px; + background: rgba(255,255,255,0.7); + width: 80px; + height: 80px; + cursor: move; + border-radius: 200px 50px; +} +/* The text within the zoom handle */ +.ng-image-crop .zoom-handle > span { + color: rgba(0, 0, 0, 0.5); + -webkit-transform: rotate(-45deg); + -moz-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + -o-transform: rotate(-45deg); + transform: rotate(-45deg); + display: block; + position: relative; + top: 32px; +} \ No newline at end of file diff --git a/www/index.html b/www/index.html index a9a243ed654635058b2b242537b76b8d34069e31..aad157b31a7f9eee083ee0b5920ce5c9f0f284e8 100644 --- a/www/index.html +++ b/www/index.html @@ -10,9 +10,9 @@ <!-- build:css dist_css/cesium.css --> <link href="css/ionic.app.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> + <link href="css/angular-image-crop.css" rel="stylesheet"> <!--removeIf(device)--> - <link href="lib/angular-image-crop/image-crop-styles.css" rel="stylesheet"> <link href="css/style-no-device.css" rel="stylesheet"> <!--endRemoveIf(device)--> @@ -42,7 +42,7 @@ <script src="lib/ionic/js/angular/angular-cache.js"></script> <script src="lib/ionic/js/angular/angular-screenmatch.min.js"></script> <script src="lib/ionic/js/angular/angular-bind-notifier.min.js"></script> - <script src="lib/angular-image-crop/image-crop.js"></script> + <script src="lib/ionic/js/angular/angular-image-crop.js"></script> <script src="js/vendor/base58.js" async></script> <!--removeIf(device)--> <script src="js/vendor/nacl_factory.js" async></script> diff --git a/www/js/app.js b/www/js/app.js index 059fc6cae9907a78ac05e29812d36428946136c9..f81e4a1de0278b7fcd1b76070a48e43e0d5cc34b 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -5,9 +5,8 @@ // the 2nd parameter is an array of 'requires' // 'starter.controllers' is found in controllers.js angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht.translate', - 'ngApi', 'angular-cache', 'angular.screenmatch', 'angular.bind.notifier', + 'ngApi', 'angular-cache', 'angular.screenmatch', 'angular.bind.notifier', 'ImageCropper', // removeIf(device) - 'ImageCropper', // endRemoveIf(device) // removeIf(no-device) 'ngCordova', diff --git a/www/js/services/crypto-services.js b/www/js/services/crypto-services.js index 062a22383ab68c20c9c9d56dc0bae30ae9b89c8c..588bc3c4971cc3257a639b67d5be5c68e35465df 100644 --- a/www/js/services/crypto-services.js +++ b/www/js/services/crypto-services.js @@ -606,23 +606,28 @@ angular.module('cesium.crypto.services', ['ngResource', 'cesium.device.services' // Use cordova implementation, when possible - var service; - if (Device.enable) { - service = new CordovaServiceFactory(); - } - else { - service = new FullJSServiceFactory(); - } + var service = new CryptoAbstractService(); + Device.ready().then(function() { var now = new Date().getTime(); + + var serviceImpl; + if (Device.enable) { + serviceImpl = new CordovaServiceFactory(); + } + else { + serviceImpl = new FullJSServiceFactory(); + } + // Load (async lib) - service.load() + serviceImpl.load() .catch(function(err) { //console.error(err); throw err; }) .then(function() { + service.copy(serviceImpl); console.debug('[crypto] Loaded \'{0}\' implementation in {1}ms'.format(service.id, new Date().getTime() - now)); });