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

View File

@ -104,18 +104,26 @@ module.exports = function(grunt) {
eslint: {
// 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.
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.
options: {quiet: !grunt.option('show-lint-warnings')},
amd: {
src: amdSrc,
options: {
rules: {'no-undef': 'error', 'no-unused-vars': 'error', 'no-empty': 'error', 'no-unused-expressions': 'error'}
// Check AMD with some slightly stricter rules.
rules: {
'no-unused-vars': 'error',
'no-implicit-globals': 'error'
}
},
// Check YUI module source files.
yui: {
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: {

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

View File

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

View File

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

View File

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

View File

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

View File

@ -55,7 +55,7 @@ define(['jquery',
Competencydialogue.prototype.triggerCompetencyViewedEvent = function(competencyId) {
ajax.call([{
methodname: 'core_competency_competency_viewed',
args: { id: competencyId }
args: {id: competencyId}
}]);
};
@ -143,8 +143,8 @@ define(['jquery',
Competencydialogue.prototype.getCompetencyDataPromise = function(competencyid, options) {
var requests = ajax.call([
{ methodname: 'tool_lp_data_for_competency_summary',
args: { competencyid: competencyid,
{methodname: 'tool_lp_data_for_competency_summary',
args: {competencyid: competencyid,
includerelated: options.includerelated || false,
includecourses: options.includecourses || false
}
@ -170,7 +170,7 @@ define(['jquery',
// Instantiate the one instance and delegate event on the body.
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));
}
};

View File

@ -118,7 +118,7 @@ define(['jquery',
if (valid) {
validIds.push(compId);
}
}.bind(self));
});
self._selectedCompetencies = validIds;
@ -128,14 +128,14 @@ define(['jquery',
} else {
self._find('[data-region="competencylinktree"] [data-action="add"]').removeAttr('disabled');
}
}.bind(self));
});
// Add listener for framework change.
if (!self._singleFramework) {
self._find('[data-action="chooseframework"]').change(function(e) {
self._frameworkId = $(e.target).val();
self._loadCompetencies().then(self._refresh.bind(self));
}.bind(self));
});
}
// Add listener for search.
@ -146,13 +146,13 @@ define(['jquery',
return self._refresh().always(function() {
$(e.target).removeAttr('disabled');
});
}.bind(self));
});
// Add listener for cancel.
self._find('[data-region="competencylinktree"] [data-action="cancel"]').click(function(e) {
e.preventDefault();
self.close();
}.bind(self));
});
// Add listener for add.
self._find('[data-region="competencylinktree"] [data-action="add"]').click(function(e) {
@ -162,14 +162,14 @@ define(['jquery',
}
if (self._multiSelect) {
self._trigger('save', { competencyIds: self._selectedCompetencies });
self._trigger('save', {competencyIds: self._selectedCompetencies});
} else {
// 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();
}.bind(self));
});
// The list of selected competencies will be modified while looping (because of the listeners above).
var currentItems = self._selectedCompetencies.slice(0);
@ -180,7 +180,7 @@ define(['jquery',
tree.toggleItem(node);
tree.updateFocus(node);
}
}.bind(self));
});
};
@ -210,8 +210,8 @@ define(['jquery',
html,
self._afterRender.bind(self)
);
}.bind(self));
}.bind(self)).fail(Notification.exception);
});
}).fail(Notification.exception);
};
/**
@ -226,7 +226,7 @@ define(['jquery',
var self = this;
return Ajax.call([
{ methodname: 'core_competency_search_competencies', args: {
{methodname: 'core_competency_search_competencies', args: {
searchtext: searchText,
competencyframeworkid: frameworkId
}}
@ -248,7 +248,8 @@ define(['jquery',
}
// Expand the list of competencies into a tree.
var i, tree = [], comp;
var i, comp;
var tree = [];
for (i = 0; i < competencies.length; i++) {
comp = competencies[i];
if (comp.parentid == "0") { // Loose check for now, because WS returns a string.
@ -261,7 +262,7 @@ define(['jquery',
self._competencies = tree;
}.bind(self)).fail(Notification.exception);
}).fail(Notification.exception);
};
/**
@ -287,7 +288,7 @@ define(['jquery',
$.each(this._frameworks, function(i, f) {
if (f.id == fid) {
frm = f;
return false;
return;
}
});
return frm;
@ -320,7 +321,7 @@ define(['jquery',
if (self._singleFramework) {
promise = Ajax.call([
{ methodname: 'core_competency_read_competency_framework', args: {
{methodname: 'core_competency_read_competency_framework', args: {
id: this._frameworkId
}}
])[0].then(function(framework) {
@ -328,9 +329,9 @@ define(['jquery',
});
} else {
promise = Ajax.call([
{ methodname: 'core_competency_list_competency_frameworks', args: {
{methodname: 'core_competency_list_competency_frameworks', args: {
sort: 'shortname',
context: { contextid: self._pageContextId },
context: {contextid: self._pageContextId},
includes: self._pageContextIncludes,
onlyvisible: self._onlyVisible
}}
@ -373,7 +374,7 @@ define(['jquery',
}
return self._loadCompetencies();
}.bind(self));
});
};
/**
@ -387,7 +388,7 @@ define(['jquery',
return self._render().then(function(html) {
self._find('[data-region="competencylinktree"]').replaceWith(html);
self._afterRender();
}.bind(self));
});
};
/**
@ -419,7 +420,7 @@ define(['jquery',
};
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._planId = $(e.target).val();
self._loadCompetencies().then(self._refresh.bind(self));
}.bind(self));
});
}
};
@ -94,13 +94,14 @@ define(['jquery',
var self = this;
return Ajax.call([
{ methodname: 'core_competency_list_plan_competencies', args: {
{methodname: 'core_competency_list_plan_competencies', args: {
id: planId
}}
])[0].done(function(competencies) {
// 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++) {
comp = competencies[i].competency;
if (comp.shortname.toLowerCase().indexOf(searchText.toLowerCase()) < 0) {
@ -128,7 +129,7 @@ define(['jquery',
$.each(this._plans, function(i, f) {
if (f.id == id) {
plan = f;
return false;
return;
}
});
return plan;
@ -161,7 +162,7 @@ define(['jquery',
if (self._singlePlan) {
promise = Ajax.call([
{ methodname: 'core_competency_read_plan', args: {
{methodname: 'core_competency_read_plan', args: {
id: this._planId
}}
])[0].then(function(plan) {
@ -169,7 +170,7 @@ define(['jquery',
});
} else {
promise = Ajax.call([
{ methodname: 'core_competency_list_user_plans', args: {
{methodname: 'core_competency_list_user_plans', args: {
userid: self._userId
}}
])[0];
@ -200,7 +201,7 @@ define(['jquery',
}
return self._loadCompetencies();
}.bind(self));
});
};
/**
@ -232,7 +233,7 @@ define(['jquery',
};
return Templates.render('tool_lp/competency_picker_user_plans', context);
}.bind(self));
});
};
return /** @alias module:tool_lp/competencypicker_user_plans */ Picker;

View File

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

View File

@ -52,7 +52,7 @@ define(['jquery',
var currentValue = $(e.target).closest('a').data('pushratingstouserplans');
var context = {
courseid: courseid,
settings: { pushratingstouserplans: currentValue }
settings: {pushratingstouserplans: currentValue}
};
e.preventDefault();
@ -112,11 +112,11 @@ define(['jquery',
var newValue = this._find('input[name="pushratingstouserplans"]:checked').val();
var courseId = this._find('input[name="courseid"]').val();
var settings = { pushratingstouserplans: newValue };
var settings = {pushratingstouserplans: newValue};
ajax.call([
{ methodname: 'core_competency_update_course_competency_settings',
args: { courseid: courseId, settings: settings } }
{methodname: 'core_competency_update_course_competency_settings',
args: {courseid: courseId, settings: settings}}
])[0].done(function() {
this.refreshCourseCompetenciesPage();
}.bind(this)).fail(notification.exception);
@ -133,8 +133,8 @@ define(['jquery',
var courseId = this._find('input[name="courseid"]').val();
ajax.call([
{ methodname: 'tool_lp_data_for_course_competencies_page',
args: { courseid: courseId } }
{methodname: 'tool_lp_data_for_course_competencies_page',
args: {courseid: courseId}}
])[0].done(function(context) {
templates.render('tool_lp/course_competencies_page', context).done(function(html, js) {
$('[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
// wait for a good alternative without having inconsistent UIs.
str.get_strings([
{ key: 'emptydragdropregion', component: 'moodle' },
{ key: 'movecontent', component: 'moodle' },
{ key: 'tocontent', component: 'moodle' },
{key: 'emptydragdropregion', component: 'moodle'},
{key: 'movecontent', component: 'moodle'},
{key: 'tocontent', component: 'moodle'},
]).done(function() {
Y.use('moodle-tool_lp-dragdrop-reorder', function() {

View File

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

View File

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

View File

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

View File

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

View File

@ -175,7 +175,7 @@ define(['jquery'], function($) {
if (this.handlers) {
$.each(this.handlers, function(selector, handler) {
if (eventHandled) {
return false;
return;
}
if (item.find(selector).length > 0) {
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) {
ajax.call([
{ methodname: 'core_competency_read_competency', args: {
{methodname: 'core_competency_read_competency', args: {
id: data.competencyId
}}
])[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);
}.bind(self));
});
};
// On selected competency.
picker.on('save', function(e, data) {
self.setParent(data);
}.bind(self));
});
picker.display();
});

View File

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

View File

@ -140,7 +140,7 @@ define(['jquery', 'core/notification', 'core/templates', 'core/ajax', 'tool_lp/d
}.bind(this));
body.on('click', '[data-action="cancel"]', function() {
popup.close();
}.bind(this));
});
};
/**
@ -151,7 +151,7 @@ define(['jquery', 'core/notification', 'core/templates', 'core/ajax', 'tool_lp/d
ScaleConfig.prototype.setScaleConfig = function() {
var body = $(this.popup.getContent());
// Get the data.
var data = [{ scaleid: this.scaleid}];
var data = [{scaleid: this.scaleid}];
this.scalevalues.forEach(function(value) {
var scaledefault = 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.
var requests = ajax.call([{
methodname: 'core_competency_delete_template',
args: { id: templateid,
deleteplans: deleteplans }
args: {id: templateid,
deleteplans: deleteplans}
}, {
methodname: 'tool_lp_data_for_templates_manage_page',
args: {
@ -93,7 +93,7 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
// We are chaining ajax requests here.
var requests = ajax.call([{
methodname: 'core_competency_duplicate_template',
args: { id: templateid }
args: {id: templateid}
}, {
methodname: 'tool_lp_data_for_templates_manage_page',
args: {
@ -119,22 +119,22 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
var requests = ajax.call([{
methodname: 'core_competency_read_template',
args: { id: templateid }
args: {id: templateid}
}, {
methodname: 'core_competency_template_has_related_data',
args: { id: templateid }
args: {id: templateid}
}]);
requests[0].done(function(template) {
requests[1].done(function(templatehasrelateddata) {
if (templatehasrelateddata) {
str.get_strings([
{ key: 'deletetemplate', component: 'tool_lp', param: template.shortname },
{ key: 'deletetemplatewithplans', component: 'tool_lp' },
{ key: 'deleteplans', component: 'tool_lp' },
{ key: 'unlinkplanstemplate', component: 'tool_lp' },
{ key: 'confirm', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
{key: 'deletetemplate', component: 'tool_lp', param: template.shortname},
{key: 'deletetemplatewithplans', component: 'tool_lp'},
{key: 'deleteplans', component: 'tool_lp'},
{key: 'unlinkplanstemplate', component: 'tool_lp'},
{key: 'confirm', component: 'moodle'},
{key: 'cancel', component: 'moodle'}
]).done(function(strings) {
var actions = [{'text': strings[2], 'value': 'delete'},
{'text': strings[3], 'value': 'unlink'}];
@ -154,10 +154,10 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str'
}).fail(notification.exception);
} else {
str.get_strings([
{ key: 'confirm', component: 'moodle' },
{ key: 'deletetemplate', component: 'tool_lp', param: template.shortname },
{ key: 'delete', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
{key: 'confirm', component: 'moodle'},
{key: 'deletetemplate', component: 'tool_lp', param: template.shortname},
{key: 'delete', component: 'moodle'},
{key: 'cancel', component: 'moodle'}
]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.

View File

@ -168,7 +168,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
if (!this.multiSelect) {
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.
* @return {Boolean}
*/
// This function should be simplified. In the meantime..
// eslint-disable-next-line complexity
Tree.prototype.handleKeyDown = function(item, e) {
var currentIndex = this.visibleItems.index(item);
var newItem = null;

View File

@ -44,15 +44,15 @@ define(['jquery', 'core/notification', 'core/ajax', 'core/templates'], function(
if (this._planId) {
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';
} else if (this._courseId) {
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';
} else {
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';
}
};

View File

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

View File

@ -104,7 +104,7 @@ define(['jquery',
templates.render(self._template, context)
.done(function(newhtml, newjs) {
templates.replaceNode($(self._region), newhtml, newjs);
}.bind(self))
})
.fail(notification.exception);
};
@ -126,7 +126,7 @@ define(['jquery',
// Apply all the promises, and refresh when the last one is resolved.
return $.when.apply($.when, ajax.call(calls))
.then(function() {
self._renderView.call(self, arguments[arguments.length - 1]);
self._renderView(arguments[arguments.length - 1]);
})
.fail(notification.exception);
};
@ -140,7 +140,7 @@ define(['jquery',
var self = this,
calls = [{
methodname: 'core_competency_delete_user_evidence',
args: { id: evidenceData.id }
args: {id: evidenceData.id}
}];
self._callAndRefresh(calls, evidenceData);
};
@ -156,15 +156,15 @@ define(['jquery',
requests = ajax.call([{
methodname: 'core_competency_read_user_evidence',
args: { id: evidenceData.id }
args: {id: evidenceData.id}
}]);
requests[0].done(function(evidence) {
str.get_strings([
{ key: 'confirm', component: 'moodle' },
{ key: 'deleteuserevidence', component: 'tool_lp', param: evidence.name },
{ key: 'delete', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
{key: 'confirm', component: 'moodle'},
{key: 'deleteuserevidence', component: 'tool_lp', param: evidence.name},
{key: 'delete', component: 'moodle'},
{key: 'cancel', component: 'moodle'}
]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
@ -173,7 +173,7 @@ define(['jquery',
strings[3], // Cancel.
function() {
self._doDelete(evidenceData);
}.bind(self)
}
);
}).fail(notification.exception);
}).fail(notification.exception);
@ -227,7 +227,7 @@ define(['jquery',
picker.on('save', function(e, data) {
var competencyIds = data.competencyIds;
self._doCreateUserEvidenceCompetency(evidenceData, competencyIds, data.requestReview);
}.bind(self));
});
picker.display();
};
@ -295,7 +295,7 @@ define(['jquery',
var self = this,
calls = [{
methodname: 'core_competency_request_review_of_user_evidence_linked_competencies',
args: { id: evidenceData.id }
args: {id: evidenceData.id}
}];
self._callAndRefresh(calls, evidenceData);
};
@ -311,15 +311,15 @@ define(['jquery',
requests = ajax.call([{
methodname: 'core_competency_read_user_evidence',
args: { id: evidenceData.id }
args: {id: evidenceData.id}
}]);
requests[0].done(function(evidence) {
str.get_strings([
{ key: 'confirm', component: 'moodle' },
{ key: 'sendallcompetenciestoreview', component: 'tool_lp', param: evidence.name },
{ key: 'confirm', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
{key: 'confirm', component: 'moodle'},
{key: 'sendallcompetenciestoreview', component: 'tool_lp', param: evidence.name},
{key: 'confirm', component: 'moodle'},
{key: 'cancel', component: 'moodle'}
]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
@ -328,7 +328,7 @@ define(['jquery',
strings[3], // Cancel.
function() {
self._doReviewUserEvidenceCompetencies(evidenceData);
}.bind(self)
}
);
}).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.
*/
var reloadListTemplate = function(templateList) {
templates.render('tool_templatelibrary/search_results', { templates: templateList })
templates.render('tool_templatelibrary/search_results', {templates: templateList})
.done(function(result, js) {
templates.replaceNode($('[data-region="searchresults"]'), result, js);
}).fail(notification.exception);
@ -49,10 +49,10 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
// Trigger the search.
ajax.call([
{ methodname: 'tool_templatelibrary_list_templates',
args: { component: componentStr, search: searchStr },
{methodname: 'tool_templatelibrary_list_templates',
args: {component: componentStr, search: searchStr},
done: reloadListTemplate,
fail: notification.exception }
fail: notification.exception}
], true, false);
};

View File

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

View File

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

View File

@ -1,5 +1,7 @@
YUI.add('moodle-course-management', function (Y, NAME) {
/* global DragDrop, Category, Course */
/**
* 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.console = new Console(config);
};
/* global Console */
/**
* Drag and Drop handler
*
@ -1173,6 +1177,8 @@ Item.prototype = {
}
};
Y.extend(Item, Y.Base, Item.prototype);
/* global Item */
/**
* A managed category.
*
@ -1616,6 +1622,8 @@ Category.prototype = {
}
};
Y.extend(Category, Item, Category.prototype);
/* global Item */
/**
* A managed course.
*

View File

@ -1,5 +1,7 @@
YUI.add('moodle-course-management', function (Y, NAME) {
/* global DragDrop, Category, Course */
/**
* 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.console = new Console(config);
};
/* global Console */
/**
* Drag and Drop handler
*
@ -1147,6 +1151,8 @@ Item.prototype = {
}
};
Y.extend(Item, Y.Base, Item.prototype);
/* global Item */
/**
* A managed category.
*
@ -1575,6 +1581,8 @@ Category.prototype = {
}
};
Y.extend(Category, Item, Category.prototype);
/* global Item */
/**
* A managed course.
*

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
/**
* 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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* eslint-disable no-unused-vars */
/**
* 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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global SELECTORS */
/**
* @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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* eslint-disable no-unused-vars */
/**
* 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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global SELECTORS */
/**
* @module moodle-gradereport_grader-gradereporttable

View File

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

View File

@ -12,6 +12,7 @@
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* eslint-disable no-unused-vars */
/**
* 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());
// 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) {
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.
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 = [];
originalSelect.children('option').each(function(index, option) {
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.
var searchquery = state.caseSensitive ? query : query.toLocaleLowerCase();
var context = $.extend({ options: suggestions}, options, state);
var context = $.extend({options: suggestions}, options, state);
templates.render(
'core/form_autocomplete_suggestions',
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.
var suggestions = [];
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.

View File

@ -29,12 +29,13 @@ define(['core/ajax', 'jquery'], function(ajax, $) {
// Public variables and functions.
processResults: function(selector, data) {
// Mangle the results into an array of objects.
var results = [], i = 0;
var results = [];
var i = 0;
var excludelist = String($(selector).data('exclude')).split(',');
for (i = 0; i < data.courses.length; i++) {
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;

View File

@ -109,7 +109,7 @@ define(['jquery', 'core/ajax'], function($, ajax) {
allScript += ' ' + scriptNode.text();
}
}
}.bind(this));
});
promise.resolve(data.html, allScript);
}).fail(function(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.
/* jshint bitwise: false */
/* eslint no-bitwise: "off" */
var hash = 0, i, chr, len;
var hash = 0;
var i, chr, len;
if (source.length === 0) {
return hash;
}

View File

@ -66,7 +66,7 @@ function(Y, $, log) {
setupTargetRegion: function() {
var targetRegion = $('#' + notificationModule.fieldName);
if (targetRegion.length) {
return;
return false;
}
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([{
methodname: 'core_tag_get_tagindex',
args: { tagindex: args }
args: {tagindex: args}
}], true);
$.when.apply($, promises)
@ -102,7 +102,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
var form = $(this).closest('form').get(0),
cnt = $(form).find("input[type=checkbox]:checked").length;
if (!cnt) {
return false;
return;
}
var tempElement = $("<input type='hidden'/>").attr('name', this.name);
e.preventDefault();
@ -134,7 +134,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
notification.alert(s[0], s[1], s[2]);
}
);
return false;
return;
}
var tempElement = $("<input type='hidden'/>").attr('name', this.name);
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;
str.get_strings([
{key: 'delete'},
{key: 'suredeletecoll', component: 'tag', param: $(this).attr('data-collname') },
{key: 'suredeletecoll', component: 'tag', param: $(this).attr('data-collname')},
{key: 'yes'},
{key: 'no'},
]).done(function(s) {

View File

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

View File

@ -343,6 +343,8 @@ define(['jquery'], function($) {
* @param {Event} e The event.
* @return {Boolean}
*/
// This function should be simplified. In the meantime..
// eslint-disable-next-line complexity
Tree.prototype.handleKeyDown = function(item, e) {
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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* eslint-disable no-unused-vars */
/**
* 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
// 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.
@ -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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global LOGNAME */
/**
* @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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global LOGNAME */
/**
* @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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global rangy */
/**
* @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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global rangy */
/**
* @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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* eslint-disable no-unused-vars */
/**
* 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
// 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.
@ -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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global LOGNAME */
/**
* @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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global LOGNAME */
/**
* @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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global rangy */
/**
* @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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global rangy */
/**
* @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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global YUI */
/**
* @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
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* global YUI */
/**
* @module moodle-editor_atto-plugin

View File

@ -12,6 +12,8 @@
//
// You should have received a copy of the GNU General Public License
// 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.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,7 @@
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
* easier within this module.

View File

@ -1,5 +1,7 @@
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
* 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
* easier within this module.

View File

@ -1,5 +1,7 @@
YUI.add('moodle-core-blocks', function (Y, NAME) {
/* global MANAGER */
/**
* 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.blockdraganddrop.init(params);
};
/* global BLOCKREGION, SELECTOR, AJAXURL */
/**
* 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.
*

View File

@ -1,5 +1,7 @@
YUI.add('moodle-core-blocks', function (Y, NAME) {
/* global MANAGER */
/**
* 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.blockdraganddrop.init(params);
};
/* global BLOCKREGION, SELECTOR, AJAXURL */
/**
* 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.
*

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,6 @@
YUI.add('moodle-core-notification-ajaxexception', function (Y, NAME) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX,
BASE,
CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once.
M.core = M.core || {};
/* global BASE, DIALOGUE_PREFIX */
/**
* A dialogue type designed to display an appropriate error when an error
* 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) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX,
BASE,
CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once.
M.core = M.core || {};
/* global BASE, DIALOGUE_PREFIX */
/**
* A dialogue type designed to display an appropriate error when an error
* 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) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX,
BASE,
CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once.
M.core = M.core || {};
/* global BASE, TITLE, CONFIRMYES, DIALOGUE_PREFIX */
/**
* 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) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX,
BASE,
CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once.
M.core = M.core || {};
/* global BASE, TITLE, CONFIRMYES, DIALOGUE_PREFIX */
/**
* 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) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX,
BASE,
CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once.
M.core = M.core || {};
/* global CONFIRMYES, CONFIRMNO, QUESTION, BASE, TITLE, DIALOGUE_PREFIX */
/**
* 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) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX,
BASE,
CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once.
M.core = M.core || {};
/* global CONFIRMYES, CONFIRMNO, QUESTION, BASE, TITLE, DIALOGUE_PREFIX */
/**
* 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) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX,
BASE,
CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once.
M.core = M.core || {};
/* global DIALOGUE_PREFIX, BASE */
/**
* The generic dialogue class for use in Moodle.
*
@ -744,6 +747,8 @@ Y.Base.modifyAttrs(DIALOGUE, {
Y.Base.mix(DIALOGUE, [Y.M.core.WidgetFocusAfterHide]);
M.core.dialogue = DIALOGUE;
/* global DIALOGUE_PREFIX */
/**
* 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) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX,
BASE,
CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once.
M.core = M.core || {};
/* global DIALOGUE_PREFIX, BASE */
/**
* The generic dialogue class for use in Moodle.
*
@ -741,6 +744,8 @@ Y.Base.modifyAttrs(DIALOGUE, {
Y.Base.mix(DIALOGUE, [Y.M.core.WidgetFocusAfterHide]);
M.core.dialogue = DIALOGUE;
/* global DIALOGUE_PREFIX */
/**
* 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) {
/* eslint-disable no-unused-vars, no-unused-expressions */
var DIALOGUE_PREFIX,
BASE,
CONFIRMYES,
@ -27,6 +28,8 @@ CSS = {
// Set up the namespace once.
M.core = M.core || {};
/* global BASE, DIALOGUE_PREFIX */
/**
* A dialogue type designed to display an appropriate error when a generic
* javascript error was thrown and caught.

View File

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

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