From 0c3967b311db24e1f5ff41eb5819c5b4d2e5d87f Mon Sep 17 00:00:00 2001 From: blavenie <benoit.lavenier@e-is.pro> Date: Thu, 26 May 2016 15:49:36 +0200 Subject: [PATCH] - Allow to enable native transitions (by a config option) - Open the default currency, when ES registry not enable - Menu: Add new "registry" item, to search uid/pubkey on the WoT, when ES registry not enable - Currency: remove wot search - Market: hide picture title if not set --- README.md | 8 + app/config.json | 12 +- config.xml | 136 ++-- gulpfile.js | 14 +- ionic.project | 11 +- package.json | 5 +- www/i18n/locale-en.json | 9 +- www/i18n/locale-fr-FR.json | 7 +- www/index.html | 1 + www/js/app.js | 41 +- www/js/config.js | 5 +- www/js/controllers/currency-controllers.js | 15 +- www/js/controllers/wot-controllers.js | 12 +- www/lib/ionic/js/ionic-native-transitions.js | 749 ++++++++++++++++++ .../ionic/js/ionic-native-transitions.min.js | 11 + www/templates/currency/view_currency.html | 7 - www/templates/currency/view_currency_lg.html | 4 - www/templates/home/home.html | 11 + www/templates/login.html | 3 + www/templates/market/view_record.html | 4 +- www/templates/menu.html | 26 +- www/templates/wot/lookup.html | 5 + 22 files changed, 993 insertions(+), 103 deletions(-) create mode 100644 www/lib/ionic/js/ionic-native-transitions.js create mode 100644 www/lib/ionic/js/ionic-native-transitions.min.js create mode 100644 www/templates/wot/lookup.html diff --git a/README.md b/README.md index 8e234c21..67645901 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,17 @@ To contribute and compile cesium, you will have to: gulp & ionic serve ``` +### Manage configuration + - To build on another environment : - Add your environment config into `app/config.json` - Run compitaltion using option `--env`: ``` gulp default --env <your_env_name> ``` + +### Best pratices + + Cesium could be run on phone devices. Please read [performance tips on AgularJS + Ionic ](http://julienrenaux.fr/2015/08/24/ultimate-angularjs-and-ionic-performance-cheat-sheet/) + before starting to contribute. + Read also [Angular performance for large applicatoins](https://www.airpair.com/angularjs/posts/angularjs-performance-large-applications). diff --git a/app/config.json b/app/config.json index 2af90af8..8728e4c5 100644 --- a/app/config.json +++ b/app/config.json @@ -4,7 +4,8 @@ "DUNITER_NODE": "cgeek.fr:9330", "NEW_ISSUE_LINK": "https://github.com/duniter/cesium/issues/new?labels=bug", "TIMEOUT": 4000, - "DEBUG": false + "DEBUG": false, + "NATIVE_TRANSITION": false } }, @@ -13,7 +14,8 @@ "DUNITER_NODE": "cgeek.fr:9330", "NEW_ISSUE_LINK": "https://github.com/duniter/cesium/issues/new?labels=bug", "TIMEOUT": 4000, - "DEBUG": false + "DEBUG": false, + "NATIVE_TRANSITION": false } }, @@ -23,7 +25,8 @@ "DUNITER_NODE_ES": "data.duniter.fr", "NEW_ISSUE_LINK": "https://github.com/duniter/cesium/issues/new?labels=bug&title=[ES]", "TIMEOUT": 4000, - "DEBUG": true + "DEBUG": true, + "NATIVE_TRANSITION": false } }, @@ -32,7 +35,8 @@ "DUNITER_NODE": "192.168.0.5:9201", "DUNITER_NODE_ES": "192.168.0.5:9200", "TIMEOUT": 4000, - "DEBUG": false + "DEBUG": false, + "NATIVE_TRANSITION": true } } diff --git a/config.xml b/config.xml index 3a91ad31..68ff4dee 100644 --- a/config.xml +++ b/config.xml @@ -1,71 +1,75 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<?xml version='1.0' encoding='utf-8'?> <widget id="com.ionicframework.lesou" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> - <name>Cesium</name> - <description> + <name>Cesium</name> + <description> A webapp client for Duniter </description> - <author email="contact@le-sou.org" href="http://le-sou.org"> + <author email="contact@le-sou.org" href="http://le-sou.org"> le Sou </author> - <content src="index.html"/> - <access origin="*"/> - <preference name="webviewbounce" value="false"/> - <preference name="UIWebViewBounce" value="false"/> - <preference name="DisallowOverscroll" value="true"/> - <preference name="android-minSdkVersion" value="16"/> - <preference name="BackupWebStorage" value="none"/> - <preference name="SplashScreen" value="screen"/> - <preference name="SplashScreenDelay" value="3000"/> - <feature name="StatusBar"> - <param name="ios-package" value="CDVStatusBar" onload="true"/> - </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> - <platform name="ios"> - <icon src="resources/ios/icon/icon.png" width="57" height="57"/> - <icon src="resources/ios/icon/icon@2x.png" width="114" height="114"/> - <icon src="resources/ios/icon/icon-40.png" width="40" height="40"/> - <icon src="resources/ios/icon/icon-40@2x.png" width="80" height="80"/> - <icon src="resources/ios/icon/icon-50.png" width="50" height="50"/> - <icon src="resources/ios/icon/icon-50@2x.png" width="100" height="100"/> - <icon src="resources/ios/icon/icon-60.png" width="60" height="60"/> - <icon src="resources/ios/icon/icon-60@2x.png" width="120" height="120"/> - <icon src="resources/ios/icon/icon-60@3x.png" width="180" height="180"/> - <icon src="resources/ios/icon/icon-72.png" width="72" height="72"/> - <icon src="resources/ios/icon/icon-72@2x.png" width="144" height="144"/> - <icon src="resources/ios/icon/icon-76.png" width="76" height="76"/> - <icon src="resources/ios/icon/icon-76@2x.png" width="152" height="152"/> - <icon src="resources/ios/icon/icon-small.png" width="29" height="29"/> - <icon src="resources/ios/icon/icon-small@2x.png" width="58" height="58"/> - <icon src="resources/ios/icon/icon-small@3x.png" width="87" height="87"/> - <splash src="resources/ios/splash/Default-568h@2x~iphone.png" height="1136" width="640"/> - <splash src="resources/ios/splash/Default-667h.png" height="1334" width="750"/> - <splash src="resources/ios/splash/Default-736h.png" height="2208" width="1242"/> - <splash src="resources/ios/splash/Default-Landscape-736h.png" height="1242" width="2208"/> - <splash src="resources/ios/splash/Default-Landscape@2x~ipad.png" height="1536" width="2048"/> - <splash src="resources/ios/splash/Default-Landscape~ipad.png" height="768" width="1024"/> - <splash src="resources/ios/splash/Default-Portrait@2x~ipad.png" height="2048" width="1536"/> - <splash src="resources/ios/splash/Default-Portrait~ipad.png" height="1024" width="768"/> - <splash src="resources/ios/splash/Default@2x~iphone.png" height="960" width="640"/> - <splash src="resources/ios/splash/Default~iphone.png" height="480" width="320"/> - </platform> - <allow-navigation href="*"/> -</widget> \ No newline at end of file + <content src="index.html" /> + <access origin="*" /> + <preference name="webviewbounce" value="false" /> + <preference name="UIWebViewBounce" value="false" /> + <preference name="DisallowOverscroll" value="true" /> + <preference name="android-minSdkVersion" value="16" /> + <preference name="BackupWebStorage" value="none" /> + <preference name="SplashScreen" value="screen" /> + <preference name="SplashScreenDelay" value="4000" /> + <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> + <platform name="ios"> + <icon height="57" src="resources/ios/icon/icon.png" width="57" /> + <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" /> + <icon height="40" src="resources/ios/icon/icon-40.png" width="40" /> + <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" /> + <icon height="50" src="resources/ios/icon/icon-50.png" width="50" /> + <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" /> + <icon height="60" src="resources/ios/icon/icon-60.png" width="60" /> + <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" /> + <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" /> + <icon height="72" src="resources/ios/icon/icon-72.png" width="72" /> + <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" /> + <icon height="76" src="resources/ios/icon/icon-76.png" width="76" /> + <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" /> + <icon height="29" src="resources/ios/icon/icon-small.png" width="29" /> + <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" /> + <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" /> + <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" /> + <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" /> + <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" /> + <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" /> + <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" /> + <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" /> + <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" /> + <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" /> + <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" /> + <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" /> + </platform> + <allow-navigation href="data:*" /> + <preference name="xwalkVersion" value="xwalk_core_library_beta:18+" /> + <preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect" /> + <preference name="xwalkMode" value="embedded" /> + <preference name="xwalkMultipleApk" value="true" /> +</widget> diff --git a/gulpfile.js b/gulpfile.js index 77017c0e..8988f85a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -12,13 +12,15 @@ var ngConstant = require('gulp-ng-constant'); var fs = require("fs"); var argv = require('yargs').argv; var header = require('gulp-header'); +var removeCode = require('gulp-remove-code'); var paths = { sass: ['./scss/**/*.scss'], - config: ['./app/config.json'] + config: ['./app/config.json'], + templates: ['./www/templates/**/*.html'] }; -gulp.task('default', ['sass', 'config']); +gulp.task('default', ['sass', /*'removeCode',*/ 'config']); gulp.task('sass', function(done) { gulp.src('./scss/ionic.app.scss') @@ -32,9 +34,17 @@ gulp.task('sass', function(done) { .on('end', done); }); +gulp.task('removeCode', function(done) { + gulp.src('./www/templates/**/*.html') + .pipe(removeCode({ production: true })) + .pipe(gulp.dest('./dist/templates')) + .on('end', done); +}); + gulp.task('watch', function() { gulp.watch(paths.sass, ['sass']); //gulp.watch(paths.config, ['config']); + gulp.watch(paths.templates, ['removeCode']); }); gulp.task('install', ['git-check'], function() { diff --git a/ionic.project b/ionic.project index 2e7b5c0e..b392585b 100644 --- a/ionic.project +++ b/ionic.project @@ -9,5 +9,12 @@ "sass", "watch" ], - "defaultBrowser": "chrome" -} \ No newline at end of file + "defaultBrowser": "chrome", + "browsers": [ + { + "platform": "android", + "browser": "crosswalk", + "version": "12.41.296.5" + } + ] +} diff --git a/package.json b/package.json index dda2888d..15214ca8 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "gulp-minify-css": "^0.3.0", "gulp-rename": "^1.2.0", "gulp-sass": "^2.2.0", + "ionic-native-transitions": "^1.0.0-rc10", "node-sass": "^3.3.3" }, "devDependencies": { @@ -28,7 +29,7 @@ "cordova-plugin-device" ], "cordovaPlatforms": [ - "android", - "ios" + "ios", + "android" ] } diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json index 76bcecbc..51e4c06e 100644 --- a/www/i18n/locale-en.json +++ b/www/i18n/locale-en.json @@ -33,6 +33,7 @@ "HOME": "Home", "REGISTRY": "Registry", "MARKET": "Market place", + "CURRENCY": "Currency", "CURRENCIES": "Currencies", "ACCOUNT": "My Account", "SETTINGS": "Settings" @@ -45,6 +46,7 @@ "BTN_REGISTRY": "Registry", "BTN_MARKET": "Market place", "BTN_CURRENCIES": "Explore currencies", + "BTN_CURRENCY": "Explore currency", "DEV_WARNING": "Warning", "DEV_WARNING_MESSAGE": "This application is still in active development.<br/>Please report us all issues !", "DEV_WARNING_MESSAGE_SHORT": "This App is still unstable (still under development).", @@ -90,6 +92,9 @@ "EXPIRE_IN": "Expires", "BTN_SEND_MONEY": "Send money", "BTN_CERTIFY": "Certify", + "LOOKUP": { + "TITLE": "Registry" + }, "MODAL": { "TITLE": "Search" } @@ -232,8 +237,8 @@ "BTN_SAVE": "Save" }, "ERROR": { - "LOAD_RECORD_FAILED": "Chargement impossible", - "SAVE_RECORD_FAILED": "Erreur de la sauvegarde" + "LOAD_RECORD_FAILED": "Loading failed", + "SAVE_RECORD_FAILED": "Sending failed" } }, "ERROR": { diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json index bcd4d014..ed055a0c 100644 --- a/www/i18n/locale-fr-FR.json +++ b/www/i18n/locale-fr-FR.json @@ -33,6 +33,7 @@ "HOME": "Accueil", "REGISTRY": "Annuaire", "MARKET": "Annonces", + "CURRENCY": "Monnaie", "CURRENCIES": "Monnaies", "ACCOUNT": "Mon compte", "SETTINGS": "Configuration" @@ -45,6 +46,7 @@ "BTN_REGISTRY": "Annuaire", "BTN_MARKET": "Offres/demandes", "BTN_CURRENCIES": "Explorer les monnaies", + "BTN_CURRENCY": "Explorer la monnaie", "DEV_WARNING": "Avertissement", "DEV_WARNING_MESSAGE": "Cette application n'est pas encore stabilisée (développement en cours).<br/>N'hésitez pas à nous remonter les anomalies rencontrées !", "DEV_WARNING_MESSAGE_SHORT": "Cette App n'est pas encore stabilisée (développement en cours).", @@ -90,6 +92,9 @@ "EXPIRE_IN": "Expiration", "BTN_SEND_MONEY": "Payer", "BTN_CERTIFY": "Certifier", + "LOOKUP": { + "TITLE": "Annuaire" + }, "MODAL": { "TITLE": "Recherche" } @@ -263,7 +268,7 @@ "TAKE_PICTURE_FAILED": "Echec de la récupération de la photo.", "SCAN_FAILED": "Echec du scan de QR Code", "WOT_LOOKUP_FAILED": "Echec de la recherche", - "LOAD_NODE_DATA_FAILED": "Interrogation du noeud Duniter impossible. Veuillez réessayer ultérieurement.", + "LOAD_NODE_DATA_FAILED": "Lecture du noeud Duniter impossible. Veuillez réessayer ultérieurement.", "NEED_LOGIN_FIRST": "Veuillez d'abord vous connecter.", "AMOUNT_REQUIRED": "Le montant est obligatoire.", "AMOUNT_NEGATIVE": "Montant négatif non autorisé.", diff --git a/www/index.html b/www/index.html index 74b0f508..25c883fa 100644 --- a/www/index.html +++ b/www/index.html @@ -24,6 +24,7 @@ <!-- ionic/angularjs js --> <script src="lib/ionic/js/ionic.bundle.js"></script> <script src="lib/ionic/js/ionic.material.min.js"></script> + <script src="lib/ionic/js/ionic-native-transitions.min.js"></script> <script src="lib/ionic/js/angular/angular-resource.min.js"></script> <script src="lib/ionic/js/angular/angular-translate.min.js"></script> <script src="lib/ionic/js/angular/angular-translate-loader-static-files.min.js"></script> diff --git a/www/js/app.js b/www/js/app.js index a6475dad..8ce2116e 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -4,7 +4,7 @@ // 'starter' is the name of this angular module example (also set in a <body> attribute in index.html) // the 2nd parameter is an array of 'requires' // 'starter.controllers' is found in controllers.js -angular.module('cesium', ['ionic', 'ngCordova', 'ionic-material', 'ngMessages', 'pascalprecht.translate', 'angularMoment', 'cesium.controllers']) +angular.module('cesium', ['ionic', 'ngCordova', 'ionic-material', 'ngMessages', 'pascalprecht.translate', 'angularMoment', 'cesium.controllers', 'ngAnimate', 'ionic-native-transitions']) .filter('formatInteger', function() { return function(input) { @@ -99,6 +99,45 @@ angular.module('cesium', ['ionic', 'ngCordova', 'ionic-material', 'ngMessages', $compileProvider.debugInfoEnabled(!!APP_CONFIG.DEBUG); }]) + .config(function($animateProvider) { + $animateProvider.classNameFilter( /\banimate-/ ); + }) + + .config(['$ionicNativeTransitionsProvider', 'APP_CONFIG', function($ionicNativeTransitionsProvider, APP_CONFIG){ + if (!!APP_CONFIG.NATIVE_TRANSITION) { + $ionicNativeTransitionsProvider.enable(true); + $ionicNativeTransitionsProvider.setDefaultOptions({ + duration: 400, // in milliseconds (ms), default 400, + slowdownfactor: 4, // overlap views (higher number is more) or no overlap (1), default 4 + iosdelay: -1, // ms to wait for the iOS webview to update before animation kicks in, default -1 + androiddelay: -1, // same as above but for Android, default -1 + winphonedelay: -1, // same as above but for Windows Phone, default -1, + fixedPixelsTop: 0, // the number of pixels of your fixed header, default 0 (iOS and Android) + fixedPixelsBottom: 0, // the number of pixels of your fixed footer (f.i. a tab bar), default 0 (iOS and Android) + triggerTransitionEvent: '$ionicView.afterEnter', // internal ionic-native-transitions option + backInOppositeDirection: false // Takes over default back transition and state back transition to use the opposite direction transition to go back + }); + $ionicNativeTransitionsProvider.setDefaultTransition({ + type: 'slide', + direction: 'left' + }); + $ionicNativeTransitionsProvider.setDefaultBackTransition({ + type: 'slide', + direction: 'right' + }); + } + else { + $ionicNativeTransitionsProvider.enable(false); + } + }]) + + .config(function($ionicConfigProvider) { + if (ionic.Platform.isAndroid()) { + $ionicConfigProvider.scrolling.jsScrolling(false); + } + $ionicConfigProvider.views.maxCache(5); + }) + // Add new compare-to directive (need for form validation) .directive("compareTo", function() { return { diff --git a/www/js/config.js b/www/js/config.js index e02dadf1..f45f2933 100644 --- a/www/js/config.js +++ b/www/js/config.js @@ -13,8 +13,9 @@ angular.module("cesium.config", []) "NEW_ISSUE_LINK": "https://github.com/duniter/cesium/issues/new?labels=bug", "TIMEOUT": 4000, "DEBUG": false, + "NATIVE_TRANSITION": false, "VERSION": "0.0.2", - "BUILD_DATE": "2016-05-16T19:37:53.349Z" + "BUILD_DATE": "2016-05-25T16:12:20.922Z" }) -; \ No newline at end of file +; diff --git a/www/js/controllers/currency-controllers.js b/www/js/controllers/currency-controllers.js index 0c563655..4bcf3d54 100644 --- a/www/js/controllers/currency-controllers.js +++ b/www/js/controllers/currency-controllers.js @@ -5,7 +5,7 @@ angular.module('cesium.currency.controllers', ['cesium.services']) $stateProvider .state('app.currency_lookup', { - url: "/currency", + url: "/currencies", views: { 'menuContent': { templateUrl: "templates/currency/lookup.html", @@ -113,7 +113,18 @@ function CurrencyViewController($scope, $rootScope, $state, BMA, $q, UIUtils, $i $scope.load($scope.id); } else { - $state.go('app.currency_lookup'); + if (Registry) { + $state.go('app.currency_lookup'); + } + else { + UIUtils.loading.show(); + $scope.loadCurrencies() + .then(function (res) { + $scope.load(res.id); + UIUtils.loading.hide(); + }) + .catch(IUtils.onError('ERROR.GET_CURRENCY_FAILED')); + } return; } }); diff --git a/www/js/controllers/wot-controllers.js b/www/js/controllers/wot-controllers.js index 484c0b6e..94fe9c90 100644 --- a/www/js/controllers/wot-controllers.js +++ b/www/js/controllers/wot-controllers.js @@ -3,8 +3,18 @@ angular.module('cesium.wot.controllers', ['cesium.services']) .config(function($stateProvider, $urlRouterProvider) { $stateProvider + .state('app.wot_lookup', { + url: "/wot", + views: { + 'menuContent': { + templateUrl: "templates/wot/lookup.html", + controller: 'WotLookupCtrl' + } + } + }) + .state('app.view_identity', { - url: "/wot/:pub", + url: "/wot/view/:pub", views: { 'menuContent': { templateUrl: "templates/wot/view_identity.html", diff --git a/www/lib/ionic/js/ionic-native-transitions.js b/www/lib/ionic/js/ionic-native-transitions.js new file mode 100644 index 00000000..77ddfab5 --- /dev/null +++ b/www/lib/ionic/js/ionic-native-transitions.js @@ -0,0 +1,749 @@ +/*! + * ionic-native-transitions + * --- + * Native transitions for Ionic applications + * @version: v1.0.0-rc9 + * @author: shprink <contact@julienrenaux.fr> + * @link: https://github.com/shprink/ionic-native-transitions + * @license: MIT + * + */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define(factory); + else if(typeof exports === 'object') + exports["ionicNativeTransitions"] = factory(); + else + root["ionicNativeTransitions"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/*!**********************!*\ + !*** ./lib/index.js ***! + \**********************/ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _providerJs = __webpack_require__(/*! ./provider.js */ 1); + + var _providerJs2 = _interopRequireDefault(_providerJs); + + var _nativeSrefJs = __webpack_require__(/*! ./nativeSref.js */ 2); + + var _nativeSrefJs2 = _interopRequireDefault(_nativeSrefJs); + + var _runJs = __webpack_require__(/*! ./run.js */ 3); + + var _runJs2 = _interopRequireDefault(_runJs); + + var mod = angular.module('ionic-native-transitions', ['ionic', 'ui.router']); + + mod.directive('nativeUiSref', _nativeSrefJs2['default']); + mod.provider('$ionicNativeTransitions', _providerJs2['default']); + mod.run(_runJs2['default']); + + exports['default'] = mod = mod.name; + module.exports = exports['default']; + +/***/ }, +/* 1 */ +/*!*************************!*\ + !*** ./lib/provider.js ***! + \*************************/ +/***/ function(module, exports) { + + /** + * @ngdoc service + * @name ionic-native-transitions.$ionicNativeTransitions + * @description + * ionic-native-transitions service + */ + /** + * @ngdoc service + * @name ionic-native-transitions.$ionicNativeTransitionsProvider + * @description + * ionic-native-transitions provider + */ + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + exports['default'] = function () { + 'ngInject'; + + var enabled = true, + $stateChangeStart = null, + $stateChangeSuccess = null, + $stateChangeError = null, + $stateAfterEnter = null, + oppositeDirections = { + up: 'down', + down: 'up', + left: 'right', + right: 'left' + }, + defaultTransition = { + type: 'slide', + direction: 'left' + }, + defaultBackTransition = { + type: 'slide', + direction: 'right' + }, + defaultOptions = { + duration: 400, // in milliseconds (ms), default 400, + slowdownfactor: 4, // overlap views (higher number is more) or no overlap (1), default 4 + iosdelay: -1, // ms to wait for the iOS webview to update before animation kicks in, default -1 + androiddelay: -1, // same as above but for Android, default -1 + winphonedelay: -1, // same as above but for Windows Phone, default -1, + fixedPixelsTop: 0, // the number of pixels of your fixed header, default 0 (iOS and Android) + fixedPixelsBottom: 0, // the number of pixels of your fixed footer (f.i. a tab bar), default 0 (iOS and Android), + triggerTransitionEvent: '$ionicView.afterEnter', // internal ionic-native-transitions option + backInOppositeDirection: false // Disable default back transition and uses the opposite transition to go back + }; + + $get.$inject = ["$log", "$ionicConfig", "$rootScope", "$timeout", "$state", "$location", "$ionicHistory", "$ionicPlatform"]; + return { + $get: $get, + enable: enable, + setDefaultTransition: setDefaultTransition, + setDefaultBackTransition: setDefaultBackTransition, + setDefaultOptions: setDefaultOptions + }; + + /** + * @ngdoc function + * @name ionic-native-transitions.$ionicNativeTransitionsProvider#enable + * @access public + * @methodOf ionic-native-transitions.$ionicNativeTransitionsProvider + * + * @description + * Overwrite default nativepagetransitions plugin options + * @param {object} injectedOptions options that will overwrite defaults + */ + function enable() { + var enabled = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0]; + + enable = enabled; + return this; + } + + /** + * @ngdoc function + * @name ionic-native-transitions.$ionicNativeTransitionsProvider#isEnabled + * @access public + * @methodOf ionic-native-transitions.$ionicNativeTransitionsProvider + * + * @description + * Is ionic-native-transitions enabled or not? + */ + /** + * @ngdoc function + * @name ionic-native-transitions.$ionicNativeTransitions#isEnabled + * @access public + * @methodOf ionic-native-transitions.$ionicNativeTransitions + * + * @description + * Is ionic-native-transitions enabled or not? + */ + function isEnabled() { + if (window.cordova && window.plugins && window.plugins.nativepagetransitions) { + return enable; + } + return false; + } + + /** + * @ngdoc function + * @name ionic-native-transitions.$ionicNativeTransitionsProvider#setDefaultOptions + * @access public + * @methodOf ionic-native-transitions.$ionicNativeTransitionsProvider + * + * @description + * Overwrite default nativepagetransitions plugin options + * @param {object} injectedOptions options that will overwrite defaults + */ + function setDefaultOptions() { + var injectedOptions = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + angular.extend(defaultOptions, injectedOptions); + return this; + } + + /** + * @ngdoc function + * @name ionic-native-transitions.$ionicNativeTransitionsProvider#setDefaultTransition + * @access public + * @methodOf ionic-native-transitions.$ionicNativeTransitionsProvider + * + * @description + * Overwrite default transitions + * @param {object} transitionOptions options that will overwrite defaults + */ + function setDefaultTransition() { + var transition = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + angular.extend(defaultTransition, transition); + return this; + } + + /** + * @ngdoc function + * @name ionic-native-transitions.$ionicNativeTransitionsProvider#setDefaultBackTransition + * @access public + * @methodOf ionic-native-transitions.$ionicNativeTransitionsProvider + * + * @description + * Overwrite default back transitions + * @param {object} transitionOptions options that will overwrite defaults + */ + function setDefaultBackTransition() { + var transition = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + angular.extend(defaultBackTransition, transition); + return this; + } + + function $get($log, $ionicConfig, $rootScope, $timeout, $state, $location, $ionicHistory, $ionicPlatform) { + 'ngInject'; + + var legacyGoBack = undefined, + backButtonUnregister = undefined; + + return { + init: init, + getDefaultOptions: getDefaultOptions, + enable: enableFromService, + isEnabled: isEnabled, + transition: transition, + registerToRouteEvents: registerToRouteEvents, + unregisterToRouteEvents: unregisterToRouteEvents, + registerToStateChangeStartEvent: registerToStateChangeStartEvent, + unregisterToStateChangeStartEvent: unregisterToStateChangeStartEvent, + locationUrl: locationUrl, + stateGo: stateGo, + goBack: goBack + }; + + /** + * @ngdoc function + * @name ionic-native-transitions.$ionicNativeTransitions#locationUrl + * @access public + * @methodOf ionic-native-transitions.$ionicNativeTransitions + * + * @description + * Call location url and apply a native transition + * @param {string|null} url default:null + * @param {object|null} transitionOptions default:null + */ + function locationUrl() { + var url = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0]; + var transitionOptions = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + + if (!url) { + $log.debug('[native transition] cannot change url without url...'); + return; + } + unregisterToStateChangeStartEvent(); + $location.url(url); + transition(transitionOptions); + } + + /** + * @ngdoc function + * @name ionic-native-transitions.$ionicNativeTransitions#stateGo + * @access public + * @methodOf ionic-native-transitions.$ionicNativeTransitions + * + * @description + * Call state go and apply a native transition + * @param {string|null} state default:null + * @param {object} stateParams default:{} + * @param {object|null} transitionOptions default:null + * @param {object} stateOptions default:{} + */ + function stateGo() { + var state = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0]; + var stateParams = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + var transitionOptions = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; + var stateOptions = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3]; + + if (!state) { + $log.debug('[native transition] cannot change state without a state...'); + return; + } + unregisterToStateChangeStartEvent(); + $state.go(state, stateParams, stateOptions); + transition(transitionOptions); + } + + /** + * @ngdoc function + * @name ionic-native-transitions.$ionicNativeTransitions#enable + * @access public + * @methodOf ionic-native-transitions.$ionicNativeTransitions + * + * @description + * enable/disable plugin + * @param {boolean} enabled + * @param {boolean} disableIonicTransitions + * @param {string} ionicTransitionType + */ + function enableFromService() { + var enabled = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0]; + var disableIonicTransitions = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1]; + var ionicTransitionType = arguments.length <= 2 || arguments[2] === undefined ? 'platform' : arguments[2]; + + if (enabled && !(window.cordova && window.plugins && window.plugins.nativepagetransitions)) { + $log.debug('[native transition] is disabled or nativepagetransitions plugin is not present'); + return; + } + enable = enabled; + + if (enabled) { + $log.debug('[native transition] enabling plugin'); + if (window.plugins && window.plugins.nativepagetransitions) { + angular.extend(window.plugins.nativepagetransitions.globalOptions, getDefaultOptions()); + } + $rootScope.$ionicGoBack = goBack; + backButtonUnregister = $ionicPlatform.registerBackButtonAction(function (e, count) { + return goBack(count); + }, 100); + registerToRouteEvents(); + } else { + $log.debug('[native transition] disabling plugin'); + if (typeof arguments[1] === 'undefined') { + disableIonicTransitions = false; + } + $rootScope.$ionicGoBack = legacyGoBack; + if (angular.isFunction(backButtonUnregister)) { + backButtonUnregister.call(); + } + unregisterToRouteEvents(); + } + + if (disableIonicTransitions) { + $log.debug('[native transition] disabling ionic transitions'); + $ionicConfig.views.transition('none'); + } else { + $log.debug('[native transition] enabling ionic transitions'); + $ionicConfig.views.transition(ionicTransitionType); + } + + return this; + } + + function transition() { + if (!isEnabled()) { + return; + } + var options = {}; + if (angular.isObject(arguments[0])) { + options = arguments[0]; + } else if (angular.isString(arguments[0])) { + switch (arguments[0]) { + case 'back': + if (getDefaultOptions().backInOppositeDirection && arguments[1] && getStateTransition(arguments[1])) { + options = getStateTransition(arguments[1]); + if (options.direction) { + options.direction = oppositeDirections[options.direction]; + } + } else if (arguments[2] && getBackStateTransition(arguments[2])) { + options = getBackStateTransition(arguments[2]); + } else { + options = defaultBackTransition; + } + break; + } + } else { + options = defaultTransition; + } + options = angular.copy(options); + var type = options.type; + delete options.type; + $log.debug('[native transition]', options); + switch (type) { + case 'flip': + window.plugins.nativepagetransitions.flip(options, transitionSuccess, transitionError); + break; + case 'fade': + window.plugins.nativepagetransitions.fade(options, transitionSuccess, transitionError); + break; + case 'curl': + window.plugins.nativepagetransitions.curl(options, transitionSuccess, transitionError); + break; + case 'drawer': + window.plugins.nativepagetransitions.drawer(options, transitionSuccess, transitionError); + break; + case 'slide': + default: + window.plugins.nativepagetransitions.slide(options, transitionSuccess, transitionError); + break; + } + + function getTransitionDuration() { + var duration = undefined; + if (options.duration) { + duration = parseInt(options.duration); + } else { + duration = parseInt(getDefaultOptions().duration); + } + if (ionic.Platform.isAndroid()) { + if (options.androiddelay) { + duration += parseInt(options.androiddelay); + } else { + duration += parseInt(getDefaultOptions().androiddelay); + } + } else if (ionic.Platform.isIOS()) { + if (options.iosdelay) { + duration += parseInt(options.iosdelay); + } else { + duration += parseInt(getDefaultOptions().iosdelay); + } + } else if (ionic.Platform.isWindowsPhone()) { + if (options.winphonedelay) { + duration += parseInt(options.winphonedelay); + } else { + duration += parseInt(getDefaultOptions().winphonedelay); + } + } + return duration; + } + + function transitionSuccess() { + setTimeout(function () { + return $rootScope.$broadcast('ionicNativeTransitions.success'); + }, getTransitionDuration()); + } + + function transitionError() { + setTimeout(function () { + return $rootScope.$broadcast('ionicNativeTransitions.error'); + }, getTransitionDuration()); + } + } + + function executePendingTransition() { + window.plugins.nativepagetransitions.executePendingTransition(); + // $rootScope.$broadcast('ionicNativeTransitions.', executePendingTransition); + registerToStateChangeStartEvent(); + } + + function registerToRouteEvents() { + unregisterToRouteEvents(); + registerToStateChangeStartEvent(); + // $stateChangeSuccess = $rootScope.$on('$stateChangeSuccess', executePendingTransition); + $stateChangeError = $rootScope.$on('$stateChangeError', executePendingTransition); + $stateAfterEnter = $rootScope.$on(getDefaultOptions().triggerTransitionEvent, executePendingTransition); + } + + function registerToStateChangeStartEvent() { + if ($stateChangeStart) { + return; + } + $stateChangeStart = $rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) { + var options = null; + // Abort if event was preventDefault'ed + if (event.defaultPrevented) { + return; + } + // Disable native transition for this state + if (toState.nativeTransitions === null) { + return; + } + options = getStateTransition(toState); + $log.debug('[native transition] $stateChangeStart', toState, options); + transition(options); + }); + } + + function getBackStateTransition(state) { + if (angular.isObject(state.nativeTransitionsBackIOS) && ionic.Platform.isIOS()) { + return angular.extend({}, state.nativeTransitionsBackIOS); + } else if (angular.isObject(state.nativeTransitionsBackAndroid) && ionic.Platform.isAndroid()) { + return angular.extend({}, state.nativeTransitionsBackAndroid); + } else if (angular.isObject(state.nativeTransitionsBackWindowsPhone) && ionic.Platform.isWindowsPhone()) { + return angular.extend({}, state.nativeTransitionsBackWindowsPhone); + } else if (angular.isObject(state.nativeTransitionsBack)) { + return angular.extend({}, state.nativeTransitionsBack); + } + return null; + } + + function getStateTransition(state) { + if (angular.isObject(state.nativeTransitionsIOS) && ionic.Platform.isIOS()) { + return angular.extend({}, state.nativeTransitionsIOS); + } else if (angular.isObject(state.nativeTransitionsAndroid) && ionic.Platform.isAndroid()) { + return angular.extend({}, state.nativeTransitionsAndroid); + } else if (angular.isObject(state.nativeTransitionsWindowsPhone) && ionic.Platform.isWindowsPhone()) { + return angular.extend({}, state.nativeTransitionsWindowsPhone); + } else if (angular.isObject(state.nativeTransitions)) { + return angular.extend({}, state.nativeTransitions); + } + return null; + } + + function unregisterToStateChangeStartEvent() { + if ($stateChangeStart && angular.isFunction($stateChangeStart)) { + $stateChangeStart(); + $stateChangeStart = null; + } + } + + function unregisterToRouteEvents() { + if ($stateChangeStart && angular.isFunction($stateChangeStart)) { + $stateChangeStart(); + $stateChangeStart = null; + } + if ($stateChangeSuccess && angular.isFunction($stateChangeSuccess)) { + $stateChangeSuccess(); + $stateChangeSuccess = null; + } + if ($stateChangeError && angular.isFunction($stateChangeError)) { + $stateChangeError(); + $stateChangeError = null; + } + if ($stateAfterEnter && angular.isFunction($stateAfterEnter)) { + $stateAfterEnter(); + $stateAfterEnter = null; + } + } + + /** + * @ngdoc function + * @name ionic-native-transitions.$ionicNativeTransitions#getDefaultOptions + * @access public + * @methodOf ionic-native-transitions.$ionicNativeTransitions + * + * @description + * Get default options + */ + function getDefaultOptions() { + return defaultOptions; + } + + /** + * @ngdoc function + * @name ionic-native-transitions.$ionicNativeTransitions#init + * @access public + * @methodOf ionic-native-transitions.$ionicNativeTransitions + * + * @description + * Init nativepagetransitions plugin + */ + function init() { + legacyGoBack = $rootScope.$ionicGoBack; + if (!isEnabled()) { + $log.debug('nativepagetransitions is disabled or nativepagetransitions plugin is not present'); + return; + } else { + enableFromService(); + } + } + + /** + * @ngdoc function + * @name ionic-native-transitions.$ionicNativeTransitions#goBack + * @access public + * @methodOf ionic-native-transitions.$ionicNativeTransitions + * @description Navigate back in the current history stack with a back navigation transition + * @param {number} backCount - The number of views to go back to. default will be the previous view + */ + function goBack(backCount) { + + if (!$ionicHistory.backView()) { + // Close the app when no more history + if (navigator.app) { + navigator.app.exitApp(); + } + return; + } + if (backCount >= 0) { + return; + } + var stateName = $ionicHistory.backView().stateName; + + // Use backCount to find next state only if its defined, else pass as it is to $ionicHistory.goBack + // which defaults to previous view transition + // Get current history stack and find the cursor for the new view + // Based on the new cursor, find the new state to transition to + if (!!backCount && !isNaN(parseInt(backCount))) { + var viewHistory = $ionicHistory.viewHistory(); + var currentHistory = viewHistory.histories[$ionicHistory.currentView().historyId]; + var newCursor = currentHistory.cursor + backCount; + + // If new cursor is more than the max possible or less than zero, default it to first view in history + if (newCursor < 0 || newCursor > currentHistory.stack.length) { + newCursor = 0; + } + + stateName = currentHistory.stack[newCursor].stateName; + } + + unregisterToStateChangeStartEvent(); + var currentStateTransition = angular.extend({}, $state.current); + var toStateTransition = angular.extend({}, $state.get(stateName)); + $log.debug('nativepagetransitions goBack', backCount, stateName, currentStateTransition, toStateTransition); + $ionicHistory.goBack(backCount); + transition('back', currentStateTransition, toStateTransition); + } + } + }; + + ; + module.exports = exports['default']; + +/***/ }, +/* 2 */ +/*!***************************!*\ + !*** ./lib/nativeSref.js ***! + \***************************/ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + exports['default'] = ["$log", "$ionicNativeTransitions", "$state", function ($log, $ionicNativeTransitions, $state) { + 'ngInject'; + + controller.$inject = ["$scope", "$element", "$attrs", "$state"]; + return { + controller: controller, + restrict: 'A', + scope: false + }; + + function controller($scope, $element, $attrs, $state) { + 'ngInject'; + + var stateOptions = $scope.$eval($attrs.nativeUiSrefOpts) || {}; + var nativeOptions = null; + + $attrs.$observe('nativeOptions', function (newOptions) { + var evalOptions = $scope.$eval(newOptions); + nativeOptions = angular.isObject(evalOptions) ? evalOptions : {}; + }); + + $element.on('click', function (event) { + var ref = parseStateRef($attrs.nativeUiSref, $state.current.name); + var params = angular.copy($scope.$eval(ref.paramExpr)); + if (!$ionicNativeTransitions.isEnabled()) { + $state.go(ref.state, params, stateOptions); + return; + } + + $ionicNativeTransitions.stateGo(ref.state, params, nativeOptions, stateOptions); + }); + } + }]; + + function parseStateRef(ref, current) { + var preparsed = ref.match(/^\s*({[^}]*})\s*$/), + parsed; + if (preparsed) ref = current + '(' + preparsed[1] + ')'; + parsed = ref.replace(/\n/g, " ").match(/^([^(]+?)\s*(\((.*)\))?$/); + if (!parsed || parsed.length !== 4) throw new Error("Invalid state ref '" + ref + "'"); + return { + state: parsed[1], + paramExpr: parsed[3] || null + }; + } + module.exports = exports['default']; + +/***/ }, +/* 3 */ +/*!********************!*\ + !*** ./lib/run.js ***! + \********************/ +/***/ function(module, exports) { + + /** + * @ngdoc service + * @name ionic-native-transitions.$ionicNativeTransitions + * @description + * ionic-native-transitions service + */ + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + exports['default'] = ["$ionicNativeTransitions", "$ionicPlatform", "$ionicHistory", "$rootScope", function ($ionicNativeTransitions, $ionicPlatform, $ionicHistory, $rootScope) { + 'ngInject'; + + $ionicPlatform.ready(function () { + $ionicNativeTransitions.init(); + }); + }]; + + ; + module.exports = exports['default']; + /** + * @ngdoc service + * @name ionic-native-transitions.$ionicNativeTransitionsProvider + * @description + * ionic-native-transitions provider + */ + +/***/ } +/******/ ]) +}); +; +//# sourceMappingURL=ionic-native-transitions.js.map \ No newline at end of file diff --git a/www/lib/ionic/js/ionic-native-transitions.min.js b/www/lib/ionic/js/ionic-native-transitions.min.js new file mode 100644 index 00000000..1666600d --- /dev/null +++ b/www/lib/ionic/js/ionic-native-transitions.min.js @@ -0,0 +1,11 @@ +/*! + * ionic-native-transitions + * --- + * Native transitions for Ionic applications + * @version: v1.0.0-rc9 + * @author: shprink <contact@julienrenaux.fr> + * @link: https://github.com/shprink/ionic-native-transitions + * @license: MIT + * + */ +!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):"object"==typeof exports?exports.ionicNativeTransitions=t():n.ionicNativeTransitions=t()}(this,function(){return function(n){function t(e){if(i[e])return i[e].exports;var a=i[e]={exports:{},id:e,loaded:!1};return n[e].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var i={};return t.m=n,t.c=i,t.p="",t(0)}([function(n,t,i){"use strict";function e(n){return n&&n.__esModule?n:{"default":n}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(2),r=e(a),o=i(1),s=e(o),u=i(3),l=e(u),d=angular.module("ionic-native-transitions",["ionic","ui.router"]);d.directive("nativeUiSref",s["default"]),d.provider("$ionicNativeTransitions",r["default"]),d.run(l["default"]),t["default"]=d=d.name,n.exports=t["default"]},function(n,t){"use strict";function i(n,t){var i,e=n.match(/^\s*({[^}]*})\s*$/);if(e&&(n=t+"("+e[1]+")"),i=n.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!i||4!==i.length)throw new Error("Invalid state ref '"+n+"'");return{state:i[1],paramExpr:i[3]||null}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=["$log","$ionicNativeTransitions","$state",function(n,t,e){"ngInject";function a(n,e,a,r){var o=n.$eval(a.nativeUiSrefOpts)||{},s=null;a.$observe("nativeOptions",function(t){var i=n.$eval(t);s=angular.isObject(i)?i:{}}),e.on("click",function(e){var u=i(a.nativeUiSref,r.current.name),l=angular.copy(n.$eval(u.paramExpr));return t.isEnabled()?void t.stateGo(u.state,l,s,o):void r.go(u.state,l,o)})}return a.$inject=["$scope","$element","$attrs","$state"],{controller:a,restrict:"A",scope:!1}}],n.exports=t["default"]},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(){"ngInject";function n(){var t=arguments.length<=0||void 0===arguments[0]?!0:arguments[0];return n=t,this}function t(){return window.cordova&&window.plugins&&window.plugins.nativepagetransitions?n:!1}function i(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return angular.extend(v,n),this}function e(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return angular.extend(g,n),this}function a(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return angular.extend(c,n),this}function r(i,e,a,r,f,p,m,w){function b(){var n=arguments.length<=0||void 0===arguments[0]?null:arguments[0],t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return n?(I(),p.url(n),void T(t)):void i.debug("[native transition] cannot change url without url...")}function h(){var n=arguments.length<=0||void 0===arguments[0]?null:arguments[0],t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],e=arguments.length<=2||void 0===arguments[2]?null:arguments[2],a=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];return n?(I(),f.go(n,t,a),void T(e)):void i.debug("[native transition] cannot change state without a state...")}function $(){var t=arguments.length<=0||void 0===arguments[0]?!0:arguments[0],r=arguments.length<=1||void 0===arguments[1]?!0:arguments[1],o=arguments.length<=2||void 0===arguments[2]?"platform":arguments[2];return!t||window.cordova&&window.plugins&&window.plugins.nativepagetransitions?(n=t,t?(i.debug("[native transition] enabling plugin"),window.plugins&&window.plugins.nativepagetransitions&&angular.extend(window.plugins.nativepagetransitions.globalOptions,S()),a.$ionicGoBack=E,A=w.registerBackButtonAction(function(n,t){return E(t)},100),y()):(i.debug("[native transition] disabling plugin"),"undefined"==typeof arguments[1]&&(r=!1),a.$ionicGoBack=N,angular.isFunction(A)&&A.call(),j()),r?(i.debug("[native transition] disabling ionic transitions"),e.views.transition("none")):(i.debug("[native transition] enabling ionic transitions"),e.views.transition(o)),this):void i.debug("[native transition] is disabled or nativepagetransitions plugin is not present")}function T(){function n(){var n=void 0;return n=o.duration?parseInt(o.duration):parseInt(S().duration),ionic.Platform.isAndroid()?n+=o.androiddelay?parseInt(o.androiddelay):parseInt(S().androiddelay):ionic.Platform.isIOS()?n+=o.iosdelay?parseInt(o.iosdelay):parseInt(S().iosdelay):ionic.Platform.isWindowsPhone()&&(n+=o.winphonedelay?parseInt(o.winphonedelay):parseInt(S().winphonedelay)),n}function e(){setTimeout(function(){return a.$broadcast("ionicNativeTransitions.success")},n())}function r(){setTimeout(function(){return a.$broadcast("ionicNativeTransitions.error")},n())}if(t()){var o={};if(angular.isObject(arguments[0]))o=arguments[0];else if(angular.isString(arguments[0]))switch(arguments[0]){case"back":S().backInOppositeDirection&&arguments[1]&&P(arguments[1])?(o=P(arguments[1]),o.direction&&(o.direction=d[o.direction])):o=arguments[2]&&O(arguments[2])?O(arguments[2]):c}else o=g;o=angular.copy(o);var s=o.type;switch(delete o.type,i.debug("[native transition]",o),s){case"flip":window.plugins.nativepagetransitions.flip(o,e,r);break;case"fade":window.plugins.nativepagetransitions.fade(o,e,r);break;case"curl":window.plugins.nativepagetransitions.curl(o,e,r);break;case"drawer":window.plugins.nativepagetransitions.drawer(o,e,r);break;case"slide":default:window.plugins.nativepagetransitions.slide(o,e,r)}}}function x(){window.plugins.nativepagetransitions.executePendingTransition(),k()}function y(){j(),k(),u=a.$on("$stateChangeError",x),l=a.$on(S().triggerTransitionEvent,x)}function k(){o||(o=a.$on("$stateChangeStart",function(n,t,e,a,r){var o=null;n.defaultPrevented||null!==t.nativeTransitions&&(o=P(t),i.debug("[native transition] $stateChangeStart",t,o),T(o))}))}function O(n){return angular.isObject(n.nativeTransitionsBackIOS)&&ionic.Platform.isIOS()?angular.extend({},n.nativeTransitionsBackIOS):angular.isObject(n.nativeTransitionsBackAndroid)&&ionic.Platform.isAndroid()?angular.extend({},n.nativeTransitionsBackAndroid):angular.isObject(n.nativeTransitionsBackWindowsPhone)&&ionic.Platform.isWindowsPhone()?angular.extend({},n.nativeTransitionsBackWindowsPhone):angular.isObject(n.nativeTransitionsBack)?angular.extend({},n.nativeTransitionsBack):null}function P(n){return angular.isObject(n.nativeTransitionsIOS)&&ionic.Platform.isIOS()?angular.extend({},n.nativeTransitionsIOS):angular.isObject(n.nativeTransitionsAndroid)&&ionic.Platform.isAndroid()?angular.extend({},n.nativeTransitionsAndroid):angular.isObject(n.nativeTransitionsWindowsPhone)&&ionic.Platform.isWindowsPhone()?angular.extend({},n.nativeTransitionsWindowsPhone):angular.isObject(n.nativeTransitions)?angular.extend({},n.nativeTransitions):null}function I(){o&&angular.isFunction(o)&&(o(),o=null)}function j(){o&&angular.isFunction(o)&&(o(),o=null),s&&angular.isFunction(s)&&(s(),s=null),u&&angular.isFunction(u)&&(u(),u=null),l&&angular.isFunction(l)&&(l(),l=null)}function S(){return v}function B(){return N=a.$ionicGoBack,t()?void $():void i.debug("nativepagetransitions is disabled or nativepagetransitions plugin is not present")}function E(n){if(!m.backView())return void(navigator.app&&navigator.app.exitApp());if(!(n>=0)){var t=m.backView().stateName;if(n&&!isNaN(parseInt(n))){var e=m.viewHistory(),a=e.histories[m.currentView().historyId],r=a.cursor+n;(0>r||r>a.stack.length)&&(r=0),t=a.stack[r].stateName}I();var o=angular.extend({},f.current),s=angular.extend({},f.get(t));i.debug("nativepagetransitions goBack",n,t,o,s),m.goBack(n),T("back",o,s)}}var N=void 0,A=void 0;return{init:B,getDefaultOptions:S,enable:$,isEnabled:t,transition:T,registerToRouteEvents:y,unregisterToRouteEvents:j,registerToStateChangeStartEvent:k,unregisterToStateChangeStartEvent:I,locationUrl:b,stateGo:h,goBack:E}}var o=null,s=null,u=null,l=null,d={up:"down",down:"up",left:"right",right:"left"},g={type:"slide",direction:"left"},c={type:"slide",direction:"right"},v={duration:400,slowdownfactor:4,iosdelay:-1,androiddelay:-1,winphonedelay:-1,fixedPixelsTop:0,fixedPixelsBottom:0,triggerTransitionEvent:"$ionicView.afterEnter",backInOppositeDirection:!1};return r.$inject=["$log","$ionicConfig","$rootScope","$timeout","$state","$location","$ionicHistory","$ionicPlatform"],{$get:r,enable:n,setDefaultTransition:e,setDefaultBackTransition:a,setDefaultOptions:i}},n.exports=t["default"]},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=["$ionicNativeTransitions","$ionicPlatform","$ionicHistory","$rootScope",function(n,t,i,e){"ngInject";t.ready(function(){n.init()})}],n.exports=t["default"]}])}); \ No newline at end of file diff --git a/www/templates/currency/view_currency.html b/www/templates/currency/view_currency.html index 4d917175..405e887e 100644 --- a/www/templates/currency/view_currency.html +++ b/www/templates/currency/view_currency.html @@ -16,13 +16,6 @@ </ion-content> </ion-tab> - <ion-tab title="{{'CURRENCY.VIEW.TAB_WOT'|translate}}" icon="ion-person-stalker"> - <ion-nav-view name="wot-tab"/> - <ion-content class="padding no-padding-xs"> - <ng-include src="'templates/wot/lookup_form.html'"></ng-include> - </ion-content> - </ion-tab> - <ion-tab title="{{'CURRENCY.VIEW.TAB_NETWORK'|translate}}" icon="ion-network" > <ion-nav-view name="network-tab"/> <ion-content class="padding no-padding-xs"> diff --git a/www/templates/currency/view_currency_lg.html b/www/templates/currency/view_currency_lg.html index 7baedaf0..0c12e99c 100644 --- a/www/templates/currency/view_currency_lg.html +++ b/www/templates/currency/view_currency_lg.html @@ -14,10 +14,6 @@ <ng-include src="'templates/currency/tabs/view_parameters.html'"></ng-include> </div> <div class="col col-50"> - <div class="item item-divider" translate> - CURRENCY.VIEW.TAB_WOT - </div> - <ng-include src="'templates/wot/lookup_form.html'"></ng-include> <ng-include src="'templates/currency/tabs/view_network.html'"></ng-include> </div> </div> diff --git a/www/templates/home/home.html b/www/templates/home/home.html index cdcb7b80..0617421a 100644 --- a/www/templates/home/home.html +++ b/www/templates/home/home.html @@ -15,9 +15,20 @@ <div class="col-25 hidden-xs hidden-sm"> </div> <div class="col"> + <!-- CURRENCY --> <button type="button" class="button button-block button-stable button-raised icon icon-left ion-ios-world-outline ink-dark" + ng-if="options.registry.enable" ui-sref="app.currency_lookup" translate>HOME.BTN_CURRENCIES</button> + <button type="button" + class="button button-block button-stable button-raised icon icon-left ion-ios-world-outline ink-dark hidden-sm hidden-xs" + ng-if="!options.registry || !options.registry.enable" + ui-sref="app.currency_view_lg" translate>HOME.BTN_CURRENCY</button> + <button type="button" + class="button button-block button-stable button-raised icon icon-left ion-ios-world-outline ink-dark visible-sm visible-xs" + ng-if="!options.registry || !options.registry.enable" + ui-sref="app.currency_view" translate>HOME.BTN_CURRENCY</button> + <button type="button" class="button button-block button-positive button-raised icon icon-left ion-locked ink-dark" ng-click="login()" ng-show="!isLogged()" translate>COMMON.BTN_LOGIN</button> diff --git a/www/templates/login.html b/www/templates/login.html index 183d4326..6bbdffa6 100644 --- a/www/templates/login.html +++ b/www/templates/login.html @@ -52,6 +52,9 @@ </div> </div> + <!-- remember me + <ion-checkbox ng-model="isChecked">Checkbox Label</ion-checkbox>--> + <!-- Show public key --> <div class="item item-icon-left item-button-right left"> <span class="input-label" translate>COMMON.PUBKEY</span> diff --git a/www/templates/market/view_record.html b/www/templates/market/view_record.html index 188ecea7..9eb78835 100644 --- a/www/templates/market/view_record.html +++ b/www/templates/market/view_record.html @@ -64,8 +64,8 @@ <div ng-repeat="picture in pictures" class="item card card-gallery"> <div class="ink"> - <h2>{{picture.title}}</h2> - <img ng-src="{{picture.src}}" ></img> + <h2 ng-if="picture.title">{{::picture.title}}</h2> + <img ng-src="{{::picture.src}}" ></img> </div> </div> </div> diff --git a/www/templates/menu.html b/www/templates/menu.html index 7e52023d..5dea616a 100644 --- a/www/templates/menu.html +++ b/www/templates/menu.html @@ -26,19 +26,35 @@ <i class="icon ion-home"></i> <span translate>MENU.HOME</span> </ion-item> - <ion-item menu-close class="item item-icon-left" href="#/app/currency"> + + <!-- CURRENCY --> + <ion-item menu-close class="item item-icon-left" href="#/app/currencies" ng-if="options.registry.enable"> <i class="icon ion-ios-world-outline"></i> <span translate>MENU.CURRENCIES</span> </ion-item> + <ion-item menu-close class="item item-icon-left hidden-xs hidden-sm" href="#/app/currency/view/lg/" ng-if="!options.registry || !options.registry.enable"> + <i class="icon ion-ios-world-outline"></i> + <span translate>MENU.CURRENCY</span> + </ion-item> + <ion-item menu-close class="item item-icon-left visible-xs visible-sm" href="#/app/currency/view/" ng-if="!options.registry || !options.registry.enable"> + <i class="icon ion-ios-world-outline"></i> + <span translate>MENU.CURRENCY</span> + </ion-item> - <div class="item item-divider" - ng-show="options.market.enable || options.market.enable"></div> + <div class="item item-divider"></div> - <ion-item menu-close class="item item-icon-left" href="#/app/registry" ng-show="options.registry.enable"> + <!-- REGISTRY --> + <ion-item menu-close class="item item-icon-left" href="#/app/wot" ng-if="!options.registry || !options.registry.enable"> <i class="icon ion-person-stalker"></i> <span translate>MENU.REGISTRY</span> </ion-item> - <ion-item menu-close class="item item-icon-left" href="#/app/market" ng-show="options.market.enable"> + <ion-item menu-close class="item item-icon-left" href="#/app/registry" ng-if="options.registry.enable"> + <i class="icon ion-person-stalker"></i> + <span translate>MENU.REGISTRY</span> + </ion-item> + + <!-- MARKET --> + <ion-item menu-close class="item item-icon-left" href="#/app/market" ng-if="options.market.enable"> <i class="icon ion-speakerphone"></i> <span translate>MENU.MARKET</span> </ion-item> diff --git a/www/templates/wot/lookup.html b/www/templates/wot/lookup.html new file mode 100644 index 00000000..a7080e21 --- /dev/null +++ b/www/templates/wot/lookup.html @@ -0,0 +1,5 @@ +<ion-view view-title="{{'WOT.LOOKUP.TITLE' | translate}}"> + <ion-content class="padding no-padding-xs"> + <ng-include src="'templates/wot/lookup_form.html'"/> + </ion-content> +</ion-view> -- GitLab