From bc8b6dc6525d20533765c8c87476a36324ec4a87 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Fri, 15 Jul 2016 16:38:21 +0100 Subject: [PATCH] MDL-55244 js: fix various lint warnings in yui * Incorrect brace style * Empty functions * Multiple var statemnts --- availability/yui/src/form/js/form.js | 14 ++++-- .../src/backupselectall/js/backupselectall.js | 45 ++++++++++++++----- course/yui/src/dragdrop/js/section.js | 4 +- course/yui/src/toolboxes/js/toolbox.js | 4 +- .../yui/src/button/js/button.js | 3 +- .../plugins/image/yui/src/button/js/button.js | 11 +++-- .../indent/yui/src/button/js/button.js | 6 ++- lib/editor/atto/yui/src/editor/js/commands.js | 3 +- .../yui/src/dateselector/js/dateselector.js | 4 +- .../src/passwordunmask/js/passwordunmask.js | 4 +- lib/yui/src/blocks/js/blocks.js | 4 +- lib/yui/src/blocks/js/manager.js | 4 +- lib/yui/src/dock/js/dockeditem.js | 3 +- lib/yui/src/dragdrop/js/dragdrop.js | 11 ++--- lib/yui/src/notification/js/ajaxexception.js | 8 +++- lib/yui/src/notification/js/alert.js | 3 +- lib/yui/src/notification/js/confirm.js | 3 +- lib/yui/src/notification/js/exception.js | 8 +++- .../yui/src/toolboxes/js/toolboxes.js | 4 +- .../editpdf/yui/src/editor/js/comment.js | 3 +- .../editpdf/yui/src/editor/js/commentmenu.js | 12 ++++- .../editpdf/yui/src/editor/js/dropdown.js | 4 +- .../editpdf/yui/src/editor/js/editor.js | 3 +- mod/quiz/yui/src/dragdrop/js/section.js | 4 +- .../quizquestionbank/js/quizquestionbank.js | 8 +++- mod/quiz/yui/src/toolboxes/js/toolbox.js | 4 +- mod/quiz/yui/src/util/js/page.js | 3 +- mod/quiz/yui/src/util/js/slot.js | 6 ++- 28 files changed, 141 insertions(+), 52 deletions(-) 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(''); droplist.addClass('dragdrop-keyboard-drag'); - var listitem, - listlink, - listitemtext; + var listitem, listlink, listitemtext; // Search for possible drop targets. var droptargets = Y.all('.' + this.samenodeclass + ', .' + this.parentnodeclass); droptargets.each(function(node) { - var validdrop = false, labelroot = node; + var validdrop = false; + var labelroot = node; if (node.drop && node.drop.inGroup(this.groups) && node.drop.get('node') !== dragcontainer) { // This is a drag and drop target with the same class as the grabbed node. validdrop = true; @@ -620,7 +620,8 @@ Y.extend(DRAGDROP, Y.Base, { // Check the drag groups to see if we are the handler for this node. draggroups = draghandle.getAttribute('data-draggroups').split(' '); - var i, j, validgroup = false; + var i, j; + var validgroup = false; for (i = 0; i < draggroups.length; i++) { for (j = 0; j < this.groups.length; j++) { diff --git a/lib/yui/src/notification/js/ajaxexception.js b/lib/yui/src/notification/js/ajaxexception.js index 6a792cf9a71..39fa89e23cc 100644 --- a/lib/yui/src/notification/js/ajaxexception.js +++ b/lib/yui/src/notification/js/ajaxexception.js @@ -49,7 +49,9 @@ Y.extend(AJAXEXCEPTION, M.core.notification.info, { this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE); if (delay) { - this._hideTimeout = setTimeout(function() { self.hide(); }, delay); + this._hideTimeout = setTimeout(function() { + self.hide(); + }, delay); } this.after('visibleChange', this.visibilityChanged, this); this._keypress = Y.on('key', this.hide, window, 'down:13, 27', this); @@ -59,7 +61,9 @@ Y.extend(AJAXEXCEPTION, M.core.notification.info, { if (e.attrName === 'visible' && e.prevVal && !e.newVal) { var self = this; this._keypress.detach(); - setTimeout(function() { self.destroy(); }, 1000); + setTimeout(function() { + self.destroy(); + }, 1000); } } }, { diff --git a/lib/yui/src/notification/js/alert.js b/lib/yui/src/notification/js/alert.js index 0dcab3330c5..637ef38bd87 100644 --- a/lib/yui/src/notification/js/alert.js +++ b/lib/yui/src/notification/js/alert.js @@ -43,7 +43,8 @@ Y.extend(ALERT, M.core.notification.info, { this.get(BASE).addClass('moodle-dialogue-confirm'); this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE); this.setStdModContent(Y.WidgetStdMod.HEADER, - '

' + this.get(TITLE) + '

', Y.WidgetStdMod.REPLACE); + '

' + this.get(TITLE) + '

', + Y.WidgetStdMod.REPLACE); this._closeEvents.push( Y.on('key', this.submit, window, 'down:13', this), diff --git a/lib/yui/src/notification/js/confirm.js b/lib/yui/src/notification/js/confirm.js index 2eb3a5b5f2f..edda4fbff9f 100644 --- a/lib/yui/src/notification/js/confirm.js +++ b/lib/yui/src/notification/js/confirm.js @@ -76,7 +76,8 @@ Y.extend(CONFIRM, M.core.notification.info, { this.get(BASE).addClass('moodle-dialogue-confirm'); this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE); this.setStdModContent(Y.WidgetStdMod.HEADER, - '

' + this.get(TITLE) + '

', Y.WidgetStdMod.REPLACE); + '

' + this.get(TITLE) + '

', + Y.WidgetStdMod.REPLACE); this._closeEvents.push( Y.on('key', this.submit, window, 'down:27', this, false), diff --git a/lib/yui/src/notification/js/exception.js b/lib/yui/src/notification/js/exception.js index d9e33bf729c..7c5fdc43c38 100644 --- a/lib/yui/src/notification/js/exception.js +++ b/lib/yui/src/notification/js/exception.js @@ -65,7 +65,9 @@ Y.extend(EXCEPTION, M.core.notification.info, { this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE); if (delay) { - this._hideTimeout = setTimeout(function() { self.hide(); }, delay); + this._hideTimeout = setTimeout(function() { + self.hide(); + }, delay); } this.after('visibleChange', this.visibilityChanged, this); this._keypress = Y.on('key', this.hide, window, 'down:13,27', this); @@ -77,7 +79,9 @@ Y.extend(EXCEPTION, M.core.notification.info, { this._keypress.detach(); } var self = this; - setTimeout(function() { self.destroy(); }, 1000); + setTimeout(function() { + self.destroy(); + }, 1000); } } }, { diff --git a/message/output/airnotifier/yui/src/toolboxes/js/toolboxes.js b/message/output/airnotifier/yui/src/toolboxes/js/toolboxes.js index 291c55e051e..711e5543af7 100644 --- a/message/output/airnotifier/yui/src/toolboxes/js/toolboxes.js +++ b/message/output/airnotifier/yui/src/toolboxes/js/toolboxes.js @@ -121,7 +121,9 @@ Y.extend(TOOLBOX, Y.Base, { } else if (responsetext.success) { callbacksuccess(); } - } catch (e) {} + } catch (e) { + // Ignore. + } if (statusspinner) { statusspinner.hide(); } diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/comment.js b/mod/assign/feedback/editpdf/yui/src/editor/js/comment.js index 5b9c279f4b2..da4144d593d 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/comment.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/comment.js @@ -316,7 +316,8 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) { * @method remove */ this.remove = function() { - var i = 0, comments; + var i = 0; + var comments; comments = this.editor.pages[this.editor.currentpage].comments; for (i = 0; i < comments.length; i++) { diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/commentmenu.js b/mod/assign/feedback/editpdf/yui/src/editor/js/commentmenu.js index bbbda75320f..5504623d769 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/commentmenu.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/commentmenu.js @@ -49,8 +49,16 @@ Y.extend(COMMENTMENU, M.assignfeedback_editpdf.dropdown, { link = Y.Node.create('
  • ' + M.util.get_string('deletecomment', 'assignfeedback_editpdf') + '
  • '); - link.on('click', function(e) { e.preventDefault(); this.menu.hide(); this.remove(); }, comment); - link.on('key', function() { comment.menu.hide(); comment.remove(); }, 'enter,space', comment); + link.on('click', function(e) { + e.preventDefault(); + this.menu.hide(); + this.remove(); + }, comment); + + link.on('key', function() { + comment.menu.hide(); + comment.remove(); + }, 'enter,space', comment); commentlinks.append(link); diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/dropdown.js b/mod/assign/feedback/editpdf/yui/src/editor/js/dropdown.js index c63c8a52660..3494727c991 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/dropdown.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/dropdown.js @@ -59,7 +59,9 @@ Y.extend(DROPDOWN, M.core.dialogue, { } }, this); - button.on('click', function(e) { e.preventDefault(); this.show(); }, this); + button.on('click', function(e) { + e.preventDefault(); this.show(); + }, this); button.on('key', this.show, 'enter,space', this); }, diff --git a/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js b/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js index 898200f8777..2bdc486a9a8 100644 --- a/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js +++ b/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js @@ -347,7 +347,8 @@ EDITOR.prototype = { * @method link_handler */ link_handler: function(e) { - var drawingcanvas, drawingregion, resize = true; + var drawingcanvas, drawingregion; + var resize = true; e.preventDefault(); if (!this.dialogue) { diff --git a/mod/quiz/yui/src/dragdrop/js/section.js b/mod/quiz/yui/src/dragdrop/js/section.js index db7b6a92bd5..53663afac39 100644 --- a/mod/quiz/yui/src/dragdrop/js/section.js +++ b/mod/quiz/yui/src/dragdrop/js/section.js @@ -192,7 +192,9 @@ Y.extend(DRAGSECTION, M.core.dragdrop, { new M.core.ajaxException(responsetext); } M.mod_quiz.edit.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/mod/quiz/yui/src/quizquestionbank/js/quizquestionbank.js b/mod/quiz/yui/src/quizquestionbank/js/quizquestionbank.js index a31961b4ace..72a65199369 100644 --- a/mod/quiz/yui/src/quizquestionbank/js/quizquestionbank.js +++ b/mod/quiz/yui/src/quizquestionbank/js/quizquestionbank.js @@ -65,7 +65,9 @@ Y.extend(POPUP, Y.Base, { this.loadingDiv = this.dialogue.bodyNode.getHTML(); - Y.later(100, this, function() { this.load_content(window.location.search); }); + Y.later(100, this, function() { + this.load_content(window.location.search); + }); }, initializer: function() { @@ -127,7 +129,9 @@ Y.extend(POPUP, Y.Base, { Y.log('Load completed.', 'debug', 'moodle-mod_quiz-quizquestionbank'); this.dialogue.bodyNode.setHTML(result.contents); - Y.use('moodle-question-chooser', function() { M.question.init_chooser({}); }); + Y.use('moodle-question-chooser', function() { + M.question.init_chooser({}); + }); this.dialogue.bodyNode.one('form').delegate('change', this.options_changed, '.searchoptions', this); if (this.dialogue.visible) { diff --git a/mod/quiz/yui/src/toolboxes/js/toolbox.js b/mod/quiz/yui/src/toolboxes/js/toolbox.js index 8423fb3da0e..756180fdff4 100644 --- a/mod/quiz/yui/src/toolboxes/js/toolbox.js +++ b/mod/quiz/yui/src/toolboxes/js/toolbox.js @@ -126,7 +126,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 (responsetext.hasOwnProperty('newsummarks')) { diff --git a/mod/quiz/yui/src/util/js/page.js b/mod/quiz/yui/src/util/js/page.js index ea16fb339dd..686754b17c0 100644 --- a/mod/quiz/yui/src/util/js/page.js +++ b/mod/quiz/yui/src/util/js/page.js @@ -234,7 +234,8 @@ Y.Moodle.mod_quiz.util.page = { */ reorderPages: function() { // Get list of page nodes. - var pages = this.getPages(), currentpagenumber = 0; + var pages = this.getPages(); + var currentpagenumber = 0; // Loop through pages incrementing the number each time. pages.each(function(page) { // Is the page empty? diff --git a/mod/quiz/yui/src/util/js/slot.js b/mod/quiz/yui/src/util/js/slot.js index 5493db729d7..90689fe306f 100644 --- a/mod/quiz/yui/src/util/js/slot.js +++ b/mod/quiz/yui/src/util/js/slot.js @@ -305,7 +305,8 @@ Y.Moodle.mod_quiz.util.slot = { */ reorderPageBreaks: function() { // Get list of slot nodes. - var slots = this.getSlots(), slotnumber = 0; + var slots = this.getSlots(); + var slotnumber = 0; // Loop through slots incrementing the number each time. slots.each(function(slot, key) { slotnumber++; @@ -330,7 +331,8 @@ Y.Moodle.mod_quiz.util.slot = { var pagebreaklink = pagebreak.get('childNodes').item(0); // Get the correct title. - var action = '', iconname = ''; + var action = ''; + var iconname = ''; if (Y.Moodle.mod_quiz.util.page.isPage(nextitem)) { action = 'removepagebreak'; iconname = 'e/remove_page_break';