-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing all IIFEs and fixing style-guide warnings
- Loading branch information
Showing
24 changed files
with
500 additions
and
519 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
(function() { | ||
'use strict'; | ||
angular.module('starter', [ | ||
'ionic', | ||
'starter.configureKeyBoard', | ||
'starter.configureStatusBar', | ||
'starter.state.sidemenu', | ||
'starter.state.search', | ||
'starter.state.browse', | ||
'starter.state.playlists', | ||
'starter.state.single', | ||
'starter.state.index', | ||
'starter.state.infinite-scroll', | ||
'starter.state.refresher', | ||
'starter.state.spinners', | ||
'starter.state.come-back', | ||
'starter.state.loading' | ||
]); | ||
})(); | ||
angular.module('starter', [ | ||
'ionic', | ||
'starter.configureKeyBoard', | ||
'starter.configureStatusBar', | ||
'starter.state.sidemenu', | ||
'starter.state.search', | ||
'starter.state.browse', | ||
'starter.state.playlists', | ||
'starter.state.single', | ||
'starter.state.index', | ||
'starter.state.infinite-scroll', | ||
'starter.state.refresher', | ||
'starter.state.spinners', | ||
'starter.state.come-back', | ||
'starter.state.loading' | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
(function() { | ||
'use strict'; | ||
|
||
angular.module('starter.configureKeyBoard', [ | ||
'ionic' | ||
]) | ||
|
||
angular | ||
.module('starter.configureKeyBoard', []) | ||
.run(configKeyBoard); | ||
|
||
/** | ||
* Configure Keyboard | ||
*/ | ||
function configKeyBoard($ionicPlatform) { | ||
$ionicPlatform.ready(platformReady); | ||
|
||
/** | ||
* Configure Keyboard | ||
* Configure Keyboard plugin | ||
*/ | ||
function configKeyBoard($ionicPlatform) { | ||
$ionicPlatform.ready(function() { | ||
if (window.cordova && window.cordova.plugins.Keyboard) { | ||
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); | ||
} | ||
}); | ||
function platformReady() { | ||
if (window.cordova && window.cordova.plugins.Keyboard) { | ||
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); | ||
} | ||
} | ||
|
||
})(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
(function() { | ||
'use strict'; | ||
|
||
angular.module('starter.configureStatusBar', [ | ||
'ionic' | ||
]) | ||
|
||
angular | ||
.module('starter.configureStatusBar', []) | ||
.run(configStatusBar); | ||
|
||
/** | ||
* Configure Status Bar style | ||
*/ | ||
function configStatusBar($ionicPlatform) { | ||
$ionicPlatform.ready(platformReady); | ||
|
||
/** | ||
* Configure Status Bar style | ||
* Configure StatusBar plugin | ||
*/ | ||
function configStatusBar($ionicPlatform) { | ||
$ionicPlatform.ready(function() { | ||
if (window.StatusBar) { | ||
StatusBar.styleDefault(); | ||
} | ||
}); | ||
function platformReady() { | ||
if (window.StatusBar) { | ||
StatusBar.styleDefault() | ||
} | ||
} | ||
})(); | ||
} |
72 changes: 36 additions & 36 deletions
72
src/shared/ig-button-loading/ig-button-loading.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
(function() { | ||
'use strict'; | ||
angular | ||
.module('starter.shared.ig-button-loading.controller', []) | ||
.controller('IGButtonLoadingController', IGButtonLoadingController); | ||
|
||
IGButtonLoadingController.$inject = ['$scope', '$state', '$timeout', '$ionicLoading']; | ||
|
||
var DEFAULT_LOADING_OPTIONS = { | ||
noBackdrop: false, | ||
hideOnStateChange: false, | ||
delay: 0, | ||
duration: undefined | ||
angular | ||
.module('starter.shared.ig-button-loading.controller', []) | ||
.controller('IGButtonLoadingController', IGButtonLoadingController); | ||
|
||
IGButtonLoadingController.$inject = ['$scope', '$state', '$timeout', '$ionicLoading']; | ||
|
||
var DEFAULT_LOADING_OPTIONS = { | ||
noBackdrop: false, | ||
hideOnStateChange: false, | ||
delay: 0, | ||
duration: undefined | ||
} | ||
|
||
/** | ||
* Controller Definition | ||
*/ | ||
function IGButtonLoadingController($scope, $state, $timeout, $ionicLoading) { | ||
|
||
console.log($scope.ig); | ||
$scope.ig = ionic.extend(DEFAULT_LOADING_OPTIONS, $scope.ig); | ||
console.log($scope.ig); | ||
|
||
$scope.$on('$destroy', function () { | ||
console.log('igLoading $destroy'); | ||
}); | ||
|
||
function show() { | ||
$ionicLoading.show(DEFAULT_LOADING_OPTIONS); | ||
} | ||
|
||
function IGButtonLoadingController($scope, $state, $timeout, $ionicLoading) { | ||
|
||
console.log($scope.ig); | ||
$scope.ig = ionic.extend(DEFAULT_LOADING_OPTIONS, $scope.ig) | ||
console.log($scope.ig); | ||
|
||
$scope.$on('$destroy', function () { | ||
console.log('igLoading $destroy'); | ||
function showNoBackdrop() { | ||
$ionicLoading.show({ | ||
template: $scope.title, | ||
noBackdrop: true | ||
}); | ||
} | ||
|
||
function show() { | ||
$ionicLoading.show(DEFAULT_LOADING_OPTIONS); | ||
} | ||
|
||
function showNoBackdrop() { | ||
$ionicLoading.show({ | ||
template: $scope.title, | ||
noBackdrop: true | ||
}); | ||
} | ||
|
||
function hideLoading() { | ||
$ionicLoading.show(); | ||
} | ||
function hideLoading() { | ||
$ionicLoading.show(); | ||
} | ||
})(); | ||
} |
60 changes: 33 additions & 27 deletions
60
src/shared/ig-button-loading/ig-button-loading.directive.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
(function () { | ||
angular | ||
.module('starter.shared.ig-button-loading', ['starter.shared.ig-button-loading.controller']) | ||
.directive('igLoading', igLoading); | ||
angular | ||
.module('starter.shared.ig-button-loading', ['starter.shared.ig-button-loading.controller']) | ||
.directive('igLoading', igLoading); | ||
|
||
function igLoading() { | ||
var directive = { | ||
restrict: 'E', | ||
scope: { | ||
duration: '=duration', | ||
noBackdrop: '=noBackdrop', | ||
hideOnStateChange: '=hideOnStateChange' | ||
}, | ||
link: link, | ||
controller: 'IGButtonLoadingController', | ||
controllerAs: 'ig', | ||
bindToController: true | ||
}; | ||
/** | ||
* Directive Definition | ||
*/ | ||
function igLoading() { | ||
var directive = { | ||
restrict: 'E', | ||
scope: { | ||
duration: '=duration', | ||
noBackdrop: '=noBackdrop', | ||
hideOnStateChange: '=hideOnStateChange' | ||
}, | ||
link: link, | ||
controller: 'IGButtonLoadingController', | ||
controllerAs: 'ig', | ||
bindToController: true | ||
}; | ||
|
||
return directive; | ||
return directive; | ||
|
||
function link(scope, element, attr, controller) { | ||
scope.ig.count = 0; | ||
scope.ig.time = Date.now(); | ||
/** | ||
* Directive Link Function | ||
*/ | ||
function link(scope, element, attr, controller) { | ||
scope.ig.count = 0; | ||
scope.ig.time = Date.now(); | ||
|
||
// console.log(scope.ig) | ||
element.on('click', click); | ||
|
||
element.on('click', function () { | ||
console.log('igLoading click ', scope.ig.time, scope.ig.count++); | ||
}) | ||
/** | ||
* Click in the directive's element | ||
*/ | ||
function click() { | ||
console.log('igLoading click ', scope.ig.time, scope.ig.count++); | ||
} | ||
} | ||
|
||
}()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
(function() { | ||
'use strict'; | ||
|
||
angular.module('starter.state.browse', []) | ||
|
||
angular | ||
.module('starter.state.browse', []) | ||
.config(configBrowse); | ||
|
||
/** | ||
* Define Browse Route | ||
*/ | ||
function configBrowse($stateProvider) { | ||
$stateProvider | ||
.state('app.browse', { | ||
url: '/browse', | ||
views: { | ||
'menuContent': { | ||
templateUrl: 'states/browse/template.html' | ||
} | ||
/** | ||
* Define Browse Route | ||
*/ | ||
function configBrowse($stateProvider) { | ||
$stateProvider | ||
.state('app.browse', { | ||
url: '/browse', | ||
views: { | ||
'menuContent': { | ||
templateUrl: 'states/browse/template.html' | ||
} | ||
}); | ||
} | ||
})(); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
(function() { | ||
'use strict'; | ||
angular | ||
.module('starter.state.come-back.controller', []) | ||
.controller('ComeBackController', ComeBackController); | ||
angular | ||
.module('starter.state.come-back.controller', []) | ||
.controller('ComeBackController', ComeBackController); | ||
|
||
ComeBackController.$inject = ['$timeout', '$ionicHistory']; | ||
ComeBackController.$inject = ['$timeout', '$ionicHistory']; | ||
|
||
/** | ||
* Define Come Back Controller | ||
*/ | ||
function ComeBackController($timeout, $ionicHistory) { | ||
var vm = this; | ||
vm.title = 'Wait a second'; | ||
|
||
vm.$on('$ionicView.enter', returnAfter2Seconds); | ||
|
||
/** | ||
* Define Come Back Controller | ||
* Return to previous view after two seconds in the current view | ||
*/ | ||
function ComeBackController($timeout, $ionicHistory) { | ||
var vm = this; | ||
vm.title = 'Wait a second'; | ||
|
||
vm.$on('$ionicView.enter', returnAfter2Seconds); | ||
function returnAfter2Seconds() { | ||
$timeout(next, 2000); | ||
|
||
/** | ||
* Return to previous view after two seconds in the current view | ||
* Navigate to previous view | ||
*/ | ||
function returnAfter2Seconds() { | ||
$timeout(function() { | ||
$ionicHistory.goBack(); | ||
}, 2000); | ||
function next() { | ||
$ionicHistory.goBack(); | ||
} | ||
} | ||
})(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
(function() { | ||
'use strict'; | ||
angular.module('starter.state.come-back', ['starter.state.come-back.controller']) | ||
|
||
angular | ||
.module('starter.state.come-back', ['starter.state.come-back.controller']) | ||
.config(configComeBack); | ||
|
||
/** | ||
* Define Come Back Route | ||
*/ | ||
function configComeBack($stateProvider) { | ||
$stateProvider.state('app.comeBack', { | ||
url: '/come-back', | ||
views: { | ||
'menuContent': { | ||
templateUrl: 'states/come-back/template.html', | ||
controller: 'ComeBackController as vm' | ||
} | ||
/** | ||
* Define Come Back Route | ||
*/ | ||
function configComeBack($stateProvider) { | ||
$stateProvider.state('app.comeBack', { | ||
url: '/come-back', | ||
views: { | ||
'menuContent': { | ||
templateUrl: 'states/come-back/template.html', | ||
controller: 'ComeBackController as vm' | ||
} | ||
}); | ||
} | ||
})(); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
(function() { | ||
'use strict'; | ||
angular.module('starter.state.index', []) | ||
|
||
angular | ||
.module('starter.state.index', []) | ||
.config(configIndex); | ||
|
||
/** | ||
* Define default/index route | ||
*/ | ||
function configIndex($urlRouterProvider) { | ||
$urlRouterProvider.otherwise('/app/playlists'); | ||
} | ||
})(); | ||
/** | ||
* Define default/index route | ||
*/ | ||
function configIndex($urlRouterProvider) { | ||
$urlRouterProvider.otherwise('/app/playlists'); | ||
} |
Oops, something went wrong.