-
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.
Merge pull request #30 from IonicBrazil/feat-style-guides
Implement IIFE and named functions to accomplish the style guide
- Loading branch information
Showing
67 changed files
with
752 additions
and
9,467 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,3 +1,3 @@ | ||
{ | ||
"directory": "www/lib" | ||
"directory": "src/lib" | ||
} |
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
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
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"es3": false, | ||
"forin": true, | ||
"freeze": true, | ||
"immed": true, | ||
"indent": 2, | ||
"latedef": "nofunc", | ||
"newcap": true, | ||
"noarg": true, | ||
"noempty": true, | ||
"nonbsp": true, | ||
"nonew": true, | ||
"plusplus": false, | ||
"quotmark": "single", | ||
"undef": true, | ||
"unused": false, | ||
"strict": false, | ||
"maxparams": 10, | ||
"maxdepth": 5, | ||
"maxstatements": 40, | ||
"maxcomplexity": 8, | ||
"maxlen": 120, | ||
|
||
"asi": false, | ||
"boss": false, | ||
"debug": false, | ||
"eqnull": true, | ||
"esnext": false, | ||
"evil": false, | ||
"expr": false, | ||
"funcscope": false, | ||
"globalstrict": false, | ||
"iterator": false, | ||
"lastsemic": false, | ||
"laxbreak": false, | ||
"laxcomma": false, | ||
"loopfunc": true, | ||
"maxerr": 50, | ||
"moz": false, | ||
"multistr": false, | ||
"notypeof": false, | ||
"proto": false, | ||
"scripturl": false, | ||
"shadow": false, | ||
"sub": true, | ||
"supernew": false, | ||
"validthis": false, | ||
"noyield": false, | ||
|
||
"browser": true, | ||
"node": true, | ||
|
||
"globals": { | ||
"angular": false, | ||
"cordova": false, | ||
"StatusBar": false | ||
} | ||
} |
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,18 +1,21 @@ | ||
var src = './www'; | ||
var src = './src'; | ||
var dest = './www'; | ||
|
||
var tasks = {}; | ||
|
||
tasks.common = {} | ||
|
||
// All files path | ||
tasks.common.allHTMLFiles = src + '/*.html' | ||
tasks.common.allJSFiles = ['www/{,*/}*.js', 'www/states/{,*/}*.js'] | ||
tasks.common.allJSFiles = ['src/{,*/}*.js', 'src/states/{,*/}*.js'] | ||
tasks.common.scriptBase = src + '/{,*/}{,*/}*.js' | ||
tasks.common.allSCSSFiles = src + '/scss/{,*/}*.scss' | ||
tasks.common.allStaticFiles = [src + '/**', '!'+src+'/scss{,/**}'] | ||
tasks.common.src = src + '/' | ||
tasks.common.allFiles = src + '/**' | ||
|
||
// Dest paths | ||
tasks.common.destBase = src | ||
tasks.common.destBase = dest | ||
tasks.common.destCSS = tasks.common.destBase + '/css/' | ||
|
||
module.exports = tasks; |
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,3 +1,3 @@ | ||
var gulp = require('gulp'); | ||
|
||
gulp.task('default', ['style-guide', 'sass']); | ||
gulp.task('default', ['style-guide', 'styles', 'source']); |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var gulp = require('gulp'); | ||
var config = require('../config').common; | ||
|
||
gulp.task('source', function(done) { | ||
gulp.src(config.allStaticFiles) | ||
.pipe(gulp.dest(config.destBase)) | ||
.on('end', done); | ||
}); |
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,8 +1,11 @@ | ||
var gulp = require('gulp'); | ||
var jscs = require('gulp-jscs'); | ||
var jshint = require('gulp-jshint'); | ||
var config = require('../config').common; | ||
|
||
gulp.task('style-guide', function () { | ||
return gulp.src(config.allJSFiles) | ||
.pipe(jshint()) | ||
.pipe(jshint.reporter('jshint-stylish', {verbose: true})) | ||
.pipe(jscs()); | ||
}); |
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
(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.loading' | ||
]); | ||
})(); |
File renamed without changes
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
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
(function() { | ||
'use strict'; | ||
|
||
angular.module('starter.configureKeyBoard', [ | ||
'ionic' | ||
]) | ||
|
||
.run(configKeyBoard); | ||
|
||
function configKeyBoard($ionicPlatform) { | ||
$ionicPlatform.ready(function() { | ||
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(function() { | ||
'use strict'; | ||
|
||
angular.module('starter.configureStatusBar', [ | ||
'ionic' | ||
]) | ||
|
||
.run(configStatusBar); | ||
|
||
function configStatusBar($ionicPlatform) { | ||
$ionicPlatform.ready(function() { | ||
if (window.StatusBar) { | ||
StatusBar.styleDefault(); | ||
} | ||
}); | ||
} | ||
})(); |
41 changes: 41 additions & 0 deletions
41
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 |
---|---|---|
@@ -0,0 +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 | ||
} | ||
|
||
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 showNoBackdrop() { | ||
$ionicLoading.show({ | ||
template: $scope.title, | ||
noBackdrop: true | ||
}); | ||
} | ||
|
||
function hideLoading() { | ||
$ionicLoading.show(); | ||
} | ||
} | ||
})(); |
34 changes: 34 additions & 0 deletions
34
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(function () { | ||
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 | ||
}; | ||
|
||
return directive; | ||
|
||
function link(scope, element, attr, controller) { | ||
scope.ig.count = 0; | ||
scope.ig.time = Date.now(); | ||
|
||
// console.log(scope.ig) | ||
|
||
element.on('click', function () { | ||
console.log('igLoading $destroy', 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
// TODO |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
(function() { | ||
'use strict'; | ||
|
||
angular.module('starter.state.browse', []) | ||
|
||
.config(configBrowse); | ||
|
||
function configBrowse($stateProvider) { | ||
$stateProvider | ||
.state('app.browse', { | ||
url: '/browse', | ||
views: { | ||
'menuContent': { | ||
templateUrl: 'states/browse/template.html' | ||
} | ||
} | ||
}); | ||
} | ||
})(); |
File renamed without changes.
Oops, something went wrong.