diff --git a/availability/yui/src/form/js/form.js b/availability/yui/src/form/js/form.js index 0ccb8595698..e99abb087cf 100644 --- a/availability/yui/src/form/js/form.js +++ b/availability/yui/src/form/js/form.js @@ -277,6 +277,7 @@ M.core_availability.plugin = { * @protected */ initInner: function() { + // Can be overriden. }, /** @@ -319,6 +320,7 @@ M.core_availability.plugin = { * @param {Y.Node} node YUI node (same one returned from getNode) */ fillErrors: function() { + // Can be overriden. }, /** @@ -409,7 +411,9 @@ M.core_availability.List = function(json, root, parentRoot) { // Create the button and add it. var button = Y.Node.create(''); - button.on("click", function() { this.clickAdd(); }, this); + button.on("click", function() { + this.clickAdd(); + }, this); this.node.one('div.availability-button').appendChild(button); if (json) { @@ -1080,7 +1084,9 @@ M.core_availability.EyeIcon = function(individual, shown) { }; this.span.on('click', click, this); this.span.on('key', click, 'up:32', this); - this.span.on('key', function(e) { e.preventDefault(); }, 'down:32', this); + this.span.on('key', function(e) { + e.preventDefault(); + }, 'down:32', this); }; /** @@ -1132,7 +1138,9 @@ M.core_availability.DeleteIcon = function(toDelete) { }; this.span.on('click', click, this); this.span.on('key', click, 'up:32', this); - this.span.on('key', function(e) { e.preventDefault(); }, 'down:32', this); + this.span.on('key', function(e) { + e.preventDefault(); + }, 'down:32', this); }; /** diff --git a/backup/util/ui/yui/src/backupselectall/js/backupselectall.js b/backup/util/ui/yui/src/backupselectall/js/backupselectall.js index fae42eed84b..faf369b38cd 100644 --- a/backup/util/ui/yui/src/backupselectall/js/backupselectall.js +++ b/backup/util/ui/yui/src/backupselectall/js/backupselectall.js @@ -91,11 +91,19 @@ M.core_backup.backupselectall = function(modnames) { // Add select all/none for each module type. var initlinks = function(links, mod) { - Y.one('#backup-all-mod_' + mod).on('click', function(e) { helper(e, true, '_included', mod); }); - Y.one('#backup-none-mod_' + mod).on('click', function(e) { helper(e, false, '_included', mod); }); + Y.one('#backup-all-mod_' + mod).on('click', function(e) { + helper(e, true, '_included', mod); + }); + Y.one('#backup-none-mod_' + mod).on('click', function(e) { + helper(e, false, '_included', mod); + }); if (withuserdata) { - Y.one('#backup-all-userdata-mod_' + mod).on('click', function(e) { helper(e, true, withuserdata, mod); }); - Y.one('#backup-none-userdata-mod_' + mod).on('click', function(e) { helper(e, false, withuserdata, mod); }); + Y.one('#backup-all-userdata-mod_' + mod).on('click', function(e) { + helper(e, true, withuserdata, mod); + }); + Y.one('#backup-none-userdata-mod_' + mod).on('click', function(e) { + helper(e, false, withuserdata, mod); + }); } }; @@ -141,24 +149,39 @@ M.core_backup.backupselectall = function(modnames) { animcfg.to = {maxHeight: modlist.get('clientHeight') + 'px'}; modlist.setStyle('maxHeight', '0px'); anim = new Y.Anim(animcfg); - anim.on('end', function() { modlist.setStyle('maxHeight', 'none'); }); + anim.on('end', function() { + modlist.setStyle('maxHeight', 'none'); + }); anim.run(); } else { // Animate hide of the module links. animcfg.to = {maxHeight: '0px'}; modlist.setStyle('maxHeight', modlist.get('clientHeight') + 'px'); anim = new Y.Anim(animcfg); - anim.on('end', function() { modlist.hide(); modlist.setStyle('maxHeight', 'none'); }); + anim.on('end', function() { + modlist.hide(); + modlist.setStyle('maxHeight', 'none'); + }); anim.run(); } }; - Y.one('#backup-bytype').on('click', function() { toggletypes(); }); + Y.one('#backup-bytype').on('click', function() { + toggletypes(); + }); - Y.one('#backup-all-included').on('click', function(e) { helper(e, true, '_included'); }); - Y.one('#backup-none-included').on('click', function(e) { helper(e, false, '_included'); }); + Y.one('#backup-all-included').on('click', function(e) { + helper(e, true, '_included'); + }); + Y.one('#backup-none-included').on('click', function(e) { + helper(e, false, '_included'); + }); if (withuserdata) { - Y.one('#backup-all-userdata').on('click', function(e) { helper(e, true, withuserdata); }); - Y.one('#backup-none-userdata').on('click', function(e) { helper(e, false, withuserdata); }); + Y.one('#backup-all-userdata').on('click', function(e) { + helper(e, true, withuserdata); + }); + Y.one('#backup-none-userdata').on('click', function(e) { + helper(e, false, withuserdata); + }); } }; diff --git a/course/yui/src/dragdrop/js/section.js b/course/yui/src/dragdrop/js/section.js index e160f15131c..452e410c94c 100644 --- a/course/yui/src/dragdrop/js/section.js +++ b/course/yui/src/dragdrop/js/section.js @@ -214,7 +214,9 @@ Y.extend(DRAGSECTION, M.core.dragdrop, { new M.core.ajaxException(responsetext); } M.course.format.process_sections(Y, sectionlist, responsetext, loopstart, loopend); - } catch (e) {} + } catch (e) { + // Ignore. + } // Update all of the section IDs - first unset them, then set them // to avoid duplicates in the DOM. diff --git a/course/yui/src/toolboxes/js/toolbox.js b/course/yui/src/toolboxes/js/toolbox.js index b881d119cfe..6f78e0970ef 100644 --- a/course/yui/src/toolboxes/js/toolbox.js +++ b/course/yui/src/toolboxes/js/toolbox.js @@ -112,7 +112,9 @@ Y.extend(TOOLBOX, Y.Base, { if (responsetext.error) { new M.core.ajaxException(responsetext); } - } catch (e) {} + } catch (e) { + // Ignore. + } // Run the callback if we have one. if (success_callback) { diff --git a/lib/editor/atto/plugins/accessibilitychecker/yui/src/button/js/button.js b/lib/editor/atto/plugins/accessibilitychecker/yui/src/button/js/button.js index dad114e52e8..1634ac7649a 100644 --- a/lib/editor/atto/plugins/accessibilitychecker/yui/src/button/js/button.js +++ b/lib/editor/atto/plugins/accessibilitychecker/yui/src/button/js/button.js @@ -147,7 +147,8 @@ Y.namespace('M.atto_accessibilitychecker').Button = Y.Base.create('button', Y.M. ' Luminance 2: ' + lum2); // We only want the highest node with dodgy contrast reported. - var i = 0, found = false; + var i = 0; + var found = false; for (i = 0; i < problemNodes.length; i++) { if (node.ancestors('*').indexOf(problemNodes[i]) !== -1) { // Do not add node - it already has a parent in the list. diff --git a/lib/editor/atto/plugins/image/yui/src/button/js/button.js b/lib/editor/atto/plugins/image/yui/src/button/js/button.js index e6c2fe908e4..411f105bfcf 100644 --- a/lib/editor/atto/plugins/image/yui/src/button/js/button.js +++ b/lib/editor/atto/plugins/image/yui/src/button/js/button.js @@ -219,8 +219,12 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi this.editor.on('drop', this._handleDragDrop, this); // e.preventDefault needed to stop the default event from clobbering the desired behaviour in some browsers. - this.editor.on('dragover', function(e) { e.preventDefault(); }, this); - this.editor.on('dragenter', function(e) { e.preventDefault(); }, this); + this.editor.on('dragover', function(e) { + e.preventDefault(); + }, this); + this.editor.on('dragenter', function(e) { + e.preventDefault(); + }, this); }, /** @@ -393,7 +397,8 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi * @private */ _loadPreviewImage: function(url) { - var image = new Image(), self = this; + var image = new Image(); + var self = this; image.onerror = function() { var preview = self._form.one('.' + CSS.IMAGEPREVIEW); diff --git a/lib/editor/atto/plugins/indent/yui/src/button/js/button.js b/lib/editor/atto/plugins/indent/yui/src/button/js/button.js index ee49a6a7c09..bc37415828b 100644 --- a/lib/editor/atto/plugins/indent/yui/src/button/js/button.js +++ b/lib/editor/atto/plugins/indent/yui/src/button/js/button.js @@ -156,7 +156,8 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed .setStyle(margindir, '30px') .addClass('editor-indent'); // We use childNodes here because we are interested in both type 1 and 3 child nodes. - var children = blockquote.getDOMNode().childNodes, child; + var children = blockquote.getDOMNode().childNodes; + var child; child = children[0]; while (typeof child !== "undefined") { clone.append(child); @@ -182,7 +183,8 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.Ed .getAttrs()) .removeClass('editor-indent'); // We use childNodes here because we are interested in both type 1 and 3 child nodes. - var children = indent.getDOMNode().childNodes, child; + var children = indent.getDOMNode().childNodes; + var child; child = children[0]; while (typeof child !== "undefined") { clone.append(child); diff --git a/lib/editor/atto/yui/src/editor/js/commands.js b/lib/editor/atto/yui/src/editor/js/commands.js index 753399d459d..5b1cc003167 100644 --- a/lib/editor/atto/yui/src/editor/js/commands.js +++ b/lib/editor/atto/yui/src/editor/js/commands.js @@ -111,7 +111,8 @@ EditorCommand.prototype = { clone.setAttribute('class', node.getAttribute('class')); } // We use childNodes here because we are interested in both type 1 and 3 child nodes. - var children = node.getDOMNode().childNodes, child; + var children = node.getDOMNode().childNodes; + var child; child = children[0]; while (typeof child !== "undefined") { clone.append(child); diff --git a/lib/form/yui/src/dateselector/js/dateselector.js b/lib/form/yui/src/dateselector/js/dateselector.js index 62f8a6a6b66..278e3522780 100644 --- a/lib/form/yui/src/dateselector/js/dateselector.js +++ b/lib/form/yui/src/dateselector/js/dateselector.js @@ -76,7 +76,9 @@ M.form.dateselector = { Y.one('#dateselector-calendar-panel').setStyle('zIndex', null); this.panel.on('heightChange', this.fix_position, this); - Y.one('#dateselector-calendar-panel').on('click', function(e) { e.halt(); }); + Y.one('#dateselector-calendar-panel').on('click', function(e) { + e.halt(); + }); Y.one(document.body).on('click', this.document_click, this); this.calendar = new MOODLECALENDAR({ diff --git a/lib/form/yui/src/passwordunmask/js/passwordunmask.js b/lib/form/yui/src/passwordunmask/js/passwordunmask.js index e0dae0656db..56097ea1dcc 100644 --- a/lib/form/yui/src/passwordunmask/js/passwordunmask.js +++ b/lib/form/yui/src/passwordunmask/js/passwordunmask.js @@ -22,7 +22,9 @@ Y.extend(PASSWORDUNMASK, Y.Base, { checkboxname + 'unmask">'); unmaskdiv.appendChild(unmaskchb); // Attach event using static javascript function for unmasking password. - unmaskchb.on('click', function() { window.unmaskPassword(elementid); }); + unmaskchb.on('click', function() { + window.unmaskPassword(elementid); + }); // Add label for checkbox to unmaskdiv. var unmasklabel = Y.Node.create(''); diff --git a/lib/yui/src/blocks/js/blocks.js b/lib/yui/src/blocks/js/blocks.js index 3ee6fd0c2ba..32af2fe59c8 100644 --- a/lib/yui/src/blocks/js/blocks.js +++ b/lib/yui/src/blocks/js/blocks.js @@ -293,7 +293,9 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, { if (responsetext.error) { new M.core.ajaxException(responsetext); } - } catch (e) {} + } catch (e) { + // Ignore. + } }, failure: function(tid, response) { this.ajax_failure(response); diff --git a/lib/yui/src/blocks/js/manager.js b/lib/yui/src/blocks/js/manager.js index b61e99509c4..1db4d316c78 100644 --- a/lib/yui/src/blocks/js/manager.js +++ b/lib/yui/src/blocks/js/manager.js @@ -315,7 +315,9 @@ MANAGER.prototype = { if (responsetext.error) { new M.core.ajaxException(responsetext); } - } catch (e) {} + } catch (e) { + // Ignore. + } }, failure: function(tid, response) { this.ajax_failure(response); diff --git a/lib/yui/src/dock/js/dockeditem.js b/lib/yui/src/dock/js/dockeditem.js index 62c0a12fbe8..482decc6fc8 100644 --- a/lib/yui/src/dock/js/dockeditem.js +++ b/lib/yui/src/dock/js/dockeditem.js @@ -98,7 +98,8 @@ DOCKEDITEM.prototype = { this.fire('dockeditem:drawstart'); - docktitle = create('
'); + docktitle = create(''); docktitle.append(this.get('title')); dockitem = create(''); if (count === 1) { diff --git a/lib/yui/src/dragdrop/js/dragdrop.js b/lib/yui/src/dragdrop/js/dragdrop.js index 25e620645d4..e7ec62102f3 100644 --- a/lib/yui/src/dragdrop/js/dragdrop.js +++ b/lib/yui/src/dragdrop/js/dragdrop.js @@ -1,3 +1,4 @@ +/* eslint-disable no-empty-function */ /** * The core drag and drop module for Moodle which extends the YUI drag and * drop functionality with additional features. @@ -395,15 +396,14 @@ Y.extend(DRAGDROP, Y.Base, { // Build the list of drop targets. var droplist = Y.Node.create('