mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-53451 competency: Removing sneaky whitespaces
This commit is contained in:
parent
69c478660a
commit
4474c87401
@ -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});
|
@ -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 - <serge.gauthier.2@umontreal.ca>
|
||||
@ -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 = '';
|
||||
};
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -100,7 +100,7 @@ define(['jquery',
|
||||
settingsMod.prototype._find = function(selector) {
|
||||
return $('[data-region="coursecompetencysettings"]').find(selector);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Save the settings.
|
||||
*
|
||||
|
@ -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.
|
||||
|
||||
@ -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);
|
||||
|
||||
|
@ -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 |
|
||||
|
@ -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([{
|
||||
|
Loading…
x
Reference in New Issue
Block a user