Skip to content
This repository was archived by the owner on Jul 11, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
b-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz

pids
logs
results

npm-debug.log
node_modules
out
bower_components
.bowerrc
.idea/*
*.iml
*.sublime-*
projectFilesBackup

.DS_Store

.build
.dist
.tmp

# Test generated files

# Built asset files

# Coverage reports
10 changes: 6 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<!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.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link rel="stylesheet" href="http://code.ionicframework.com/1.0.0/css/ionic.css" />
<link rel="stylesheet" href="css/style.css" />

<!-- 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.js"></script>
<!-- ionic -->
<script src="http://code.ionicframework.com/1.0.0/js/ionic.bundle.js"></script>

<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
Expand All @@ -26,4 +27,5 @@
<body ng-app="starter">
<ion-nav-view></ion-nav-view>
</body>

</html>
134 changes: 75 additions & 59 deletions js/app.js
Original file line number Diff line number Diff line change
@@ -1,73 +1,89 @@
// Ionic Starter App
/*!
* Ionic - Side menu Starter App
* MIT Licensed
*/

// angular.module is a global place for creating, registering and retrieving Angular modules
// '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('starter', ['ionic', 'starter.controllers'])
'use strict';

.run(function($ionicPlatform) {
$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.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
angular.module('starter', [
'ionic' // inject the Ionic framework
// 'starter.controllers'
])

}
if (window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.styleDefault();
}
});
})
.config(function($ionicConfigProvider, $stateProvider, $urlRouterProvider) {

.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
$ionicConfigProvider.views.maxCache(10); // the default is 10
$ionicConfigProvider.views.transition('platform');
$ionicConfigProvider.views.forwardCache(false); // the default is false
$ionicConfigProvider.backButton.icon('ion-ios-arrow-back');
$ionicConfigProvider.backButton.text(''); // default is 'Back'
$ionicConfigProvider.backButton.previousTitleText(false); // hides the 'Back' text
$ionicConfigProvider.templates.maxPrefetch(20);

.state('app', {
url: '/app',
abstract: true,
templateUrl: 'templates/menu.html',
controller: 'AppCtrl'
})
$stateProvider
.state('app', {
url: '/app',
templateUrl: 'templates/menu.html',
controller: 'AppCtrl',
abstract: true
})

.state('app.search', {
url: '/search',
views: {
'menuContent': {
templateUrl: 'templates/search.html'
}
}
})
.state('app.search', {
url: '/search',
views: {
'menuContent': {
templateUrl: 'templates/search.html'
}
}
})

.state('app.browse', {
url: '/browse',
views: {
'menuContent': {
templateUrl: 'templates/browse.html'
.state('app.browse', {
url: '/browse',
views: {
'menuContent': {
templateUrl: 'templates/browse.html'
}
}
}
})
.state('app.playlists', {
url: '/playlists',
views: {
})

.state('app.playlists', {
url: '/playlists',
views: {
'menuContent': {
templateUrl: 'templates/playlists.html',
controller: 'PlaylistsCtrl'
}
}
})

.state('app.single', {
url: '/playlists/{playlistId}', // {} supports regex
views: {
'menuContent': {
templateUrl: 'templates/playlists.html',
controller: 'PlaylistsCtrl'
templateUrl: 'templates/playlist.html',
controller: 'PlaylistCtrl'
}
}
});

// if none of the above states are matched, use this as the fallback
$urlRouterProvider.otherwise('/app/playlists');
})

.run(function($ionicPlatform) {
$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.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
}
})

.state('app.single', {
url: '/playlists/:playlistId',
views: {
'menuContent': {
templateUrl: 'templates/playlist.html',
controller: 'PlaylistCtrl'
if (window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.styleDefault();
}
}

});
});
// if none of the above states are matched, use this as the fallback
$urlRouterProvider.otherwise('/app/playlists');
});
118 changes: 68 additions & 50 deletions js/controllers.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,74 @@
angular.module('starter.controllers', [])
/*!
* Ionic - Side menu Starter App
* MIT Licensed
*/

.controller('AppCtrl', function($scope, $ionicModal, $timeout) {
'use strict';

// With the new view caching in Ionic, Controllers are only called
// when they are recreated or on app start, instead of every page change.
// To listen for when this page is active (for example, to refresh data),
// listen for the $ionicView.enter event:
//$scope.$on('$ionicView.enter', function(e) {
//});
angular.module('starter')
.controller('AppCtrl', function(
$log, // inject the $log service
$scope, // inject the $scope service
$ionicModal, // inject the $ionicModal service
$timeout // inject the $timeout service
) {

// Form data for the login modal
$scope.loginData = {};
$log.info('AppCtrl');

// Create the login modal that we will use later
$ionicModal.fromTemplateUrl('templates/login.html', {
scope: $scope
}).then(function(modal) {
$scope.modal = modal;
$scope.$on('$ionicView.beforeEnter', function() {
// The view has fully entered and is now the active view.
// This event will fire, whether it was the first load or a cached view.
$log.info('AppCtrl - $ionicView.beforeEnter');
});

// Form data for the login modal
$scope.loginData = {};

// Create the login modal that we will use later
$ionicModal.fromTemplateUrl('templates/login.html', {
scope: $scope
}).then(function(modal) {
$scope.modal = modal;
});

// Triggered in the login modal to close it
$scope.closeLogin = function() {
$scope.modal.hide();
};

// Open the login modal
$scope.login = function() {
$scope.modal.show();
};

// Perform the login action when the user submits the login form
$scope.doLogin = function() {
console.log('Doing login', $scope.loginData);

// Simulate a login delay. Remove this and replace with your login
// code if using a login system
$timeout(function() {
$scope.closeLogin();
}, 1000);
};
})

.controller('PlaylistsCtrl', function($scope) {
$scope.playlists = [
{ title: 'Reggae', id: 1 },
{ title: 'Chill', id: 2 },
{ title: 'Dubstep', id: 3 },
{ title: 'Indie', id: 4 },
{ title: 'Rap', id: 5 },
{ title: 'Cowbell', id: 6 }
];
})

.controller('PlaylistCtrl', function($log) {
$log.info('PlaylistCtrl');
});

// Triggered in the login modal to close it
$scope.closeLogin = function() {
$scope.modal.hide();
};

// Open the login modal
$scope.login = function() {
$scope.modal.show();
};

// Perform the login action when the user submits the login form
$scope.doLogin = function() {
console.log('Doing login', $scope.loginData);

// Simulate a login delay. Remove this and replace with your login
// code if using a login system
$timeout(function() {
$scope.closeLogin();
}, 1000);
};
})

.controller('PlaylistsCtrl', function($scope) {
$scope.playlists = [
{ title: 'Reggae', id: 1 },
{ title: 'Chill', id: 2 },
{ title: 'Dubstep', id: 3 },
{ title: 'Indie', id: 4 },
{ title: 'Rap', id: 5 },
{ title: 'Cowbell', id: 6 }
];
})

.controller('PlaylistCtrl', function($scope, $stateParams) {
});




2 changes: 2 additions & 0 deletions templates/browse.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<ion-view view-title="Browse">

<ion-content>
<h1>Browse</h1>
</ion-content>

</ion-view>
Loading