Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
fix(docs): Fix comments content and style
Browse files Browse the repository at this point in the history
Changed some bad comments referencing the Articles module in other modules.
Typo fixed in xxx.client.modules.js files ("Application" => "Applicaion")
Full stop character removed at the end of line comments
  • Loading branch information
combefis committed Jan 17, 2016
1 parent 3dee3fc commit d2b2dfd
Show file tree
Hide file tree
Showing 26 changed files with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var path = require('path'),
mongoose = require('mongoose'),
Article = mongoose.model('Article'),
errorHandler = require(path.resolve('./modules/core/server/controllers/errors.server.controller'));

/**
* Create a article
* Create an article
*/
exports.create = function (req, res) {
var article = new Article(req.body);
Expand All @@ -34,7 +34,7 @@ exports.read = function (req, res) {
};

/**
* Update a article
* Update an article
*/
exports.update = function (req, res) {
var article = req.article;
Expand Down
2 changes: 1 addition & 1 deletion modules/articles/server/models/article.server.model.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
Expand Down
4 changes: 2 additions & 2 deletions modules/articles/server/policies/articles.server.policy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var acl = require('acl');

Expand Down Expand Up @@ -56,7 +56,7 @@ exports.isAllowed = function (req, res, next) {
// Check for user roles
acl.areAnyRolesAllowed(roles, req.route.path, req.method.toLowerCase(), function (err, isAllowed) {
if (err) {
// An authorization error occurred.
// An authorization error occurred
return res.status(500).send('Unexpected authorization error');
} else {
if (isAllowed) {
Expand Down
2 changes: 1 addition & 1 deletion modules/articles/server/routes/articles.server.routes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var articlesPolicy = require('../policies/articles.server.policy'),
articles = require('../controllers/articles.server.controller');
Expand Down
2 changes: 1 addition & 1 deletion modules/core/client/core.client.module.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

// Use Applicaion configuration module to register a new module
// Use Application configuration module to register a new module
ApplicationConfiguration.registerModule('core');
ApplicationConfiguration.registerModule('core.admin', ['core']);
ApplicationConfiguration.registerModule('core.admin.routes', ['ui.router']);
2 changes: 1 addition & 1 deletion modules/users/client/config/users-admin.client.menus.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

// Configuring the Articles module
// Configuring the Users module
angular.module('users.admin').run(['Menus',
function (Menus) {
Menus.addSubMenuItem('topbar', 'admin', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ angular.module('users').controller('PasswordController', ['$scope', '$stateParam
$scope.authentication = Authentication;
$scope.popoverMsg = PasswordValidator.getPopoverMsg();

//If user is signed in then redirect back home
// If user is signed in then redirect back home
if ($scope.authentication.user) {
$location.path('/');
}
Expand Down
2 changes: 1 addition & 1 deletion modules/users/client/users.client.module.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

// Use Applicaion configuration module to register a new module
// Use Application configuration module to register a new module
ApplicationConfiguration.registerModule('users', ['core']);
ApplicationConfiguration.registerModule('users.admin', ['core.admin']);
ApplicationConfiguration.registerModule('users.admin.routes', ['core.admin.routes']);
2 changes: 1 addition & 1 deletion modules/users/server/config/strategies/facebook.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var passport = require('passport'),
FacebookStrategy = require('passport-facebook').Strategy,
Expand Down
2 changes: 1 addition & 1 deletion modules/users/server/config/strategies/github.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var passport = require('passport'),
GithubStrategy = require('passport-github').Strategy,
Expand Down
2 changes: 1 addition & 1 deletion modules/users/server/config/strategies/google.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var passport = require('passport'),
GoogleStrategy = require('passport-google-oauth').OAuth2Strategy,
Expand Down
2 changes: 1 addition & 1 deletion modules/users/server/config/strategies/linkedin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var passport = require('passport'),
LinkedInStrategy = require('passport-linkedin').Strategy,
Expand Down
2 changes: 1 addition & 1 deletion modules/users/server/config/strategies/local.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var passport = require('passport'),
LocalStrategy = require('passport-local').Strategy,
Expand Down
2 changes: 1 addition & 1 deletion modules/users/server/config/strategies/paypal.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var passport = require('passport'),
PayPalStrategy = require('passport-paypal-openidconnect').Strategy,
Expand Down
2 changes: 1 addition & 1 deletion modules/users/server/config/strategies/twitter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var passport = require('passport'),
TwitterStrategy = require('passport-twitter').Strategy,
Expand Down
4 changes: 2 additions & 2 deletions modules/users/server/config/users.server.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var passport = require('passport'),
User = require('mongoose').model('User'),
path = require('path'),
config = require(path.resolve('./config/config'));

/**
* Module init function.
* Module init function
*/
module.exports = function (app, db) {
// Serialize sessions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var path = require('path'),
mongoose = require('mongoose'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var _ = require('lodash');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var path = require('path'),
errorHandler = require(path.resolve('./modules/core/server/controllers/errors.server.controller')),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var _ = require('lodash'),
mongoose = require('mongoose'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var path = require('path'),
config = require(path.resolve('./config/config')),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var _ = require('lodash'),
fs = require('fs'),
Expand Down
10 changes: 5 additions & 5 deletions modules/users/server/models/user.server.model.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
Expand Down Expand Up @@ -168,7 +168,7 @@ UserSchema.statics.findUniqueUsername = function (username, suffix, callback) {
};

/**
* Generates a random passphrase that passes the owasp test.
* Generates a random passphrase that passes the owasp test
* Returns a promise that resolves with the generated passphrase, or rejects with an error if something goes wrong.
* NOTE: Passphrases are only tested against the required owasp strength tests, and not the optional tests.
*/
Expand All @@ -177,8 +177,8 @@ UserSchema.statics.generateRandomPassphrase = function () {
var password = '';
var repeatingCharacters = new RegExp('(.)\\1{2,}', 'g');

// iterate until the we have a valid passphrase.
// NOTE: Should rarely iterate more than once, but we need this to ensure no repeating characters are present.
// iterate until the we have a valid passphrase
// NOTE: Should rarely iterate more than once, but we need this to ensure no repeating characters are present
while (password.length < 20 || repeatingCharacters.test(password)) {
// build the random password
password = generatePassword.generate({
Expand All @@ -189,7 +189,7 @@ UserSchema.statics.generateRandomPassphrase = function () {
excludeSimilarCharacters: true,
});

// check if we need to remove any repeating characters.
// check if we need to remove any repeating characters
password = password.replace(repeatingCharacters, '');
}

Expand Down
4 changes: 2 additions & 2 deletions modules/users/server/policies/admin.server.policy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var acl = require('acl');

Expand Down Expand Up @@ -33,7 +33,7 @@ exports.isAllowed = function (req, res, next) {
// Check for user roles
acl.areAnyRolesAllowed(roles, req.route.path, req.method.toLowerCase(), function (err, isAllowed) {
if (err) {
// An authorization error occurred.
// An authorization error occurred
return res.status(500).send('Unexpected authorization error');
} else {
if (isAllowed) {
Expand Down
2 changes: 1 addition & 1 deletion modules/users/server/routes/admin.server.routes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var adminPolicy = require('../policies/admin.server.policy'),
admin = require('../controllers/admin.server.controller');
Expand Down
2 changes: 1 addition & 1 deletion modules/users/server/routes/auth.server.routes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* Module dependencies.
* Module dependencies
*/
var passport = require('passport');

Expand Down

0 comments on commit d2b2dfd

Please sign in to comment.