Merge branch 'MDL-59761-master' of git://github.com/danpoltawski/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2017-09-12 01:43:19 +02:00
commit e658430a88
9 changed files with 686 additions and 318 deletions

View File

@ -16,6 +16,7 @@
// === Possible Errors ===
'comma-dangle': 'off',
'no-compare-neg-zero': 'error',
'no-cond-assign': 'error',
'no-console': 'error',
'no-constant-condition': 'error',
@ -67,7 +68,6 @@
'no-fallthrough': 'error',
'no-floating-decimal': 'warn',
'no-global-assign': 'warn',
// Enabled by grunt for AMD modules: 'no-implicit-globals': 'error',
'no-implied-eval': 'error',
'no-invalid-this': 'error',
'no-iterator': 'error',
@ -106,6 +106,7 @@
'block-spacing': 'warn',
'brace-style': ['warn', '1tbs'],
'camelcase': 'warn',
'capitalized-comments': ['warn', 'always', { 'ignoreConsecutiveComments': true }],
'comma-spacing': ['warn', { 'before': false, 'after': true }],
'comma-style': ['warn', 'last'],
'computed-property-spacing': 'error',
@ -190,5 +191,24 @@
'message': 'Use AMD module "core/str" or M.util.get_string()'
}],
}
},
overrides: [
{
files: ["**/yui/src/**/*.js"],
// Disable some rules which we can't safely define for YUI rollups.
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
'no-unused-expressions': 'off'
}
},
{
files: ["**/amd/src/*.js"],
// Check AMD with some slightly stricter rules.
rules: {
'no-unused-vars': 'error',
'no-implicit-globals': 'error'
}
}
]
}

View File

@ -112,26 +112,9 @@ module.exports = function(grunt) {
// Even though warnings dont stop the build we don't display warnings by default because
// at this moment we've got too many core warnings.
options: {quiet: !grunt.option('show-lint-warnings')},
amd: {
src: amdSrc,
// Check AMD with some slightly stricter rules.
rules: {
'no-unused-vars': 'error',
'no-implicit-globals': 'error'
}
},
amd: {src: amdSrc},
// Check YUI module source files.
yui: {
src: ['**/yui/src/**/*.js', '!*/**/yui/src/*/meta/*.js'],
options: {
// Disable some rules which we can't safely define for YUI rollups.
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
'no-unused-expressions': 'off'
}
}
}
yui: {src: ['**/yui/src/**/*.js', '!*/**/yui/src/*/meta/*.js']}
},
uglify: {
amd: {

View File

@ -229,7 +229,7 @@ define(['jquery',
notification.confirm(
strings[0], // Confirm.
strings[1], // Reopen plan X?
strings[2], // reopen.
strings[2], // Reopen.
strings[3], // Cancel.
function() {
self._doReopenPlan(planData);

View File

@ -369,7 +369,7 @@ define(['jquery', 'core/notification', 'core/templates',
// Render the events.
return render(root, calendarEvents).then(function(renderCount) {
if (renderCount < calendarEvents.length) {
// if the number of events that was rendered is less than
// If the number of events that was rendered is less than
// the number we sent for rendering we can assume that there
// are no groups to add them in. Since the ordering of the
// events is guaranteed it means that any future requests will

View File

@ -206,7 +206,8 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
*/
var findNextFocusable = function(mainElement) {
var tabables = $("a:visible");
var isInside = false, foundElement = null;
var isInside = false;
var foundElement = null;
tabables.each(function() {
if ($.contains(mainElement[0], this)) {
isInside = true;

View File

@ -438,7 +438,7 @@ define(['core/mustache',
treated += content.substring(0, index);
content = content.substr(index);
strIndex = '';
walker = 4; // 4 is the length of '[[_s'.
walker = 4; // 4 is the length of '[[_s'.
// Walk the characters to manually extract the index of the string from the placeholder.
char = content.substr(walker, 1);
@ -455,7 +455,7 @@ define(['core/mustache',
strFinal = '';
}
treated += strFinal;
content = content.substr(6 + strIndex.length); // 6 is the length of the placeholder without the index: '[[_s]]'.
content = content.substr(6 + strIndex.length); // 6 is the length of the placeholder without the index: '[[_s]]'.
// Find the next placeholder.
index = content.search(pattern);

View File

@ -249,7 +249,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/custom_interactio
// If the element isn't in the view window.
if (relativeTop > container.innerHeight()) {
var height = notificationElement.outerHeight();
// offset enough to make sure the notification will be in view.
// Offset enough to make sure the notification will be in view.
height = height * 4;
var scrollTo = position.top - height;
container.scrollTop(scrollTo);

942
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,14 +4,14 @@
"description": "Moodle",
"devDependencies": {
"async": "1.5.2",
"eslint": "3.7.1",
"eslint": "4.4.1",
"eslint-plugin-promise": "3.5.0",
"gherkin-lint": "1.1.3",
"grunt": "1.0.1",
"grunt-contrib-less": "1.3.0",
"grunt-contrib-uglify": "1.0.1",
"grunt-contrib-watch": "1.0.0",
"grunt-eslint": "19.0.0",
"grunt-eslint": "20.0.0",
"grunt-stylelint": "0.6.0",
"semver": "5.3.0",
"shifter": "0.5.0",