MDL-54939 amd: Fix lint issues fixable with eslint --fix

This commit is contained in:
Dan Poltawski 2016-06-16 15:56:12 +01:00
parent 49619ce243
commit 35be582696
37 changed files with 188 additions and 188 deletions

View File

@ -170,8 +170,8 @@ define(['jquery',
for (var i in self._actions) {
choices.push(self._actions[i]);
}
var content = {'message': self._message, 'choices' : choices,
'confirm' : self._confirm, 'cancel' : self._cancel};
var content = {'message': self._message, 'choices': choices,
'confirm': self._confirm, 'cancel': self._cancel};
return Templates.render('tool_lp/action_selector', content);
};

View File

@ -276,7 +276,7 @@ define(['jquery',
{ key: message, component: 'tool_lp', param: competency.shortname },
{ key: 'confirm', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
]).done(function (strings) {
]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Unlink the competency X from the course?
@ -300,7 +300,7 @@ define(['jquery',
if (localthis.itemtype == 'course') {
// Course completion rule handling.
$('[data-region="coursecompetenciespage"]').on('change', 'select[data-field="ruleoutcome"]', function(e){
$('[data-region="coursecompetenciespage"]').on('change', 'select[data-field="ruleoutcome"]', function(e) {
var requests = [];
var pagerender = 'tool_lp/course_competencies_page';
var pageregion = 'coursecompetenciespage';

View File

@ -66,7 +66,7 @@ define(['jquery',
var parent = $('[data-region="competencyactions"]').data('competency');
var params = {
competencyframeworkid : treeModel.getCompetencyFrameworkId(),
competencyframeworkid: treeModel.getCompetencyFrameworkId(),
pagecontextid: pageContextId
};
@ -86,7 +86,7 @@ define(['jquery',
{ key: 'addingcompetencywillresetparentrule', component: 'tool_lp', param: parent.shortname },
{ key: 'yes', component: 'core' },
{ key: 'no', component: 'core' }
]).done(function (strings) {
]).done(function(strings) {
notification.confirm(
strings[0],
strings[1],
@ -157,7 +157,7 @@ define(['jquery',
{ key: confirmMessage, component: 'tool_lp' },
{ key: 'yes', component: 'moodle' },
{ key: 'no', component: 'moodle' }
]).done(function (strings) {
]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Delete competency X?
@ -230,7 +230,7 @@ define(['jquery',
competencyframeworkid: competency.competencyframeworkid,
searchtext: ''
}
},{
}, {
methodname: 'core_competency_read_competency_framework',
args: {
id: competency.competencyframeworkid
@ -257,7 +257,7 @@ define(['jquery',
{ key: 'movecompetency', component: 'tool_lp', param: competency.shortname },
{ key: 'move', component: 'tool_lp' },
{ key: 'cancel', component: 'moodle' }
]).done(function (strings) {
]).done(function(strings) {
var context = {
framework: framework,
@ -288,8 +288,8 @@ define(['jquery',
var competency = $('[data-region="competencyactions"]').data('competency');
var params = {
competencyframeworkid : treeModel.getCompetencyFrameworkId(),
id : competency.id,
competencyframeworkid: treeModel.getCompetencyFrameworkId(),
id: competency.id,
parentid: competency.parentid,
pagecontextid: pageContextId
};
@ -381,7 +381,7 @@ define(['jquery',
courses: courses
};
templates.render('tool_lp/linked_courses_summary', context).done(function(html) {
str.get_string('linkedcourses', 'tool_lp').done(function (linkedcourses) {
str.get_string('linkedcourses', 'tool_lp').done(function(linkedcourses) {
new Dialogue(
linkedcourses, // Title.
html, // The linked courses.
@ -413,7 +413,7 @@ define(['jquery',
});
});
calls.push( {
calls.push({
methodname: 'tool_lp_data_for_related_competencies_section',
args: { competencyid: relatedTarget.id }
});
@ -486,7 +486,7 @@ define(['jquery',
str.get_strings([
{ key: 'competencycannotbedeleted', component: 'tool_lp', param: competency.shortname },
{ key: 'cancel', component: 'moodle' }
]).done(function (strings) {
]).done(function(strings) {
notification.alert(
null,
strings[0]
@ -514,7 +514,7 @@ define(['jquery',
{ key: confirmMessage, component: 'tool_lp', param: competency.shortname },
{ key: 'delete', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
]).done(function (strings) {
]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Delete competency X?

View File

@ -57,7 +57,7 @@ define(['jquery',
e.preventDefault();
templates.render('tool_lp/course_competency_settings', context).done(function(html) {
str.get_string('configurecoursecompetencysettings', 'tool_lp').done(function (title) {
str.get_string('configurecoursecompetencysettings', 'tool_lp').done(function(title) {
this._dialogue = new Dialogue(
title,
html,

View File

@ -43,7 +43,7 @@ define(['core/yui'], function(Y) {
wide = false;
}
Y.use('moodle-core-notification', 'timers', function () {
Y.use('moodle-core-notification', 'timers', function() {
var width = '480px';
if (wide) {
width = '800px';

View File

@ -70,8 +70,8 @@ define(['core/str', 'core/yui'], function(str, Y) {
{ key: 'emptydragdropregion', component: 'moodle' },
{ key: 'movecontent', component: 'moodle' },
{ key: 'tocontent', component: 'moodle' },
]).done( function () {
Y.use('moodle-tool_lp-dragdrop-reorder', function () {
]).done(function() {
Y.use('moodle-tool_lp-dragdrop-reorder', function() {
var context = {
callback: callback

View File

@ -62,7 +62,7 @@ define(['jquery',
{ key: 'areyousure', component: 'moodle' },
{ key: 'delete', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
]).done(function (strings) {
]).done(function(strings) {
Notification.confirm(
strings[0], // Confirm.
strings[1], // Are you sure?

View File

@ -93,17 +93,17 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
}
}
}]);
requests[0].done(function (success) {
requests[0].done(function(success) {
if (success === false) {
var req = ajax.call([{
methodname: 'core_competency_read_competency_framework',
args: { id: frameworkid }
}]);
req[0].done(function (framework) {
req[0].done(function(framework) {
str.get_strings([
{ key: 'frameworkcannotbedeleted', component: 'tool_lp', param: framework.shortname },
{ key: 'cancel', component: 'moodle' }
]).done(function (strings) {
]).done(function(strings) {
notification.alert(
null,
strings[0]
@ -136,7 +136,7 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
{ key: 'deletecompetencyframework', component: 'tool_lp', param: framework.shortname },
{ key: 'delete', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
]).done(function (strings) {
]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Delete competency framework X?

View File

@ -166,7 +166,7 @@ define(['jquery'], function($) {
this.activeItem = null;
// Close the menu.
this.menuRoot.find('ul').not('.root-level').attr('aria-hidden','true');
this.menuRoot.find('ul').not('.root-level').attr('aria-hidden', 'true');
// Follow any link, or call the click handlers.
var anchor = item.find('a').first();
var clickEvent = new $.Event('click');
@ -290,7 +290,7 @@ define(['jquery'], function($) {
subMenuContainer.css('margin-right', '-' + marginright + 'px');
}
} else {
if ( pos.left + menuRealWidth > $(window).width()) {
if (pos.left + menuRealWidth > $(window).width()) {
marginleft = menuRealWidth - widthmenuRoot;
subMenuContainer.css('margin-left', '-' + marginleft + 'px');
}
@ -319,7 +319,7 @@ define(['jquery'], function($) {
return true;
}
switch(e.keyCode) {
switch (e.keyCode) {
case this.keys.tab: {
// Hide all menu items and update their aria attributes.
@ -438,7 +438,7 @@ define(['jquery'], function($) {
// This is the root level move to next sibling. This will require closing
// the current child menu and opening the new one.
if (menuIndex < menuNum-1) {
if (menuIndex < menuNum - 1) {
// Not the last root menu.
newItem = item.next();
} else { // Wrap to first item.
@ -501,7 +501,7 @@ define(['jquery'], function($) {
menuIndex = this.rootMenus.index(rootItem);
// If this is not the last root menu item, move to the next one.
if (menuIndex < this.rootMenus.length-1) {
if (menuIndex < this.rootMenus.length - 1) {
newItem = rootItem.next();
} else {
// Loop.
@ -687,7 +687,7 @@ define(['jquery'], function($) {
// to the next item with a title that begins with that character.
if (startChr) {
var match = false;
var curNdx = menuIndex+1;
var curNdx = menuIndex + 1;
// Check if the active item was the last one on the list.
if (curNdx == menuNum) {
@ -696,7 +696,7 @@ define(['jquery'], function($) {
// Iterate through the menu items (starting from the current item and wrapping) until a match is found
// or the loop returns to the current menu item.
while (curNdx != menuIndex) {
while (curNdx != menuIndex) {
var titleChr = menuItems.eq(curNdx).html().charAt(0);
@ -705,7 +705,7 @@ define(['jquery'], function($) {
break;
}
curNdx = curNdx+1;
curNdx = curNdx + 1;
if (curNdx == menuNum) {
// Reached the end of the list, start again at the beginning.
@ -724,8 +724,8 @@ define(['jquery'], function($) {
return item;
}
} else {
if (menuIndex < menuNum-1) {
newItem = menuItems.eq(menuIndex+1);
if (menuIndex < menuNum - 1) {
newItem = menuItems.eq(menuIndex + 1);
} else {
newItem = menuItems.first();
}
@ -763,7 +763,7 @@ define(['jquery'], function($) {
// If item is not the first item in its menu, move to the previous item.
if (menuIndex > 0) {
newItem = menuItems.eq(menuIndex-1);
newItem = menuItems.eq(menuIndex - 1);
} else {
// Loop to top of menu.
newItem = menuItems.last();
@ -823,7 +823,7 @@ define(['jquery'], function($) {
* { "[data-action='add']" : callAddFunction }
*/
enhance: function(selector, handler) {
$(selector).each(function (index, element) {
$(selector).each(function(index, element) {
var menuRoot = $(element);
// Don't enhance the same menu twice.
if (menuRoot.data("menubarEnhanced") !== true) {

View File

@ -178,7 +178,7 @@ define(['jquery',
{ key: 'deleteplan', component: 'tool_lp', param: plan.name },
{ key: 'delete', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
]).done(function (strings) {
]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Delete plan X?
@ -225,7 +225,7 @@ define(['jquery',
{ key: 'reopenplanconfirm', component: 'tool_lp', param: plan.name },
{ key: 'reopenplan', component: 'tool_lp' },
{ key: 'cancel', component: 'moodle' }
]).done(function (strings) {
]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Reopen plan X?
@ -272,7 +272,7 @@ define(['jquery',
{ key: 'completeplanconfirm', component: 'tool_lp', param: plan.name },
{ key: 'completeplan', component: 'tool_lp' },
{ key: 'cancel', component: 'moodle' }
]).done(function (strings) {
]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Complete plan X?
@ -318,7 +318,7 @@ define(['jquery',
{ key: 'unlinkplantemplateconfirm', component: 'tool_lp', param: plan.name },
{ key: 'unlinkplantemplate', component: 'tool_lp' },
{ key: 'cancel', component: 'moodle' }
]).done(function (strings) {
]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Unlink plan X?
@ -507,7 +507,7 @@ define(['jquery',
courses: courses
};
templates.render('tool_lp/linked_courses_summary', context).done(function(html) {
str.get_string('linkedcourses', 'tool_lp').done(function (linkedcourses) {
str.get_string('linkedcourses', 'tool_lp').done(function(linkedcourses) {
new Dialogue(
linkedcourses, // Title.
html // The linked courses.

View File

@ -40,7 +40,7 @@ define(['jquery', 'core/ajax'], function($, ajax) {
if (typeof localCache[scaleid] === 'undefined') {
ajax.call([{
methodname: 'core_competency_get_scale_values',
args: {scaleid : scaleid},
args: {scaleid: scaleid},
done: function(scaleinfo) {
localCache[scaleid] = scaleinfo;
deferred.resolve(scaleinfo);

View File

@ -21,7 +21,7 @@
* @copyright 2015 Damyon Wiese <damyon@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str','tool_lp/actionselector'],
define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str', 'tool_lp/actionselector'],
function($, templates, ajax, notification, str, Actionselector) {
// Private variables and functions.
@ -135,9 +135,9 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
{ key: 'unlinkplanstemplate', component: 'tool_lp' },
{ key: 'confirm', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
]).done(function (strings) {
var actions = [{'text': strings[2], 'value' : 'delete'},
{'text': strings[3], 'value' : 'unlink'}];
]).done(function(strings) {
var actions = [{'text': strings[2], 'value': 'delete'},
{'text': strings[3], 'value': 'unlink'}];
var actionselector = new Actionselector(
strings[0], // Title.
strings[1], // Message
@ -159,7 +159,7 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
{ key: 'deletetemplate', component: 'tool_lp', param: template.shortname },
{ key: 'delete', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
]).done(function (strings) {
]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Delete learning plan template X?

View File

@ -186,12 +186,12 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
var oneItem = null;
while (lastIndex < currentIndex) {
oneItem = $(this.visibleItems.get(lastIndex));
oneItem = $(this.visibleItems.get(lastIndex));
oneItem.attr('aria-selected', 'true');
lastIndex++;
}
while (lastIndex > currentIndex) {
oneItem = $(this.visibleItems.get(lastIndex));
oneItem = $(this.visibleItems.get(lastIndex));
oneItem.attr('aria-selected', 'true');
lastIndex--;
}
@ -454,7 +454,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
// Iterate through the menu items (starting from the current item and wrapping) until a match is found
// or the loop returns to the current menu item.
while (currentIndex != itemIndex) {
while (currentIndex != itemIndex) {
var currentItem = this.visibleItems.eq(currentIndex);
var titleChr = currentItem.text().charAt(0);
@ -468,7 +468,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
break;
}
currentIndex = currentIndex+1;
currentIndex = currentIndex + 1;
if (currentIndex == itemCount) {
// Reached the end of the list, start again at the beginning.
currentIndex = 0;

View File

@ -53,14 +53,14 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/templates'
var planId = this._planId;
var requests = ajax.call([{
methodname : 'tool_lp_data_for_user_competency_summary_in_plan',
methodname: 'tool_lp_data_for_user_competency_summary_in_plan',
args: { competencyid: competencyId, planid: planId },
done: this._contextLoaded.bind(this),
fail: notification.exception
}]);
// Log the user competency viewed in plan event.
requests[0].then(function (result) {
requests[0].then(function(result) {
var eventMethodName = 'core_competency_user_competency_viewed_in_plan';
// Trigger core_competency_user_competency_plan_viewed event instead if plan is already completed.
if (result.plan.iscompleted) {
@ -98,7 +98,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/templates'
var planId = this._planId;
ajax.call([{
methodname : 'tool_lp_data_for_plan_page',
methodname: 'tool_lp_data_for_plan_page',
args: { planid: planId},
done: this._pageContextLoaded.bind(this),
fail: notification.exception

View File

@ -165,7 +165,7 @@ define(['jquery',
{ key: 'deleteuserevidence', component: 'tool_lp', param: evidence.name },
{ key: 'delete', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
]).done(function (strings) {
]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Delete evidence X?
@ -320,7 +320,7 @@ define(['jquery',
{ key: 'sendallcompetenciestoreview', component: 'tool_lp', param: evidence.name },
{ key: 'confirm', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
]).done(function (strings) {
]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Send all competencies in review for X?

View File

@ -120,14 +120,14 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
var promises = ajax.call([{
methodname: 'core_output_load_template',
args:{
args: {
component: component,
template: name,
themename: config.theme
}
}, {
methodname: 'tool_templatelibrary_load_canonical_template',
args:{
args: {
component: component,
template: name
}
@ -136,7 +136,7 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
// When returns a new promise that is resolved when all the passed in promises are resolved.
// The arguments to the done become the values of each resolved promise.
$.when.apply($, promises)
.done( function(source, originalSource) { templateLoaded(templateName, source, originalSource); })
.done(function(source, originalSource) { templateLoaded(templateName, source, originalSource); })
.fail(notification.exception);
};

View File

@ -32,7 +32,7 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
*/
var reloadListTemplate = function(templateList) {
templates.render('tool_templatelibrary/search_results', { templates: templateList })
.done(function (result, js) {
.done(function(result, js) {
templates.replaceNode($('[data-region="searchresults"]'), result, js);
}).fail(notification.exception);
};

View File

@ -28,9 +28,9 @@ define(['jquery'], function($) {
// Copied from lib/navigationlib.php navigation_node constants.
var NODETYPE = {
// @type int Activity (course module) = 40.
ACTIVITY : 40,
ACTIVITY: 40,
// @type int Resource (course module = 50.
RESOURCE : 50,
RESOURCE: 50,
};
/**
@ -94,7 +94,7 @@ define(['jquery'], function($) {
if (icon) {
link.append(icon);
link.append('<span class="item-content-wrap">'+node.name+'</span>');
link.append('<span class="item-content-wrap">' + node.name + '</span>');
} else {
link.append(node.name);
}
@ -109,7 +109,7 @@ define(['jquery'], function($) {
if (icon) {
span.append(icon);
span.append('<span class="item-content-wrap">'+node.name+'</span>');
span.append('<span class="item-content-wrap">' + node.name + '</span>');
} else {
span.append(node.name);
}

View File

@ -22,7 +22,7 @@
* @copyright 2015 Jun Pataleta <jun@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery', 'core/templates', 'core/notification', 'core/yui'], function ($, templates, notification) {
define(['jquery', 'core/templates', 'core/notification', 'core/yui'], function($, templates, notification) {
// Private variables and functions.
@ -39,7 +39,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/yui'], function (
* @param remarkId The element ID of the remark text area where the text of the selected comment will be copied to.
* @param commentOptions The array of frequently used comments to be used as options.
*/
initialise: function (criterionId, buttonId, remarkId, commentOptions) {
initialise: function(criterionId, buttonId, remarkId, commentOptions) {
/**
* Display the chooser dialog using the compiled HTML from the mustache template
* and binds onclick events for the generated comment options.
@ -68,11 +68,11 @@ define(['jquery', 'core/templates', 'core/notification', 'core/yui'], function (
});
// Loop over each comment item and bind click events.
$.each(comments, function (index, comment) {
$.each(comments, function(index, comment) {
var commentOptionId = '#comment-option-' + criterionId + '-' + comment.id;
// Delegate click event for the generated option link.
$(commentOptionId).click(function () {
$(commentOptionId).click(function() {
var remarkTextArea = $('#' + remarkId);
var remarkText = remarkTextArea.val();
@ -88,7 +88,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/yui'], function (
});
// Handle keypress on list items.
$(document).off('keypress', commentOptionId).on('keypress', commentOptionId, function () {
$(document).off('keypress', commentOptionId).on('keypress', commentOptionId, function() {
var keyCode = event.which || event.keyCode;
// Enter or space key.
@ -124,14 +124,14 @@ define(['jquery', 'core/templates', 'core/notification', 'core/yui'], function (
// Render the template and display the comment chooser dialog.
templates.render('gradingform_guide/comment_chooser', context)
.done(function (compiledSource) {
.done(function(compiledSource) {
displayChooserDialog(compiledSource, commentOptions);
})
.fail(notification.exception);
}
// Bind click event for the comments chooser button.
$("#" + buttonId).click(function (e) {
$("#" + buttonId).click(function(e) {
e.preventDefault();
generateCommentsChooser();
});

View File

@ -23,7 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since 3.0
*/
define([ 'jquery', 'core/yui' ],
define(['jquery', 'core/yui'],
function($, Y) {
return /** @alias module:core/event */ {

View File

@ -28,9 +28,9 @@
* @since 2.9
*/
define(['jquery'], function($) {
$(document).bind("ajaxStart", function(){
$(document).bind("ajaxStart", function() {
M.util.js_pending('jq');
}).bind("ajaxStop", function(){
}).bind("ajaxStop", function() {
M.util.js_complete('jq');
});
});

View File

@ -90,7 +90,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
}
originalSelect.children('option').each(function(index, ele) {
if ($(ele).prop('selected')) {
items.push( { label: $(ele).html(), value: $(ele).attr('value') } );
items.push({ label: $(ele).html(), value: $(ele).attr('value') });
}
});
var context = $.extend({ items: items }, options, state);
@ -215,7 +215,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
// Find it's index.
var current = suggestionsElement.children('[aria-hidden=false]').index(element);
// Activate the next one.
activateItem(current+1, state);
activateItem(current + 1, state);
};
/**
@ -237,7 +237,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
// Find it's index.
var current = selectionsElement.children('[aria-selected=true]').index(element);
// Activate the next one.
activateSelection(current-1, state);
activateSelection(current - 1, state);
};
/**
* Find the index of the current active selection, and activate the next one.
@ -258,7 +258,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
// Find it's index.
var current = selectionsElement.children('[aria-selected=true]').index(element);
// Activate the next one.
activateSelection(current+1, state);
activateSelection(current + 1, state);
};
/**
@ -276,7 +276,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
// Find it's index.
var current = suggestionsElement.children('[aria-hidden=false]').index(element);
// Activate the next one.
activateItem(current-1, state);
activateItem(current - 1, state);
};
/**
@ -723,7 +723,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
options.showSuggestions = showSuggestions;
}
if (typeof noSelectionString === "undefined") {
str.get_string('noselection', 'form').done(function (result) {
str.get_string('noselection', 'form').done(function(result) {
options.noSelectionString = result;
}).fail(notification.exception);
}

View File

@ -50,7 +50,7 @@ define(['jquery', 'core/ajax'], function($, ajax) {
var promises = ajax.call([{
methodname: 'core_get_fragment',
args:{
args: {
component: component,
callback: callback,
contextid: contextid,

View File

@ -46,7 +46,7 @@ define(['core/config'], function(config) {
// Disable cache if debugging.
return false;
}
if (typeof(window.localStorage) === "undefined") {
if (typeof (window.localStorage) === "undefined") {
return false;
}
var testKey = 'test';
@ -111,8 +111,8 @@ define(['core/config'], function(config) {
return hash;
}
for (i = 0, len = source.length; i < len; i++) {
chr = source.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
chr = source.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
}
return hash;

View File

@ -25,10 +25,10 @@
*/
define(['core/loglevel'], function(log) {
var originalFactory = log.methodFactory;
log.methodFactory = function (methodName, logLevel) {
log.methodFactory = function(methodName, logLevel) {
var rawMethod = originalFactory(methodName, logLevel);
return function (message, source) {
return function(message, source) {
if (source) {
rawMethod(source + ": " + message);
} else {

View File

@ -97,7 +97,7 @@ function(Y, $, log) {
if (notification.template) {
template = notification.template;
delete notification.template;
} else if (notification.type){
} else if (notification.type) {
if (typeof notificationModule.types[notification.type] !== 'undefined') {
template = notificationModule.types[notification.type];
}
@ -126,10 +126,10 @@ function(Y, $, log) {
alert: function(title, message, yesLabel) {
// Here we are wrapping YUI. This allows us to start transitioning, but
// wait for a good alternative without having inconsistent dialogues.
Y.use('moodle-core-notification-alert', function () {
Y.use('moodle-core-notification-alert', function() {
var alert = new M.core.alert({
title : title,
message : message,
title: title,
message: message,
yesLabel: yesLabel
});
@ -140,10 +140,10 @@ function(Y, $, log) {
confirm: function(title, question, yesLabel, noLabel, yesCallback, noCallback) {
// Here we are wrapping YUI. This allows us to start transitioning, but
// wait for a good alternative without having inconsistent dialogues.
Y.use('moodle-core-notification-confirm', function () {
Y.use('moodle-core-notification-confirm', function() {
var modal = new M.core.confirm({
title : title,
question : question,
title: title,
question: question,
yesLabel: yesLabel,
noLabel: noLabel
});
@ -169,7 +169,7 @@ function(Y, $, log) {
ex.stack = ex.debuginfo;
ex.name = ex.errorcode;
}
Y.use('moodle-core-notification-exception', function () {
Y.use('moodle-core-notification-exception', function() {
var modal = new M.core.exception(ex);
modal.show();

View File

@ -23,7 +23,7 @@
/**
* @module admin/permissionmanager
*/
define(['jquery', 'core/config','core/notification', 'core/templates'], function($, config, notification, templates) {
define(['jquery', 'core/config', 'core/notification', 'core/templates'], function($, config, notification, templates) {
/**
* Used CSS selectors
@ -63,7 +63,7 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function
};
loadOverideableRoles();
}
catch(err) {
catch (err) {
notification.exception(err);
}
})
@ -118,11 +118,11 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function
default:
return;
}
templates.render('core/permissionmanager_role',templatedata)
.done(function (content) {
if (action == 'allow'){
templates.render('core/permissionmanager_role', templatedata)
.done(function(content) {
if (action == 'allow') {
$(content).insertBefore(row.find('.allowmore:first'));
}else if (action == 'prohibit'){
} else if (action == 'prohibit') {
$(content).insertBefore(row.find('.prohibitmore:first'));
// Remove allowed link
var allowedLink = row.find('.allowedroles').first().find('a[data-role-id="' + roleid + '"]');
@ -134,7 +134,7 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function
})
.fail(notification.exception);
}
catch(err) {
catch (err) {
notification.exception(err);
}
})
@ -150,7 +150,7 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function
* @method handleAddRole
* @param {event} e
*/
var handleAddRole = function(e){
var handleAddRole = function(e) {
e.preventDefault();
$('body').one('rolesloaded', function() {
@ -162,8 +162,8 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function
context: contextname
};
var message = M.util.get_string('role' + action + 'info', 'core_role', confirmationDetails);
if (panel === null){
panel = new M.core.dialogue ({
if (panel === null) {
panel = new M.core.dialogue({
draggable: true,
modal: true,
closeButton: true,
@ -175,7 +175,7 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function
var i, existingrolelinks;
var roles = [];
switch (action){
switch (action) {
case 'allow':
existingrolelinks = row.find(SELECTORS.REMOVEROLE);
break;
@ -186,18 +186,18 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function
for (i in overideableroles) {
var disabled = '';
var disable = existingrolelinks.filter("[data-role-id='" + i + "']").length;
if (disable){
if (disable) {
disabled = 'disabled';
}
var roledetails = {roleid:i, rolename: overideableroles[i], disabled:disabled};
var roledetails = {roleid: i, rolename: overideableroles[i], disabled: disabled};
roles.push(roledetails);
}
templates.render('core/permissionmanager_panelcontent',{message:message, roles:roles})
.done(function (content) {
templates.render('core/permissionmanager_panelcontent', {message: message, roles: roles})
.done(function(content) {
panel.set('bodyContent', content);
panel.show();
$('div.role_buttons').delegate('input', 'click',function(e){
$('div.role_buttons').delegate('input', 'click', function(e) {
var roleid = $(e.currentTarget).data('role-id');
changePermissions(row, roleid, action);
});
@ -215,7 +215,7 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function
* @method handleRemoveRole
* @param {event} e
*/
var handleRemoveRole = function(e){
var handleRemoveRole = function(e) {
e.preventDefault();
$('body').one('rolesloaded', function() {
var link = $(e.currentTarget);
@ -229,10 +229,10 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function
};
notification.confirm(M.util.get_string('confirmunassigntitle', 'core_role'),
M.util.get_string('confirmrole' + action, 'core_role',questionDetails),
M.util.get_string('confirmrole' + action, 'core_role', questionDetails),
M.util.get_string('confirmunassignyes', 'core_role'),
M.util.get_string('confirmunassignno', 'core_role'),
function(){
function() {
changePermissions(row, roleid, action);
}
);
@ -248,7 +248,7 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function
* @param {string} contextname
* @param {string} adminurl
*/
initialize : function(args) {
initialize: function(args) {
contextid = args.contextid;
contextname = args.contextname;
adminurl = args.adminurl;

View File

@ -35,10 +35,10 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
// Click handler for changing tag type.
$('body').delegate('.tagarea[data-ta] a[data-quickload=1]', 'click', function(e) {
e.preventDefault();
var target = $( this ),
var target = $(this),
query = target.context.search.replace(/^\?/, ''),
tagarea = target.closest('.tagarea[data-ta]'),
args = query.split('&').reduce(function(s,c){var t=c.split('=');s[t[0]]=decodeURIComponent(t[1]);return s;},{});
args = query.split('&').reduce(function(s, c) { var t = c.split('='); s[t[0]] = decodeURIComponent(t[1]); return s; }, {});
var promises = ajax.call([{
methodname: 'core_tag_get_tagindex',
@ -46,7 +46,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
}], true);
$.when.apply($, promises)
.done( function(data) {
.done(function(data) {
templates.render('core_tag/index', data).done(function(html) {
tagarea.replaceWith(html);
});
@ -81,10 +81,10 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
e.preventDefault();
var href = $(this).attr('href');
str.get_strings([
{key : 'delete'},
{key : 'confirmdeletetag', component : 'tag'},
{key : 'yes'},
{key : 'no'},
{key: 'delete'},
{key: 'confirmdeletetag', component: 'tag'},
{key: 'yes'},
{key: 'no'},
]).done(function(s) {
notification.confirm(s[0], s[1], s[2], s[3], function() {
window.location.href = href;
@ -94,7 +94,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
});
// Confirmation for bulk tag delete button.
$("#tag-management-delete").click(function(e){
$("#tag-management-delete").click(function(e) {
var form = $(this).closest('form').get(0),
cnt = $(form).find("input[type=checkbox]:checked").length;
if (!cnt) {
@ -103,10 +103,10 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
var tempElement = $("<input type='hidden'/>").attr('name', this.name);
e.preventDefault();
str.get_strings([
{key : 'delete'},
{key : 'confirmdeletetags', component : 'tag'},
{key : 'yes'},
{key : 'no'},
{key: 'delete'},
{key: 'confirmdeletetags', component: 'tag'},
{key: 'yes'},
{key: 'no'},
]).done(function(s) {
notification.confirm(s[0], s[1], s[2], s[3], function() {
tempElement.appendTo(form);
@ -117,15 +117,15 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
});
// Confirmation for bulk tag combine button.
$("#tag-management-combine").click(function(e){
$("#tag-management-combine").click(function(e) {
e.preventDefault();
var form = $(this).closest('form').get(0),
tags = $(form).find("input[type=checkbox]:checked");
if (tags.length <= 1) {
str.get_strings([
{key : 'combineselected', component : 'tag'},
{key : 'selectmultipletags', component : 'tag'},
{key : 'ok'},
{key: 'combineselected', component: 'tag'},
{key: 'selectmultipletags', component: 'tag'},
{key: 'ok'},
]).done(function(s) {
notification.alert(s[0], s[1], s[2]);
}
@ -134,14 +134,14 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
}
var tempElement = $("<input type='hidden'/>").attr('name', this.name);
str.get_strings([
{key : 'combineselected', component : 'tag'},
{key : 'selectmaintag', component : 'tag'},
{key : 'continue'},
{key : 'cancel'},
{key: 'combineselected', component: 'tag'},
{key: 'selectmaintag', component: 'tag'},
{key: 'continue'},
{key: 'cancel'},
]).done(function(s) {
var el = $('<div><form id="combinetags_form" class="form-inline">'+
var el = $('<div><form id="combinetags_form" class="form-inline">' +
'<p class="description"></p><p class="options"></p>' +
'<p class="mdl-align"><input type="submit" id="combinetags_submit"/>'+
'<p class="mdl-align"><input type="submit" id="combinetags_submit"/>' +
'<input type="button" id="combinetags_cancel"/></p>' +
'</form></div>');
el.find('.description').html(s[1]);
@ -150,11 +150,11 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
var fldset = el.find('.options');
tags.each(function() {
var tagid = $(this).val(),
tagname = $('.inplaceeditable[data-itemtype=tagname][data-itemid='+tagid+']').attr('data-value');
fldset.append($('<input type="radio" name="maintag" id="combinetags_maintag_'+tagid+'" value="'+tagid+
'"/><label for="combinetags_maintag_'+tagid+'">'+tagname+'</label><br>'));
tagname = $('.inplaceeditable[data-itemtype=tagname][data-itemid=' + tagid + ']').attr('data-value');
fldset.append($('<input type="radio" name="maintag" id="combinetags_maintag_' + tagid + '" value="' + tagid +
'"/><label for="combinetags_maintag_' + tagid + '">' + tagname + '</label><br>'));
});
var panel = new M.core.dialogue ({
var panel = new M.core.dialogue({
draggable: true,
modal: true,
closeButton: true,
@ -184,9 +184,9 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
if (exception.errorcode === 'namesalreadybeeingused') {
e.preventDefault(); // This will prevent default error dialogue.
str.get_strings([
{key : 'nameuseddocombine', component : 'tag'},
{key : 'yes'},
{key : 'cancel'},
{key: 'nameuseddocombine', component: 'tag'},
{key: 'yes'},
{key: 'cancel'},
]).done(function(s) {
notification.confirm(e.message, s[0], s[1], s[2], function() {
window.location.href = window.location.href + "&newname=" + encodeURIComponent(newvalue) +
@ -201,10 +201,10 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
$('body').on('click', 'a[data-action=addstandardtag]', function(e) {
e.preventDefault();
str.get_strings([
{key : 'addotags', component : 'tag'},
{key : 'inputstandardtags', component : 'tag'},
{key : 'continue'},
{key : 'cancel'},
{key: 'addotags', component: 'tag'},
{key: 'inputstandardtags', component: 'tag'},
{key: 'continue'},
{key: 'cancel'},
]).done(function(s) {
var el = $('<div><form id="addtags_form" class="form-inline" method="POST">' +
'<input type="hidden" name="action" value="addstandardtag"/>' +
@ -217,7 +217,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
el.find('#addtags_form').attr('action', window.location.href);
el.find('#addtags_submit').attr('value', s[2]);
el.find('#addtags_cancel').attr('value', s[3]);
var panel = new M.core.dialogue ({
var panel = new M.core.dialogue({
draggable: true,
modal: true,
closeButton: true,
@ -244,12 +244,12 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
areaid, collid, isenabled;
if (ajaxreturn.component === 'core_tag' && ajaxreturn.itemtype === 'tagareaenable') {
areaid = $(this).attr('data-itemid');
$(".tag-collections-table ul[data-collectionid] li[data-areaid="+areaid+"]").addClass('hidden');
$(".tag-collections-table ul[data-collectionid] li[data-areaid=" + areaid + "]").addClass('hidden');
isenabled = ajaxreturn.value;
if (isenabled === '1') {
$(this).closest('tr').removeClass('dimmed_text');
collid = $(this).closest('tr').find('[data-itemtype="tagareacollection"]').attr("data-value");
$(".tag-collections-table ul[data-collectionid="+collid+"] li[data-areaid="+areaid+"]")
$(".tag-collections-table ul[data-collectionid=" + collid + "] li[data-areaid=" + areaid + "]")
.removeClass('hidden');
} else {
$(this).closest('tr').addClass('dimmed_text');
@ -257,11 +257,11 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
}
if (ajaxreturn.component === 'core_tag' && ajaxreturn.itemtype === 'tagareacollection') {
areaid = $(this).attr('data-itemid');
$(".tag-collections-table ul[data-collectionid] li[data-areaid="+areaid+"]").addClass('hidden');
$(".tag-collections-table ul[data-collectionid] li[data-areaid=" + areaid + "]").addClass('hidden');
collid = $(this).attr('data-value');
isenabled = $(this).closest('tr').find('[data-itemtype="tagareaenable"]').attr("data-value");
if (isenabled === "1") {
$(".tag-collections-table ul[data-collectionid="+collid+"] li[data-areaid="+areaid+"]")
$(".tag-collections-table ul[data-collectionid=" + collid + "] li[data-areaid=" + areaid + "]")
.removeClass('hidden');
}
}
@ -271,25 +271,25 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
e.preventDefault();
var href = $(this).attr('data-url') + '&sesskey=' + M.cfg.sesskey;
str.get_strings([
{key : 'addtagcoll', component : 'tag'},
{key : 'name'},
{key : 'searchable', component : 'tag'},
{key : 'create'},
{key : 'cancel'},
{key: 'addtagcoll', component: 'tag'},
{key: 'name'},
{key: 'searchable', component: 'tag'},
{key: 'create'},
{key: 'cancel'},
]).done(function(s) {
var el = $('<div><form id="addtagcoll_form" class="form-inline">'+
var el = $('<div><form id="addtagcoll_form" class="form-inline">' +
'<p><label for="addtagcoll_name"></label>: ' +
'<input id="addtagcoll_name" type="text"/></p>' +
'<p><label for="addtagcoll_searchable"></label>: ' +
'<input id="addtagcoll_searchable" type="checkbox" value="1" checked/></p>' +
'<p class="mdl-align"><input type="submit" id="addtagcoll_submit"/>'+
'<p class="mdl-align"><input type="submit" id="addtagcoll_submit"/>' +
'<input type="button" id="addtagcoll_cancel"/></p>' +
'</form></div>');
el.find('label[for="addtagcoll_name"]').html(s[1]);
el.find('label[for="addtagcoll_searchable"]').html(s[2]);
el.find('#addtagcoll_submit').attr('value', s[3]);
el.find('#addtagcoll_cancel').attr('value', s[4]);
var panel = new M.core.dialogue ({
var panel = new M.core.dialogue({
draggable: true,
modal: true,
closeButton: true,
@ -318,10 +318,10 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
e.preventDefault();
var href = $(this).attr('data-url') + '&sesskey=' + M.cfg.sesskey;
str.get_strings([
{key : 'delete'},
{key : 'suredeletecoll', component : 'tag', param : $(this).attr('data-collname') },
{key : 'yes'},
{key : 'no'},
{key: 'delete'},
{key: 'suredeletecoll', component: 'tag', param: $(this).attr('data-collname') },
{key: 'yes'},
{key: 'no'},
]).done(function(s) {
notification.confirm(s[0], s[1], s[2], s[3], function() {
window.location.href = href;

View File

@ -23,7 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since 2.9
*/
define([ 'core/mustache',
define(['core/mustache',
'jquery',
'core/ajax',
'core/str',
@ -90,7 +90,7 @@ define([ 'core/mustache',
// Oh well - load via ajax.
var promises = ajax.call([{
methodname: 'core_output_load_template',
args:{
args: {
component: component,
template: name,
themename: currentThemeName
@ -98,13 +98,13 @@ define([ 'core/mustache',
}], async, false);
promises[0].done(
function (templateSource) {
function(templateSource) {
storage.set('core_template/' + searchKey, templateSource);
templateCache[searchKey] = templateSource;
deferred.resolve(templateSource);
}
).fail(
function (ex) {
function(ex) {
deferred.reject(ex);
}
);
@ -263,7 +263,7 @@ define([ 'core/mustache',
context.pix = function() { return pixHelper; };
context.js = function() { return jsHelper; };
context.quote = function() { return quoteHelper; };
context.globals = { config : config };
context.globals = { config: config };
context.currentTheme = themeName;
};
@ -414,7 +414,7 @@ define([ 'core/mustache',
*/
var runTemplateJS = function(source) {
if (source.trim() !== '') {
var newscript = $('<script>').attr('type','text/javascript').html(source);
var newscript = $('<script>').attr('type', 'text/javascript').html(source);
$('head').append(newscript);
}
};

View File

@ -69,10 +69,10 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
// We do not allow navigation while ajax requests are pending.
$(document).bind("start-loading-user", function(){
$(document).bind("start-loading-user", function() {
this._isLoading = true;
}.bind(this));
$(document).bind("finish-loading-user", function(){
$(document).bind("finish-loading-user", function() {
this._isLoading = false;
}.bind(this));
};

View File

@ -153,7 +153,7 @@ define(['jquery', 'core/ajax', 'core/notification', 'mod_lti/tool_type', 'mod_lt
var promise = toolType.create({cartridgeurl: url, key: consumerKey, secret: sharedSecret});
promise.done(function() {
str.get_string('successfullycreatedtooltype', 'mod_lti').done(function (s) {
str.get_string('successfullycreatedtooltype', 'mod_lti').done(function(s) {
$(document).trigger(ltiEvents.NEW_TOOL_TYPE);
$(document).trigger(ltiEvents.STOP_CARTRIDGE_REGISTRATION);
$(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, {
@ -161,7 +161,7 @@ define(['jquery', 'core/ajax', 'core/notification', 'mod_lti/tool_type', 'mod_lt
});
}).fail(notification.exception);
}).fail(function() {
str.get_string('failedtocreatetooltype', 'mod_lti').done(function (s) {
str.get_string('failedtocreatetooltype', 'mod_lti').done(function(s) {
$(document).trigger(ltiEvents.NEW_TOOL_TYPE);
$(document).trigger(ltiEvents.STOP_CARTRIDGE_REGISTRATION);
$(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, {

View File

@ -306,7 +306,7 @@ define(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'mod_lti/e
var id = getToolProxyId();
toolProxy.delete(id).done(function() {
promise.resolve();
}).fail(function (failure) {
}).fail(function(failure) {
promise.reject(failure);
});
} else {
@ -317,11 +317,11 @@ define(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'mod_lti/e
// Return to the original page.
finishExternalRegistration();
stopLoadingCancel();
}).fail(function (failure) {
}).fail(function(failure) {
notification.exception(failure);
finishExternalRegistration();
stopLoadingCancel();
str.get_string('failedtodeletetoolproxy', 'mod_lti').done(function (s) {
str.get_string('failedtodeletetoolproxy', 'mod_lti').done(function(s) {
var feedback = {
message: s,
error: true
@ -569,7 +569,7 @@ define(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'mod_lti/e
};
if (data.status == "success") {
str.get_string('successfullycreatedtooltype', 'mod_lti').done(function (s) {
str.get_string('successfullycreatedtooltype', 'mod_lti').done(function(s) {
feedback.message = s;
}).fail(notification.exception);

View File

@ -272,7 +272,7 @@ define(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'mod_lti/t
announceFailure(element);
promise.reject(error);
});
}, function () {
}, function() {
stopLoading(element);
promise.resolve();
});

View File

@ -277,7 +277,7 @@ define(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'mod_lti/e
.fail(promise.reject);
promise.fail(notification.exception)
.always(function () {
.always(function() {
stopLoading(container);
});
};
@ -313,9 +313,9 @@ define(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'mod_lti/e
}
});
promise.fail(function () {
promise.fail(function() {
str.get_string('errorbadurl', 'mod_lti')
.done(function (s) {
.done(function(s) {
$(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, {
message: s,
error: true

View File

@ -205,7 +205,7 @@ define(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'mod_lti/t
announceFailure(element);
promise.reject(error);
});
}, function () {
}, function() {
stopLoading(element);
promise.resolve();
});

View File

@ -45,7 +45,7 @@ define(['jquery', 'core/yui'], function($, Y) {
init: function(startButton, confirmationTitle, confirmationForm, popupoptions) {
var finalStartButton = startButton;
Y.use('moodle-core-notification', 'moodle-core-formchangechecker', 'io-form', function () {
Y.use('moodle-core-notification', 'moodle-core-formchangechecker', 'io-form', function() {
if (Y.one(confirmationForm)) {
t.confirmDialogue = new M.core.dialogue({
headerContent: confirmationTitle,

View File

@ -52,16 +52,16 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/log', 'cor
log.debug('Clicked on cell: competencyId=' + competencyId + ', courseId=' + courseId + ', userId=' + userId);
var requests = ajax.call([{
methodname : 'tool_lp_data_for_user_competency_summary_in_course',
methodname: 'tool_lp_data_for_user_competency_summary_in_course',
args: { userid: userId, competencyid: competencyId, courseid: courseId },
done: this._contextLoaded.bind(this),
fail: notification.exception
}]);
// Log the user competency viewed in course event.
requests[0].then(function(){
requests[0].then(function() {
ajax.call([{
methodname : 'core_competency_user_competency_viewed_in_course',
methodname: 'core_competency_user_competency_viewed_in_course',
args: { userid: userId, competencyid: competencyId, courseid: courseId },
fail: notification.exception
}]);
@ -96,7 +96,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/log', 'cor
var userId = region.data('userid');
ajax.call([{
methodname : 'report_competency_data_for_report',
methodname: 'report_competency_data_for_report',
args: { courseid: courseId, userid: userId },
done: this._pageContextLoaded.bind(this),
fail: notification.exception