Merge branch 'MDL-54944-master' of git://github.com/danpoltawski/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2016-07-11 16:50:51 +02:00
commit cf7dc57a91
166 changed files with 672 additions and 409 deletions

View File

@ -9,10 +9,10 @@
}, },
'rules': { 'rules': {
// See http://eslint.org/docs/rules/ for all rules and explanations of all // See http://eslint.org/docs/rules/ for all rules and explanations of all
// rules. Commented out rules with 'DEFINE POLICY' are rules Dan P has flagged // rules.
// for discussion and possible enable soon.
// === Possible Errors === // === Possible Errors ===
// DEFINE POLICY: 'comma-dangle': ['off', 'always'], 'comma-dangle': 'off',
'no-cond-assign': 'error', 'no-cond-assign': 'error',
'no-console': 'error', 'no-console': 'error',
'no-constant-condition': 'error', 'no-constant-condition': 'error',
@ -21,7 +21,7 @@
'no-dupe-args': 'error', 'no-dupe-args': 'error',
'no-dupe-keys': 'error', 'no-dupe-keys': 'error',
'no-duplicate-case': 'error', 'no-duplicate-case': 'error',
// Disabled for YUI rollups, enabled by grunt for AMD: 'no-empty': 'error', 'no-empty': 'warn',
'no-empty-character-class': 'error', 'no-empty-character-class': 'error',
'no-ex-assign': 'error', 'no-ex-assign': 'error',
'no-extra-boolean-cast': 'error', 'no-extra-boolean-cast': 'error',
@ -45,18 +45,25 @@
// === Best Practices === // === Best Practices ===
// (these mostly match our jshint config) // (these mostly match our jshint config)
'array-callback-return': 'warn',
'block-scoped-var': 'warn',
'complexity': 'warn',
'consistent-return': 'warn',
'curly': 'error', 'curly': 'error',
'dot-notation': 'warn', 'dot-notation': 'warn',
'no-alert': 'warn', 'no-alert': 'warn',
'no-caller': 'error', 'no-caller': 'error',
'no-case-declarations': 'error', 'no-case-declarations': 'error',
'no-div-regex': 'error',
'no-empty-pattern': 'error', 'no-empty-pattern': 'error',
'no-empty-function': 'warn', 'no-empty-function': 'warn',
//DEFINE POLICY: 'no-eq-null': 'warn', 'no-eq-null': 'error',
'no-eval': 'error', 'no-eval': 'error',
//DEFINE POLICY: 'no-extra-bind': 'warn', 'no-extend-native': 'error',
'no-extra-bind': 'warn',
'no-fallthrough': 'error', 'no-fallthrough': 'error',
//DEFINE POLICY: 'no-implicit-globals': 'warn', 'no-floating-decimal': 'warn',
// Enabled by grunt for AMD modules: 'no-implicit-globals': 'error',
'no-implied-eval': 'error', 'no-implied-eval': 'error',
'no-invalid-this': 'error', 'no-invalid-this': 'error',
'no-iterator': 'error', 'no-iterator': 'error',
@ -67,27 +74,29 @@
'no-native-reassign': 'warn', 'no-native-reassign': 'warn',
'no-new-func': 'error', 'no-new-func': 'error',
'no-new-wrappers': 'error', 'no-new-wrappers': 'error',
// DEFINE POLICY: no-octal: "error" 'no-octal': 'error',
// DEFINE POLICY: no-octal-escape: "error" 'no-octal-escape': 'error',
'no-proto': 'error', 'no-proto': 'error',
'no-redeclare': 'warn', 'no-redeclare': 'warn',
'no-return-assign': 'error', 'no-return-assign': 'error',
'no-script-url': 'error', 'no-script-url': 'error',
'no-self-assign': 'error', 'no-self-assign': 'error',
'no-self-compare': 'error', 'no-self-compare': 'error',
'no-sequences': 'warn',
'no-throw-literal': 'warn',
'no-unmodified-loop-condition': 'error', 'no-unmodified-loop-condition': 'error',
// Disabled for YUI rollups, enabled by grunt for AMD: 'no-unused-expressions': 'error', 'no-unused-expressions': 'error',
'no-unused-labels': 'error', 'no-unused-labels': 'error',
//DEFINE POLICY: 'no-useless-call': 'error', 'no-useless-call': 'warn',
'no-useless-escape': 'warn', 'no-useless-escape': 'warn',
//DEFINE POLICY: 'no-with': 'error', 'no-with': 'error',
'wrap-iife': ['error', 'any'], 'wrap-iife': ['error', 'any'],
// === Variables === // === Variables ===
'no-delete-var': 'error', 'no-delete-var': 'error',
// Disabled for YUI rollups, enabled by grunt for AMD: 'no-undef': 'off', 'no-undef': 'error',
//DEFINE POLICY: 'no-undef-init': 'error', 'no-undef-init': 'error',
// Disabled for YUI rollups, enabled by grunt for AMD: 'no-unused-vars': 'error', 'no-unused-vars': ['error', { 'caughtErrors': 'none', 'argsIgnorePattern': "(e|event)" }],
// === Stylistic Issues === // === Stylistic Issues ===
'array-bracket-spacing': 'warn', 'array-bracket-spacing': 'warn',
@ -109,17 +118,16 @@
'lines-around-comment': 'off', 'lines-around-comment': 'off',
'max-len': ['error', 132], 'max-len': ['error', 132],
'max-lines': 'off', 'max-lines': 'off',
// DEFINE POLICY: turn on some of these max values? 'max-depth': 'warn',
'max-depth': 'off', 'max-nested-callbacks': ['warn', 5],
'max-nested-callbacks': 'off',
'max-params': 'off', 'max-params': 'off',
'max-statements': 'off', 'max-statements': 'off',
'max-statements-per-line': 'off', 'max-statements-per-line': ['warn', { max: 2 }],
'new-cap': ['warn', { 'properties': false }], 'new-cap': ['warn', { 'properties': false }],
'new-parens': 'warn', 'new-parens': 'warn',
'newline-after-var': 'off', 'newline-after-var': 'off',
'newline-before-return': 'off', 'newline-before-return': 'off',
// REVIST POLICY: 'newline-per-chained-call': 'warn', 'newline-per-chained-call': 'off',
'no-array-constructor': 'off', 'no-array-constructor': 'off',
'no-bitwise': 'error', 'no-bitwise': 'error',
'no-continue': 'off', 'no-continue': 'off',
@ -136,17 +144,17 @@
'no-ternary': 'off', 'no-ternary': 'off',
'no-trailing-spaces': 'error', 'no-trailing-spaces': 'error',
'no-underscore-dangle': 'off', 'no-underscore-dangle': 'off',
// DEFINE POLICY: 'no-unneeded-ternary': 'off', 'no-unneeded-ternary': 'off',
'no-whitespace-before-property': 'warn', 'no-whitespace-before-property': 'warn',
// DEFINE POLICY: 'object-curly-newline': 'off, 'object-curly-newline': 'off',
// DEFINE POLICY: 'object-curly-spacing': 'off', 'object-curly-spacing': 'warn',
// DEFINE POLICY: 'object-property-newline': 'off', 'object-property-newline': 'off',
'one-var': 'off', 'one-var': 'off',
// DEFINE POLICY: 'one-var-declaration-per-line': 'off', 'one-var-declaration-per-line': ['warn', 'initializations'],
'operator-assignment': 'off', 'operator-assignment': 'off',
'operator-linebreak': 'off', 'operator-linebreak': 'off',
'padded-blocks': 'off', 'padded-blocks': 'off',
// DEFINE POLICY: 'quote-props': 'off', 'quote-props': ['warn', 'as-needed', {'unnecessary': false, 'keywords': true, 'numbers': true}],
'quotes': 'off', 'quotes': 'off',
'require-jsdoc': 'warn', 'require-jsdoc': 'warn',
'semi': 'error', 'semi': 'error',

View File

@ -104,18 +104,26 @@ module.exports = function(grunt) {
eslint: { eslint: {
// Even though warnings dont stop the build we don't display warnings by default because // Even though warnings dont stop the build we don't display warnings by default because
// at this moment we've got too many core warnings. // at this moment we've got too many core warnings.
options: { quiet: !grunt.option('show-lint-warnings') }, options: {quiet: !grunt.option('show-lint-warnings')},
// Check AMD files. We add some stricter rules which we can't apply to the default configuration due
// to YUI rollups.
amd: { amd: {
src: amdSrc, src: amdSrc,
options: { // Check AMD with some slightly stricter rules.
rules: {'no-undef': 'error', 'no-unused-vars': 'error', 'no-empty': 'error', 'no-unused-expressions': 'error'} rules: {
'no-unused-vars': 'error',
'no-implicit-globals': 'error'
} }
}, },
// Check YUI module source files. // Check YUI module source files.
yui: { yui: {
src: ['**/yui/src/**/*.js', '!*/**/yui/src/*/meta/*.js'], src: ['**/yui/src/**/*.js', '!*/**/yui/src/*/meta/*.js'],
options: {
// Disable some rules which we can't safely define for YUI rollups.
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
'no-unused-expressions': 'off'
}
}
} }
}, },
uglify: { uglify: {

View File

@ -1 +1 @@
define(["jquery","core/notification","core/ajax","core/templates","tool_lp/dialogue","tool_lp/event_base"],function(a,b,c,d,e,f){var g=function(a,b,c,d,e){var g=this;f.prototype.constructor.apply(this,[]),g._title=a,g._message=b,g._actions=c,g._confirm=d,g._cancel=e,g._selectedValue=null,g._reset()};return g.prototype=Object.create(f.prototype),g.prototype._selectedValue=null,g.prototype._popup=null,g.prototype._title=null,g.prototype._message=null,g.prototype._actions=null,g.prototype._confirm=null,g.prototype._cancel=null,g.prototype._afterRender=function(){var b=this;b._find('[data-action="action-selector-confirm"]').attr("disabled","disabled"),b._find('[data-region="action-selector-radio-buttons"]').change(function(){b._selectedValue=a("input[type='radio']:checked").val(),b._find('[data-action="action-selector-confirm"]').removeAttr("disabled"),b._refresh.bind(b)}.bind(b)),b._find('[data-action="action-selector-cancel"]').click(function(a){a.preventDefault(),b.close()}.bind(b)),b._find('[data-action="action-selector-confirm"]').click(function(a){a.preventDefault(),b._selectedValue.length&&(b._trigger("save",{action:b._selectedValue}),b.close())}.bind(b))},g.prototype.close=function(){var a=this;a._popup.close(),a._reset()},g.prototype.display=function(){var a=this;return a._render().then(function(b){a._popup=new e(a._title,b,a._afterRender.bind(a))}.bind(a)).fail(b.exception)},g.prototype._find=function(b){return a(this._popup.getContent()).find(b)},g.prototype._refresh=function(){var a=this;return a._render().then(function(b){a._find('[data-region="action-selector"]').replaceWith(b),a._afterRender()}.bind(a))},g.prototype._render=function(){var a=this,b=[];for(var c in a._actions)b.push(a._actions[c]);var e={message:a._message,choices:b,confirm:a._confirm,cancel:a._cancel};return d.render("tool_lp/action_selector",e)},g.prototype._reset=function(){this._popup=null,this._selectedValue=""},g}); define(["jquery","core/notification","core/ajax","core/templates","tool_lp/dialogue","tool_lp/event_base"],function(a,b,c,d,e,f){var g=function(a,b,c,d,e){var g=this;f.prototype.constructor.apply(this,[]),g._title=a,g._message=b,g._actions=c,g._confirm=d,g._cancel=e,g._selectedValue=null,g._reset()};return g.prototype=Object.create(f.prototype),g.prototype._selectedValue=null,g.prototype._popup=null,g.prototype._title=null,g.prototype._message=null,g.prototype._actions=null,g.prototype._confirm=null,g.prototype._cancel=null,g.prototype._afterRender=function(){var b=this;b._find('[data-action="action-selector-confirm"]').attr("disabled","disabled"),b._find('[data-region="action-selector-radio-buttons"]').change(function(){b._selectedValue=a("input[type='radio']:checked").val(),b._find('[data-action="action-selector-confirm"]').removeAttr("disabled"),b._refresh.bind(b)}),b._find('[data-action="action-selector-cancel"]').click(function(a){a.preventDefault(),b.close()}),b._find('[data-action="action-selector-confirm"]').click(function(a){a.preventDefault(),b._selectedValue.length&&(b._trigger("save",{action:b._selectedValue}),b.close())})},g.prototype.close=function(){var a=this;a._popup.close(),a._reset()},g.prototype.display=function(){var a=this;return a._render().then(function(b){a._popup=new e(a._title,b,a._afterRender.bind(a))}).fail(b.exception)},g.prototype._find=function(b){return a(this._popup.getContent()).find(b)},g.prototype._refresh=function(){var a=this;return a._render().then(function(b){a._find('[data-region="action-selector"]').replaceWith(b),a._afterRender()})},g.prototype._render=function(){var a=this,b=[];for(var c in a._actions)b.push(a._actions[c]);var e={message:a._message,choices:b,confirm:a._confirm,cancel:a._cancel};return d.render("tool_lp/action_selector",e)},g.prototype._reset=function(){this._popup=null,this._selectedValue=""},g});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
define(["jquery","core/notification","core/ajax","core/templates","core/str","tool_lp/tree","tool_lp/competencypicker"],function(a,b,c,d,e,f,g){var h=function(a,b,c){g.prototype.constructor.apply(this,[1,!1,"self",c]),this._userId=a,this._plans=[],b&&(this._planId=b,this._singlePlan=!0)};return h.prototype=Object.create(g.prototype),h.prototype._plans=null,h.prototype._planId=null,h.prototype._singlePlan=!1,h.prototype._userId=null,h.prototype._afterRender=function(){var b=this;g.prototype._afterRender.apply(b,arguments),b._singlePlan||b._find('[data-action="chooseplan"]').change(function(c){b._planId=a(c.target).val(),b._loadCompetencies().then(b._refresh.bind(b))}.bind(b))},h.prototype._fetchCompetencies=function(a,d){var e=this;return c.call([{methodname:"core_competency_list_plan_competencies",args:{id:a}}])[0].done(function(a){var b,c,f=[];for(b=0;b<a.length;b++)c=a[b].competency,c.shortname.toLowerCase().indexOf(d.toLowerCase())<0||(c.children=[],c.haschildren=0,f.push(c));e._competencies=f}).fail(b.exception)},h.prototype._getPlan=function(b){var c;return a.each(this._plans,function(a,d){return d.id==b?(c=d,!1):void 0}),c},h.prototype._loadCompetencies=function(){return this._fetchCompetencies(this._planId,this._searchText)},h.prototype._loadPlans=function(){var d,e=this;return e._plans.length>0?a.when():(d=e._singlePlan?c.call([{methodname:"core_competency_read_plan",args:{id:this._planId}}])[0].then(function(a){return[a]}):c.call([{methodname:"core_competency_list_user_plans",args:{userid:e._userId}}])[0],d.done(function(a){e._plans=a}).fail(b.exception))},h.prototype._preRender=function(){var b=this;return b._loadPlans().then(function(){return!b._planId&&b._plans.length>0&&(b._planId=b._plans[0].id),b._planId?b._loadCompetencies():(b._plans=[],a.when())}.bind(b))},h.prototype._render=function(){var b=this;return b._preRender().then(function(){b._singlePlan||a.each(b._plans,function(a,c){c.id==b._planId?c.selected=!0:c.selected=!1});var c={competencies:b._competencies,plan:b._getPlan(b._planId),plans:b._plans,search:b._searchText,singlePlan:b._singlePlan};return d.render("tool_lp/competency_picker_user_plans",c)}.bind(b))},h}); define(["jquery","core/notification","core/ajax","core/templates","core/str","tool_lp/tree","tool_lp/competencypicker"],function(a,b,c,d,e,f,g){var h=function(a,b,c){g.prototype.constructor.apply(this,[1,!1,"self",c]),this._userId=a,this._plans=[],b&&(this._planId=b,this._singlePlan=!0)};return h.prototype=Object.create(g.prototype),h.prototype._plans=null,h.prototype._planId=null,h.prototype._singlePlan=!1,h.prototype._userId=null,h.prototype._afterRender=function(){var b=this;g.prototype._afterRender.apply(b,arguments),b._singlePlan||b._find('[data-action="chooseplan"]').change(function(c){b._planId=a(c.target).val(),b._loadCompetencies().then(b._refresh.bind(b))})},h.prototype._fetchCompetencies=function(a,d){var e=this;return c.call([{methodname:"core_competency_list_plan_competencies",args:{id:a}}])[0].done(function(a){var b,c,f=[];for(b=0;b<a.length;b++)c=a[b].competency,c.shortname.toLowerCase().indexOf(d.toLowerCase())<0||(c.children=[],c.haschildren=0,f.push(c));e._competencies=f}).fail(b.exception)},h.prototype._getPlan=function(b){var c;return a.each(this._plans,function(a,d){return d.id==b?void(c=d):void 0}),c},h.prototype._loadCompetencies=function(){return this._fetchCompetencies(this._planId,this._searchText)},h.prototype._loadPlans=function(){var d,e=this;return e._plans.length>0?a.when():(d=e._singlePlan?c.call([{methodname:"core_competency_read_plan",args:{id:this._planId}}])[0].then(function(a){return[a]}):c.call([{methodname:"core_competency_list_user_plans",args:{userid:e._userId}}])[0],d.done(function(a){e._plans=a}).fail(b.exception))},h.prototype._preRender=function(){var b=this;return b._loadPlans().then(function(){return!b._planId&&b._plans.length>0&&(b._planId=b._plans[0].id),b._planId?b._loadCompetencies():(b._plans=[],a.when())})},h.prototype._render=function(){var b=this;return b._preRender().then(function(){b._singlePlan||a.each(b._plans,function(a,c){c.id==b._planId?c.selected=!0:c.selected=!1});var c={competencies:b._competencies,plan:b._getPlan(b._planId),plans:b._plans,search:b._searchText,singlePlan:b._singlePlan};return d.render("tool_lp/competency_picker_user_plans",c)})},h});

View File

@ -1 +1 @@
define(["jquery","core/notification","core/templates","tool_lp/dialogue","tool_lp/competency_outcomes","core/str"],function(a,b,c,d,e,f){var g=function(b,c){this._eventNode=a("<div></div>"),this._tree=b,this._rulesModules=c,this._setUp()};return g.prototype._competency=null,g.prototype._eventNode=null,g.prototype._outcomesOption=null,g.prototype._popup=null,g.prototype._ready=null,g.prototype._rules=null,g.prototype._rulesModules=null,g.prototype._tree=null,g.prototype._afterChange=function(){this._isValid()?this._find('[data-action="save"]').prop("disabled",!1):this._find('[data-action="save"]').prop("disabled",!0)},g.prototype._afterRuleConfigChange=function(a,b){b==this._getRule()&&this._afterChange()},g.prototype._afterRender=function(){var a=this;a._find('[name="outcome"]').on("change",function(){a._switchedOutcome()}).trigger("change"),a._find('[name="rule"]').on("change",function(){a._switchedRule()}).trigger("change"),a._find('[data-action="save"]').on("click",function(){a._trigger("save",a._getConfig()),a.close()}),a._find('[data-action="cancel"]').on("click",function(){a.close()})},g.prototype.canBeConfigured=function(){var b=!1;return a.each(this._rules,function(a,c){return c.canConfig()?(b=!0,!1):void 0}),b},g.prototype.close=function(){this._popup.close(),this._popup=null},g.prototype.display=function(){var a=this;if(a._competency)return a._render().then(function(b){return f.get_string("competencyrule","tool_lp").then(function(c){a._popup=new d(c,b,a._afterRender.bind(a))})}).fail(b.exception)},g.prototype._find=function(b){return a(this._popup.getContent()).find(b)},g.prototype._getApplicableOutcomesOptions=function(){var b=this,c=[];return a.each(b._outcomesOption,function(a,d){c.push({code:d.code,name:d.name,selected:d.code==b._competency.ruleoutcome?!0:!1})}),c},g.prototype._getApplicableRulesOptions=function(){var b=this,c=[];return a.each(b._rules,function(a,d){d.canConfig()&&c.push({name:b._getRuleName(d.getType()),type:d.getType(),selected:d.getType()==b._competency.ruletype?!0:!1})}),c},g.prototype._getConfig=function(){var a=this._getRule();return{ruletype:a?a.getType():null,ruleconfig:a?a.getConfig():null,ruleoutcome:this._getOutcome()}},g.prototype._getOutcome=function(){return this._find('[name="outcome"]').val()},g.prototype._getRule=function(){var b,c=this._find('[name="rule"]').val();return a.each(this._rules,function(a,d){return d.getType()==c?(b=d,!1):void 0}),b},g.prototype._getRuleName=function(b){var c,d=this;return a.each(d._rulesModules,function(a,d){return d.type==b?(c=d.name,!1):void 0}),c},g.prototype._initOutcomes=function(){var a=this;return e.getAll().then(function(b){a._outcomesOption=b})},g.prototype._initRules=function(){var b=this,c=[];return a.each(b._rules,function(d,e){var f=e.init().then(function(){e.setTargetCompetency(b._competency),e.on("change",b._afterRuleConfigChange.bind(b))},function(){return b._rules.splice(d,1),a.when()});c.push(f)}),a.when.apply(a.when,c)},g.prototype._isValid=function(){var a=this._getOutcome(),b=this._getRule();return a==e.NONE?!0:b?b.isValid():!1},g.prototype.on=function(a,b){this._eventNode.on(a,b)},g.prototype._preRender=function(){return this.ready()},g.prototype.ready=function(){return this._ready.promise()},g.prototype._render=function(){var a=this;return this._preRender().then(function(){var b;a.canBeConfigured()?(b={},b.outcomes=a._getApplicableOutcomesOptions(),b.rules=a._getApplicableRulesOptions()):b=!1;var d={competencyshortname:a._competency.shortname,config:b};return c.render("tool_lp/competency_rule_config",d)})},g.prototype.setTargetCompetencyId=function(b){var c=this;c._competency=c._tree.getCompetency(b),a.each(c._rules,function(a,b){b.setTargetCompetency(c._competency)})},g.prototype._setUp=function(){var b=this,c=[],d=[];b._ready=a.Deferred(),b._rules=[],a.each(b._rulesModules,function(a,b){d.push(b.amd)}),require(d,function(){a.each(arguments,function(a,c){var d=new c(b._tree);b._rules.push(d)}),c.push(b._initRules()),c.push(b._initOutcomes()),a.when.apply(a.when,c).always(function(){b._ready.resolve()})})},g.prototype._switchedOutcome=function(){var a=this,b=a._getOutcome();return b==e.NONE?(a._find('[data-region="rule-type"]').hide().find('[name="rule"]').val(-1),a._find('[data-region="rule-config"]').empty().hide(),void a._afterChange()):(a._find('[data-region="rule-type"]').show(),a._find('[data-region="rule-config"]').show(),void a._afterChange())},g.prototype._switchedRule=function(){var a=this,b=a._find('[data-region="rule-config"]'),c=a._getRule();return c?void c.injectTemplate(b).then(function(){b.show()},function(){b.empty().hide()}).always(function(){a._afterChange()}):(b.empty().hide(),void a._afterChange())},g.prototype._trigger=function(a,b){this._eventNode.trigger(a,[b])},g}); define(["jquery","core/notification","core/templates","tool_lp/dialogue","tool_lp/competency_outcomes","core/str"],function(a,b,c,d,e,f){var g=function(b,c){this._eventNode=a("<div></div>"),this._tree=b,this._rulesModules=c,this._setUp()};return g.prototype._competency=null,g.prototype._eventNode=null,g.prototype._outcomesOption=null,g.prototype._popup=null,g.prototype._ready=null,g.prototype._rules=null,g.prototype._rulesModules=null,g.prototype._tree=null,g.prototype._afterChange=function(){this._isValid()?this._find('[data-action="save"]').prop("disabled",!1):this._find('[data-action="save"]').prop("disabled",!0)},g.prototype._afterRuleConfigChange=function(a,b){b==this._getRule()&&this._afterChange()},g.prototype._afterRender=function(){var a=this;a._find('[name="outcome"]').on("change",function(){a._switchedOutcome()}).trigger("change"),a._find('[name="rule"]').on("change",function(){a._switchedRule()}).trigger("change"),a._find('[data-action="save"]').on("click",function(){a._trigger("save",a._getConfig()),a.close()}),a._find('[data-action="cancel"]').on("click",function(){a.close()})},g.prototype.canBeConfigured=function(){var b=!1;return a.each(this._rules,function(a,c){return c.canConfig()?void(b=!0):void 0}),b},g.prototype.close=function(){this._popup.close(),this._popup=null},g.prototype.display=function(){var a=this;return a._competency?a._render().then(function(b){return f.get_string("competencyrule","tool_lp").then(function(c){a._popup=new d(c,b,a._afterRender.bind(a))})}).fail(b.exception):!1},g.prototype._find=function(b){return a(this._popup.getContent()).find(b)},g.prototype._getApplicableOutcomesOptions=function(){var b=this,c=[];return a.each(b._outcomesOption,function(a,d){c.push({code:d.code,name:d.name,selected:d.code==b._competency.ruleoutcome?!0:!1})}),c},g.prototype._getApplicableRulesOptions=function(){var b=this,c=[];return a.each(b._rules,function(a,d){d.canConfig()&&c.push({name:b._getRuleName(d.getType()),type:d.getType(),selected:d.getType()==b._competency.ruletype?!0:!1})}),c},g.prototype._getConfig=function(){var a=this._getRule();return{ruletype:a?a.getType():null,ruleconfig:a?a.getConfig():null,ruleoutcome:this._getOutcome()}},g.prototype._getOutcome=function(){return this._find('[name="outcome"]').val()},g.prototype._getRule=function(){var b,c=this._find('[name="rule"]').val();return a.each(this._rules,function(a,d){return d.getType()==c?void(b=d):void 0}),b},g.prototype._getRuleName=function(b){var c,d=this;return a.each(d._rulesModules,function(a,d){return d.type==b?void(c=d.name):void 0}),c},g.prototype._initOutcomes=function(){var a=this;return e.getAll().then(function(b){a._outcomesOption=b})},g.prototype._initRules=function(){var b=this,c=[];return a.each(b._rules,function(d,e){var f=e.init().then(function(){e.setTargetCompetency(b._competency),e.on("change",b._afterRuleConfigChange.bind(b))},function(){return b._rules.splice(d,1),a.when()});c.push(f)}),a.when.apply(a.when,c)},g.prototype._isValid=function(){var a=this._getOutcome(),b=this._getRule();return a==e.NONE?!0:b?b.isValid():!1},g.prototype.on=function(a,b){this._eventNode.on(a,b)},g.prototype._preRender=function(){return this.ready()},g.prototype.ready=function(){return this._ready.promise()},g.prototype._render=function(){var a=this;return this._preRender().then(function(){var b;a.canBeConfigured()?(b={},b.outcomes=a._getApplicableOutcomesOptions(),b.rules=a._getApplicableRulesOptions()):b=!1;var d={competencyshortname:a._competency.shortname,config:b};return c.render("tool_lp/competency_rule_config",d)})},g.prototype.setTargetCompetencyId=function(b){var c=this;c._competency=c._tree.getCompetency(b),a.each(c._rules,function(a,b){b.setTargetCompetency(c._competency)})},g.prototype._setUp=function(){var b=this,c=[],d=[];b._ready=a.Deferred(),b._rules=[],a.each(b._rulesModules,function(a,b){d.push(b.amd)}),require(d,function(){a.each(arguments,function(a,c){var d=new c(b._tree);b._rules.push(d)}),c.push(b._initRules()),c.push(b._initOutcomes()),a.when.apply(a.when,c).always(function(){b._ready.resolve()})})},g.prototype._switchedOutcome=function(){var a=this,b=a._getOutcome();return b==e.NONE?(a._find('[data-region="rule-type"]').hide().find('[name="rule"]').val(-1),a._find('[data-region="rule-config"]').empty().hide(),void a._afterChange()):(a._find('[data-region="rule-type"]').show(),a._find('[data-region="rule-config"]').show(),void a._afterChange())},g.prototype._switchedRule=function(){var a=this,b=a._find('[data-region="rule-config"]'),c=a._getRule();return c?void c.injectTemplate(b).then(function(){b.show()},function(){b.empty().hide()}).always(function(){a._afterChange()}):(b.empty().hide(),void a._afterChange())},g.prototype._trigger=function(a,b){this._eventNode.trigger(a,[b])},g});

View File

@ -1 +1 @@
define(["jquery","core/notification","core/ajax","core/log","tool_lp/grade_dialogue","tool_lp/event_base","tool_lp/scalevalues"],function(a,b,c,d,e,f,g){var h=function(b,c,d,e,g,h,i){f.prototype.constructor.apply(this,[]);var j=a(b);if(!j.length)throw new Error("Could not find the trigger");this._scaleId=c,this._competencyId=d,this._userId=e,this._planId=g,this._courseId=h,this._chooseStr=i,this._setUp(),j.click(function(a){a.preventDefault(),this._dialogue.display()}.bind(this)),this._planId?(this._methodName="core_competency_grade_competency_in_plan",this._args={competencyid:this._competencyId,planid:this._planId}):this._courseId?(this._methodName="core_competency_grade_competency_in_course",this._args={competencyid:this._competencyId,courseid:this._courseId,userid:this._userId}):(this._methodName="core_competency_grade_competency",this._args={userid:this._userId,competencyid:this._competencyId})};return h.prototype=Object.create(f.prototype),h.prototype._setUp=function(){var a=[],d=this,f=g.get_values(d._scaleId);f.done(function(f){a.push({value:"",name:d._chooseStr});for(var g=0;g<f.length;g++){var h=f[g];a.push({value:h.id,name:h.name})}d._dialogue=new e(a),d._dialogue.on("rated",function(a,e){var f=d._args;f.grade=e.rating,f.note=e.note,c.call([{methodname:d._methodName,args:f,done:function(a){d._trigger("competencyupdated",{args:f,evidence:a})}.bind(d),fail:b.exception}])}.bind(d))}).fail(b.exception)},h.prototype._scaleId=null,h.prototype._competencyId=null,h.prototype._userId=null,h.prototype._planId=null,h.prototype._courseId=null,h.prototype._chooseStr=null,h.prototype._dialogue=null,h}); define(["jquery","core/notification","core/ajax","core/log","tool_lp/grade_dialogue","tool_lp/event_base","tool_lp/scalevalues"],function(a,b,c,d,e,f,g){var h=function(b,c,d,e,g,h,i){f.prototype.constructor.apply(this,[]);var j=a(b);if(!j.length)throw new Error("Could not find the trigger");this._scaleId=c,this._competencyId=d,this._userId=e,this._planId=g,this._courseId=h,this._chooseStr=i,this._setUp(),j.click(function(a){a.preventDefault(),this._dialogue.display()}.bind(this)),this._planId?(this._methodName="core_competency_grade_competency_in_plan",this._args={competencyid:this._competencyId,planid:this._planId}):this._courseId?(this._methodName="core_competency_grade_competency_in_course",this._args={competencyid:this._competencyId,courseid:this._courseId,userid:this._userId}):(this._methodName="core_competency_grade_competency",this._args={userid:this._userId,competencyid:this._competencyId})};return h.prototype=Object.create(f.prototype),h.prototype._setUp=function(){var a=[],d=this,f=g.get_values(d._scaleId);f.done(function(f){a.push({value:"",name:d._chooseStr});for(var g=0;g<f.length;g++){var h=f[g];a.push({value:h.id,name:h.name})}d._dialogue=new e(a),d._dialogue.on("rated",function(a,e){var f=d._args;f.grade=e.rating,f.note=e.note,c.call([{methodname:d._methodName,args:f,done:function(a){d._trigger("competencyupdated",{args:f,evidence:a})},fail:b.exception}])})}).fail(b.exception)},h.prototype._scaleId=null,h.prototype._competencyId=null,h.prototype._userId=null,h.prototype._planId=null,h.prototype._courseId=null,h.prototype._chooseStr=null,h.prototype._dialogue=null,h});

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
define(["jquery","core/ajax","core/str","tool_lp/competencypicker","core/templates","core/notification"],function(a,b,c,d,e,f){var g=function(a,b,c,d,e){this.buttonSelector=a,this.inputHiddenSelector=b,this.staticElementSelector=c,this.frameworkId=d,this.pageContextId=e,this.registerEvents()};return g.prototype.buttonSelector=null,g.prototype.inputHiddenSelector=null,g.prototype.staticElementSelector=null,g.prototype.frameworkId=null,g.prototype.pageContextId=null,g.prototype.setParent=function(d){var e=this;0!==d.competencyId?b.call([{methodname:"core_competency_read_competency",args:{id:d.competencyId}}])[0].done(function(b){a(e.staticElementSelector).html(b.shortname),a(e.inputHiddenSelector).val(b.id)}).fail(f.exception):c.get_string("competencyframeworkroot","tool_lp").then(function(b){a(e.staticElementSelector).html(b),a(e.inputHiddenSelector).val(d.competencyId)}).fail(f.exception)},g.prototype.registerEvents=function(){var b=this;a(b.buttonSelector).on("click",function(a){a.preventDefault();var c=new d(b.pageContextId,b.frameworkId,"self",!1);c._render=function(){var a=this;return a._preRender().then(function(){var b={competencies:a._competencies,framework:a._getFramework(a._frameworkId),frameworks:a._frameworks,search:a._searchText,singleFramework:a._singleFramework};return e.render("tool_lp/competency_picker_competencyform",b)}.bind(a))},c.on("save",function(a,c){b.setParent(c)}.bind(b)),c.display()})},{init:function(a,b,c,d,e){new g(a,b,c,d,e)}}}); define(["jquery","core/ajax","core/str","tool_lp/competencypicker","core/templates","core/notification"],function(a,b,c,d,e,f){var g=function(a,b,c,d,e){this.buttonSelector=a,this.inputHiddenSelector=b,this.staticElementSelector=c,this.frameworkId=d,this.pageContextId=e,this.registerEvents()};return g.prototype.buttonSelector=null,g.prototype.inputHiddenSelector=null,g.prototype.staticElementSelector=null,g.prototype.frameworkId=null,g.prototype.pageContextId=null,g.prototype.setParent=function(d){var e=this;0!==d.competencyId?b.call([{methodname:"core_competency_read_competency",args:{id:d.competencyId}}])[0].done(function(b){a(e.staticElementSelector).html(b.shortname),a(e.inputHiddenSelector).val(b.id)}).fail(f.exception):c.get_string("competencyframeworkroot","tool_lp").then(function(b){a(e.staticElementSelector).html(b),a(e.inputHiddenSelector).val(d.competencyId)}).fail(f.exception)},g.prototype.registerEvents=function(){var b=this;a(b.buttonSelector).on("click",function(a){a.preventDefault();var c=new d(b.pageContextId,b.frameworkId,"self",!1);c._render=function(){var a=this;return a._preRender().then(function(){var b={competencies:a._competencies,framework:a._getFramework(a._frameworkId),frameworks:a._frameworks,search:a._searchText,singleFramework:a._singleFramework};return e.render("tool_lp/competency_picker_competencyform",b)})},c.on("save",function(a,c){b.setParent(c)}),c.display()})},{init:function(a,b,c,d,e){new g(a,b,c,d,e)}}});

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
define(["jquery","core/notification","core/templates","core/ajax","tool_lp/dialogue","tool_lp/scalevalues"],function(a,b,c,d,e,f){var g=function(b,c,d){this.selectSelector=b,this.inputSelector=c,this.triggerSelector=d,this.originalscaleid=a(b).val(),a(b).on("change",this.scaleChangeHandler.bind(this)).change(),a(d).click(this.showConfig.bind(this))};return g.prototype.selectSelector=null,g.prototype.inputSelector=null,g.prototype.triggerSelector=null,g.prototype.scalevalues=null,g.prototype.originalscaleid=0,g.prototype.scaleid=0,g.prototype.popup=null,g.prototype.showConfig=function(){var d=this;if(this.scaleid=a(this.selectSelector).val(),!(this.scaleid<=0)){var f=a(this.selectSelector).find("option:selected").text();this.getScaleValues(this.scaleid).done(function(){var a={scalename:f,scales:d.scalevalues};c.render("tool_lp/scale_configuration_page",a).done(function(a){new e(f,a,d.initScaleConfig.bind(d))}).fail(b.exception)}).fail(b.exception)}},g.prototype.retrieveOriginalScaleConfig=function(){var b=a(this.inputSelector).val();if(""!==b){var c=a.parseJSON(b),d=c.shift();if(d.scaleid===this.originalscaleid)return c}return""},g.prototype.initScaleConfig=function(b){this.popup=b;var c=a(b.getContent());if(this.originalscaleid===this.scaleid){var d=this.retrieveOriginalScaleConfig();""!==d&&d.forEach(function(a){1===a.scaledefault&&c.find('[data-field="tool_lp_scale_default_'+a.id+'"]').attr("checked",!0),1===a.proficient&&c.find('[data-field="tool_lp_scale_proficient_'+a.id+'"]').attr("checked",!0)})}c.on("click",'[data-action="close"]',function(){this.setScaleConfig(),b.close()}.bind(this)),c.on("click",'[data-action="cancel"]',function(){b.close()}.bind(this))},g.prototype.setScaleConfig=function(){var b=a(this.popup.getContent()),c=[{scaleid:this.scaleid}];this.scalevalues.forEach(function(a){var d=0,e=0;b.find('[data-field="tool_lp_scale_default_'+a.id+'"]').is(":checked")&&(d=1),b.find('[data-field="tool_lp_scale_proficient_'+a.id+'"]').is(":checked")&&(e=1),(d||e)&&c.push({id:a.id,scaledefault:d,proficient:e})});var d=JSON.stringify(c);a(this.inputSelector).val(d),this.originalscaleid=this.scaleid},g.prototype.getScaleValues=function(a){return f.get_values(a).then(function(a){return this.scalevalues=a,a}.bind(this))},g.prototype.scaleChangeHandler=function(b){a(b.target).val()<=0?a(this.triggerSelector).prop("disabled",!0):a(this.triggerSelector).prop("disabled",!1)},{init:function(a,b,c){return new g(a,b,c)}}}); define(["jquery","core/notification","core/templates","core/ajax","tool_lp/dialogue","tool_lp/scalevalues"],function(a,b,c,d,e,f){var g=function(b,c,d){this.selectSelector=b,this.inputSelector=c,this.triggerSelector=d,this.originalscaleid=a(b).val(),a(b).on("change",this.scaleChangeHandler.bind(this)).change(),a(d).click(this.showConfig.bind(this))};return g.prototype.selectSelector=null,g.prototype.inputSelector=null,g.prototype.triggerSelector=null,g.prototype.scalevalues=null,g.prototype.originalscaleid=0,g.prototype.scaleid=0,g.prototype.popup=null,g.prototype.showConfig=function(){var d=this;if(this.scaleid=a(this.selectSelector).val(),!(this.scaleid<=0)){var f=a(this.selectSelector).find("option:selected").text();this.getScaleValues(this.scaleid).done(function(){var a={scalename:f,scales:d.scalevalues};c.render("tool_lp/scale_configuration_page",a).done(function(a){new e(f,a,d.initScaleConfig.bind(d))}).fail(b.exception)}).fail(b.exception)}},g.prototype.retrieveOriginalScaleConfig=function(){var b=a(this.inputSelector).val();if(""!==b){var c=a.parseJSON(b),d=c.shift();if(d.scaleid===this.originalscaleid)return c}return""},g.prototype.initScaleConfig=function(b){this.popup=b;var c=a(b.getContent());if(this.originalscaleid===this.scaleid){var d=this.retrieveOriginalScaleConfig();""!==d&&d.forEach(function(a){1===a.scaledefault&&c.find('[data-field="tool_lp_scale_default_'+a.id+'"]').attr("checked",!0),1===a.proficient&&c.find('[data-field="tool_lp_scale_proficient_'+a.id+'"]').attr("checked",!0)})}c.on("click",'[data-action="close"]',function(){this.setScaleConfig(),b.close()}.bind(this)),c.on("click",'[data-action="cancel"]',function(){b.close()})},g.prototype.setScaleConfig=function(){var b=a(this.popup.getContent()),c=[{scaleid:this.scaleid}];this.scalevalues.forEach(function(a){var d=0,e=0;b.find('[data-field="tool_lp_scale_default_'+a.id+'"]').is(":checked")&&(d=1),b.find('[data-field="tool_lp_scale_proficient_'+a.id+'"]').is(":checked")&&(e=1),(d||e)&&c.push({id:a.id,scaledefault:d,proficient:e})});var d=JSON.stringify(c);a(this.inputSelector).val(d),this.originalscaleid=this.scaleid},g.prototype.getScaleValues=function(a){return f.get_values(a).then(function(a){return this.scalevalues=a,a}.bind(this))},g.prototype.scaleChangeHandler=function(b){a(b.target).val()<=0?a(this.triggerSelector).prop("disabled",!0):a(this.triggerSelector).prop("disabled",!1)},{init:function(a,b,c){return new g(a,b,c)}}});

File diff suppressed because one or more lines are too long

View File

@ -87,13 +87,13 @@ define(['jquery',
self._selectedValue = $("input[type='radio']:checked").val(); self._selectedValue = $("input[type='radio']:checked").val();
self._find('[data-action="action-selector-confirm"]').removeAttr('disabled'); self._find('[data-action="action-selector-confirm"]').removeAttr('disabled');
self._refresh.bind(self); self._refresh.bind(self);
}.bind(self)); });
// Add listener for cancel. // Add listener for cancel.
self._find('[data-action="action-selector-cancel"]').click(function(e) { self._find('[data-action="action-selector-cancel"]').click(function(e) {
e.preventDefault(); e.preventDefault();
self.close(); self.close();
}.bind(self)); });
// Add listener for confirm. // Add listener for confirm.
self._find('[data-action="action-selector-confirm"]').click(function(e) { self._find('[data-action="action-selector-confirm"]').click(function(e) {
@ -101,9 +101,9 @@ define(['jquery',
if (!self._selectedValue.length) { if (!self._selectedValue.length) {
return; return;
} }
self._trigger('save', { action: self._selectedValue }); self._trigger('save', {action: self._selectedValue});
self.close(); self.close();
}.bind(self)); });
}; };
/** /**
@ -131,7 +131,7 @@ define(['jquery',
html, html,
self._afterRender.bind(self) self._afterRender.bind(self)
); );
}.bind(self)).fail(Notification.exception); }).fail(Notification.exception);
}; };
/** /**
@ -156,7 +156,7 @@ define(['jquery',
return self._render().then(function(html) { return self._render().then(function(html) {
self._find('[data-region="action-selector"]').replaceWith(html); self._find('[data-region="action-selector"]').replaceWith(html);
self._afterRender(); self._afterRender();
}.bind(self)); });
}; };
/** /**

View File

@ -59,13 +59,13 @@ define(['jquery',
function(movestring) { function(movestring) {
dragdrop.dragdrop('movecompetency', dragdrop.dragdrop('movecompetency',
movestring, movestring,
{ identifier: 'movecompetency', component: 'tool_lp'}, {identifier: 'movecompetency', component: 'tool_lp'},
{ identifier: 'movecompetencyafter', component: 'tool_lp'}, {identifier: 'movecompetencyafter', component: 'tool_lp'},
'drag-samenode', 'drag-samenode',
'drag-parentnode', 'drag-parentnode',
'drag-handlecontainer', 'drag-handlecontainer',
function(drag, drop) { function(drag, drop) {
localthis.handleDrop.call(localthis, drag, drop); localthis.handleDrop(drag, drop);
}); });
} }
).fail(notification.exception); ).fail(notification.exception);
@ -89,21 +89,21 @@ define(['jquery',
requests = ajax.call([ requests = ajax.call([
{ {
methodname: 'core_competency_reorder_course_competency', methodname: 'core_competency_reorder_course_competency',
args: { courseid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid } args: {courseid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid}
} }
]); ]);
} else if (localthis.itemtype == 'template') { } else if (localthis.itemtype == 'template') {
requests = ajax.call([ requests = ajax.call([
{ {
methodname: 'core_competency_reorder_template_competency', methodname: 'core_competency_reorder_template_competency',
args: { templateid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid } args: {templateid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid}
} }
]); ]);
} else if (localthis.itemtype == 'plan') { } else if (localthis.itemtype == 'plan') {
requests = ajax.call([ requests = ajax.call([
{ {
methodname: 'core_competency_reorder_plan_competency', methodname: 'core_competency_reorder_plan_competency',
args: { planid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid } args: {planid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid}
} }
]); ]);
} else { } else {
@ -139,12 +139,12 @@ define(['jquery',
$.each(compIds, function(index, compId) { $.each(compIds, function(index, compId) {
requests.push({ requests.push({
methodname: 'core_competency_add_competency_to_course', methodname: 'core_competency_add_competency_to_course',
args: { courseid: self.itemid, competencyid: compId } args: {courseid: self.itemid, competencyid: compId}
}); });
}); });
requests.push({ requests.push({
methodname: 'tool_lp_data_for_course_competencies_page', methodname: 'tool_lp_data_for_course_competencies_page',
args: { courseid: self.itemid } args: {courseid: self.itemid}
}); });
pagerender = 'tool_lp/course_competencies_page'; pagerender = 'tool_lp/course_competencies_page';
@ -156,12 +156,12 @@ define(['jquery',
$.each(compIds, function(index, compId) { $.each(compIds, function(index, compId) {
requests.push({ requests.push({
methodname: 'core_competency_add_competency_to_template', methodname: 'core_competency_add_competency_to_template',
args: { templateid: self.itemid, competencyid: compId } args: {templateid: self.itemid, competencyid: compId}
}); });
}); });
requests.push({ requests.push({
methodname: 'tool_lp_data_for_template_competencies_page', methodname: 'tool_lp_data_for_template_competencies_page',
args: { templateid: self.itemid, pagecontext: { contextid: self.pageContextId }} args: {templateid: self.itemid, pagecontext: {contextid: self.pageContextId}}
}); });
pagerender = 'tool_lp/template_competencies_page'; pagerender = 'tool_lp/template_competencies_page';
pageregion = 'templatecompetenciespage'; pageregion = 'templatecompetenciespage';
@ -171,12 +171,12 @@ define(['jquery',
$.each(compIds, function(index, compId) { $.each(compIds, function(index, compId) {
requests.push({ requests.push({
methodname: 'core_competency_add_competency_to_plan', methodname: 'core_competency_add_competency_to_plan',
args: { planid: self.itemid, competencyid: compId } args: {planid: self.itemid, competencyid: compId}
}); });
}); });
requests.push({ requests.push({
methodname: 'tool_lp_data_for_plan_page', methodname: 'tool_lp_data_for_plan_page',
args: { planid: self.itemid} args: {planid: self.itemid}
}); });
pagerender = 'tool_lp/plan_page'; pagerender = 'tool_lp/plan_page';
pageregion = 'plan-page'; pageregion = 'plan-page';
@ -209,28 +209,28 @@ define(['jquery',
// Delete the link and reload the page template. // Delete the link and reload the page template.
if (localthis.itemtype == 'course') { if (localthis.itemtype == 'course') {
requests = ajax.call([ requests = ajax.call([
{ methodname: 'core_competency_remove_competency_from_course', {methodname: 'core_competency_remove_competency_from_course',
args: { courseid: localthis.itemid, competencyid: deleteid } }, args: {courseid: localthis.itemid, competencyid: deleteid}},
{ methodname: 'tool_lp_data_for_course_competencies_page', {methodname: 'tool_lp_data_for_course_competencies_page',
args: { courseid: localthis.itemid } } args: {courseid: localthis.itemid}}
]); ]);
pagerender = 'tool_lp/course_competencies_page'; pagerender = 'tool_lp/course_competencies_page';
pageregion = 'coursecompetenciespage'; pageregion = 'coursecompetenciespage';
} else if (localthis.itemtype == 'template') { } else if (localthis.itemtype == 'template') {
requests = ajax.call([ requests = ajax.call([
{ methodname: 'core_competency_remove_competency_from_template', {methodname: 'core_competency_remove_competency_from_template',
args: { templateid: localthis.itemid, competencyid: deleteid } }, args: {templateid: localthis.itemid, competencyid: deleteid}},
{ methodname: 'tool_lp_data_for_template_competencies_page', {methodname: 'tool_lp_data_for_template_competencies_page',
args: { templateid: localthis.itemid, pagecontext: { contextid: localthis.pageContextId } } } args: {templateid: localthis.itemid, pagecontext: {contextid: localthis.pageContextId}}}
]); ]);
pagerender = 'tool_lp/template_competencies_page'; pagerender = 'tool_lp/template_competencies_page';
pageregion = 'templatecompetenciespage'; pageregion = 'templatecompetenciespage';
} else if (localthis.itemtype == 'plan') { } else if (localthis.itemtype == 'plan') {
requests = ajax.call([ requests = ajax.call([
{ methodname: 'core_competency_remove_competency_from_plan', {methodname: 'core_competency_remove_competency_from_plan',
args: { planid: localthis.itemid, competencyid: deleteid } }, args: {planid: localthis.itemid, competencyid: deleteid}},
{ methodname: 'tool_lp_data_for_plan_page', {methodname: 'tool_lp_data_for_plan_page',
args: { planid: localthis.itemid } } args: {planid: localthis.itemid}}
]); ]);
pagerender = 'tool_lp/plan_page'; pagerender = 'tool_lp/plan_page';
pageregion = 'plan-page'; pageregion = 'plan-page';
@ -268,15 +268,15 @@ define(['jquery',
requests = ajax.call([{ requests = ajax.call([{
methodname: 'core_competency_read_competency', methodname: 'core_competency_read_competency',
args: { id: deleteid } args: {id: deleteid}
}]); }]);
requests[0].done(function(competency) { requests[0].done(function(competency) {
str.get_strings([ str.get_strings([
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: message, component: 'tool_lp', param: competency.shortname }, {key: message, component: 'tool_lp', param: competency.shortname},
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: 'cancel', component: 'moodle' } {key: 'cancel', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
notification.confirm( notification.confirm(
strings[0], // Confirm. strings[0], // Confirm.
@ -308,10 +308,10 @@ define(['jquery',
var coursecompetencyid = $(e.target).data('id'); var coursecompetencyid = $(e.target).data('id');
var ruleoutcome = $(e.target).val(); var ruleoutcome = $(e.target).val();
requests = ajax.call([ requests = ajax.call([
{ methodname: 'core_competency_set_course_competency_ruleoutcome', {methodname: 'core_competency_set_course_competency_ruleoutcome',
args: { coursecompetencyid: coursecompetencyid, ruleoutcome: ruleoutcome } }, args: {coursecompetencyid: coursecompetencyid, ruleoutcome: ruleoutcome}},
{ methodname: 'tool_lp_data_for_course_competencies_page', {methodname: 'tool_lp_data_for_course_competencies_page',
args: { courseid: localthis.itemid } } args: {courseid: localthis.itemid}}
]); ]);
requests[1].done(function(context) { requests[1].done(function(context) {

View File

@ -46,16 +46,16 @@ define(['jquery',
getAll: function() { getAll: function() {
var self = this; var self = this;
return Str.get_strings([ return Str.get_strings([
{ key: 'competencyoutcome_none', component: 'tool_lp' }, {key: 'competencyoutcome_none', component: 'tool_lp'},
{ key: 'competencyoutcome_evidence', component: 'tool_lp' }, {key: 'competencyoutcome_evidence', component: 'tool_lp'},
{ key: 'competencyoutcome_recommend', component: 'tool_lp' }, {key: 'competencyoutcome_recommend', component: 'tool_lp'},
{ key: 'competencyoutcome_complete', component: 'tool_lp' }, {key: 'competencyoutcome_complete', component: 'tool_lp'},
]).then(function(strings) { ]).then(function(strings) {
var outcomes = {}; var outcomes = {};
outcomes[self.NONE] = { code: self.NONE, name: strings[0] }; outcomes[self.NONE] = {code: self.NONE, name: strings[0]};
outcomes[self.EVIDENCE] = { code: self.EVIDENCE, name: strings[1] }; outcomes[self.EVIDENCE] = {code: self.EVIDENCE, name: strings[1]};
outcomes[self.RECOMMEND] = { code: self.RECOMMEND, name: strings[2] }; outcomes[self.RECOMMEND] = {code: self.RECOMMEND, name: strings[2]};
outcomes[self.COMPLETE] = { code: self.COMPLETE, name: strings[3] }; outcomes[self.COMPLETE] = {code: self.COMPLETE, name: strings[3]};
return outcomes; return outcomes;
}); });
}, },

View File

@ -115,7 +115,7 @@ define(['jquery',
children = this._tree.getChildren(this._competency.id), children = this._tree.getChildren(this._competency.id),
context, context,
config = { config = {
base: { points: 2 }, base: {points: 2},
competencies: [] competencies: []
}; };

View File

@ -82,10 +82,10 @@ define(['jquery',
if (parent !== null && treeModel.hasRule(parent.id)) { if (parent !== null && treeModel.hasRule(parent.id)) {
str.get_strings([ str.get_strings([
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: 'addingcompetencywillresetparentrule', component: 'tool_lp', param: parent.shortname }, {key: 'addingcompetencywillresetparentrule', component: 'tool_lp', param: parent.shortname},
{ key: 'yes', component: 'core' }, {key: 'yes', component: 'core'},
{ key: 'no', component: 'core' } {key: 'no', component: 'core'}
]).done(function(strings) { ]).done(function(strings) {
notification.confirm( notification.confirm(
strings[0], strings[0],
@ -108,11 +108,11 @@ define(['jquery',
var frameworkid = $('[data-region="filtercompetencies"]').data('frameworkid'); var frameworkid = $('[data-region="filtercompetencies"]').data('frameworkid');
var requests = ajax.call([{ var requests = ajax.call([{
methodname: 'core_competency_set_parent_competency', methodname: 'core_competency_set_parent_competency',
args: { competencyid: moveSource, parentid: moveTarget } args: {competencyid: moveSource, parentid: moveTarget}
}, { }, {
methodname: 'tool_lp_data_for_competencies_manage_page', methodname: 'tool_lp_data_for_competencies_manage_page',
args: { competencyframeworkid: frameworkid, args: {competencyframeworkid: frameworkid,
search: $('[data-region="filtercompetencies"] input').val() } search: $('[data-region="filtercompetencies"] input').val()}
}]); }]);
requests[1].done(reloadPage).fail(notification.exception); requests[1].done(reloadPage).fail(notification.exception);
}; };
@ -153,10 +153,10 @@ define(['jquery',
// Show confirm, and/or do the things. // Show confirm, and/or do the things.
if (showConfirm) { if (showConfirm) {
str.get_strings([ str.get_strings([
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: confirmMessage, component: 'tool_lp' }, {key: confirmMessage, component: 'tool_lp'},
{ key: 'yes', component: 'moodle' }, {key: 'yes', component: 'moodle'},
{ key: 'no', component: 'moodle' } {key: 'no', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
notification.confirm( notification.confirm(
strings[0], // Confirm. strings[0], // Confirm.
@ -248,7 +248,8 @@ define(['jquery',
$.when.apply(null, requests).done(function(competencies, framework) { $.when.apply(null, requests).done(function(competencies, framework) {
// Expand the list of competencies into a tree. // Expand the list of competencies into a tree.
var i, competenciestree = []; var i;
var competenciestree = [];
for (i = 0; i < competencies.length; i++) { for (i = 0; i < competencies.length; i++) {
var onecompetency = competencies[i]; var onecompetency = competencies[i];
if (onecompetency.parentid == "0") { if (onecompetency.parentid == "0") {
@ -260,9 +261,9 @@ define(['jquery',
} }
str.get_strings([ str.get_strings([
{ key: 'movecompetency', component: 'tool_lp', param: competency.shortname }, {key: 'movecompetency', component: 'tool_lp', param: competency.shortname},
{ key: 'move', component: 'tool_lp' }, {key: 'move', component: 'tool_lp'},
{ key: 'cancel', component: 'moodle' } {key: 'cancel', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
var context = { var context = {
@ -330,8 +331,8 @@ define(['jquery',
var requests = ajax.call([{ var requests = ajax.call([{
methodname: 'tool_lp_data_for_competencies_manage_page', methodname: 'tool_lp_data_for_competencies_manage_page',
args: { competencyframeworkid: frameworkid, args: {competencyframeworkid: frameworkid,
search: $('[data-region="filtercompetencies"] input').val() } search: $('[data-region="filtercompetencies"] input').val()}
}]); }]);
requests[0].done(reloadPage).fail(notification.exception); requests[0].done(reloadPage).fail(notification.exception);
}; };
@ -345,11 +346,11 @@ define(['jquery',
var competency = $('[data-region="competencyactions"]').data('competency'); var competency = $('[data-region="competencyactions"]').data('competency');
var requests = ajax.call([{ var requests = ajax.call([{
methodname: 'core_competency_move_up_competency', methodname: 'core_competency_move_up_competency',
args: { id: competency.id } args: {id: competency.id}
}, { }, {
methodname: 'tool_lp_data_for_competencies_manage_page', methodname: 'tool_lp_data_for_competencies_manage_page',
args: { competencyframeworkid: competency.competencyframeworkid, args: {competencyframeworkid: competency.competencyframeworkid,
search: $('[data-region="filtercompetencies"] input').val() } search: $('[data-region="filtercompetencies"] input').val()}
}]); }]);
requests[1].done(reloadPage).fail(notification.exception); requests[1].done(reloadPage).fail(notification.exception);
}; };
@ -363,11 +364,11 @@ define(['jquery',
var competency = $('[data-region="competencyactions"]').data('competency'); var competency = $('[data-region="competencyactions"]').data('competency');
var requests = ajax.call([{ var requests = ajax.call([{
methodname: 'core_competency_move_down_competency', methodname: 'core_competency_move_down_competency',
args: { id: competency.id } args: {id: competency.id}
}, { }, {
methodname: 'tool_lp_data_for_competencies_manage_page', methodname: 'tool_lp_data_for_competencies_manage_page',
args: { competencyframeworkid: competency.competencyframeworkid, args: {competencyframeworkid: competency.competencyframeworkid,
search: $('[data-region="filtercompetencies"] input').val() } search: $('[data-region="filtercompetencies"] input').val()}
}]); }]);
requests[1].done(reloadPage).fail(notification.exception); requests[1].done(reloadPage).fail(notification.exception);
}; };
@ -381,7 +382,7 @@ define(['jquery',
var requests = ajax.call([{ var requests = ajax.call([{
methodname: 'tool_lp_list_courses_using_competency', methodname: 'tool_lp_list_courses_using_competency',
args: { id: competency.id } args: {id: competency.id}
}]); }]);
requests[0].done(function(courses) { requests[0].done(function(courses) {
@ -417,13 +418,13 @@ define(['jquery',
$.each(compIds, function(index, value) { $.each(compIds, function(index, value) {
calls.push({ calls.push({
methodname: 'core_competency_add_related_competency', methodname: 'core_competency_add_related_competency',
args: { competencyid: value, relatedcompetencyid: relatedTarget.id } args: {competencyid: value, relatedcompetencyid: relatedTarget.id}
}); });
}); });
calls.push({ calls.push({
methodname: 'tool_lp_data_for_related_competencies_section', methodname: 'tool_lp_data_for_related_competencies_section',
args: { competencyid: relatedTarget.id } args: {competencyid: relatedTarget.id}
}); });
var promises = ajax.call(calls); var promises = ajax.call(calls);
@ -462,7 +463,7 @@ define(['jquery',
}; };
var promise = ajax.call([{ var promise = ajax.call([{
methodname: 'core_competency_update_competency', methodname: 'core_competency_update_competency',
args: { competency: update } args: {competency: update}
}]); }]);
promise[0].then(function(result) { promise[0].then(function(result) {
if (result) { if (result) {
@ -483,17 +484,17 @@ define(['jquery',
var competency = $('[data-region="competencyactions"]').data('competency'); var competency = $('[data-region="competencyactions"]').data('competency');
var requests = ajax.call([{ var requests = ajax.call([{
methodname: 'core_competency_delete_competency', methodname: 'core_competency_delete_competency',
args: { id: competency.id } args: {id: competency.id}
}, { }, {
methodname: 'tool_lp_data_for_competencies_manage_page', methodname: 'tool_lp_data_for_competencies_manage_page',
args: { competencyframeworkid: competency.competencyframeworkid, args: {competencyframeworkid: competency.competencyframeworkid,
search: $('[data-region="filtercompetencies"] input').val() } search: $('[data-region="filtercompetencies"] input').val()}
}]); }]);
requests[0].done(function(success) { requests[0].done(function(success) {
if (success === false) { if (success === false) {
str.get_strings([ str.get_strings([
{ key: 'competencycannotbedeleted', component: 'tool_lp', param: competency.shortname }, {key: 'competencycannotbedeleted', component: 'tool_lp', param: competency.shortname},
{ key: 'cancel', component: 'moodle' } {key: 'cancel', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
notification.alert( notification.alert(
null, null,
@ -518,10 +519,10 @@ define(['jquery',
} }
str.get_strings([ str.get_strings([
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: confirmMessage, component: 'tool_lp', param: competency.shortname }, {key: confirmMessage, component: 'tool_lp', param: competency.shortname},
{ key: 'delete', component: 'moodle' }, {key: 'delete', component: 'moodle'},
{ key: 'cancel', component: 'moodle' } {key: 'cancel', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
notification.confirm( notification.confirm(
strings[0], // Confirm. strings[0], // Confirm.
@ -598,18 +599,18 @@ define(['jquery',
var relatedid = this.id.substr(11); var relatedid = this.id.substr(11);
var competency = $('[data-region="competencyactions"]').data('competency'); var competency = $('[data-region="competencyactions"]').data('competency');
var removeRelated = ajax.call([ var removeRelated = ajax.call([
{ methodname: 'core_competency_remove_related_competency', {methodname: 'core_competency_remove_related_competency',
args: { relatedcompetencyid: relatedid, competencyid: competency.id } }, args: {relatedcompetencyid: relatedid, competencyid: competency.id}},
{ methodname: 'tool_lp_data_for_related_competencies_section', {methodname: 'tool_lp_data_for_related_competencies_section',
args: { competencyid: competency.id } } args: {competencyid: competency.id}}
]); ]);
removeRelated[1].done(function(context) { removeRelated[1].done(function(context) {
templates.render('tool_lp/related_competencies', context).done(function(html) { templates.render('tool_lp/related_competencies', context).done(function(html) {
$('[data-region="relatedcompetencies"]').replaceWith(html); $('[data-region="relatedcompetencies"]').replaceWith(html);
updatedRelatedCompetencies(); updatedRelatedCompetencies();
}.bind(this)).fail(notification.exception); }).fail(notification.exception);
}.bind(this)).fail(notification.exception); }).fail(notification.exception);
}; };
/** /**
@ -636,7 +637,7 @@ define(['jquery',
selectedCompetencyId = competency.id; selectedCompetencyId = competency.id;
ajax.call([{ ajax.call([{
methodname: 'core_competency_competency_viewed', methodname: 'core_competency_competency_viewed',
args: { id: competency.id } args: {id: competency.id}
}]); }]);
} }
}; };
@ -703,7 +704,7 @@ define(['jquery',
}).done(function() { }).done(function() {
ajax.call([{ ajax.call([{
methodname: 'tool_lp_data_for_related_competencies_section', methodname: 'tool_lp_data_for_related_competencies_section',
args: { competencyid: competency.id }, args: {competencyid: competency.id},
done: function(context) { done: function(context) {
return templates.render('tool_lp/related_competencies', context).done(function(html, js) { return templates.render('tool_lp/related_competencies', context).done(function(html, js) {
$('[data-region="relatedcompetencies"]').replaceWith(html); $('[data-region="relatedcompetencies"]').replaceWith(html);

View File

@ -55,7 +55,7 @@ define(['jquery',
Competencydialogue.prototype.triggerCompetencyViewedEvent = function(competencyId) { Competencydialogue.prototype.triggerCompetencyViewedEvent = function(competencyId) {
ajax.call([{ ajax.call([{
methodname: 'core_competency_competency_viewed', methodname: 'core_competency_competency_viewed',
args: { id: competencyId } args: {id: competencyId}
}]); }]);
}; };
@ -143,8 +143,8 @@ define(['jquery',
Competencydialogue.prototype.getCompetencyDataPromise = function(competencyid, options) { Competencydialogue.prototype.getCompetencyDataPromise = function(competencyid, options) {
var requests = ajax.call([ var requests = ajax.call([
{ methodname: 'tool_lp_data_for_competency_summary', {methodname: 'tool_lp_data_for_competency_summary',
args: { competencyid: competencyid, args: {competencyid: competencyid,
includerelated: options.includerelated || false, includerelated: options.includerelated || false,
includecourses: options.includecourses || false includecourses: options.includecourses || false
} }
@ -170,7 +170,7 @@ define(['jquery',
// Instantiate the one instance and delegate event on the body. // Instantiate the one instance and delegate event on the body.
instance = new Competencydialogue(); instance = new Competencydialogue();
$('body').delegate('[data-action="competency-dialogue"]', 'click', { compdialogue: instance }, $('body').delegate('[data-action="competency-dialogue"]', 'click', {compdialogue: instance},
instance.clickEventHandler.bind(instance)); instance.clickEventHandler.bind(instance));
} }
}; };

View File

@ -118,7 +118,7 @@ define(['jquery',
if (valid) { if (valid) {
validIds.push(compId); validIds.push(compId);
} }
}.bind(self)); });
self._selectedCompetencies = validIds; self._selectedCompetencies = validIds;
@ -128,14 +128,14 @@ define(['jquery',
} else { } else {
self._find('[data-region="competencylinktree"] [data-action="add"]').removeAttr('disabled'); self._find('[data-region="competencylinktree"] [data-action="add"]').removeAttr('disabled');
} }
}.bind(self)); });
// Add listener for framework change. // Add listener for framework change.
if (!self._singleFramework) { if (!self._singleFramework) {
self._find('[data-action="chooseframework"]').change(function(e) { self._find('[data-action="chooseframework"]').change(function(e) {
self._frameworkId = $(e.target).val(); self._frameworkId = $(e.target).val();
self._loadCompetencies().then(self._refresh.bind(self)); self._loadCompetencies().then(self._refresh.bind(self));
}.bind(self)); });
} }
// Add listener for search. // Add listener for search.
@ -146,13 +146,13 @@ define(['jquery',
return self._refresh().always(function() { return self._refresh().always(function() {
$(e.target).removeAttr('disabled'); $(e.target).removeAttr('disabled');
}); });
}.bind(self)); });
// Add listener for cancel. // Add listener for cancel.
self._find('[data-region="competencylinktree"] [data-action="cancel"]').click(function(e) { self._find('[data-region="competencylinktree"] [data-action="cancel"]').click(function(e) {
e.preventDefault(); e.preventDefault();
self.close(); self.close();
}.bind(self)); });
// Add listener for add. // Add listener for add.
self._find('[data-region="competencylinktree"] [data-action="add"]').click(function(e) { self._find('[data-region="competencylinktree"] [data-action="add"]').click(function(e) {
@ -162,14 +162,14 @@ define(['jquery',
} }
if (self._multiSelect) { if (self._multiSelect) {
self._trigger('save', { competencyIds: self._selectedCompetencies }); self._trigger('save', {competencyIds: self._selectedCompetencies});
} else { } else {
// We checked above that the array has at least one value. // We checked above that the array has at least one value.
self._trigger('save', { competencyId: self._selectedCompetencies[0] }); self._trigger('save', {competencyId: self._selectedCompetencies[0]});
} }
self.close(); self.close();
}.bind(self)); });
// The list of selected competencies will be modified while looping (because of the listeners above). // The list of selected competencies will be modified while looping (because of the listeners above).
var currentItems = self._selectedCompetencies.slice(0); var currentItems = self._selectedCompetencies.slice(0);
@ -180,7 +180,7 @@ define(['jquery',
tree.toggleItem(node); tree.toggleItem(node);
tree.updateFocus(node); tree.updateFocus(node);
} }
}.bind(self)); });
}; };
@ -210,8 +210,8 @@ define(['jquery',
html, html,
self._afterRender.bind(self) self._afterRender.bind(self)
); );
}.bind(self)); });
}.bind(self)).fail(Notification.exception); }).fail(Notification.exception);
}; };
/** /**
@ -226,7 +226,7 @@ define(['jquery',
var self = this; var self = this;
return Ajax.call([ return Ajax.call([
{ methodname: 'core_competency_search_competencies', args: { {methodname: 'core_competency_search_competencies', args: {
searchtext: searchText, searchtext: searchText,
competencyframeworkid: frameworkId competencyframeworkid: frameworkId
}} }}
@ -248,7 +248,8 @@ define(['jquery',
} }
// Expand the list of competencies into a tree. // Expand the list of competencies into a tree.
var i, tree = [], comp; var i, comp;
var tree = [];
for (i = 0; i < competencies.length; i++) { for (i = 0; i < competencies.length; i++) {
comp = competencies[i]; comp = competencies[i];
if (comp.parentid == "0") { // Loose check for now, because WS returns a string. if (comp.parentid == "0") { // Loose check for now, because WS returns a string.
@ -261,7 +262,7 @@ define(['jquery',
self._competencies = tree; self._competencies = tree;
}.bind(self)).fail(Notification.exception); }).fail(Notification.exception);
}; };
/** /**
@ -287,7 +288,7 @@ define(['jquery',
$.each(this._frameworks, function(i, f) { $.each(this._frameworks, function(i, f) {
if (f.id == fid) { if (f.id == fid) {
frm = f; frm = f;
return false; return;
} }
}); });
return frm; return frm;
@ -320,7 +321,7 @@ define(['jquery',
if (self._singleFramework) { if (self._singleFramework) {
promise = Ajax.call([ promise = Ajax.call([
{ methodname: 'core_competency_read_competency_framework', args: { {methodname: 'core_competency_read_competency_framework', args: {
id: this._frameworkId id: this._frameworkId
}} }}
])[0].then(function(framework) { ])[0].then(function(framework) {
@ -328,9 +329,9 @@ define(['jquery',
}); });
} else { } else {
promise = Ajax.call([ promise = Ajax.call([
{ methodname: 'core_competency_list_competency_frameworks', args: { {methodname: 'core_competency_list_competency_frameworks', args: {
sort: 'shortname', sort: 'shortname',
context: { contextid: self._pageContextId }, context: {contextid: self._pageContextId},
includes: self._pageContextIncludes, includes: self._pageContextIncludes,
onlyvisible: self._onlyVisible onlyvisible: self._onlyVisible
}} }}
@ -373,7 +374,7 @@ define(['jquery',
} }
return self._loadCompetencies(); return self._loadCompetencies();
}.bind(self)); });
}; };
/** /**
@ -387,7 +388,7 @@ define(['jquery',
return self._render().then(function(html) { return self._render().then(function(html) {
self._find('[data-region="competencylinktree"]').replaceWith(html); self._find('[data-region="competencylinktree"]').replaceWith(html);
self._afterRender(); self._afterRender();
}.bind(self)); });
}; };
/** /**
@ -419,7 +420,7 @@ define(['jquery',
}; };
return Templates.render('tool_lp/competency_picker', context); return Templates.render('tool_lp/competency_picker', context);
}.bind(self)); });
}; };
/** /**

View File

@ -78,7 +78,7 @@ define(['jquery',
self._find('[data-action="chooseplan"]').change(function(e) { self._find('[data-action="chooseplan"]').change(function(e) {
self._planId = $(e.target).val(); self._planId = $(e.target).val();
self._loadCompetencies().then(self._refresh.bind(self)); self._loadCompetencies().then(self._refresh.bind(self));
}.bind(self)); });
} }
}; };
@ -94,13 +94,14 @@ define(['jquery',
var self = this; var self = this;
return Ajax.call([ return Ajax.call([
{ methodname: 'core_competency_list_plan_competencies', args: { {methodname: 'core_competency_list_plan_competencies', args: {
id: planId id: planId
}} }}
])[0].done(function(competencies) { ])[0].done(function(competencies) {
// Expand the list of competencies into a fake tree. // Expand the list of competencies into a fake tree.
var i, tree = [], comp; var i, comp;
var tree = [];
for (i = 0; i < competencies.length; i++) { for (i = 0; i < competencies.length; i++) {
comp = competencies[i].competency; comp = competencies[i].competency;
if (comp.shortname.toLowerCase().indexOf(searchText.toLowerCase()) < 0) { if (comp.shortname.toLowerCase().indexOf(searchText.toLowerCase()) < 0) {
@ -128,7 +129,7 @@ define(['jquery',
$.each(this._plans, function(i, f) { $.each(this._plans, function(i, f) {
if (f.id == id) { if (f.id == id) {
plan = f; plan = f;
return false; return;
} }
}); });
return plan; return plan;
@ -161,7 +162,7 @@ define(['jquery',
if (self._singlePlan) { if (self._singlePlan) {
promise = Ajax.call([ promise = Ajax.call([
{ methodname: 'core_competency_read_plan', args: { {methodname: 'core_competency_read_plan', args: {
id: this._planId id: this._planId
}} }}
])[0].then(function(plan) { ])[0].then(function(plan) {
@ -169,7 +170,7 @@ define(['jquery',
}); });
} else { } else {
promise = Ajax.call([ promise = Ajax.call([
{ methodname: 'core_competency_list_user_plans', args: { {methodname: 'core_competency_list_user_plans', args: {
userid: self._userId userid: self._userId
}} }}
])[0]; ])[0];
@ -200,7 +201,7 @@ define(['jquery',
} }
return self._loadCompetencies(); return self._loadCompetencies();
}.bind(self)); });
}; };
/** /**
@ -232,7 +233,7 @@ define(['jquery',
}; };
return Templates.render('tool_lp/competency_picker_user_plans', context); return Templates.render('tool_lp/competency_picker_user_plans', context);
}.bind(self)); });
}; };
return /** @alias module:tool_lp/competencypicker_user_plans */ Picker; return /** @alias module:tool_lp/competencypicker_user_plans */ Picker;

View File

@ -137,7 +137,7 @@ define(['jquery',
$.each(this._rules, function(index, rule) { $.each(this._rules, function(index, rule) {
if (rule.canConfig()) { if (rule.canConfig()) {
can = true; can = true;
return false; return;
} }
}); });
return can; return can;
@ -163,7 +163,7 @@ define(['jquery',
RuleConfig.prototype.display = function() { RuleConfig.prototype.display = function() {
var self = this; var self = this;
if (!self._competency) { if (!self._competency) {
return; return false;
} }
return self._render().then(function(html) { return self._render().then(function(html) {
return Str.get_string('competencyrule', 'tool_lp').then(function(title) { return Str.get_string('competencyrule', 'tool_lp').then(function(title) {
@ -276,7 +276,7 @@ define(['jquery',
$.each(this._rules, function(index, rule) { $.each(this._rules, function(index, rule) {
if (rule.getType() == type) { if (rule.getType() == type) {
result = rule; result = rule;
return false; return;
} }
}); });
@ -297,7 +297,7 @@ define(['jquery',
$.each(self._rulesModules, function(index, modInfo) { $.each(self._rulesModules, function(index, modInfo) {
if (modInfo.type == type) { if (modInfo.type == type) {
name = modInfo.name; name = modInfo.name;
return false; return;
} }
}); });
return name; return name;

View File

@ -52,7 +52,7 @@ define(['jquery',
var currentValue = $(e.target).closest('a').data('pushratingstouserplans'); var currentValue = $(e.target).closest('a').data('pushratingstouserplans');
var context = { var context = {
courseid: courseid, courseid: courseid,
settings: { pushratingstouserplans: currentValue } settings: {pushratingstouserplans: currentValue}
}; };
e.preventDefault(); e.preventDefault();
@ -112,11 +112,11 @@ define(['jquery',
var newValue = this._find('input[name="pushratingstouserplans"]:checked').val(); var newValue = this._find('input[name="pushratingstouserplans"]:checked').val();
var courseId = this._find('input[name="courseid"]').val(); var courseId = this._find('input[name="courseid"]').val();
var settings = { pushratingstouserplans: newValue }; var settings = {pushratingstouserplans: newValue};
ajax.call([ ajax.call([
{ methodname: 'core_competency_update_course_competency_settings', {methodname: 'core_competency_update_course_competency_settings',
args: { courseid: courseId, settings: settings } } args: {courseid: courseId, settings: settings}}
])[0].done(function() { ])[0].done(function() {
this.refreshCourseCompetenciesPage(); this.refreshCourseCompetenciesPage();
}.bind(this)).fail(notification.exception); }.bind(this)).fail(notification.exception);
@ -133,8 +133,8 @@ define(['jquery',
var courseId = this._find('input[name="courseid"]').val(); var courseId = this._find('input[name="courseid"]').val();
ajax.call([ ajax.call([
{ methodname: 'tool_lp_data_for_course_competencies_page', {methodname: 'tool_lp_data_for_course_competencies_page',
args: { courseid: courseId } } args: {courseid: courseId}}
])[0].done(function(context) { ])[0].done(function(context) {
templates.render('tool_lp/course_competencies_page', context).done(function(html, js) { templates.render('tool_lp/course_competencies_page', context).done(function(html, js) {
$('[data-region="coursecompetenciespage"]').replaceWith(html); $('[data-region="coursecompetenciespage"]').replaceWith(html);

View File

@ -67,9 +67,9 @@ define(['core/str', 'core/yui'], function(str, Y) {
// Here we are wrapping YUI. This allows us to start transitioning, but // Here we are wrapping YUI. This allows us to start transitioning, but
// wait for a good alternative without having inconsistent UIs. // wait for a good alternative without having inconsistent UIs.
str.get_strings([ str.get_strings([
{ key: 'emptydragdropregion', component: 'moodle' }, {key: 'emptydragdropregion', component: 'moodle'},
{ key: 'movecontent', component: 'moodle' }, {key: 'movecontent', component: 'moodle'},
{ key: 'tocontent', component: 'moodle' }, {key: 'tocontent', component: 'moodle'},
]).done(function() { ]).done(function() {
Y.use('moodle-tool_lp-dragdrop-reorder', function() { Y.use('moodle-tool_lp-dragdrop-reorder', function() {

View File

@ -57,10 +57,10 @@ define(['jquery',
e.stopPropagation(); e.stopPropagation();
Str.get_strings([ Str.get_strings([
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: 'areyousure', component: 'moodle' }, {key: 'areyousure', component: 'moodle'},
{ key: 'delete', component: 'moodle' }, {key: 'delete', component: 'moodle'},
{ key: 'cancel', component: 'moodle' } {key: 'cancel', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
Notification.confirm( Notification.confirm(
strings[0], // Confirm. strings[0], // Confirm.

View File

@ -47,7 +47,7 @@ define(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {
methodname: 'tool_lp_search_cohorts', methodname: 'tool_lp_search_cohorts',
args: { args: {
query: query, query: query,
context: { contextid: contextid }, context: {contextid: contextid},
includes: includes includes: includes
} }
}]); }]);

View File

@ -65,7 +65,7 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
// We are chaining ajax requests here. // We are chaining ajax requests here.
var requests = ajax.call([{ var requests = ajax.call([{
methodname: 'core_competency_duplicate_competency_framework', methodname: 'core_competency_duplicate_competency_framework',
args: { id: frameworkid } args: {id: frameworkid}
}, { }, {
methodname: 'tool_lp_data_for_competency_frameworks_manage_page', methodname: 'tool_lp_data_for_competency_frameworks_manage_page',
args: { args: {
@ -84,7 +84,7 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
// We are chaining ajax requests here. // We are chaining ajax requests here.
var requests = ajax.call([{ var requests = ajax.call([{
methodname: 'core_competency_delete_competency_framework', methodname: 'core_competency_delete_competency_framework',
args: { id: frameworkid } args: {id: frameworkid}
}, { }, {
methodname: 'tool_lp_data_for_competency_frameworks_manage_page', methodname: 'tool_lp_data_for_competency_frameworks_manage_page',
args: { args: {
@ -97,12 +97,12 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
if (success === false) { if (success === false) {
var req = ajax.call([{ var req = ajax.call([{
methodname: 'core_competency_read_competency_framework', methodname: 'core_competency_read_competency_framework',
args: { id: frameworkid } args: {id: frameworkid}
}]); }]);
req[0].done(function(framework) { req[0].done(function(framework) {
str.get_strings([ str.get_strings([
{ key: 'frameworkcannotbedeleted', component: 'tool_lp', param: framework.shortname }, {key: 'frameworkcannotbedeleted', component: 'tool_lp', param: framework.shortname},
{ key: 'cancel', component: 'moodle' } {key: 'cancel', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
notification.alert( notification.alert(
null, null,
@ -127,15 +127,15 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
var requests = ajax.call([{ var requests = ajax.call([{
methodname: 'core_competency_read_competency_framework', methodname: 'core_competency_read_competency_framework',
args: { id: frameworkid } args: {id: frameworkid}
}]); }]);
requests[0].done(function(framework) { requests[0].done(function(framework) {
str.get_strings([ str.get_strings([
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: 'deletecompetencyframework', component: 'tool_lp', param: framework.shortname }, {key: 'deletecompetencyframework', component: 'tool_lp', param: framework.shortname},
{ key: 'delete', component: 'moodle' }, {key: 'delete', component: 'moodle'},
{ key: 'cancel', component: 'moodle' } {key: 'cancel', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
notification.confirm( notification.confirm(
strings[0], // Confirm. strings[0], // Confirm.

View File

@ -118,11 +118,11 @@ define(['jquery',
methodname: self._methodName, methodname: self._methodName,
args: args, args: args,
done: function(evidence) { done: function(evidence) {
self._trigger('competencyupdated', { args: args, evidence: evidence }); self._trigger('competencyupdated', {args: args, evidence: evidence});
}.bind(self), },
fail: notification.exception fail: notification.exception
}]); }]);
}.bind(self)); });
}).fail(notification.exception); }).fail(notification.exception);
}; };

View File

@ -175,7 +175,7 @@ define(['jquery'], function($) {
if (this.handlers) { if (this.handlers) {
$.each(this.handlers, function(selector, handler) { $.each(this.handlers, function(selector, handler) {
if (eventHandled) { if (eventHandled) {
return false; return;
} }
if (item.find(selector).length > 0) { if (item.find(selector).length > 0) {
var callable = $.proxy(handler, anchor); var callable = $.proxy(handler, anchor);

View File

@ -69,7 +69,7 @@ define(['jquery', 'core/ajax', 'core/str', 'tool_lp/competencypicker', 'core/tem
if (data.competencyId !== 0) { if (data.competencyId !== 0) {
ajax.call([ ajax.call([
{ methodname: 'core_competency_read_competency', args: { {methodname: 'core_competency_read_competency', args: {
id: data.competencyId id: data.competencyId
}} }}
])[0].done(function(competency) { ])[0].done(function(competency) {
@ -112,13 +112,13 @@ define(['jquery', 'core/ajax', 'core/str', 'tool_lp/competencypicker', 'core/tem
}; };
return Templates.render('tool_lp/competency_picker_competencyform', context); return Templates.render('tool_lp/competency_picker_competencyform', context);
}.bind(self)); });
}; };
// On selected competency. // On selected competency.
picker.on('save', function(e, data) { picker.on('save', function(e, data) {
self.setParent(data); self.setParent(data);
}.bind(self)); });
picker.display(); picker.display();
}); });

View File

@ -117,7 +117,7 @@ define(['jquery',
.done(function(newhtml, newjs) { .done(function(newhtml, newjs) {
$(self._region).replaceWith(newhtml); $(self._region).replaceWith(newhtml);
templates.runTemplateJS(newjs); templates.runTemplateJS(newjs);
}.bind(self)) })
.fail(notification.exception); .fail(notification.exception);
}; };
@ -139,7 +139,7 @@ define(['jquery',
// Apply all the promises, and refresh when the last one is resolved. // Apply all the promises, and refresh when the last one is resolved.
return $.when.apply($.when, ajax.call(calls)) return $.when.apply($.when, ajax.call(calls))
.then(function() { .then(function() {
self._renderView.call(self, arguments[arguments.length - 1]); self._renderView(arguments[arguments.length - 1]);
}) })
.fail(notification.exception); .fail(notification.exception);
}; };
@ -153,7 +153,7 @@ define(['jquery',
var self = this, var self = this,
calls = [{ calls = [{
methodname: 'core_competency_delete_plan', methodname: 'core_competency_delete_plan',
args: { id: planData.id } args: {id: planData.id}
}]; }];
self._callAndRefresh(calls, planData); self._callAndRefresh(calls, planData);
}; };
@ -169,15 +169,15 @@ define(['jquery',
requests = ajax.call([{ requests = ajax.call([{
methodname: 'core_competency_read_plan', methodname: 'core_competency_read_plan',
args: { id: planData.id } args: {id: planData.id}
}]); }]);
requests[0].done(function(plan) { requests[0].done(function(plan) {
str.get_strings([ str.get_strings([
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: 'deleteplan', component: 'tool_lp', param: plan.name }, {key: 'deleteplan', component: 'tool_lp', param: plan.name},
{ key: 'delete', component: 'moodle' }, {key: 'delete', component: 'moodle'},
{ key: 'cancel', component: 'moodle' } {key: 'cancel', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
notification.confirm( notification.confirm(
strings[0], // Confirm. strings[0], // Confirm.
@ -186,7 +186,7 @@ define(['jquery',
strings[3], // Cancel. strings[3], // Cancel.
function() { function() {
self._doDelete(planData); self._doDelete(planData);
}.bind(self) }
); );
}).fail(notification.exception); }).fail(notification.exception);
}).fail(notification.exception); }).fail(notification.exception);
@ -202,7 +202,7 @@ define(['jquery',
var self = this, var self = this,
calls = [{ calls = [{
methodname: 'core_competency_reopen_plan', methodname: 'core_competency_reopen_plan',
args: { planid: planData.id} args: {planid: planData.id}
}]; }];
self._callAndRefresh(calls, planData); self._callAndRefresh(calls, planData);
}; };
@ -216,15 +216,15 @@ define(['jquery',
var self = this, var self = this,
requests = ajax.call([{ requests = ajax.call([{
methodname: 'core_competency_read_plan', methodname: 'core_competency_read_plan',
args: { id: planData.id } args: {id: planData.id}
}]); }]);
requests[0].done(function(plan) { requests[0].done(function(plan) {
str.get_strings([ str.get_strings([
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: 'reopenplanconfirm', component: 'tool_lp', param: plan.name }, {key: 'reopenplanconfirm', component: 'tool_lp', param: plan.name},
{ key: 'reopenplan', component: 'tool_lp' }, {key: 'reopenplan', component: 'tool_lp'},
{ key: 'cancel', component: 'moodle' } {key: 'cancel', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
notification.confirm( notification.confirm(
strings[0], // Confirm. strings[0], // Confirm.
@ -233,7 +233,7 @@ define(['jquery',
strings[3], // Cancel. strings[3], // Cancel.
function() { function() {
self._doReopenPlan(planData); self._doReopenPlan(planData);
}.bind(self) }
); );
}).fail(notification.exception); }).fail(notification.exception);
}).fail(notification.exception); }).fail(notification.exception);
@ -249,7 +249,7 @@ define(['jquery',
var self = this, var self = this,
calls = [{ calls = [{
methodname: 'core_competency_complete_plan', methodname: 'core_competency_complete_plan',
args: { planid: planData.id} args: {planid: planData.id}
}]; }];
self._callAndRefresh(calls, planData); self._callAndRefresh(calls, planData);
}; };
@ -263,15 +263,15 @@ define(['jquery',
var self = this, var self = this,
requests = ajax.call([{ requests = ajax.call([{
methodname: 'core_competency_read_plan', methodname: 'core_competency_read_plan',
args: { id: planData.id } args: {id: planData.id}
}]); }]);
requests[0].done(function(plan) { requests[0].done(function(plan) {
str.get_strings([ str.get_strings([
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: 'completeplanconfirm', component: 'tool_lp', param: plan.name }, {key: 'completeplanconfirm', component: 'tool_lp', param: plan.name},
{ key: 'completeplan', component: 'tool_lp' }, {key: 'completeplan', component: 'tool_lp'},
{ key: 'cancel', component: 'moodle' } {key: 'cancel', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
notification.confirm( notification.confirm(
strings[0], // Confirm. strings[0], // Confirm.
@ -280,7 +280,7 @@ define(['jquery',
strings[3], // Cancel. strings[3], // Cancel.
function() { function() {
self._doCompletePlan(planData); self._doCompletePlan(planData);
}.bind(self) }
); );
}).fail(notification.exception); }).fail(notification.exception);
}).fail(notification.exception); }).fail(notification.exception);
@ -295,7 +295,7 @@ define(['jquery',
var self = this, var self = this,
calls = [{ calls = [{
methodname: 'core_competency_unlink_plan_from_template', methodname: 'core_competency_unlink_plan_from_template',
args: { planid: planData.id} args: {planid: planData.id}
}]; }];
self._callAndRefresh(calls, planData); self._callAndRefresh(calls, planData);
}; };
@ -309,15 +309,15 @@ define(['jquery',
var self = this, var self = this,
requests = ajax.call([{ requests = ajax.call([{
methodname: 'core_competency_read_plan', methodname: 'core_competency_read_plan',
args: { id: planData.id } args: {id: planData.id}
}]); }]);
requests[0].done(function(plan) { requests[0].done(function(plan) {
str.get_strings([ str.get_strings([
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: 'unlinkplantemplateconfirm', component: 'tool_lp', param: plan.name }, {key: 'unlinkplantemplateconfirm', component: 'tool_lp', param: plan.name},
{ key: 'unlinkplantemplate', component: 'tool_lp' }, {key: 'unlinkplantemplate', component: 'tool_lp'},
{ key: 'cancel', component: 'moodle' } {key: 'cancel', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
notification.confirm( notification.confirm(
strings[0], // Confirm. strings[0], // Confirm.
@ -326,7 +326,7 @@ define(['jquery',
strings[3], // Cancel. strings[3], // Cancel.
function() { function() {
self._doUnlinkPlan(planData); self._doUnlinkPlan(planData);
}.bind(self) }
); );
}).fail(notification.exception); }).fail(notification.exception);
}).fail(notification.exception); }).fail(notification.exception);
@ -499,7 +499,7 @@ define(['jquery',
var competencyid = $(e.target).data('id'); var competencyid = $(e.target).data('id');
var requests = ajax.call([{ var requests = ajax.call([{
methodname: 'tool_lp_list_courses_using_competency', methodname: 'tool_lp_list_courses_using_competency',
args: { id: competencyid } args: {id: competencyid}
}]); }]);
requests[0].done(function(courses) { requests[0].done(function(courses) {

View File

@ -140,7 +140,7 @@ define(['jquery', 'core/notification', 'core/templates', 'core/ajax', 'tool_lp/d
}.bind(this)); }.bind(this));
body.on('click', '[data-action="cancel"]', function() { body.on('click', '[data-action="cancel"]', function() {
popup.close(); popup.close();
}.bind(this)); });
}; };
/** /**
@ -151,7 +151,7 @@ define(['jquery', 'core/notification', 'core/templates', 'core/ajax', 'tool_lp/d
ScaleConfig.prototype.setScaleConfig = function() { ScaleConfig.prototype.setScaleConfig = function() {
var body = $(this.popup.getContent()); var body = $(this.popup.getContent());
// Get the data. // Get the data.
var data = [{ scaleid: this.scaleid}]; var data = [{scaleid: this.scaleid}];
this.scalevalues.forEach(function(value) { this.scalevalues.forEach(function(value) {
var scaledefault = 0; var scaledefault = 0;
var proficient = 0; var proficient = 0;

View File

@ -67,8 +67,8 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
// We are chaining ajax requests here. // We are chaining ajax requests here.
var requests = ajax.call([{ var requests = ajax.call([{
methodname: 'core_competency_delete_template', methodname: 'core_competency_delete_template',
args: { id: templateid, args: {id: templateid,
deleteplans: deleteplans } deleteplans: deleteplans}
}, { }, {
methodname: 'tool_lp_data_for_templates_manage_page', methodname: 'tool_lp_data_for_templates_manage_page',
args: { args: {
@ -93,7 +93,7 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
// We are chaining ajax requests here. // We are chaining ajax requests here.
var requests = ajax.call([{ var requests = ajax.call([{
methodname: 'core_competency_duplicate_template', methodname: 'core_competency_duplicate_template',
args: { id: templateid } args: {id: templateid}
}, { }, {
methodname: 'tool_lp_data_for_templates_manage_page', methodname: 'tool_lp_data_for_templates_manage_page',
args: { args: {
@ -119,22 +119,22 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
var requests = ajax.call([{ var requests = ajax.call([{
methodname: 'core_competency_read_template', methodname: 'core_competency_read_template',
args: { id: templateid } args: {id: templateid}
}, { }, {
methodname: 'core_competency_template_has_related_data', methodname: 'core_competency_template_has_related_data',
args: { id: templateid } args: {id: templateid}
}]); }]);
requests[0].done(function(template) { requests[0].done(function(template) {
requests[1].done(function(templatehasrelateddata) { requests[1].done(function(templatehasrelateddata) {
if (templatehasrelateddata) { if (templatehasrelateddata) {
str.get_strings([ str.get_strings([
{ key: 'deletetemplate', component: 'tool_lp', param: template.shortname }, {key: 'deletetemplate', component: 'tool_lp', param: template.shortname},
{ key: 'deletetemplatewithplans', component: 'tool_lp' }, {key: 'deletetemplatewithplans', component: 'tool_lp'},
{ key: 'deleteplans', component: 'tool_lp' }, {key: 'deleteplans', component: 'tool_lp'},
{ key: 'unlinkplanstemplate', component: 'tool_lp' }, {key: 'unlinkplanstemplate', component: 'tool_lp'},
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: 'cancel', component: 'moodle' } {key: 'cancel', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
var actions = [{'text': strings[2], 'value': 'delete'}, var actions = [{'text': strings[2], 'value': 'delete'},
{'text': strings[3], 'value': 'unlink'}]; {'text': strings[3], 'value': 'unlink'}];
@ -154,10 +154,10 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
}).fail(notification.exception); }).fail(notification.exception);
} else { } else {
str.get_strings([ str.get_strings([
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: 'deletetemplate', component: 'tool_lp', param: template.shortname }, {key: 'deletetemplate', component: 'tool_lp', param: template.shortname},
{ key: 'delete', component: 'moodle' }, {key: 'delete', component: 'moodle'},
{ key: 'cancel', component: 'moodle' } {key: 'cancel', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
notification.confirm( notification.confirm(
strings[0], // Confirm. strings[0], // Confirm.

View File

@ -168,7 +168,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
if (!this.multiSelect) { if (!this.multiSelect) {
allSelected = allSelected.first(); allSelected = allSelected.first();
} }
this.treeRoot.trigger('selectionchanged', { selected: allSelected }); this.treeRoot.trigger('selectionchanged', {selected: allSelected});
}; };
/** /**
@ -274,6 +274,8 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
* @param {Event} e The event. * @param {Event} e The event.
* @return {Boolean} * @return {Boolean}
*/ */
// This function should be simplified. In the meantime..
// eslint-disable-next-line complexity
Tree.prototype.handleKeyDown = function(item, e) { Tree.prototype.handleKeyDown = function(item, e) {
var currentIndex = this.visibleItems.index(item); var currentIndex = this.visibleItems.index(item);
var newItem = null; var newItem = null;

View File

@ -44,15 +44,15 @@ define(['jquery', 'core/notification', 'core/ajax', 'core/templates'], function(
if (this._planId) { if (this._planId) {
this._methodName = 'tool_lp_data_for_user_competency_summary_in_plan'; this._methodName = 'tool_lp_data_for_user_competency_summary_in_plan';
this._args = { competencyid: this._competencyId, planid: this._planId }; this._args = {competencyid: this._competencyId, planid: this._planId};
this._templateName = 'tool_lp/user_competency_summary_in_plan'; this._templateName = 'tool_lp/user_competency_summary_in_plan';
} else if (this._courseId) { } else if (this._courseId) {
this._methodName = 'tool_lp_data_for_user_competency_summary_in_course'; this._methodName = 'tool_lp_data_for_user_competency_summary_in_course';
this._args = { userid: this._userId, competencyid: this._competencyId, courseid: this._courseId }; this._args = {userid: this._userId, competencyid: this._competencyId, courseid: this._courseId};
this._templateName = 'tool_lp/user_competency_summary_in_course'; this._templateName = 'tool_lp/user_competency_summary_in_course';
} else { } else {
this._methodName = 'tool_lp_data_for_user_competency_summary'; this._methodName = 'tool_lp_data_for_user_competency_summary';
this._args = { userid: this._userId, competencyid: this._competencyId }; this._args = {userid: this._userId, competencyid: this._competencyId};
this._templateName = 'tool_lp/user_competency_summary'; this._templateName = 'tool_lp/user_competency_summary';
} }
}; };

View File

@ -54,7 +54,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/templates'
var requests = ajax.call([{ 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 }, args: {competencyid: competencyId, planid: planId},
done: this._contextLoaded.bind(this), done: this._contextLoaded.bind(this),
fail: notification.exception fail: notification.exception
}]); }]);
@ -99,7 +99,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/templates'
ajax.call([{ ajax.call([{
methodname: 'tool_lp_data_for_plan_page', methodname: 'tool_lp_data_for_plan_page',
args: { planid: planId}, args: {planid: planId},
done: this._pageContextLoaded.bind(this), done: this._pageContextLoaded.bind(this),
fail: notification.exception fail: notification.exception
}]); }]);

View File

@ -104,7 +104,7 @@ define(['jquery',
templates.render(self._template, context) templates.render(self._template, context)
.done(function(newhtml, newjs) { .done(function(newhtml, newjs) {
templates.replaceNode($(self._region), newhtml, newjs); templates.replaceNode($(self._region), newhtml, newjs);
}.bind(self)) })
.fail(notification.exception); .fail(notification.exception);
}; };
@ -126,7 +126,7 @@ define(['jquery',
// Apply all the promises, and refresh when the last one is resolved. // Apply all the promises, and refresh when the last one is resolved.
return $.when.apply($.when, ajax.call(calls)) return $.when.apply($.when, ajax.call(calls))
.then(function() { .then(function() {
self._renderView.call(self, arguments[arguments.length - 1]); self._renderView(arguments[arguments.length - 1]);
}) })
.fail(notification.exception); .fail(notification.exception);
}; };
@ -140,7 +140,7 @@ define(['jquery',
var self = this, var self = this,
calls = [{ calls = [{
methodname: 'core_competency_delete_user_evidence', methodname: 'core_competency_delete_user_evidence',
args: { id: evidenceData.id } args: {id: evidenceData.id}
}]; }];
self._callAndRefresh(calls, evidenceData); self._callAndRefresh(calls, evidenceData);
}; };
@ -156,15 +156,15 @@ define(['jquery',
requests = ajax.call([{ requests = ajax.call([{
methodname: 'core_competency_read_user_evidence', methodname: 'core_competency_read_user_evidence',
args: { id: evidenceData.id } args: {id: evidenceData.id}
}]); }]);
requests[0].done(function(evidence) { requests[0].done(function(evidence) {
str.get_strings([ str.get_strings([
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: 'deleteuserevidence', component: 'tool_lp', param: evidence.name }, {key: 'deleteuserevidence', component: 'tool_lp', param: evidence.name},
{ key: 'delete', component: 'moodle' }, {key: 'delete', component: 'moodle'},
{ key: 'cancel', component: 'moodle' } {key: 'cancel', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
notification.confirm( notification.confirm(
strings[0], // Confirm. strings[0], // Confirm.
@ -173,7 +173,7 @@ define(['jquery',
strings[3], // Cancel. strings[3], // Cancel.
function() { function() {
self._doDelete(evidenceData); self._doDelete(evidenceData);
}.bind(self) }
); );
}).fail(notification.exception); }).fail(notification.exception);
}).fail(notification.exception); }).fail(notification.exception);
@ -227,7 +227,7 @@ define(['jquery',
picker.on('save', function(e, data) { picker.on('save', function(e, data) {
var competencyIds = data.competencyIds; var competencyIds = data.competencyIds;
self._doCreateUserEvidenceCompetency(evidenceData, competencyIds, data.requestReview); self._doCreateUserEvidenceCompetency(evidenceData, competencyIds, data.requestReview);
}.bind(self)); });
picker.display(); picker.display();
}; };
@ -295,7 +295,7 @@ define(['jquery',
var self = this, var self = this,
calls = [{ calls = [{
methodname: 'core_competency_request_review_of_user_evidence_linked_competencies', methodname: 'core_competency_request_review_of_user_evidence_linked_competencies',
args: { id: evidenceData.id } args: {id: evidenceData.id}
}]; }];
self._callAndRefresh(calls, evidenceData); self._callAndRefresh(calls, evidenceData);
}; };
@ -311,15 +311,15 @@ define(['jquery',
requests = ajax.call([{ requests = ajax.call([{
methodname: 'core_competency_read_user_evidence', methodname: 'core_competency_read_user_evidence',
args: { id: evidenceData.id } args: {id: evidenceData.id}
}]); }]);
requests[0].done(function(evidence) { requests[0].done(function(evidence) {
str.get_strings([ str.get_strings([
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: 'sendallcompetenciestoreview', component: 'tool_lp', param: evidence.name }, {key: 'sendallcompetenciestoreview', component: 'tool_lp', param: evidence.name},
{ key: 'confirm', component: 'moodle' }, {key: 'confirm', component: 'moodle'},
{ key: 'cancel', component: 'moodle' } {key: 'cancel', component: 'moodle'}
]).done(function(strings) { ]).done(function(strings) {
notification.confirm( notification.confirm(
strings[0], // Confirm. strings[0], // Confirm.
@ -328,7 +328,7 @@ define(['jquery',
strings[3], // Cancel. strings[3], // Cancel.
function() { function() {
self._doReviewUserEvidenceCompetencies(evidenceData); self._doReviewUserEvidenceCompetencies(evidenceData);
}.bind(self) }
); );
}).fail(notification.exception); }).fail(notification.exception);
}).fail(notification.exception); }).fail(notification.exception);

View File

@ -31,7 +31,7 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
* @param {String[]} templateList List of template ids. * @param {String[]} templateList List of template ids.
*/ */
var reloadListTemplate = function(templateList) { var reloadListTemplate = function(templateList) {
templates.render('tool_templatelibrary/search_results', { templates: templateList }) templates.render('tool_templatelibrary/search_results', {templates: templateList})
.done(function(result, js) { .done(function(result, js) {
templates.replaceNode($('[data-region="searchresults"]'), result, js); templates.replaceNode($('[data-region="searchresults"]'), result, js);
}).fail(notification.exception); }).fail(notification.exception);
@ -49,10 +49,10 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
// Trigger the search. // Trigger the search.
ajax.call([ ajax.call([
{ methodname: 'tool_templatelibrary_list_templates', {methodname: 'tool_templatelibrary_list_templates',
args: { component: componentStr, search: searchStr }, args: {component: componentStr, search: searchStr},
done: reloadListTemplate, done: reloadListTemplate,
fail: notification.exception } fail: notification.exception}
], true, false); ], true, false);
}; };

View File

@ -1,5 +1,6 @@
YUI.add('moodle-course-dragdrop', function (Y, NAME) { YUI.add('moodle-course-dragdrop', function (Y, NAME) {
/* eslint-disable no-unused-vars */
/** /**
* Drag and Drop for course sections and course modules. * Drag and Drop for course sections and course modules.
* *

View File

@ -1,5 +1,6 @@
YUI.add('moodle-course-dragdrop', function (Y, NAME) { YUI.add('moodle-course-dragdrop', function (Y, NAME) {
/* eslint-disable no-unused-vars */
/** /**
* Drag and Drop for course sections and course modules. * Drag and Drop for course sections and course modules.
* *

View File

@ -1,5 +1,7 @@
YUI.add('moodle-course-management', function (Y, NAME) { YUI.add('moodle-course-management', function (Y, NAME) {
/* global DragDrop, Category, Course */
/** /**
* Provides drop down menus for list of action links. * Provides drop down menus for list of action links.
* *
@ -588,6 +590,8 @@ M.course.management.console = null;
M.course.management.init = function(config) { M.course.management.init = function(config) {
M.course.management.console = new Console(config); M.course.management.console = new Console(config);
}; };
/* global Console */
/** /**
* Drag and Drop handler * Drag and Drop handler
* *
@ -1173,6 +1177,8 @@ Item.prototype = {
} }
}; };
Y.extend(Item, Y.Base, Item.prototype); Y.extend(Item, Y.Base, Item.prototype);
/* global Item */
/** /**
* A managed category. * A managed category.
* *
@ -1616,6 +1622,8 @@ Category.prototype = {
} }
}; };
Y.extend(Category, Item, Category.prototype); Y.extend(Category, Item, Category.prototype);
/* global Item */
/** /**
* A managed course. * A managed course.
* *

View File

@ -1,5 +1,7 @@
YUI.add('moodle-course-management', function (Y, NAME) { YUI.add('moodle-course-management', function (Y, NAME) {
/* global DragDrop, Category, Course */
/** /**
* Provides drop down menus for list of action links. * Provides drop down menus for list of action links.
* *
@ -581,6 +583,8 @@ M.course.management.console = null;
M.course.management.init = function(config) { M.course.management.init = function(config) {
M.course.management.console = new Console(config); M.course.management.console = new Console(config);
}; };
/* global Console */
/** /**
* Drag and Drop handler * Drag and Drop handler
* *
@ -1147,6 +1151,8 @@ Item.prototype = {
} }
}; };
Y.extend(Item, Y.Base, Item.prototype); Y.extend(Item, Y.Base, Item.prototype);
/* global Item */
/** /**
* A managed category. * A managed category.
* *
@ -1575,6 +1581,8 @@ Category.prototype = {
} }
}; };
Y.extend(Category, Item, Category.prototype); Y.extend(Category, Item, Category.prototype);
/* global Item */
/** /**
* A managed course. * A managed course.
* *

View File

@ -1,5 +1,6 @@
YUI.add('moodle-course-toolboxes', function (Y, NAME) { YUI.add('moodle-course-toolboxes', function (Y, NAME) {
/* eslint-disable no-unused-vars */
/** /**
* Resource and activity toolbox class. * Resource and activity toolbox class.
* *
@ -198,6 +199,7 @@ Y.extend(TOOLBOX, Y.Base, {
} }
} }
); );
/* global TOOLBOX, BODY, SELECTOR, INDENTLIMITS */
/** /**
* Resource and activity toolbox class. * Resource and activity toolbox class.
@ -749,6 +751,8 @@ M.course.init_resource_toolbox = function(config) {
M.course.resource_toolbox = new RESOURCETOOLBOX(config); M.course.resource_toolbox = new RESOURCETOOLBOX(config);
return M.course.resource_toolbox; return M.course.resource_toolbox;
}; };
/* global SELECTOR, TOOLBOX */
/** /**
* Resource and activity toolbox class. * Resource and activity toolbox class.
* *

View File

@ -1,5 +1,6 @@
YUI.add('moodle-course-toolboxes', function (Y, NAME) { YUI.add('moodle-course-toolboxes', function (Y, NAME) {
/* eslint-disable no-unused-vars */
/** /**
* Resource and activity toolbox class. * Resource and activity toolbox class.
* *
@ -198,6 +199,7 @@ Y.extend(TOOLBOX, Y.Base, {
} }
} }
); );
/* global TOOLBOX, BODY, SELECTOR, INDENTLIMITS */
/** /**
* Resource and activity toolbox class. * Resource and activity toolbox class.
@ -749,6 +751,8 @@ M.course.init_resource_toolbox = function(config) {
M.course.resource_toolbox = new RESOURCETOOLBOX(config); M.course.resource_toolbox = new RESOURCETOOLBOX(config);
return M.course.resource_toolbox; return M.course.resource_toolbox;
}; };
/* global SELECTOR, TOOLBOX */
/** /**
* Resource and activity toolbox class. * Resource and activity toolbox class.
* *

View File

@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
/** /**
* Drag and Drop for course sections and course modules. * Drag and Drop for course sections and course modules.
* *

View File

@ -1,3 +1,5 @@
/* global Item */
/** /**
* A managed category. * A managed category.
* *

View File

@ -1,3 +1,5 @@
/* global DragDrop, Category, Course */
/** /**
* Provides drop down menus for list of action links. * Provides drop down menus for list of action links.
* *

View File

@ -1,3 +1,5 @@
/* global Item */
/** /**
* A managed course. * A managed course.
* *

View File

@ -1,3 +1,5 @@
/* global Console */
/** /**
* Drag and Drop handler * Drag and Drop handler
* *

View File

@ -1,3 +1,5 @@
/* global TOOLBOX, BODY, SELECTOR, INDENTLIMITS */
/** /**
* Resource and activity toolbox class. * Resource and activity toolbox class.
* *

View File

@ -1,3 +1,5 @@
/* global SELECTOR, TOOLBOX */
/** /**
* Resource and activity toolbox class. * Resource and activity toolbox class.
* *

View File

@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
/** /**
* Resource and activity toolbox class. * Resource and activity toolbox class.
* *
@ -196,4 +197,3 @@ Y.extend(TOOLBOX, Y.Base, {
} }
} }
); );

View File

@ -14,6 +14,7 @@ YUI.add('moodle-gradereport_grader-gradereporttable', function (Y, NAME) {
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* eslint-disable no-unused-vars */
/** /**
* Grader Report Functionality. * Grader Report Functionality.
@ -155,6 +156,7 @@ Y.namespace('M.gradereport_grader').init = function(config) {
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global SELECTORS */
/** /**
* @module moodle-gradereport_grader-gradereporttable * @module moodle-gradereport_grader-gradereporttable

View File

@ -14,6 +14,7 @@ YUI.add('moodle-gradereport_grader-gradereporttable', function (Y, NAME) {
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* eslint-disable no-unused-vars */
/** /**
* Grader Report Functionality. * Grader Report Functionality.
@ -155,6 +156,7 @@ Y.namespace('M.gradereport_grader').init = function(config) {
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global SELECTORS */
/** /**
* @module moodle-gradereport_grader-gradereporttable * @module moodle-gradereport_grader-gradereporttable

View File

@ -12,6 +12,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global SELECTORS */
/** /**
* @module moodle-gradereport_grader-gradereporttable * @module moodle-gradereport_grader-gradereporttable

View File

@ -12,6 +12,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* eslint-disable no-unused-vars */
/** /**
* Grader Report Functionality. * Grader Report Functionality.

View File

@ -1 +1 @@
define(["jquery","core/ajax"],function(a,b){var c=function(c,d,e,f){var g=[];for(var h in f)g.push({name:h,value:f[h]});var i=a.Deferred(),j=b.call([{methodname:"core_get_fragment",args:{component:c,callback:d,contextid:e,args:g}}],!1);return j[0].done(function(a){i.resolve(a)}).fail(function(a){i.reject(a)}),i.promise()};return{loadFragment:function(b,d,e,f){var g=a.Deferred();return a.when(c(b,d,e,f)).then(function(b){var c=a(b.javascript),d="";c.each(function(b,c){c=a(c);var e=c.prop("tagName");if(e&&"script"==e.toLowerCase())if(c.attr("src")){var f=!1;a("script").each(function(b,d){return a(d).attr("src")==c.attr("src")&&(f=!0),!f}),f||(d+=" { ",d+=' node = document.createElement("script"); ',d+=' node.type = "text/javascript"; ',d+=' node.src = decodeURI("'+encodeURI(c.attr("src"))+'"); ',d+=' document.getElementsByTagName("head")[0].appendChild(node); ',d+=" } ")}else d+=" "+c.text()}.bind(this)),g.resolve(b.html,d)}).fail(function(a){g.reject(a)}),g.promise()}}}); define(["jquery","core/ajax"],function(a,b){var c=function(c,d,e,f){var g=[];for(var h in f)g.push({name:h,value:f[h]});var i=a.Deferred(),j=b.call([{methodname:"core_get_fragment",args:{component:c,callback:d,contextid:e,args:g}}],!1);return j[0].done(function(a){i.resolve(a)}).fail(function(a){i.reject(a)}),i.promise()};return{loadFragment:function(b,d,e,f){var g=a.Deferred();return a.when(c(b,d,e,f)).then(function(b){var c=a(b.javascript),d="";c.each(function(b,c){c=a(c);var e=c.prop("tagName");if(e&&"script"==e.toLowerCase())if(c.attr("src")){var f=!1;a("script").each(function(b,d){return a(d).attr("src")==c.attr("src")&&(f=!0),!f}),f||(d+=" { ",d+=' node = document.createElement("script"); ',d+=' node.type = "text/javascript"; ',d+=' node.src = decodeURI("'+encodeURI(c.attr("src"))+'"); ',d+=' document.getElementsByTagName("head")[0].appendChild(node); ',d+=" } ")}else d+=" "+c.text()}),g.resolve(b.html,d)}).fail(function(a){g.reject(a)}),g.promise()}}});

View File

@ -1 +1 @@
define(["core/yui","jquery","core/log"],function(a,b,c){var d={types:{success:"core/notification_success",info:"core/notification_info",warning:"core/notification_warning",error:"core/notification_error"},fieldName:"user-notifications",fetchNotifications:function(){require(["core/ajax"],function(a){var b=a.call([{methodname:"core_fetch_notifications",args:{contextid:d.contextid}}]);b[0].done(d.addNotifications)})},addNotifications:function(a){a||(a=[]),b.each(a,function(a,b){d.renderNotification(b.template,b.variables)})},setupTargetRegion:function(){var a=b("#"+d.fieldName);if(!a.length){var c=b("<span>").attr("id",d.fieldName);return a=b("#region-main"),a.length?a.prepend(c):(a=b('[role="main"]'),a.length?a.prepend(c):(a=b("body"),a.prepend(c)))}},addNotification:function(a){var c=d.types.error;return a=b.extend({closebutton:!0,announce:!0,type:"error"},a),a.template?(c=a.template,delete a.template):a.type&&("undefined"!=typeof d.types[a.type]&&(c=d.types[a.type]),delete a.type),d.renderNotification(c,a)},renderNotification:function(a,e){return"undefined"!=typeof e.message&&e.message?void require(["core/templates"],function(c){c.render(a,e).done(function(a,e){b("#"+d.fieldName).prepend(a),c.runTemplateJS(e)}).fail(d.exception)}):void c.debug("Notification received without content. Skipping.")},alert:function(b,c,d){a.use("moodle-core-notification-alert",function(){var a=new M.core.alert({title:b,message:c,yesLabel:d});a.show()})},confirm:function(b,c,d,e,f,g){a.use("moodle-core-notification-confirm",function(){var a=new M.core.confirm({title:b,question:c,yesLabel:d,noLabel:e});a.on("complete-yes",function(){f()}),g&&a.on("complete-no",function(){g()}),a.show()})},exception:function(b){b.backtrace&&(b.lineNumber=b.backtrace[0].line,b.fileName=b.backtrace[0].file,b.fileName="..."+b.fileName.substr(b.fileName.length-20),b.stack=b.debuginfo,b.name=b.errorcode),a.use("moodle-core-notification-exception",function(){var a=new M.core.exception(b);a.show()})}};return{init:function(a,b){d.contextid=a,d.setupTargetRegion(),d.addNotifications(b),d.fetchNotifications()},fetchNotifications:d.fetchNotifications,addNotification:d.addNotification,alert:d.alert,confirm:d.confirm,exception:d.exception}}); define(["core/yui","jquery","core/log"],function(a,b,c){var d={types:{success:"core/notification_success",info:"core/notification_info",warning:"core/notification_warning",error:"core/notification_error"},fieldName:"user-notifications",fetchNotifications:function(){require(["core/ajax"],function(a){var b=a.call([{methodname:"core_fetch_notifications",args:{contextid:d.contextid}}]);b[0].done(d.addNotifications)})},addNotifications:function(a){a||(a=[]),b.each(a,function(a,b){d.renderNotification(b.template,b.variables)})},setupTargetRegion:function(){var a=b("#"+d.fieldName);if(a.length)return!1;var c=b("<span>").attr("id",d.fieldName);return a=b("#region-main"),a.length?a.prepend(c):(a=b('[role="main"]'),a.length?a.prepend(c):(a=b("body"),a.prepend(c)))},addNotification:function(a){var c=d.types.error;return a=b.extend({closebutton:!0,announce:!0,type:"error"},a),a.template?(c=a.template,delete a.template):a.type&&("undefined"!=typeof d.types[a.type]&&(c=d.types[a.type]),delete a.type),d.renderNotification(c,a)},renderNotification:function(a,e){return"undefined"!=typeof e.message&&e.message?void require(["core/templates"],function(c){c.render(a,e).done(function(a,e){b("#"+d.fieldName).prepend(a),c.runTemplateJS(e)}).fail(d.exception)}):void c.debug("Notification received without content. Skipping.")},alert:function(b,c,d){a.use("moodle-core-notification-alert",function(){var a=new M.core.alert({title:b,message:c,yesLabel:d});a.show()})},confirm:function(b,c,d,e,f,g){a.use("moodle-core-notification-confirm",function(){var a=new M.core.confirm({title:b,question:c,yesLabel:d,noLabel:e});a.on("complete-yes",function(){f()}),g&&a.on("complete-no",function(){g()}),a.show()})},exception:function(b){b.backtrace&&(b.lineNumber=b.backtrace[0].line,b.fileName=b.backtrace[0].file,b.fileName="..."+b.fileName.substr(b.fileName.length-20),b.stack=b.debuginfo,b.name=b.errorcode),a.use("moodle-core-notification-exception",function(){var a=new M.core.exception(b);a.show()})}};return{init:function(a,b){d.contextid=a,d.setupTargetRegion(),d.addNotifications(b),d.fetchNotifications()},fetchNotifications:d.fetchNotifications,addNotification:d.addNotification,alert:d.alert,confirm:d.confirm,exception:d.exception}});

File diff suppressed because one or more lines are too long

View File

@ -44,7 +44,7 @@ define(['jquery', 'core/yui'],
var yuiNodes = new Y.NodeList(nodes.get()); var yuiNodes = new Y.NodeList(nodes.get());
// And again for YUI. // And again for YUI.
Y.fire(M.core.event.FILTER_CONTENT_UPDATED, { nodes: yuiNodes }); Y.fire(M.core.event.FILTER_CONTENT_UPDATED, {nodes: yuiNodes});
}); });
}, },

View File

@ -90,10 +90,10 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
} }
originalSelect.children('option').each(function(index, ele) { originalSelect.children('option').each(function(index, ele) {
if ($(ele).prop('selected')) { 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); var context = $.extend({items: items}, options, state);
// Render the template. // Render the template.
templates.render('core/form_autocomplete_selection', context).done(function(newHTML) { templates.render('core/form_autocomplete_selection', context).done(function(newHTML) {
@ -317,13 +317,13 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
var suggestions = []; var suggestions = [];
originalSelect.children('option').each(function(index, option) { originalSelect.children('option').each(function(index, option) {
if ($(option).prop('selected') !== true) { if ($(option).prop('selected') !== true) {
suggestions[suggestions.length] = { label: option.innerHTML, value: $(option).attr('value') }; suggestions[suggestions.length] = {label: option.innerHTML, value: $(option).attr('value')};
} }
}); });
// Re-render the list of suggestions. // Re-render the list of suggestions.
var searchquery = state.caseSensitive ? query : query.toLocaleLowerCase(); var searchquery = state.caseSensitive ? query : query.toLocaleLowerCase();
var context = $.extend({ options: suggestions}, options, state); var context = $.extend({options: suggestions}, options, state);
templates.render( templates.render(
'core/form_autocomplete_suggestions', 'core/form_autocomplete_suggestions',
context context
@ -752,7 +752,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification']
// Create the new markup and insert it after the select. // Create the new markup and insert it after the select.
var suggestions = []; var suggestions = [];
originalSelect.children('option').each(function(index, option) { originalSelect.children('option').each(function(index, option) {
suggestions[index] = { label: option.innerHTML, value: $(option).attr('value') }; suggestions[index] = {label: option.innerHTML, value: $(option).attr('value')};
}); });
// Render all the parts of our UI. // Render all the parts of our UI.

View File

@ -29,12 +29,13 @@ define(['core/ajax', 'jquery'], function(ajax, $) {
// Public variables and functions. // Public variables and functions.
processResults: function(selector, data) { processResults: function(selector, data) {
// Mangle the results into an array of objects. // Mangle the results into an array of objects.
var results = [], i = 0; var results = [];
var i = 0;
var excludelist = String($(selector).data('exclude')).split(','); var excludelist = String($(selector).data('exclude')).split(',');
for (i = 0; i < data.courses.length; i++) { for (i = 0; i < data.courses.length; i++) {
if (excludelist.indexOf(String(data.courses[i].id)) === -1) { if (excludelist.indexOf(String(data.courses[i].id)) === -1) {
results.push({ value: data.courses[i].id, label: data.courses[i].displayname }); results.push({value: data.courses[i].id, label: data.courses[i].displayname});
} }
} }
return results; return results;

View File

@ -109,7 +109,7 @@ define(['jquery', 'core/ajax'], function($, ajax) {
allScript += ' ' + scriptNode.text(); allScript += ' ' + scriptNode.text();
} }
} }
}.bind(this)); });
promise.resolve(data.html, allScript); promise.resolve(data.html, allScript);
}).fail(function(ex) { }).fail(function(ex) {
promise.reject(ex); promise.reject(ex);

View File

@ -106,7 +106,8 @@ define(['core/config'], function(config) {
// From http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery. // From http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery.
/* jshint bitwise: false */ /* jshint bitwise: false */
/* eslint no-bitwise: "off" */ /* eslint no-bitwise: "off" */
var hash = 0, i, chr, len; var hash = 0;
var i, chr, len;
if (source.length === 0) { if (source.length === 0) {
return hash; return hash;
} }

View File

@ -66,7 +66,7 @@ function(Y, $, log) {
setupTargetRegion: function() { setupTargetRegion: function() {
var targetRegion = $('#' + notificationModule.fieldName); var targetRegion = $('#' + notificationModule.fieldName);
if (targetRegion.length) { if (targetRegion.length) {
return; return false;
} }
var newRegion = $('<span>').attr('id', notificationModule.fieldName); var newRegion = $('<span>').attr('id', notificationModule.fieldName);

View File

@ -46,7 +46,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
var promises = ajax.call([{ var promises = ajax.call([{
methodname: 'core_tag_get_tagindex', methodname: 'core_tag_get_tagindex',
args: { tagindex: args } args: {tagindex: args}
}], true); }], true);
$.when.apply($, promises) $.when.apply($, promises)
@ -102,7 +102,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
var form = $(this).closest('form').get(0), var form = $(this).closest('form').get(0),
cnt = $(form).find("input[type=checkbox]:checked").length; cnt = $(form).find("input[type=checkbox]:checked").length;
if (!cnt) { if (!cnt) {
return false; return;
} }
var tempElement = $("<input type='hidden'/>").attr('name', this.name); var tempElement = $("<input type='hidden'/>").attr('name', this.name);
e.preventDefault(); e.preventDefault();
@ -134,7 +134,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
notification.alert(s[0], s[1], s[2]); notification.alert(s[0], s[1], s[2]);
} }
); );
return false; return;
} }
var tempElement = $("<input type='hidden'/>").attr('name', this.name); var tempElement = $("<input type='hidden'/>").attr('name', this.name);
str.get_strings([ str.get_strings([
@ -323,7 +323,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
var href = $(this).attr('data-url') + '&sesskey=' + M.cfg.sesskey; var href = $(this).attr('data-url') + '&sesskey=' + M.cfg.sesskey;
str.get_strings([ str.get_strings([
{key: 'delete'}, {key: 'delete'},
{key: 'suredeletecoll', component: 'tag', param: $(this).attr('data-collname') }, {key: 'suredeletecoll', component: 'tag', param: $(this).attr('data-collname')},
{key: 'yes'}, {key: 'yes'},
{key: 'no'}, {key: 'no'},
]).done(function(s) { ]).done(function(s) {

View File

@ -161,9 +161,9 @@ define(['core/mustache',
var templatecontext = { var templatecontext = {
attributes: [ attributes: [
{ name: 'src', value: url}, {name: 'src', value: url},
{ name: 'alt', value: helper(text)}, {name: 'alt', value: helper(text)},
{ name: 'class', value: 'smallicon'} {name: 'class', value: 'smallicon'}
] ]
}; };
// We forced loading of this early, so it will be in the cache. // We forced loading of this early, so it will be in the cache.
@ -272,7 +272,7 @@ define(['core/mustache',
context.quote = function() { context.quote = function() {
return quoteHelper; return quoteHelper;
}; };
context.globals = { config: config }; context.globals = {config: config};
context.currentTheme = themeName; context.currentTheme = themeName;
}; };

View File

@ -343,6 +343,8 @@ define(['jquery'], function($) {
* @param {Event} e The event. * @param {Event} e The event.
* @return {Boolean} * @return {Boolean}
*/ */
// This function should be simplified. In the meantime..
// eslint-disable-next-line complexity
Tree.prototype.handleKeyDown = function(item, e) { Tree.prototype.handleKeyDown = function(item, e) {
var currentIndex = this.getVisibleItems().index(item); var currentIndex = this.getVisibleItems().index(item);

View File

@ -14,6 +14,7 @@ YUI.add('moodle-editor_atto-editor', function (Y, NAME) {
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* eslint-disable no-unused-vars */
/** /**
* The Atto WYSIWG pluggable editor, written for Moodle. * The Atto WYSIWG pluggable editor, written for Moodle.
@ -735,6 +736,8 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorTextArea]);
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global NOTIFY_WARNING, NOTIFY_INFO */
/* eslint-disable no-unused-vars */
/** /**
* A autosave function for the Atto editor. * A autosave function for the Atto editor.
@ -1250,6 +1253,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorAutosaveIo]);
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global LOGNAME */
/** /**
* @module moodle-editor_atto-editor * @module moodle-editor_atto-editor
@ -1875,6 +1879,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorToolbar]);
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global LOGNAME */
/** /**
* @module moodle-editor_atto-editor * @module moodle-editor_atto-editor
@ -2083,6 +2088,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorToolbarNav]);
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global rangy */
/** /**
* @module moodle-editor_atto-editor * @module moodle-editor_atto-editor
@ -2503,6 +2509,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorSelection]);
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global rangy */
/** /**
* @module moodle-editor_atto-editor * @module moodle-editor_atto-editor

View File

@ -14,6 +14,7 @@ YUI.add('moodle-editor_atto-editor', function (Y, NAME) {
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* eslint-disable no-unused-vars */
/** /**
* The Atto WYSIWG pluggable editor, written for Moodle. * The Atto WYSIWG pluggable editor, written for Moodle.
@ -730,6 +731,8 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorTextArea]);
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global NOTIFY_WARNING, NOTIFY_INFO */
/* eslint-disable no-unused-vars */
/** /**
* A autosave function for the Atto editor. * A autosave function for the Atto editor.
@ -1239,6 +1242,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorAutosaveIo]);
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global LOGNAME */
/** /**
* @module moodle-editor_atto-editor * @module moodle-editor_atto-editor
@ -1863,6 +1867,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorToolbar]);
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global LOGNAME */
/** /**
* @module moodle-editor_atto-editor * @module moodle-editor_atto-editor
@ -2069,6 +2074,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorToolbarNav]);
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global rangy */
/** /**
* @module moodle-editor_atto-editor * @module moodle-editor_atto-editor
@ -2489,6 +2495,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorSelection]);
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global rangy */
/** /**
* @module moodle-editor_atto-editor * @module moodle-editor_atto-editor

View File

@ -162,6 +162,7 @@ Y.namespace('M.editor_atto').EditorPlugin = EditorPlugin;
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global YUI */
/** /**
* @module moodle-editor_atto-plugin * @module moodle-editor_atto-plugin

View File

@ -162,6 +162,7 @@ Y.namespace('M.editor_atto').EditorPlugin = EditorPlugin;
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global YUI */
/** /**
* @module moodle-editor_atto-plugin * @module moodle-editor_atto-plugin

View File

@ -12,6 +12,8 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global NOTIFY_WARNING, NOTIFY_INFO */
/* eslint-disable no-unused-vars */
/** /**
* A autosave function for the Atto editor. * A autosave function for the Atto editor.

View File

@ -12,6 +12,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global LOGNAME */
/** /**
* @module moodle-editor_atto-editor * @module moodle-editor_atto-editor

View File

@ -12,6 +12,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global YUI */
/** /**
* @module moodle-editor_atto-plugin * @module moodle-editor_atto-plugin

View File

@ -12,6 +12,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* eslint-disable no-unused-vars */
/** /**
* The Atto WYSIWG pluggable editor, written for Moodle. * The Atto WYSIWG pluggable editor, written for Moodle.

View File

@ -1 +0,0 @@
/* globals rangy */

View File

@ -12,6 +12,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global rangy */
/** /**
* @module moodle-editor_atto-editor * @module moodle-editor_atto-editor

View File

@ -12,6 +12,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global rangy */
/** /**
* @module moodle-editor_atto-editor * @module moodle-editor_atto-editor

View File

@ -12,6 +12,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global LOGNAME */
/** /**
* @module moodle-editor_atto-editor * @module moodle-editor_atto-editor

View File

@ -1,5 +1,7 @@
YUI.add('moodle-form-dateselector', function (Y, NAME) { YUI.add('moodle-form-dateselector', function (Y, NAME) {
/* global CALENDAR, MOODLECALENDAR */
/** /**
* Add some custom methods to the node class to make our lives a little * Add some custom methods to the node class to make our lives a little
* easier within this module. * easier within this module.

View File

@ -1,5 +1,7 @@
YUI.add('moodle-form-dateselector', function (Y, NAME) { YUI.add('moodle-form-dateselector', function (Y, NAME) {
/* global CALENDAR, MOODLECALENDAR */
/** /**
* Add some custom methods to the node class to make our lives a little * Add some custom methods to the node class to make our lives a little
* easier within this module. * easier within this module.

View File

@ -1,3 +1,5 @@
/* global CALENDAR, MOODLECALENDAR */
/** /**
* Add some custom methods to the node class to make our lives a little * Add some custom methods to the node class to make our lives a little
* easier within this module. * easier within this module.

View File

@ -1,5 +1,7 @@
YUI.add('moodle-core-blocks', function (Y, NAME) { YUI.add('moodle-core-blocks', function (Y, NAME) {
/* global MANAGER */
/** /**
* Provides drag and drop functionality for blocks. * Provides drag and drop functionality for blocks.
* *
@ -386,6 +388,8 @@ M.core_blocks = M.core_blocks || {};
M.core_blocks.init_dragdrop = function(params) { M.core_blocks.init_dragdrop = function(params) {
M.core.blockdraganddrop.init(params); M.core.blockdraganddrop.init(params);
}; };
/* global BLOCKREGION, SELECTOR, AJAXURL */
/** /**
* This file contains the drag and drop manager class. * This file contains the drag and drop manager class.
* *
@ -789,6 +793,8 @@ Y.extend(MANAGER, M.core.dragdrop, MANAGER.prototype, {
} }
} }
}); });
/* global MANAGER */
/** /**
* This file contains the Block Region class used by the drag and drop manager. * This file contains the Block Region class used by the drag and drop manager.
* *

View File

@ -1,5 +1,7 @@
YUI.add('moodle-core-blocks', function (Y, NAME) { YUI.add('moodle-core-blocks', function (Y, NAME) {
/* global MANAGER */
/** /**
* Provides drag and drop functionality for blocks. * Provides drag and drop functionality for blocks.
* *
@ -383,6 +385,8 @@ M.core_blocks = M.core_blocks || {};
M.core_blocks.init_dragdrop = function(params) { M.core_blocks.init_dragdrop = function(params) {
M.core.blockdraganddrop.init(params); M.core.blockdraganddrop.init(params);
}; };
/* global BLOCKREGION, SELECTOR, AJAXURL */
/** /**
* This file contains the drag and drop manager class. * This file contains the drag and drop manager class.
* *
@ -784,6 +788,8 @@ Y.extend(MANAGER, M.core.dragdrop, MANAGER.prototype, {
} }
} }
}); });
/* global MANAGER */
/** /**
* This file contains the Block Region class used by the drag and drop manager. * This file contains the Block Region class used by the drag and drop manager.
* *

View File

@ -8,7 +8,6 @@ YUI.add('moodle-core-dock', function (Y, NAME) {
* @module moodle-core-dock * @module moodle-core-dock
*/ */
var LOGNS = 'moodle-core-dock', var LOGNS = 'moodle-core-dock',
BODY = Y.one(Y.config.doc.body), BODY = Y.one(Y.config.doc.body),
CSS = { CSS = {
@ -34,7 +33,7 @@ var LOGNS = 'moodle-core-dock',
DOCKPANEL, DOCKPANEL,
TABHEIGHTMANAGER, TABHEIGHTMANAGER,
BLOCK, BLOCK,
DOCKEDITEM; DOCKEDITEM; // eslint-disable-line no-unused-vars
M.core = M.core || {}; M.core = M.core || {};
M.core.dock = M.core.dock || {}; M.core.dock = M.core.dock || {};
@ -1159,6 +1158,8 @@ Y.extend(DOCK, Y.Base, DOCK.prototype, {
} }
}); });
Y.augment(DOCK, Y.EventTarget); Y.augment(DOCK, Y.EventTarget);
/* global DOCKPANEL, LOGNS */
/** /**
* Dock JS. * Dock JS.
* *
@ -1395,6 +1396,8 @@ Y.extend(DOCKPANEL, Y.Base, DOCKPANEL.prototype, {
} }
}); });
Y.augment(DOCKPANEL, Y.EventTarget); Y.augment(DOCKPANEL, Y.EventTarget);
/* global TABHEIGHTMANAGER, LOGNS */
/** /**
* Dock JS. * Dock JS.
* *
@ -1635,6 +1638,8 @@ Y.Event.define("dock:actionkey", {
sub._delegateDetacher.detach(); sub._delegateDetacher.detach();
} }
}); });
/* global BLOCK, LOGNS, DOCKEDITEM */
/** /**
* Dock JS. * Dock JS.
* *
@ -1879,6 +1884,8 @@ Y.extend(BLOCK, Y.Base, BLOCK.prototype, {
} }
} }
}); });
/* global LOGNS, DOCKEDITEM */
/** /**
* Dock JS. * Dock JS.
* *

View File

@ -8,7 +8,6 @@ YUI.add('moodle-core-dock', function (Y, NAME) {
* @module moodle-core-dock * @module moodle-core-dock
*/ */
var LOGNS = 'moodle-core-dock', var LOGNS = 'moodle-core-dock',
BODY = Y.one(Y.config.doc.body), BODY = Y.one(Y.config.doc.body),
CSS = { CSS = {
@ -34,7 +33,7 @@ var LOGNS = 'moodle-core-dock',
DOCKPANEL, DOCKPANEL,
TABHEIGHTMANAGER, TABHEIGHTMANAGER,
BLOCK, BLOCK,
DOCKEDITEM; DOCKEDITEM; // eslint-disable-line no-unused-vars
M.core = M.core || {}; M.core = M.core || {};
M.core.dock = M.core.dock || {}; M.core.dock = M.core.dock || {};
@ -1146,6 +1145,8 @@ Y.extend(DOCK, Y.Base, DOCK.prototype, {
} }
}); });
Y.augment(DOCK, Y.EventTarget); Y.augment(DOCK, Y.EventTarget);
/* global DOCKPANEL, LOGNS */
/** /**
* Dock JS. * Dock JS.
* *
@ -1381,6 +1382,8 @@ Y.extend(DOCKPANEL, Y.Base, DOCKPANEL.prototype, {
} }
}); });
Y.augment(DOCKPANEL, Y.EventTarget); Y.augment(DOCKPANEL, Y.EventTarget);
/* global TABHEIGHTMANAGER, LOGNS */
/** /**
* Dock JS. * Dock JS.
* *
@ -1620,6 +1623,8 @@ Y.Event.define("dock:actionkey", {
sub._delegateDetacher.detach(); sub._delegateDetacher.detach();
} }
}); });
/* global BLOCK, LOGNS, DOCKEDITEM */
/** /**
* Dock JS. * Dock JS.
* *
@ -1861,6 +1866,8 @@ Y.extend(BLOCK, Y.Base, BLOCK.prototype, {
} }
} }
}); });
/* global LOGNS, DOCKEDITEM */
/** /**
* Dock JS. * Dock JS.
* *

View File

@ -1,5 +1,7 @@
YUI.add('moodle-core-languninstallconfirm', function (Y, NAME) { YUI.add('moodle-core-languninstallconfirm', function (Y, NAME) {
/* global NAME */
/** /**
* Home for a Confirmation class. * Home for a Confirmation class.
* *

View File

@ -1,5 +1,7 @@
YUI.add('moodle-core-languninstallconfirm', function (Y, NAME) { YUI.add('moodle-core-languninstallconfirm', function (Y, NAME) {
/* global NAME */
/** /**
* Home for a Confirmation class. * Home for a Confirmation class.
* *

View File

@ -1,5 +1,6 @@
YUI.add('moodle-core-notification-ajaxexception', function (Y, NAME) { YUI.add('moodle-core-notification-ajaxexception', function (Y, NAME) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX, var DIALOGUE_PREFIX,
BASE, BASE,
CONFIRMYES, CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once. // Set up the namespace once.
M.core = M.core || {}; M.core = M.core || {};
/* global BASE, DIALOGUE_PREFIX */
/** /**
* A dialogue type designed to display an appropriate error when an error * A dialogue type designed to display an appropriate error when an error
* thrown in the Moodle codebase was reported during an AJAX request. * thrown in the Moodle codebase was reported during an AJAX request.

View File

@ -1,5 +1,6 @@
YUI.add('moodle-core-notification-ajaxexception', function (Y, NAME) { YUI.add('moodle-core-notification-ajaxexception', function (Y, NAME) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX, var DIALOGUE_PREFIX,
BASE, BASE,
CONFIRMYES, CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once. // Set up the namespace once.
M.core = M.core || {}; M.core = M.core || {};
/* global BASE, DIALOGUE_PREFIX */
/** /**
* A dialogue type designed to display an appropriate error when an error * A dialogue type designed to display an appropriate error when an error
* thrown in the Moodle codebase was reported during an AJAX request. * thrown in the Moodle codebase was reported during an AJAX request.

View File

@ -1,5 +1,6 @@
YUI.add('moodle-core-notification-alert', function (Y, NAME) { YUI.add('moodle-core-notification-alert', function (Y, NAME) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX, var DIALOGUE_PREFIX,
BASE, BASE,
CONFIRMYES, CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once. // Set up the namespace once.
M.core = M.core || {}; M.core = M.core || {};
/* global BASE, TITLE, CONFIRMYES, DIALOGUE_PREFIX */
/** /**
* A dialogue type designed to display an alert to the user. * A dialogue type designed to display an alert to the user.
* *

View File

@ -1,5 +1,6 @@
YUI.add('moodle-core-notification-alert', function (Y, NAME) { YUI.add('moodle-core-notification-alert', function (Y, NAME) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX, var DIALOGUE_PREFIX,
BASE, BASE,
CONFIRMYES, CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once. // Set up the namespace once.
M.core = M.core || {}; M.core = M.core || {};
/* global BASE, TITLE, CONFIRMYES, DIALOGUE_PREFIX */
/** /**
* A dialogue type designed to display an alert to the user. * A dialogue type designed to display an alert to the user.
* *

View File

@ -1,5 +1,6 @@
YUI.add('moodle-core-notification-confirm', function (Y, NAME) { YUI.add('moodle-core-notification-confirm', function (Y, NAME) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX, var DIALOGUE_PREFIX,
BASE, BASE,
CONFIRMYES, CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once. // Set up the namespace once.
M.core = M.core || {}; M.core = M.core || {};
/* global CONFIRMYES, CONFIRMNO, QUESTION, BASE, TITLE, DIALOGUE_PREFIX */
/** /**
* A dialogue type designed to display a confirmation to the user. * A dialogue type designed to display a confirmation to the user.
* *

View File

@ -1,5 +1,6 @@
YUI.add('moodle-core-notification-confirm', function (Y, NAME) { YUI.add('moodle-core-notification-confirm', function (Y, NAME) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX, var DIALOGUE_PREFIX,
BASE, BASE,
CONFIRMYES, CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once. // Set up the namespace once.
M.core = M.core || {}; M.core = M.core || {};
/* global CONFIRMYES, CONFIRMNO, QUESTION, BASE, TITLE, DIALOGUE_PREFIX */
/** /**
* A dialogue type designed to display a confirmation to the user. * A dialogue type designed to display a confirmation to the user.
* *

View File

@ -1,5 +1,6 @@
YUI.add('moodle-core-notification-dialogue', function (Y, NAME) { YUI.add('moodle-core-notification-dialogue', function (Y, NAME) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX, var DIALOGUE_PREFIX,
BASE, BASE,
CONFIRMYES, CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once. // Set up the namespace once.
M.core = M.core || {}; M.core = M.core || {};
/* global DIALOGUE_PREFIX, BASE */
/** /**
* The generic dialogue class for use in Moodle. * The generic dialogue class for use in Moodle.
* *
@ -744,6 +747,8 @@ Y.Base.modifyAttrs(DIALOGUE, {
Y.Base.mix(DIALOGUE, [Y.M.core.WidgetFocusAfterHide]); Y.Base.mix(DIALOGUE, [Y.M.core.WidgetFocusAfterHide]);
M.core.dialogue = DIALOGUE; M.core.dialogue = DIALOGUE;
/* global DIALOGUE_PREFIX */
/** /**
* A dialogue type designed to display informative messages to users. * A dialogue type designed to display informative messages to users.
* *

View File

@ -1,5 +1,6 @@
YUI.add('moodle-core-notification-dialogue', function (Y, NAME) { YUI.add('moodle-core-notification-dialogue', function (Y, NAME) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX, var DIALOGUE_PREFIX,
BASE, BASE,
CONFIRMYES, CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once. // Set up the namespace once.
M.core = M.core || {}; M.core = M.core || {};
/* global DIALOGUE_PREFIX, BASE */
/** /**
* The generic dialogue class for use in Moodle. * The generic dialogue class for use in Moodle.
* *
@ -741,6 +744,8 @@ Y.Base.modifyAttrs(DIALOGUE, {
Y.Base.mix(DIALOGUE, [Y.M.core.WidgetFocusAfterHide]); Y.Base.mix(DIALOGUE, [Y.M.core.WidgetFocusAfterHide]);
M.core.dialogue = DIALOGUE; M.core.dialogue = DIALOGUE;
/* global DIALOGUE_PREFIX */
/** /**
* A dialogue type designed to display informative messages to users. * A dialogue type designed to display informative messages to users.
* *

View File

@ -1,5 +1,6 @@
YUI.add('moodle-core-notification-exception', function (Y, NAME) { YUI.add('moodle-core-notification-exception', function (Y, NAME) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX, var DIALOGUE_PREFIX,
BASE, BASE,
CONFIRMYES, CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once. // Set up the namespace once.
M.core = M.core || {}; M.core = M.core || {};
/* global BASE, DIALOGUE_PREFIX */
/** /**
* A dialogue type designed to display an appropriate error when a generic * A dialogue type designed to display an appropriate error when a generic
* javascript error was thrown and caught. * javascript error was thrown and caught.

View File

@ -1,5 +1,6 @@
YUI.add('moodle-core-notification-exception', function (Y, NAME) { YUI.add('moodle-core-notification-exception', function (Y, NAME) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX, var DIALOGUE_PREFIX,
BASE, BASE,
CONFIRMYES, CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once. // Set up the namespace once.
M.core = M.core || {}; M.core = M.core || {};
/* global BASE, DIALOGUE_PREFIX */
/** /**
* A dialogue type designed to display an appropriate error when a generic * A dialogue type designed to display an appropriate error when a generic
* javascript error was thrown and caught. * javascript error was thrown and caught.

Some files were not shown because too many files have changed in this diff Show More