Skip to content

Commit

Permalink
Bug #6/#7, Javascript eslint fixes [iet:9820855][iet:9702401]
Browse files Browse the repository at this point in the history
* Plus, add `eslintConfig` and `jshintConfig` to `package` JSON
* Code date: 15 August 2017.
  • Loading branch information
nfreear committed Aug 21, 2017
1 parent d940b8d commit eb7712b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 18 deletions.
4 changes: 1 addition & 3 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

// IMPORTANT: console.debug() does NOT print output !!

'use strict';

var util = require('./src/ouop-utils');
var userJsonUrl = '/auth/ouopenid/user/ajax.php?r=' + util.rand();

Expand Down Expand Up @@ -63,7 +61,7 @@ require('./src/when-call')(

// ..

require('./src/local-fixes')($, data);
require('./src/local-fixes')($);

require('./src/survey-embed-link')($, data);

Expand Down
4 changes: 0 additions & 4 deletions js/src/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
OU-OpenID. © Nick Freear. © The Open University. (NDF / 02-April-2017)
*/

/* global ga: false */

'use strict';

module.exports = {
run: function ($, resp) {
include_ga_javascript();
Expand Down
6 changes: 3 additions & 3 deletions js/src/local-fixes.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// TeSLA-specific fixes ~~ usability and clarity.
// OUOP.local_fixes = function

module.exports = function ($, resp) {
module.exports = function ($) {

fix_typing_enrollment_page($);
fix_enrollment_start_page($, resp);
fix_enrollment_start_page($);

console.warn('ouop: tesla-local-fixes');
};
Expand Down Expand Up @@ -42,7 +42,7 @@ function fix_typing_enrollment_page($) {
}

// 14-August-2017.
function fix_enrollment_start_page($, resp) {
function fix_enrollment_start_page($) {
var $alert = $('#page-local-tesla-views-enrollment #user-notifications .alert');
var message = $alert.text();
var m_enroll = message ? message.match(/The required enrollments are: ([\w ]+)/) : null;
Expand Down
4 changes: 2 additions & 2 deletions js/src/moodle-user-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function complete_user_profile_form ($, resp) {
}

C.debug('ouop: complete-user-profile-form');
};
}

function user_profile_form_redirect ($, resp) {
var $form = $('#page-user-edit #region-main form');
Expand All @@ -53,7 +53,7 @@ function user_profile_form_redirect ($, resp) {
} else {
$form.before(util.alert(util.str('form_redirect_msg'), 'ouop-form-disable'));
}
};
}

function user_profile_continue_link ($, resp) {
var $pages = $('#page-user-profile, #page-user-preferences');
Expand Down
2 changes: 0 additions & 2 deletions js/src/ouop-utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Utility functions.

'use strict';

// Javascript translation/localisation [i18n].
var trans = {};

Expand Down
2 changes: 0 additions & 2 deletions js/src/survey-embed-link.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Embed or link to BOS pilot surveys.

'use strict';

module.exports = function ($, resp) {

embed_pilot_surveys($, resp);
Expand Down
20 changes: 18 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": true,
"name": "moodle-auth-ouopenid",
"description": "(See - 'composer.json') | © The Open University.",
"version": "1.3.0-beta",
"version": "2.0.0-beta",
"license": "UNLICENSED",
"main": "js/index.js",
"devDependencies": {
Expand All @@ -22,9 +22,25 @@
"uglify-2": "uglifyjs js/src/_comment.js dist.js --comments -co dist.min.js",
"uglify": "uglifyjs user/*.js --comments='/^!/' -bo ouop.min.js",
"less": "lessc style/*.less style/ouop-styles.css",
"eslint": "eslint js/ src/ user/*.js && echo eslint OK!",
"eslint": "eslint js/ js/src/ user/*.js && echo eslint OK!",
"semi": "semistandard"
},

"eslintConfig": {
"extends": "eslint:recommended",
"env": { "commonjs": true },
"globals": { "window": false, "console": false, "ga": false }
},
"jshintConfig": {
"browserify": true,
"curly": true,
"eqeqeq": true,
"nocomma": true,
"undef": true,
"unused": true,
"onecase": true,
"globals": { "window": false, "console": false, "ga": false }
},
"semistandard": {
"ignore": [
"bundle.js",
Expand Down

0 comments on commit eb7712b

Please sign in to comment.