From 4474c874016cb005d781f37e969e54c3a5cf7d36 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Tue, 19 Apr 2016 12:15:38 +0800 Subject: [PATCH] MDL-53451 competency: Removing sneaky whitespaces --- .../lp/amd/build/course_competency_settings.min.js | 2 +- admin/tool/lp/amd/src/actionselector.js | 12 ++++++------ admin/tool/lp/amd/src/competencies.js | 2 +- admin/tool/lp/amd/src/course_competency_settings.js | 2 +- admin/tool/lp/amd/src/templateactions.js | 10 +++++----- admin/tool/lp/tests/behat/framework_crud.feature | 6 +++--- report/competency/amd/src/grading_popup.js | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/admin/tool/lp/amd/build/course_competency_settings.min.js b/admin/tool/lp/amd/build/course_competency_settings.min.js index 1b1b54055d3..5fe246e85db 100644 --- a/admin/tool/lp/amd/build/course_competency_settings.min.js +++ b/admin/tool/lp/amd/build/course_competency_settings.min.js @@ -1 +1 @@ -define(["jquery","core/notification","tool_lp/dialogue","core/str","core/ajax","core/templates"],function(a,b,c,d,e,f){var g=function(b){a(b).on("click",this.configureSettings.bind(this))};return g.prototype._dialogue=null,g.prototype.configureSettings=function(e){var g=a(e.target).closest("a").data("courseid"),h=a(e.target).closest("a").data("pushratingstouserplans"),i={courseid:g,settings:{pushratingstouserplans:h}};e.preventDefault(),f.render("tool_lp/course_competency_settings",i).done(function(a){d.get_string("configurecoursecompetencysettings","tool_lp").done(function(b){this._dialogue=new c(b,a,this.addListeners.bind(this))}.bind(this)).fail(b.exception)}.bind(this)).fail(b.exception)},g.prototype.addListeners=function(){var a=this._find('[data-action="save"]');a.on("click",this.saveSettings.bind(this));var b=this._find('[data-action="cancel"]');b.on("click",this.cancelChanges.bind(this))},g.prototype.cancelChanges=function(a){a.preventDefault(),this._dialogue.close()},g.prototype._find=function(b){return a('[data-region="coursecompetencysettings"]').find(b)},g.prototype.saveSettings=function(a){a.preventDefault();var c=this._find('input[name="pushratingstouserplans"]:checked').val(),d=this._find('input[name="courseid"]').val(),f={pushratingstouserplans:c};e.call([{methodname:"core_competency_update_course_competency_settings",args:{courseid:d,settings:f}}])[0].done(function(){this.refreshCourseCompetenciesPage()}.bind(this)).fail(b.exception)},g.prototype.refreshCourseCompetenciesPage=function(){var c=this._find('input[name="courseid"]').val();e.call([{methodname:"tool_lp_data_for_course_competencies_page",args:{courseid:c}}])[0].done(function(c){f.render("tool_lp/course_competencies_page",c).done(function(b,c){a('[data-region="coursecompetenciespage"]').replaceWith(b),f.runTemplateJS(c),this._dialogue.close()}.bind(this)).fail(b.exception)}.bind(this)).fail(b.exception)},g}); +define(["jquery","core/notification","tool_lp/dialogue","core/str","core/ajax","core/templates"],function(a,b,c,d,e,f){var g=function(b){a(b).on("click",this.configureSettings.bind(this))};return g.prototype._dialogue=null,g.prototype.configureSettings=function(e){var g=a(e.target).closest("a").data("courseid"),h=a(e.target).closest("a").data("pushratingstouserplans"),i={courseid:g,settings:{pushratingstouserplans:h}};e.preventDefault(),f.render("tool_lp/course_competency_settings",i).done(function(a){d.get_string("configurecoursecompetencysettings","tool_lp").done(function(b){this._dialogue=new c(b,a,this.addListeners.bind(this))}.bind(this)).fail(b.exception)}.bind(this)).fail(b.exception)},g.prototype.addListeners=function(){var a=this._find('[data-action="save"]');a.on("click",this.saveSettings.bind(this));var b=this._find('[data-action="cancel"]');b.on("click",this.cancelChanges.bind(this))},g.prototype.cancelChanges=function(a){a.preventDefault(),this._dialogue.close()},g.prototype._find=function(b){return a('[data-region="coursecompetencysettings"]').find(b)},g.prototype.saveSettings=function(a){a.preventDefault();var c=this._find('input[name="pushratingstouserplans"]:checked').val(),d=this._find('input[name="courseid"]').val(),f={pushratingstouserplans:c};e.call([{methodname:"core_competency_update_course_competency_settings",args:{courseid:d,settings:f}}])[0].done(function(){this.refreshCourseCompetenciesPage()}.bind(this)).fail(b.exception)},g.prototype.refreshCourseCompetenciesPage=function(){var c=this._find('input[name="courseid"]').val();e.call([{methodname:"tool_lp_data_for_course_competencies_page",args:{courseid:c}}])[0].done(function(c){f.render("tool_lp/course_competencies_page",c).done(function(b,c){a('[data-region="coursecompetenciespage"]').replaceWith(b),f.runTemplateJS(c),this._dialogue.close()}.bind(this)).fail(b.exception)}.bind(this)).fail(b.exception)},g}); \ No newline at end of file diff --git a/admin/tool/lp/amd/src/actionselector.js b/admin/tool/lp/amd/src/actionselector.js index fa65700c27c..d36f06ff29f 100644 --- a/admin/tool/lp/amd/src/actionselector.js +++ b/admin/tool/lp/amd/src/actionselector.js @@ -18,7 +18,7 @@ * * To handle 'save' events use: actionselector.on('save') * This will receive the information to display in popup. - * The actions have the format [{'text': sometext, 'value' : somevalue}] + * The actions have the format [{'text': sometext, 'value' : somevalue}]. * * @package tool_lp * @copyright 2016 Serge Gauthier - @@ -43,7 +43,7 @@ define(['jquery', */ var ActionSelector = function(title, message, actions, confirm, cancel) { var self = this; - + EventBase.prototype.constructor.apply(this, []); self._title = title; self._message = message; @@ -55,7 +55,7 @@ define(['jquery', }; ActionSelector.prototype = Object.create(EventBase.prototype); - + /** @type {String} The value that was selected. */ ActionSelector.prototype._selectedValue = null; /** @type {Dialogue} The reference to the dialogue. */ @@ -170,9 +170,9 @@ define(['jquery', for (var i in self._actions) { choices.push(self._actions[i]); } - var content = {'message': self._message, 'choices' : choices, + var content = {'message': self._message, 'choices' : choices, 'confirm' : self._confirm, 'cancel' : self._cancel}; - + return Templates.render('tool_lp/action_selector', content); }; @@ -183,7 +183,7 @@ define(['jquery', * * @method _reset */ - ActionSelector.prototype._reset = function() { + ActionSelector.prototype._reset = function() { this._popup = null; this._selectedValue = ''; }; diff --git a/admin/tool/lp/amd/src/competencies.js b/admin/tool/lp/amd/src/competencies.js index bf02997eb4e..6e1973ceec0 100644 --- a/admin/tool/lp/amd/src/competencies.js +++ b/admin/tool/lp/amd/src/competencies.js @@ -246,7 +246,7 @@ define(['jquery', /** * Show a confirm dialogue before deleting a competency. - * + * * @method deleteHandler * @param {int} deleteid The id of record to delete. */ diff --git a/admin/tool/lp/amd/src/course_competency_settings.js b/admin/tool/lp/amd/src/course_competency_settings.js index 5ec02f5f7e8..bff7349814e 100644 --- a/admin/tool/lp/amd/src/course_competency_settings.js +++ b/admin/tool/lp/amd/src/course_competency_settings.js @@ -100,7 +100,7 @@ define(['jquery', settingsMod.prototype._find = function(selector) { return $('[data-region="coursecompetencysettings"]').find(selector); }; - + /** * Save the settings. * diff --git a/admin/tool/lp/amd/src/templateactions.js b/admin/tool/lp/amd/src/templateactions.js index 4309ce67dc2..0966cc254d1 100644 --- a/admin/tool/lp/amd/src/templateactions.js +++ b/admin/tool/lp/amd/src/templateactions.js @@ -21,7 +21,7 @@ * @copyright 2015 Damyon Wiese * @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. @@ -30,7 +30,7 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str' /** @var {Number} templateid The id of the template */ var templateid = 0; - + /** @var {Boolean} Action to apply to plans when deleting a template */ var deleteplans = true; @@ -136,14 +136,14 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str' { key: 'confirm', component: 'moodle' }, { key: 'cancel', component: 'moodle' } ]).done(function (strings) { - var actions = [{'text': strings[2], 'value' : 'delete'}, + var actions = [{'text': strings[2], 'value' : 'delete'}, {'text': strings[3], 'value' : 'unlink'}]; var actionselector = new Actionselector( strings[0], // Title. strings[1], // Message actions, // Radio button options. strings[4], // Confirm. - strings[5]); // Cancel. + strings[5]); // Cancel. actionselector.display(); actionselector.on('save', function(e, data) { if (data.action != 'delete') { @@ -168,7 +168,7 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str' doDelete ); }).fail(notification.exception); - } + } }).fail(notification.exception); }).fail(notification.exception); diff --git a/admin/tool/lp/tests/behat/framework_crud.feature b/admin/tool/lp/tests/behat/framework_crud.feature index d984b7d5e0b..a77dcd02ff8 100644 --- a/admin/tool/lp/tests/behat/framework_crud.feature +++ b/admin/tool/lp/tests/behat/framework_crud.feature @@ -73,7 +73,7 @@ Feature: Manage competency frameworks Scenario: Edit a framework with competencies in user competency Given the following lp "frameworks" exist: - | shortname | idnumber | + | shortname | idnumber | | Science Year-5 | sc-y-5 | And the following lp "competencies" exist: | shortname | framework | @@ -87,7 +87,7 @@ Scenario: Edit a framework with competencies in user competency | Plan Science-5 | Comp1 | | Plan Science-5 | Comp2 | And the following lp "usercompetencies" exist: - | user | competency | + | user | competency | | admin | Comp1 | | admin | Comp2 | And I follow "Competency Frameworks" @@ -103,7 +103,7 @@ Scenario: Edit a framework with competencies in user competency Scenario: Edit a framework with competencies in user competency plan Given the following lp "frameworks" exist: - | shortname | idnumber | + | shortname | idnumber | | Science Year-6 | sc-y-6 | And the following lp "competencies" exist: | shortname | framework | diff --git a/report/competency/amd/src/grading_popup.js b/report/competency/amd/src/grading_popup.js index 305f70897ba..38fcce8bb25 100644 --- a/report/competency/amd/src/grading_popup.js +++ b/report/competency/amd/src/grading_popup.js @@ -57,7 +57,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/log', 'cor done: this._contextLoaded.bind(this), fail: notification.exception }]); - + // Log the user competency viewed in course event. requests[0].then(function(){ ajax.call([{