Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* Empty. Add your own CSS if you like */ | ||
.icon.new-item { | ||
position: absolute; | ||
right: 20px; | ||
font-size: 20px; | ||
bottom: 13px; | ||
} | ||
.cancel-create { | ||
position: absolute; | ||
right: 20px; | ||
font-size: 14px; | ||
bottom: 13px; | ||
color:#ef4e3a; | ||
} | ||
[ng-click], [data-ng-click], [x-ng-click] { | ||
cursor: pointer; | ||
} | ||
/* Ionic Overwrite! */ | ||
.item-icon-left .icon, .item-icon-right .icon { | ||
font-size: 22px; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> | ||
<title></title> | ||
|
||
<link href="lib/ionic/css/ionic.min.css" rel="stylesheet"> | ||
<link href="css/style.css" rel="stylesheet"> | ||
|
||
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above | ||
<link href="css/ionic.app.css" rel="stylesheet"> | ||
--> | ||
|
||
<!-- ionic/angularjs js --> | ||
<script src="lib/ionic/js/ionic.bundle.min.js"></script> | ||
|
||
<!-- cordova script (this will be a 404 during development) --> | ||
<script src="cordova.js"></script> | ||
|
||
<script src="lib/angularbknd-sdk/dist/backand.debug.js"></script> | ||
|
||
<!-- your app's js --> | ||
<script src="js/app.js"></script> | ||
<script src="js/controllers.js"></script> | ||
<script src="js/services.js"></script> | ||
|
||
</head> | ||
<body ng-app="SimpleRESTIonic"> | ||
<!-- | ||
The nav bar that will be updated as we navigate between views. | ||
--> | ||
<ion-nav-bar class="bar-stable"> | ||
<ion-nav-back-button> | ||
</ion-nav-back-button> | ||
</ion-nav-bar> | ||
<!-- | ||
The views will be rendered in the <ion-nav-view> directive below | ||
Templates are in the /templates folder (but you could also | ||
have templates inline in this html file if you'd like). | ||
--> | ||
<ion-nav-view></ion-nav-view> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
// Ionic template App | ||
|
||
// angular.module is a global place for creating, registering and retrieving Angular modules | ||
// 'SimpleRESTIonic' 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' | ||
angular.module('SimpleRESTIonic', ['ionic', 'backand', 'SimpleRESTIonic.controllers', 'SimpleRESTIonic.services']) | ||
|
||
/* .run(function (, Backand) { | ||
}) | ||
*/ | ||
.config(function (BackandProvider, $stateProvider, $urlRouterProvider, $httpProvider) { | ||
// change here to your appName | ||
BackandProvider.setAppName('ionicstarter'); | ||
|
||
BackandProvider.setSignUpToken('4ce88904-75c5-412c-8365-df97d9e18a8f'); | ||
|
||
// token is for anonymous login. see http://docs.backand.com/en/latest/apidocs/security/index.html#anonymous-access | ||
BackandProvider.setAnonymousToken('87c37623-a2d2-42af-93df-addc65c6e9ad'); | ||
|
||
$stateProvider | ||
// setup an abstract state for the tabs directive | ||
.state('tab', { | ||
url: '/tabs', | ||
abstract: true, | ||
templateUrl: 'templates/tabs.html' | ||
}) | ||
.state('tab.dashboard', { | ||
url: '/dashboard', | ||
views: { | ||
'tab-dashboard': { | ||
templateUrl: 'templates/tab-dashboard.html', | ||
controller: 'DashboardCtrl as vm' | ||
} | ||
} | ||
}) | ||
.state('tab.login', { | ||
url: '/login', | ||
views: { | ||
'tab-login': { | ||
templateUrl: 'templates/tab-login.html', | ||
controller: 'LoginCtrl as login' | ||
} | ||
} | ||
}) | ||
.state('tab.signup', { | ||
url: '/signup', | ||
views: { | ||
'tab-signup': { | ||
templateUrl: 'templates/tab-signup.html', | ||
controller: 'SignUpCtrl as vm' | ||
} | ||
} | ||
} | ||
); | ||
|
||
$urlRouterProvider.otherwise('/tabs/dashboard'); | ||
$httpProvider.interceptors.push('APIInterceptor'); | ||
}) | ||
|
||
.run(function ($ionicPlatform, $rootScope, $state, LoginService, Backand) { | ||
|
||
$ionicPlatform.ready(function () { | ||
|
||
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard | ||
// for form inputs) | ||
if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) { | ||
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); | ||
cordova.plugins.Keyboard.disableScroll(true); | ||
} | ||
|
||
if (window.StatusBar) { | ||
// org.apache.cordova.statusbar required | ||
StatusBar.styleLightContent(); | ||
} | ||
|
||
|
||
var isMobile = !(ionic.Platform.platforms[0] == "browser"); | ||
Backand.setIsMobile(isMobile); | ||
Backand.setRunSignupAfterErrorInSigninSocial(true); | ||
}); | ||
|
||
function unauthorized() { | ||
console.log("user is unauthorized, sending to login"); | ||
$state.go('tab.login'); | ||
} | ||
|
||
function signout() { | ||
LoginService.signout(); | ||
} | ||
|
||
$rootScope.$on('unauthorized', function () { | ||
unauthorized(); | ||
}); | ||
|
||
$rootScope.$on('$stateChangeSuccess', function (event, toState) { | ||
if (toState.name == 'tab.login') { | ||
signout(); | ||
} | ||
else if (toState.name != 'tab.login' && Backand.getToken() === undefined) { | ||
unauthorized(); | ||
} | ||
}); | ||
|
||
}) |