Skip to content

Instantly share code, notes, and snippets.

@machineloop
Created September 10, 2014 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save machineloop/2799039fa82bfceddc28 to your computer and use it in GitHub Desktop.
Save machineloop/2799039fa82bfceddc28 to your computer and use it in GitHub Desktop.
Nite-out
'use strict';
angular.module('nite-out', [
'nite-out.main',
'nite-out.mainServices',
'nite-out.checkout',
'nite-out.marketTest',
'nite-out.auth',
'nite-out.authServices',
'nite-out.movies',
'nite-out.movieFactory',
'nite-out.showtimes',
'nite-out.cart',
'nite-out.mycart',
'nite-out.map',
'nite-out.mapFactory',
'nite-out.events',
'nite-out.eventFactory',
'nite-out.restaurants',
'nite-out.restaurantFactory',
'ui.router',
'ionic'
])
// .config(['$urlRouterProvider', function($urlRouterProvider) {
// $urlRouterProvider.otherwise('/main');
// }])
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('eventmenu', {
url: "/event",
abstract: true,
templateUrl: "templates/event-menu.html"
})
.state('eventmenu.home', {
url: "/home",
views: {
'menuContent' :{
templateUrl: "templates/home.html"
}
}
})
.state('eventmenu.checkin', {
url: "/check-in",
views: {
'menuContent' :{
templateUrl: "templates/check-in.html",
controller: "CheckinCtrl"
}
}
})
.state('eventmenu.attendees', {
url: "/attendees",
views: {
'menuContent' :{
templateUrl: "templates/attendees.html",
controller: "AttendeesCtrl"
}
}
})
$urlRouterProvider.otherwise("/event/home");
})
.controller('MainCtrl', function($scope, $ionicSideMenuDelegate) {
$scope.attendees = [
{ firstname: 'Nicolas', lastname: 'Cage' },
{ firstname: 'Jean-Claude', lastname: 'Van Damme' },
{ firstname: 'Keanu', lastname: 'Reeves' },
{ firstname: 'Steven', lastname: 'Seagal' }
];
$scope.toggleLeft = function() {
$ionicSideMenuDelegate.toggleLeft();
};
})
.controller('CheckinCtrl', function($scope) {
$scope.showForm = true;
$scope.shirtSizes = [
{ text: 'Large', value: 'L' },
{ text: 'Medium', value: 'M' },
{ text: 'Small', value: 'S' }
];
$scope.attendee = {};
$scope.submit = function() {
if(!$scope.attendee.firstname) {
alert('Info required');
return;
}
$scope.showForm = false;
$scope.attendees.push($scope.attendee);
};
})
.controller('AttendeesCtrl', function($scope) {
$scope.activity = [];
$scope.arrivedChange = function(attendee) {
var msg = attendee.firstname + ' ' + attendee.lastname;
msg += (!attendee.arrived ? ' has arrived, ' : ' just left, ');
msg += new Date().getMilliseconds();
$scope.activity.push(msg);
if($scope.activity.length > 3) {
$scope.activity.splice(0, 1);
}
};
});
// .run(['$rootScope', function($rootScope) {
// $rootScope.$on('$stateChangeStart', function(ev, toState) {
// if (toState.data) {
// check(toState);
// }
// });
// var check = function(toState) {
// if (checkLoading(toState)) {
// executeLoading(toState);
// }
// };
// var executeLoading = function(toState) {
// toState.data.loading();
// };
// var checkLoading = function(toState) {
// if (toState.data) {
// return (toState.data.loading !== undefined || toState.data.loading !== null) && typeof toState.data.loading === 'function';
// }
// return false;
// };
// }])
// .directive('loggedin', ['Main', function(Main) {
// return {
// restrict: 'EA',
// replace: true,
// templateUrl: 'app/auth/loggedin.tpl.html',
// link: function(scope) {
// scope.user = Main.user;
// }
// };
// }])
// .directive('needlogin', function() {
// return {
// restrict: 'EA',
// replace: true,
// templateUrl: 'app/auth/needlogin.tpl.html'
// };
// })
// .directive('cart', function() {
// return {
// restrict: 'EA',
// replace: true,
// templateUrl: 'app/cart/cart.html'
// };
// })
// .directive('modalDialog', ['$sce', function($sce) {
// return {
// restrict: 'E',
// scope: {
// show: '=',
// url: '=',
// action: '&',
// },
// replace: true,
// // Replace with the template below
// link: function(scope) {
// scope.userInfo = {};
// scope.hideModal = function() {
// scope.show = false;
// };
// scope.trustSrc = function(src) {
// return $sce.trustAsResourceUrl(src);
// };
// },
// templateUrl: function(tElement, tAttrs) {
// return tAttrs.templateUrl;
// }
// };
// }]);
<!DOCTYPE html>
<html ng-app='nite-out'>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>NiteOut</title>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Montserrat+Alternates' rel='stylesheet' type='text/css'>
<script src="https://maps.googleapis.com/maps/api/js?libraries=places&sensor=true"></script>
<link rel="stylesheet" type="text/css" href="bower_components/ionic/release/css/ionic.css" />
<!-- <link href="http://code.ionicframework.com/1.0.0-beta.11/css/ionic.css" rel="stylesheet"> -->
<script src="http://code.ionicframework.com/1.0.0-beta.11/js/ionic.bundle.js"></script>
<link rel="stylesheet" type="text/css" href="bower_components/ionicons/css/ionicons.css" />
<!-- <link rel="stylesheet" type="text/css" href="styles/style.css" /> -->
<link rel="stylesheet" type="text/css" href="styles/icecream-grid.css" />
<!-- <link rel="stylesheet" type="text/css" href="bower_components/ionic/release/css/ionic.css" /> -->
<!-- <link rel="stylesheet" type="text/css" href="styles/ionic-style-overrides.css" /> -->
</head>
<!-- <body ng-app='nite-out' ng-controller="MainCtrl">
<ion-side-menus>
<ion-side-menu-content >
<div class="bar bar-header item-input-inset">
<ion-nav-buttons side="left">
<button ng-click="toggleLeft()" class="button button-icon icon ion-navicon"></button>
</ion-nav-buttons>
<label class="item-input-wrapper">
<i class="icon ion-ios7-search placeholder-icon"></i>
<input type="search" placeholder="Search">
</label>
<div class="i-8" ui-view></div>
<div class="i-2"></div>
</ion-side-menu-content>
<ion-side-menu side="left">
<ion-header-bar class="bar-assertive">
<h1 class="title">Left Menu</h1>
</ion-header-bar>
<ion-content>
<ul class="list">
<a href="#/event/check-in" class="item" menu-close>Check-in</a>
<a href="#/event/attendees" class="item" menu-close>Attendees</a>
</ul>
</ion-content>
</ion-side-menu>
</ion-side-menus>
</ion-side-menus> -->
<!-- distribution requirements -->
<!-- <script src="dist/build.js"></script> -->
<!-- development requirements
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script> -->
<!-- <script src="bower_components/ionic/release/js/ionic.bundle.js"></script> -->
<script src="bower_components/lodash/dist/lodash.min.js"></script>
<script src="bower_components/angular-google-maps/dist/angular-google-maps.min.js"></script>
<script src="app/auth/auth.js"></script>
<script src="app/auth/services.js"></script>
<script src="app/checkout/checkout.js"></script>
<script src="app/checkout/marketTestingPage.js"></script>
<script src="app/map/map.js"></script>
<script src="app/map/services.js"></script>
<script src="app/events/events.js"></script>
<script src="app/events/services.js"></script>
<script src="app/restaurants/restaurants.js"></script>
<script src="app/restaurants/services.js"></script>
<script src="app/movies/movies.js"></script>
<script src="app/movies/services.js"></script>
<script src="app/movies/showtimes.js"></script>
<script src="app/cart/cart.js"></script>
<script src="app/cart/mycart.js"></script>
<script src="app/main/main.js"></script>
<script src="app/main/services.js"></script>
<body ng-controller="MainCtrl">
<ion-nav-view></ion-nav-view>
<script id="templates/event-menu.html" type="text/ng-template"> -->
<ion-side-menus>
<ion-side-menu-content>
<ion-nav-bar class="bar-positive">
<ion-nav-back-button class="button-icon ion-arrow-left-c">
</ion-nav-back-button>
</ion-nav-bar>
<ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" ng-click="toggleLeft()">
</button>
</ion-nav-buttons>
<ion-nav-view animation="no-animation" name="menuContent"></ion-nav-view>
<div class="i-8" ui-view></div>
<div class="i-2"></div>
</ion-side-menu-content>
<ion-side-menu side="left">
<ion-header-bar class="bar-assertive">
<h1 class="title">Left Menu</h1>
</ion-header-bar>
<ion-content>
<ul class="list">
<!-- Note each link has the 'menu-close' attribute so the menu auto closes when clicking on one of these links -->
<a href="#/event/check-in" class="item" menu-close>Check-in</a>
<a href="#/event/attendees" class="item" menu-close>Attendees</a>
</ul>
</ion-content>
</ion-side-menu>
</ion-side-menus>
</script>
<script id="templates/home.html" type="text/ng-template">
<ion-view title="Welcome">
<ion-content padding="true">
<p>Swipe to the right to reveal the left menu.</p>
<p>(On desktop click and drag from left to right)</p>
</ion-content>
</ion-view>
</script>
<script src="app/app.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment