Skip to content

Commit

Permalink
Add JSCS-JSDocs plugin
Browse files Browse the repository at this point in the history
related to #27
  • Loading branch information
felquis committed Jul 3, 2015
1 parent 4ea3890 commit ae716ff
Show file tree
Hide file tree
Showing 23 changed files with 131 additions and 22 deletions.
17 changes: 16 additions & 1 deletion .jscsrc
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,20 @@
"validateLineBreaks": "LF",
"requireSemicolons": true,
"requireParenthesesAroundIIFE": true,
"validateIndentation": 2
"validateIndentation": 2,
"plugins": [
"jscs-jsdoc"
],
"jsDoc": {
"checkParamNames": true,
"requireParamTypes": true,
"checkRedundantParams": true,
"checkRedundantReturns": true,
"requireReturnTypes": true,
"requireParamDescription": true,
"requireHyphenBeforeDescription": true,
"disallowNewlineAfterDescription": true,
"requireDescriptionCompleteSentence": true,
"enforceExistence": "exceptExports"
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"jshint-stylish": "^1.0.0",
"gulp-jshint": "^1.7.1",
"gulp-autoprefixer": "^1.0.1",
"gulp-plumber": "^0.6.6"
"gulp-plumber": "^0.6.6",
"jscs-jsdoc": "^1.1.x"
},
"scripts": {
"install-submodules": "./scripts/install/install-submodules.js"
Expand Down
3 changes: 3 additions & 0 deletions src/shared/configure-keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

.run(configKeyBoard);

/**
* Configure Keyboard
*/
function configKeyBoard($ionicPlatform) {
$ionicPlatform.ready(function() {
if (window.cordova && window.cordova.plugins.Keyboard) {
Expand Down
3 changes: 3 additions & 0 deletions src/shared/configure-status-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

.run(configStatusBar);

/**
* Configure Status Bar style
*/
function configStatusBar($ionicPlatform) {
$ionicPlatform.ready(function() {
if (window.StatusBar) {
Expand Down
3 changes: 3 additions & 0 deletions src/states/browse/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

.config(configBrowse);

/**
* Define Browse Route
*/
function configBrowse($stateProvider) {
$stateProvider
.state('app.browse', {
Expand Down
8 changes: 7 additions & 1 deletion src/states/come-back/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@

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);

/**
* Return to previous view after two seconds in the current view
*/
function returnAfter2Seconds() {
$timeout(function () {
$timeout(function() {
$ionicHistory.goBack();
}, 2000);
}
Expand Down
7 changes: 5 additions & 2 deletions src/states/come-back/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
'use strict';
angular.module('starter.state.come-back', ['starter.state.come-back.controller'])

.config(configRefresher);
.config(configComeBack);

function configRefresher($stateProvider) {
/**
* Define Come Back Route
*/
function configComeBack($stateProvider) {
$stateProvider.state('app.comeBack', {
url: '/come-back',
views: {
Expand Down
5 changes: 4 additions & 1 deletion src/states/index/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
'use strict';
angular.module('starter.state.index', [])

.config(configIndex);
.config(configIndex);

/**
* Define default/index route
*/
function configIndex($urlRouterProvider) {
$urlRouterProvider.otherwise('/app/playlists');
}
Expand Down
13 changes: 11 additions & 2 deletions src/states/infinite-scroll/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,35 @@

var total = 10;

/**
* Define Infinite Scroll Controller
*/
function InfiniteScrollController($scope, $state, $timeout) {
var vm = this;

vm.title = 'Infinite Scroll';
vm.list = getList();
vm.loadMore = loadMore;

/**
* Return a list of itens
*/
function getList(limit) {
var dados = [];
for (var i = limit; i >= 0; i--) {
dados[i] = i;
};
}

return dados;
}

/**
* Load more items in the current state
*/
function loadMore() {
total = total + 20;

$timeout(function () {
$timeout(function() {
$scope.vm.list = getList(total);
$scope.$broadcast('scroll.infiniteScrollComplete');
}, 2000);
Expand Down
9 changes: 6 additions & 3 deletions src/states/infinite-scroll/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
'use strict';
angular.module('starter.state.infinite-scroll', ['starter.state.infinite-scroll.controller'])

.config(configinfiniteScroll);
.config(configInfiniteScroll);

// configinfiniteScroll.$inject(['$stateProvider']);
configInfiniteScroll.$inject(['$stateProvider']);

function configinfiniteScroll($stateProvider) {
/**
* Define Infinite Scroll Route
*/
function configInfiniteScroll($stateProvider) {
$stateProvider.state('app.infinite-scroll', {
url: '/infinite-scroll',
views: {
Expand Down
3 changes: 3 additions & 0 deletions src/states/loading/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

LoadingController.$inject = ['$scope', '$state', '$timeout', '$ionicLoading'];

/**
* Define Loading Controller
*/
function LoadingController($scope, $state, $timeout, $ionicLoading) {
$scope.title = 'Loading';
}
Expand Down
3 changes: 3 additions & 0 deletions src/states/loading/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
'starter.shared.ig-button-loading'
]).config(configRefresher);

/**
* Define Loading Route
*/
function configRefresher($stateProvider) {
$stateProvider.state('app.loading', {
url: '/loading',
Expand Down
3 changes: 3 additions & 0 deletions src/states/playlists/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

.controller('PlaylistsController', PlaylistsController);

/**
* Define Playlists Controller
*/
function PlaylistsController() {
var vm = this;

Expand Down
5 changes: 4 additions & 1 deletion src/states/playlists/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
'use strict';
angular.module('starter.state.playlists', ['starter.state.playlists.controller'])

.config(configPlaylists);
.config(configPlaylists);

/**
* Define Playlists Route
*/
function configPlaylists($stateProvider, $urlRouterProvider) {
$stateProvider
.state('app.playlists', {
Expand Down
13 changes: 11 additions & 2 deletions src/states/refresher/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,35 @@

var total = 10;

/**
* Define Refresher Controller
*/
function RefresherController($scope, $state, $timeout) {
var vm = this;

vm.title = 'Refresher';
vm.list = getList();
vm.loadMore = loadMore;

/**
* Return a list of itens
*/
function getList(limit) {
var dados = [];
for (var i = limit; i >= 0; i--) {
dados[i] = i;
};
}

return dados;
}

/**
* Load more items in the current state
*/
function loadMore() {
total = total + 20;

$timeout(function () {
$timeout(function() {
$scope.vm.list = getList(total);
$scope.$broadcast('scroll.refreshComplete');
}, 1500);
Expand Down
3 changes: 3 additions & 0 deletions src/states/refresher/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

.config(configRefresher);

/**
* Define Refresher Route
*/
function configRefresher($stateProvider) {
$stateProvider.state('app.refresher', {
url: '/refresher',
Expand Down
3 changes: 3 additions & 0 deletions src/states/search/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

.config(configSearch);

/**
* Define Search Route
*/
function configSearch($stateProvider) {
$stateProvider
.state('app.search', {
Expand Down
21 changes: 16 additions & 5 deletions src/states/sidemenu/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,46 @@
'use strict';
angular.module('starter.state.sidemenu.controller', [])

.controller('SidemenuController', SidemenuController);
.controller('SidemenuController', SidemenuController);

SidemenuController.$inject = ['$scope', '$ionicModal', '$timeout'];

/**
* Define Sidemenu Controller
*/
function SidemenuController($scope, $ionicModal, $timeout) {
var vm = this;

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

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

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

// Open the login modal
/**
* Open the login modal
*/
vm.login = function() {
vm.modal.show();
};

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

Expand Down
3 changes: 3 additions & 0 deletions src/states/sidemenu/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

.config(configSidemenu);

/**
* Define Side Menu Route
*/
function configSidemenu($stateProvider) {
$stateProvider.state('app', {
url: '/app',
Expand Down
3 changes: 3 additions & 0 deletions src/states/single/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

SingleController.$inject = ['$state'];

/**
* Define Single Controller
*/
function SingleController($state) {
var vm = this;

Expand Down
3 changes: 3 additions & 0 deletions src/states/single/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

.config(configSingle);

/**
* Define Single Route
*/
function configSingle($stateProvider) {
$stateProvider.state('app.single', {
url: '/single/:singleId',
Expand Down
16 changes: 13 additions & 3 deletions src/states/spinners/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
SpinnersController.$inject = ['$scope', '$state', '$timeout'];

var total = 10;

/**
* Define State Controller
*/
function SpinnersController($scope, $state, $timeout) {
var vm = this;

Expand All @@ -16,19 +18,27 @@
vm.loadMore = loadMore;
vm.isChecked = true;

/**
* Get an array of items.
* @param {Number} limit - Number of items to return
* @return {Array} - Returns generated array
*/
function getList(limit) {
var dados = [];
for (var i = limit; i >= 0; i--) {
dados[i] = i;
};
}

return dados;
}

/**
* Used by ion-infinite-scroll to load more itens
*/
function loadMore() {
total = total + 20;

$timeout(function () {
$timeout(function() {
$scope.vm.list = getList(total);
$scope.$broadcast('scroll.refreshComplete');
}, 1500);
Expand Down
Loading

0 comments on commit ae716ff

Please sign in to comment.