diff --git a/admin/tool/lp/amd/src/actionselector.js b/admin/tool/lp/amd/src/actionselector.js index d36f06ff29f..58f2256d6c3 100644 --- a/admin/tool/lp/amd/src/actionselector.js +++ b/admin/tool/lp/amd/src/actionselector.js @@ -170,8 +170,8 @@ define(['jquery', for (var i in self._actions) { choices.push(self._actions[i]); } - var content = {'message': self._message, 'choices' : choices, - 'confirm' : self._confirm, 'cancel' : self._cancel}; + var content = {'message': self._message, 'choices': choices, + 'confirm': self._confirm, 'cancel': self._cancel}; return Templates.render('tool_lp/action_selector', content); }; diff --git a/admin/tool/lp/amd/src/competencies.js b/admin/tool/lp/amd/src/competencies.js index 6e1973ceec0..1699b03866f 100644 --- a/admin/tool/lp/amd/src/competencies.js +++ b/admin/tool/lp/amd/src/competencies.js @@ -276,7 +276,7 @@ define(['jquery', { key: message, component: 'tool_lp', param: competency.shortname }, { key: 'confirm', component: 'moodle' }, { key: 'cancel', component: 'moodle' } - ]).done(function (strings) { + ]).done(function(strings) { notification.confirm( strings[0], // Confirm. strings[1], // Unlink the competency X from the course? @@ -300,7 +300,7 @@ define(['jquery', if (localthis.itemtype == 'course') { // Course completion rule handling. - $('[data-region="coursecompetenciespage"]').on('change', 'select[data-field="ruleoutcome"]', function(e){ + $('[data-region="coursecompetenciespage"]').on('change', 'select[data-field="ruleoutcome"]', function(e) { var requests = []; var pagerender = 'tool_lp/course_competencies_page'; var pageregion = 'coursecompetenciespage'; diff --git a/admin/tool/lp/amd/src/competencyactions.js b/admin/tool/lp/amd/src/competencyactions.js index 21e084e0ec3..732ca4b00f4 100644 --- a/admin/tool/lp/amd/src/competencyactions.js +++ b/admin/tool/lp/amd/src/competencyactions.js @@ -66,7 +66,7 @@ define(['jquery', var parent = $('[data-region="competencyactions"]').data('competency'); var params = { - competencyframeworkid : treeModel.getCompetencyFrameworkId(), + competencyframeworkid: treeModel.getCompetencyFrameworkId(), pagecontextid: pageContextId }; @@ -86,7 +86,7 @@ define(['jquery', { key: 'addingcompetencywillresetparentrule', component: 'tool_lp', param: parent.shortname }, { key: 'yes', component: 'core' }, { key: 'no', component: 'core' } - ]).done(function (strings) { + ]).done(function(strings) { notification.confirm( strings[0], strings[1], @@ -157,7 +157,7 @@ define(['jquery', { key: confirmMessage, component: 'tool_lp' }, { key: 'yes', component: 'moodle' }, { key: 'no', component: 'moodle' } - ]).done(function (strings) { + ]).done(function(strings) { notification.confirm( strings[0], // Confirm. strings[1], // Delete competency X? @@ -230,7 +230,7 @@ define(['jquery', competencyframeworkid: competency.competencyframeworkid, searchtext: '' } - },{ + }, { methodname: 'core_competency_read_competency_framework', args: { id: competency.competencyframeworkid @@ -257,7 +257,7 @@ define(['jquery', { key: 'movecompetency', component: 'tool_lp', param: competency.shortname }, { key: 'move', component: 'tool_lp' }, { key: 'cancel', component: 'moodle' } - ]).done(function (strings) { + ]).done(function(strings) { var context = { framework: framework, @@ -288,8 +288,8 @@ define(['jquery', var competency = $('[data-region="competencyactions"]').data('competency'); var params = { - competencyframeworkid : treeModel.getCompetencyFrameworkId(), - id : competency.id, + competencyframeworkid: treeModel.getCompetencyFrameworkId(), + id: competency.id, parentid: competency.parentid, pagecontextid: pageContextId }; @@ -381,7 +381,7 @@ define(['jquery', courses: courses }; templates.render('tool_lp/linked_courses_summary', context).done(function(html) { - str.get_string('linkedcourses', 'tool_lp').done(function (linkedcourses) { + str.get_string('linkedcourses', 'tool_lp').done(function(linkedcourses) { new Dialogue( linkedcourses, // Title. html, // The linked courses. @@ -413,7 +413,7 @@ define(['jquery', }); }); - calls.push( { + calls.push({ methodname: 'tool_lp_data_for_related_competencies_section', args: { competencyid: relatedTarget.id } }); @@ -486,7 +486,7 @@ define(['jquery', str.get_strings([ { key: 'competencycannotbedeleted', component: 'tool_lp', param: competency.shortname }, { key: 'cancel', component: 'moodle' } - ]).done(function (strings) { + ]).done(function(strings) { notification.alert( null, strings[0] @@ -514,7 +514,7 @@ define(['jquery', { key: confirmMessage, component: 'tool_lp', param: competency.shortname }, { key: 'delete', component: 'moodle' }, { key: 'cancel', component: 'moodle' } - ]).done(function (strings) { + ]).done(function(strings) { notification.confirm( strings[0], // Confirm. strings[1], // Delete competency X? diff --git a/admin/tool/lp/amd/src/course_competency_settings.js b/admin/tool/lp/amd/src/course_competency_settings.js index bff7349814e..1cc3933c173 100644 --- a/admin/tool/lp/amd/src/course_competency_settings.js +++ b/admin/tool/lp/amd/src/course_competency_settings.js @@ -57,7 +57,7 @@ define(['jquery', e.preventDefault(); templates.render('tool_lp/course_competency_settings', context).done(function(html) { - str.get_string('configurecoursecompetencysettings', 'tool_lp').done(function (title) { + str.get_string('configurecoursecompetencysettings', 'tool_lp').done(function(title) { this._dialogue = new Dialogue( title, html, diff --git a/admin/tool/lp/amd/src/dialogue.js b/admin/tool/lp/amd/src/dialogue.js index 882ee5b6054..5723d87afc6 100644 --- a/admin/tool/lp/amd/src/dialogue.js +++ b/admin/tool/lp/amd/src/dialogue.js @@ -43,7 +43,7 @@ define(['core/yui'], function(Y) { wide = false; } - Y.use('moodle-core-notification', 'timers', function () { + Y.use('moodle-core-notification', 'timers', function() { var width = '480px'; if (wide) { width = '800px'; diff --git a/admin/tool/lp/amd/src/dragdrop-reorder.js b/admin/tool/lp/amd/src/dragdrop-reorder.js index d14c9ddf9aa..a94eb3017d9 100644 --- a/admin/tool/lp/amd/src/dragdrop-reorder.js +++ b/admin/tool/lp/amd/src/dragdrop-reorder.js @@ -70,8 +70,8 @@ define(['core/str', 'core/yui'], function(str, Y) { { key: 'emptydragdropregion', component: 'moodle' }, { key: 'movecontent', component: 'moodle' }, { key: 'tocontent', component: 'moodle' }, - ]).done( function () { - Y.use('moodle-tool_lp-dragdrop-reorder', function () { + ]).done(function() { + Y.use('moodle-tool_lp-dragdrop-reorder', function() { var context = { callback: callback diff --git a/admin/tool/lp/amd/src/evidence_delete.js b/admin/tool/lp/amd/src/evidence_delete.js index 19a5534aabc..95b8485ed7c 100644 --- a/admin/tool/lp/amd/src/evidence_delete.js +++ b/admin/tool/lp/amd/src/evidence_delete.js @@ -62,7 +62,7 @@ define(['jquery', { key: 'areyousure', component: 'moodle' }, { key: 'delete', component: 'moodle' }, { key: 'cancel', component: 'moodle' } - ]).done(function (strings) { + ]).done(function(strings) { Notification.confirm( strings[0], // Confirm. strings[1], // Are you sure? diff --git a/admin/tool/lp/amd/src/frameworkactions.js b/admin/tool/lp/amd/src/frameworkactions.js index a783033a91e..b554495c2e1 100644 --- a/admin/tool/lp/amd/src/frameworkactions.js +++ b/admin/tool/lp/amd/src/frameworkactions.js @@ -93,17 +93,17 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str' } } }]); - requests[0].done(function (success) { + requests[0].done(function(success) { if (success === false) { var req = ajax.call([{ methodname: 'core_competency_read_competency_framework', args: { id: frameworkid } }]); - req[0].done(function (framework) { + req[0].done(function(framework) { str.get_strings([ { key: 'frameworkcannotbedeleted', component: 'tool_lp', param: framework.shortname }, { key: 'cancel', component: 'moodle' } - ]).done(function (strings) { + ]).done(function(strings) { notification.alert( null, strings[0] @@ -136,7 +136,7 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str' { key: 'deletecompetencyframework', component: 'tool_lp', param: framework.shortname }, { key: 'delete', component: 'moodle' }, { key: 'cancel', component: 'moodle' } - ]).done(function (strings) { + ]).done(function(strings) { notification.confirm( strings[0], // Confirm. strings[1], // Delete competency framework X? diff --git a/admin/tool/lp/amd/src/menubar.js b/admin/tool/lp/amd/src/menubar.js index a91d7700c29..4b6b855f856 100644 --- a/admin/tool/lp/amd/src/menubar.js +++ b/admin/tool/lp/amd/src/menubar.js @@ -166,7 +166,7 @@ define(['jquery'], function($) { this.activeItem = null; // Close the menu. - this.menuRoot.find('ul').not('.root-level').attr('aria-hidden','true'); + this.menuRoot.find('ul').not('.root-level').attr('aria-hidden', 'true'); // Follow any link, or call the click handlers. var anchor = item.find('a').first(); var clickEvent = new $.Event('click'); @@ -290,7 +290,7 @@ define(['jquery'], function($) { subMenuContainer.css('margin-right', '-' + marginright + 'px'); } } else { - if ( pos.left + menuRealWidth > $(window).width()) { + if (pos.left + menuRealWidth > $(window).width()) { marginleft = menuRealWidth - widthmenuRoot; subMenuContainer.css('margin-left', '-' + marginleft + 'px'); } @@ -319,7 +319,7 @@ define(['jquery'], function($) { return true; } - switch(e.keyCode) { + switch (e.keyCode) { case this.keys.tab: { // Hide all menu items and update their aria attributes. @@ -438,7 +438,7 @@ define(['jquery'], function($) { // This is the root level move to next sibling. This will require closing // the current child menu and opening the new one. - if (menuIndex < menuNum-1) { + if (menuIndex < menuNum - 1) { // Not the last root menu. newItem = item.next(); } else { // Wrap to first item. @@ -501,7 +501,7 @@ define(['jquery'], function($) { menuIndex = this.rootMenus.index(rootItem); // If this is not the last root menu item, move to the next one. - if (menuIndex < this.rootMenus.length-1) { + if (menuIndex < this.rootMenus.length - 1) { newItem = rootItem.next(); } else { // Loop. @@ -687,7 +687,7 @@ define(['jquery'], function($) { // to the next item with a title that begins with that character. if (startChr) { var match = false; - var curNdx = menuIndex+1; + var curNdx = menuIndex + 1; // Check if the active item was the last one on the list. if (curNdx == menuNum) { @@ -696,7 +696,7 @@ define(['jquery'], function($) { // Iterate through the menu items (starting from the current item and wrapping) until a match is found // or the loop returns to the current menu item. - while (curNdx != menuIndex) { + while (curNdx != menuIndex) { var titleChr = menuItems.eq(curNdx).html().charAt(0); @@ -705,7 +705,7 @@ define(['jquery'], function($) { break; } - curNdx = curNdx+1; + curNdx = curNdx + 1; if (curNdx == menuNum) { // Reached the end of the list, start again at the beginning. @@ -724,8 +724,8 @@ define(['jquery'], function($) { return item; } } else { - if (menuIndex < menuNum-1) { - newItem = menuItems.eq(menuIndex+1); + if (menuIndex < menuNum - 1) { + newItem = menuItems.eq(menuIndex + 1); } else { newItem = menuItems.first(); } @@ -763,7 +763,7 @@ define(['jquery'], function($) { // If item is not the first item in its menu, move to the previous item. if (menuIndex > 0) { - newItem = menuItems.eq(menuIndex-1); + newItem = menuItems.eq(menuIndex - 1); } else { // Loop to top of menu. newItem = menuItems.last(); @@ -823,7 +823,7 @@ define(['jquery'], function($) { * { "[data-action='add']" : callAddFunction } */ enhance: function(selector, handler) { - $(selector).each(function (index, element) { + $(selector).each(function(index, element) { var menuRoot = $(element); // Don't enhance the same menu twice. if (menuRoot.data("menubarEnhanced") !== true) { diff --git a/admin/tool/lp/amd/src/planactions.js b/admin/tool/lp/amd/src/planactions.js index 8d3e05043f2..39efd98b0bf 100644 --- a/admin/tool/lp/amd/src/planactions.js +++ b/admin/tool/lp/amd/src/planactions.js @@ -178,7 +178,7 @@ define(['jquery', { key: 'deleteplan', component: 'tool_lp', param: plan.name }, { key: 'delete', component: 'moodle' }, { key: 'cancel', component: 'moodle' } - ]).done(function (strings) { + ]).done(function(strings) { notification.confirm( strings[0], // Confirm. strings[1], // Delete plan X? @@ -225,7 +225,7 @@ define(['jquery', { key: 'reopenplanconfirm', component: 'tool_lp', param: plan.name }, { key: 'reopenplan', component: 'tool_lp' }, { key: 'cancel', component: 'moodle' } - ]).done(function (strings) { + ]).done(function(strings) { notification.confirm( strings[0], // Confirm. strings[1], // Reopen plan X? @@ -272,7 +272,7 @@ define(['jquery', { key: 'completeplanconfirm', component: 'tool_lp', param: plan.name }, { key: 'completeplan', component: 'tool_lp' }, { key: 'cancel', component: 'moodle' } - ]).done(function (strings) { + ]).done(function(strings) { notification.confirm( strings[0], // Confirm. strings[1], // Complete plan X? @@ -318,7 +318,7 @@ define(['jquery', { key: 'unlinkplantemplateconfirm', component: 'tool_lp', param: plan.name }, { key: 'unlinkplantemplate', component: 'tool_lp' }, { key: 'cancel', component: 'moodle' } - ]).done(function (strings) { + ]).done(function(strings) { notification.confirm( strings[0], // Confirm. strings[1], // Unlink plan X? @@ -507,7 +507,7 @@ define(['jquery', courses: courses }; templates.render('tool_lp/linked_courses_summary', context).done(function(html) { - str.get_string('linkedcourses', 'tool_lp').done(function (linkedcourses) { + str.get_string('linkedcourses', 'tool_lp').done(function(linkedcourses) { new Dialogue( linkedcourses, // Title. html // The linked courses. diff --git a/admin/tool/lp/amd/src/scalevalues.js b/admin/tool/lp/amd/src/scalevalues.js index d27abd307d2..5c660520199 100644 --- a/admin/tool/lp/amd/src/scalevalues.js +++ b/admin/tool/lp/amd/src/scalevalues.js @@ -40,7 +40,7 @@ define(['jquery', 'core/ajax'], function($, ajax) { if (typeof localCache[scaleid] === 'undefined') { ajax.call([{ methodname: 'core_competency_get_scale_values', - args: {scaleid : scaleid}, + args: {scaleid: scaleid}, done: function(scaleinfo) { localCache[scaleid] = scaleinfo; deferred.resolve(scaleinfo); diff --git a/admin/tool/lp/amd/src/templateactions.js b/admin/tool/lp/amd/src/templateactions.js index 0966cc254d1..745fb235128 100644 --- a/admin/tool/lp/amd/src/templateactions.js +++ b/admin/tool/lp/amd/src/templateactions.js @@ -21,7 +21,7 @@ * @copyright 2015 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str','tool_lp/actionselector'], +define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str', 'tool_lp/actionselector'], function($, templates, ajax, notification, str, Actionselector) { // Private variables and functions. @@ -135,9 +135,9 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str' { key: 'unlinkplanstemplate', component: 'tool_lp' }, { key: 'confirm', component: 'moodle' }, { key: 'cancel', component: 'moodle' } - ]).done(function (strings) { - var actions = [{'text': strings[2], 'value' : 'delete'}, - {'text': strings[3], 'value' : 'unlink'}]; + ]).done(function(strings) { + var actions = [{'text': strings[2], 'value': 'delete'}, + {'text': strings[3], 'value': 'unlink'}]; var actionselector = new Actionselector( strings[0], // Title. strings[1], // Message @@ -159,7 +159,7 @@ define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str' { key: 'deletetemplate', component: 'tool_lp', param: template.shortname }, { key: 'delete', component: 'moodle' }, { key: 'cancel', component: 'moodle' } - ]).done(function (strings) { + ]).done(function(strings) { notification.confirm( strings[0], // Confirm. strings[1], // Delete learning plan template X? diff --git a/admin/tool/lp/amd/src/tree.js b/admin/tool/lp/amd/src/tree.js index f52934d3e18..d0acd2bb678 100644 --- a/admin/tool/lp/amd/src/tree.js +++ b/admin/tool/lp/amd/src/tree.js @@ -186,12 +186,12 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) { var oneItem = null; while (lastIndex < currentIndex) { - oneItem = $(this.visibleItems.get(lastIndex)); + oneItem = $(this.visibleItems.get(lastIndex)); oneItem.attr('aria-selected', 'true'); lastIndex++; } while (lastIndex > currentIndex) { - oneItem = $(this.visibleItems.get(lastIndex)); + oneItem = $(this.visibleItems.get(lastIndex)); oneItem.attr('aria-selected', 'true'); lastIndex--; } @@ -454,7 +454,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) { // Iterate through the menu items (starting from the current item and wrapping) until a match is found // or the loop returns to the current menu item. - while (currentIndex != itemIndex) { + while (currentIndex != itemIndex) { var currentItem = this.visibleItems.eq(currentIndex); var titleChr = currentItem.text().charAt(0); @@ -468,7 +468,7 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) { break; } - currentIndex = currentIndex+1; + currentIndex = currentIndex + 1; if (currentIndex == itemCount) { // Reached the end of the list, start again at the beginning. currentIndex = 0; diff --git a/admin/tool/lp/amd/src/user_competency_plan_popup.js b/admin/tool/lp/amd/src/user_competency_plan_popup.js index 87c977cd0eb..1ae64312b8e 100644 --- a/admin/tool/lp/amd/src/user_competency_plan_popup.js +++ b/admin/tool/lp/amd/src/user_competency_plan_popup.js @@ -53,14 +53,14 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/templates' var planId = this._planId; var requests = ajax.call([{ - methodname : 'tool_lp_data_for_user_competency_summary_in_plan', + methodname: 'tool_lp_data_for_user_competency_summary_in_plan', args: { competencyid: competencyId, planid: planId }, done: this._contextLoaded.bind(this), fail: notification.exception }]); // Log the user competency viewed in plan event. - requests[0].then(function (result) { + requests[0].then(function(result) { var eventMethodName = 'core_competency_user_competency_viewed_in_plan'; // Trigger core_competency_user_competency_plan_viewed event instead if plan is already completed. if (result.plan.iscompleted) { @@ -98,7 +98,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/templates' var planId = this._planId; ajax.call([{ - methodname : 'tool_lp_data_for_plan_page', + methodname: 'tool_lp_data_for_plan_page', args: { planid: planId}, done: this._pageContextLoaded.bind(this), fail: notification.exception diff --git a/admin/tool/lp/amd/src/user_evidence_actions.js b/admin/tool/lp/amd/src/user_evidence_actions.js index 8c9e47e0466..f1f5cd36059 100644 --- a/admin/tool/lp/amd/src/user_evidence_actions.js +++ b/admin/tool/lp/amd/src/user_evidence_actions.js @@ -165,7 +165,7 @@ define(['jquery', { key: 'deleteuserevidence', component: 'tool_lp', param: evidence.name }, { key: 'delete', component: 'moodle' }, { key: 'cancel', component: 'moodle' } - ]).done(function (strings) { + ]).done(function(strings) { notification.confirm( strings[0], // Confirm. strings[1], // Delete evidence X? @@ -320,7 +320,7 @@ define(['jquery', { key: 'sendallcompetenciestoreview', component: 'tool_lp', param: evidence.name }, { key: 'confirm', component: 'moodle' }, { key: 'cancel', component: 'moodle' } - ]).done(function (strings) { + ]).done(function(strings) { notification.confirm( strings[0], // Confirm. strings[1], // Send all competencies in review for X? diff --git a/admin/tool/templatelibrary/amd/src/display.js b/admin/tool/templatelibrary/amd/src/display.js index 05507ee4172..016d26361b9 100644 --- a/admin/tool/templatelibrary/amd/src/display.js +++ b/admin/tool/templatelibrary/amd/src/display.js @@ -120,14 +120,14 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates' var promises = ajax.call([{ methodname: 'core_output_load_template', - args:{ + args: { component: component, template: name, themename: config.theme } }, { methodname: 'tool_templatelibrary_load_canonical_template', - args:{ + args: { component: component, template: name } @@ -136,7 +136,7 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates' // When returns a new promise that is resolved when all the passed in promises are resolved. // The arguments to the done become the values of each resolved promise. $.when.apply($, promises) - .done( function(source, originalSource) { templateLoaded(templateName, source, originalSource); }) + .done(function(source, originalSource) { templateLoaded(templateName, source, originalSource); }) .fail(notification.exception); }; diff --git a/admin/tool/templatelibrary/amd/src/search.js b/admin/tool/templatelibrary/amd/src/search.js index 2c9d828a7fb..e14808cc9b9 100644 --- a/admin/tool/templatelibrary/amd/src/search.js +++ b/admin/tool/templatelibrary/amd/src/search.js @@ -32,7 +32,7 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates' */ var reloadListTemplate = function(templateList) { templates.render('tool_templatelibrary/search_results', { templates: templateList }) - .done(function (result, js) { + .done(function(result, js) { templates.replaceNode($('[data-region="searchresults"]'), result, js); }).fail(notification.exception); }; diff --git a/blocks/navigation/amd/src/ajax_response_renderer.js b/blocks/navigation/amd/src/ajax_response_renderer.js index 41b9b45b15b..196115cc8f8 100644 --- a/blocks/navigation/amd/src/ajax_response_renderer.js +++ b/blocks/navigation/amd/src/ajax_response_renderer.js @@ -28,9 +28,9 @@ define(['jquery'], function($) { // Copied from lib/navigationlib.php navigation_node constants. var NODETYPE = { // @type int Activity (course module) = 40. - ACTIVITY : 40, + ACTIVITY: 40, // @type int Resource (course module = 50. - RESOURCE : 50, + RESOURCE: 50, }; /** @@ -94,7 +94,7 @@ define(['jquery'], function($) { if (icon) { link.append(icon); - link.append(''+node.name+''); + link.append('' + node.name + ''); } else { link.append(node.name); } @@ -109,7 +109,7 @@ define(['jquery'], function($) { if (icon) { span.append(icon); - span.append(''+node.name+''); + span.append('' + node.name + ''); } else { span.append(node.name); } diff --git a/grade/grading/form/guide/amd/src/comment_chooser.js b/grade/grading/form/guide/amd/src/comment_chooser.js index 6f9b158d408..7c356107956 100644 --- a/grade/grading/form/guide/amd/src/comment_chooser.js +++ b/grade/grading/form/guide/amd/src/comment_chooser.js @@ -22,7 +22,7 @@ * @copyright 2015 Jun Pataleta * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -define(['jquery', 'core/templates', 'core/notification', 'core/yui'], function ($, templates, notification) { +define(['jquery', 'core/templates', 'core/notification', 'core/yui'], function($, templates, notification) { // Private variables and functions. @@ -39,7 +39,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/yui'], function ( * @param remarkId The element ID of the remark text area where the text of the selected comment will be copied to. * @param commentOptions The array of frequently used comments to be used as options. */ - initialise: function (criterionId, buttonId, remarkId, commentOptions) { + initialise: function(criterionId, buttonId, remarkId, commentOptions) { /** * Display the chooser dialog using the compiled HTML from the mustache template * and binds onclick events for the generated comment options. @@ -68,11 +68,11 @@ define(['jquery', 'core/templates', 'core/notification', 'core/yui'], function ( }); // Loop over each comment item and bind click events. - $.each(comments, function (index, comment) { + $.each(comments, function(index, comment) { var commentOptionId = '#comment-option-' + criterionId + '-' + comment.id; // Delegate click event for the generated option link. - $(commentOptionId).click(function () { + $(commentOptionId).click(function() { var remarkTextArea = $('#' + remarkId); var remarkText = remarkTextArea.val(); @@ -88,7 +88,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/yui'], function ( }); // Handle keypress on list items. - $(document).off('keypress', commentOptionId).on('keypress', commentOptionId, function () { + $(document).off('keypress', commentOptionId).on('keypress', commentOptionId, function() { var keyCode = event.which || event.keyCode; // Enter or space key. @@ -124,14 +124,14 @@ define(['jquery', 'core/templates', 'core/notification', 'core/yui'], function ( // Render the template and display the comment chooser dialog. templates.render('gradingform_guide/comment_chooser', context) - .done(function (compiledSource) { + .done(function(compiledSource) { displayChooserDialog(compiledSource, commentOptions); }) .fail(notification.exception); } // Bind click event for the comments chooser button. - $("#" + buttonId).click(function (e) { + $("#" + buttonId).click(function(e) { e.preventDefault(); generateCommentsChooser(); }); diff --git a/lib/amd/src/event.js b/lib/amd/src/event.js index ce20865f1cc..82e57445004 100644 --- a/lib/amd/src/event.js +++ b/lib/amd/src/event.js @@ -23,7 +23,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.0 */ -define([ 'jquery', 'core/yui' ], +define(['jquery', 'core/yui'], function($, Y) { return /** @alias module:core/event */ { diff --git a/lib/amd/src/first.js b/lib/amd/src/first.js index 72646f00bc8..14aa425997c 100644 --- a/lib/amd/src/first.js +++ b/lib/amd/src/first.js @@ -28,9 +28,9 @@ * @since 2.9 */ define(['jquery'], function($) { - $(document).bind("ajaxStart", function(){ + $(document).bind("ajaxStart", function() { M.util.js_pending('jq'); - }).bind("ajaxStop", function(){ + }).bind("ajaxStop", function() { M.util.js_complete('jq'); }); }); diff --git a/lib/amd/src/form-autocomplete.js b/lib/amd/src/form-autocomplete.js index 3090b1fde78..3b661c0cbd6 100644 --- a/lib/amd/src/form-autocomplete.js +++ b/lib/amd/src/form-autocomplete.js @@ -90,7 +90,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification'] } originalSelect.children('option').each(function(index, ele) { if ($(ele).prop('selected')) { - items.push( { label: $(ele).html(), value: $(ele).attr('value') } ); + items.push({ label: $(ele).html(), value: $(ele).attr('value') }); } }); var context = $.extend({ items: items }, options, state); @@ -215,7 +215,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification'] // Find it's index. var current = suggestionsElement.children('[aria-hidden=false]').index(element); // Activate the next one. - activateItem(current+1, state); + activateItem(current + 1, state); }; /** @@ -237,7 +237,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification'] // Find it's index. var current = selectionsElement.children('[aria-selected=true]').index(element); // Activate the next one. - activateSelection(current-1, state); + activateSelection(current - 1, state); }; /** * Find the index of the current active selection, and activate the next one. @@ -258,7 +258,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification'] // Find it's index. var current = selectionsElement.children('[aria-selected=true]').index(element); // Activate the next one. - activateSelection(current+1, state); + activateSelection(current + 1, state); }; /** @@ -276,7 +276,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification'] // Find it's index. var current = suggestionsElement.children('[aria-hidden=false]').index(element); // Activate the next one. - activateItem(current-1, state); + activateItem(current - 1, state); }; /** @@ -723,7 +723,7 @@ define(['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification'] options.showSuggestions = showSuggestions; } if (typeof noSelectionString === "undefined") { - str.get_string('noselection', 'form').done(function (result) { + str.get_string('noselection', 'form').done(function(result) { options.noSelectionString = result; }).fail(notification.exception); } diff --git a/lib/amd/src/fragment.js b/lib/amd/src/fragment.js index fcc354d3c8d..f12e49a418e 100644 --- a/lib/amd/src/fragment.js +++ b/lib/amd/src/fragment.js @@ -50,7 +50,7 @@ define(['jquery', 'core/ajax'], function($, ajax) { var promises = ajax.call([{ methodname: 'core_get_fragment', - args:{ + args: { component: component, callback: callback, contextid: contextid, diff --git a/lib/amd/src/localstorage.js b/lib/amd/src/localstorage.js index e1e346a7089..1847de9bda6 100644 --- a/lib/amd/src/localstorage.js +++ b/lib/amd/src/localstorage.js @@ -46,7 +46,7 @@ define(['core/config'], function(config) { // Disable cache if debugging. return false; } - if (typeof(window.localStorage) === "undefined") { + if (typeof (window.localStorage) === "undefined") { return false; } var testKey = 'test'; @@ -111,8 +111,8 @@ define(['core/config'], function(config) { return hash; } for (i = 0, len = source.length; i < len; i++) { - chr = source.charCodeAt(i); - hash = ((hash << 5) - hash) + chr; + chr = source.charCodeAt(i); + hash = ((hash << 5) - hash) + chr; hash |= 0; // Convert to 32bit integer } return hash; diff --git a/lib/amd/src/log.js b/lib/amd/src/log.js index 5447ef8b07e..6f1169f2b40 100644 --- a/lib/amd/src/log.js +++ b/lib/amd/src/log.js @@ -25,10 +25,10 @@ */ define(['core/loglevel'], function(log) { var originalFactory = log.methodFactory; - log.methodFactory = function (methodName, logLevel) { + log.methodFactory = function(methodName, logLevel) { var rawMethod = originalFactory(methodName, logLevel); - return function (message, source) { + return function(message, source) { if (source) { rawMethod(source + ": " + message); } else { diff --git a/lib/amd/src/notification.js b/lib/amd/src/notification.js index a887c8e24bb..1bf0e6c0e89 100644 --- a/lib/amd/src/notification.js +++ b/lib/amd/src/notification.js @@ -97,7 +97,7 @@ function(Y, $, log) { if (notification.template) { template = notification.template; delete notification.template; - } else if (notification.type){ + } else if (notification.type) { if (typeof notificationModule.types[notification.type] !== 'undefined') { template = notificationModule.types[notification.type]; } @@ -126,10 +126,10 @@ function(Y, $, log) { alert: function(title, message, yesLabel) { // Here we are wrapping YUI. This allows us to start transitioning, but // wait for a good alternative without having inconsistent dialogues. - Y.use('moodle-core-notification-alert', function () { + Y.use('moodle-core-notification-alert', function() { var alert = new M.core.alert({ - title : title, - message : message, + title: title, + message: message, yesLabel: yesLabel }); @@ -140,10 +140,10 @@ function(Y, $, log) { confirm: function(title, question, yesLabel, noLabel, yesCallback, noCallback) { // Here we are wrapping YUI. This allows us to start transitioning, but // wait for a good alternative without having inconsistent dialogues. - Y.use('moodle-core-notification-confirm', function () { + Y.use('moodle-core-notification-confirm', function() { var modal = new M.core.confirm({ - title : title, - question : question, + title: title, + question: question, yesLabel: yesLabel, noLabel: noLabel }); @@ -169,7 +169,7 @@ function(Y, $, log) { ex.stack = ex.debuginfo; ex.name = ex.errorcode; } - Y.use('moodle-core-notification-exception', function () { + Y.use('moodle-core-notification-exception', function() { var modal = new M.core.exception(ex); modal.show(); diff --git a/lib/amd/src/permissionmanager.js b/lib/amd/src/permissionmanager.js index 267f6cb9538..c6dd316707f 100644 --- a/lib/amd/src/permissionmanager.js +++ b/lib/amd/src/permissionmanager.js @@ -23,7 +23,7 @@ /** * @module admin/permissionmanager */ -define(['jquery', 'core/config','core/notification', 'core/templates'], function($, config, notification, templates) { +define(['jquery', 'core/config', 'core/notification', 'core/templates'], function($, config, notification, templates) { /** * Used CSS selectors @@ -63,7 +63,7 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function }; loadOverideableRoles(); } - catch(err) { + catch (err) { notification.exception(err); } }) @@ -118,11 +118,11 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function default: return; } - templates.render('core/permissionmanager_role',templatedata) - .done(function (content) { - if (action == 'allow'){ + templates.render('core/permissionmanager_role', templatedata) + .done(function(content) { + if (action == 'allow') { $(content).insertBefore(row.find('.allowmore:first')); - }else if (action == 'prohibit'){ + } else if (action == 'prohibit') { $(content).insertBefore(row.find('.prohibitmore:first')); // Remove allowed link var allowedLink = row.find('.allowedroles').first().find('a[data-role-id="' + roleid + '"]'); @@ -134,7 +134,7 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function }) .fail(notification.exception); } - catch(err) { + catch (err) { notification.exception(err); } }) @@ -150,7 +150,7 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function * @method handleAddRole * @param {event} e */ - var handleAddRole = function(e){ + var handleAddRole = function(e) { e.preventDefault(); $('body').one('rolesloaded', function() { @@ -162,8 +162,8 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function context: contextname }; var message = M.util.get_string('role' + action + 'info', 'core_role', confirmationDetails); - if (panel === null){ - panel = new M.core.dialogue ({ + if (panel === null) { + panel = new M.core.dialogue({ draggable: true, modal: true, closeButton: true, @@ -175,7 +175,7 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function var i, existingrolelinks; var roles = []; - switch (action){ + switch (action) { case 'allow': existingrolelinks = row.find(SELECTORS.REMOVEROLE); break; @@ -186,18 +186,18 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function for (i in overideableroles) { var disabled = ''; var disable = existingrolelinks.filter("[data-role-id='" + i + "']").length; - if (disable){ + if (disable) { disabled = 'disabled'; } - var roledetails = {roleid:i, rolename: overideableroles[i], disabled:disabled}; + var roledetails = {roleid: i, rolename: overideableroles[i], disabled: disabled}; roles.push(roledetails); } - templates.render('core/permissionmanager_panelcontent',{message:message, roles:roles}) - .done(function (content) { + templates.render('core/permissionmanager_panelcontent', {message: message, roles: roles}) + .done(function(content) { panel.set('bodyContent', content); panel.show(); - $('div.role_buttons').delegate('input', 'click',function(e){ + $('div.role_buttons').delegate('input', 'click', function(e) { var roleid = $(e.currentTarget).data('role-id'); changePermissions(row, roleid, action); }); @@ -215,7 +215,7 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function * @method handleRemoveRole * @param {event} e */ - var handleRemoveRole = function(e){ + var handleRemoveRole = function(e) { e.preventDefault(); $('body').one('rolesloaded', function() { var link = $(e.currentTarget); @@ -229,10 +229,10 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function }; notification.confirm(M.util.get_string('confirmunassigntitle', 'core_role'), - M.util.get_string('confirmrole' + action, 'core_role',questionDetails), + M.util.get_string('confirmrole' + action, 'core_role', questionDetails), M.util.get_string('confirmunassignyes', 'core_role'), M.util.get_string('confirmunassignno', 'core_role'), - function(){ + function() { changePermissions(row, roleid, action); } ); @@ -248,7 +248,7 @@ define(['jquery', 'core/config','core/notification', 'core/templates'], function * @param {string} contextname * @param {string} adminurl */ - initialize : function(args) { + initialize: function(args) { contextid = args.contextid; contextname = args.contextname; adminurl = args.adminurl; diff --git a/lib/amd/src/tag.js b/lib/amd/src/tag.js index bb8196245e4..eb9d020c4f9 100644 --- a/lib/amd/src/tag.js +++ b/lib/amd/src/tag.js @@ -35,10 +35,10 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' // Click handler for changing tag type. $('body').delegate('.tagarea[data-ta] a[data-quickload=1]', 'click', function(e) { e.preventDefault(); - var target = $( this ), + var target = $(this), query = target.context.search.replace(/^\?/, ''), tagarea = target.closest('.tagarea[data-ta]'), - args = query.split('&').reduce(function(s,c){var t=c.split('=');s[t[0]]=decodeURIComponent(t[1]);return s;},{}); + args = query.split('&').reduce(function(s, c) { var t = c.split('='); s[t[0]] = decodeURIComponent(t[1]); return s; }, {}); var promises = ajax.call([{ methodname: 'core_tag_get_tagindex', @@ -46,7 +46,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' }], true); $.when.apply($, promises) - .done( function(data) { + .done(function(data) { templates.render('core_tag/index', data).done(function(html) { tagarea.replaceWith(html); }); @@ -81,10 +81,10 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' e.preventDefault(); var href = $(this).attr('href'); str.get_strings([ - {key : 'delete'}, - {key : 'confirmdeletetag', component : 'tag'}, - {key : 'yes'}, - {key : 'no'}, + {key: 'delete'}, + {key: 'confirmdeletetag', component: 'tag'}, + {key: 'yes'}, + {key: 'no'}, ]).done(function(s) { notification.confirm(s[0], s[1], s[2], s[3], function() { window.location.href = href; @@ -94,7 +94,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' }); // Confirmation for bulk tag delete button. - $("#tag-management-delete").click(function(e){ + $("#tag-management-delete").click(function(e) { var form = $(this).closest('form').get(0), cnt = $(form).find("input[type=checkbox]:checked").length; if (!cnt) { @@ -103,10 +103,10 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' var tempElement = $("").attr('name', this.name); e.preventDefault(); str.get_strings([ - {key : 'delete'}, - {key : 'confirmdeletetags', component : 'tag'}, - {key : 'yes'}, - {key : 'no'}, + {key: 'delete'}, + {key: 'confirmdeletetags', component: 'tag'}, + {key: 'yes'}, + {key: 'no'}, ]).done(function(s) { notification.confirm(s[0], s[1], s[2], s[3], function() { tempElement.appendTo(form); @@ -117,15 +117,15 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' }); // Confirmation for bulk tag combine button. - $("#tag-management-combine").click(function(e){ + $("#tag-management-combine").click(function(e) { e.preventDefault(); var form = $(this).closest('form').get(0), tags = $(form).find("input[type=checkbox]:checked"); if (tags.length <= 1) { str.get_strings([ - {key : 'combineselected', component : 'tag'}, - {key : 'selectmultipletags', component : 'tag'}, - {key : 'ok'}, + {key: 'combineselected', component: 'tag'}, + {key: 'selectmultipletags', component: 'tag'}, + {key: 'ok'}, ]).done(function(s) { notification.alert(s[0], s[1], s[2]); } @@ -134,14 +134,14 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' } var tempElement = $("").attr('name', this.name); str.get_strings([ - {key : 'combineselected', component : 'tag'}, - {key : 'selectmaintag', component : 'tag'}, - {key : 'continue'}, - {key : 'cancel'}, + {key: 'combineselected', component: 'tag'}, + {key: 'selectmaintag', component: 'tag'}, + {key: 'continue'}, + {key: 'cancel'}, ]).done(function(s) { - var el = $('
'+ + var el = $('
' + '

' + - '

'+ + '

' + '

' + '
'); el.find('.description').html(s[1]); @@ -150,11 +150,11 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' var fldset = el.find('.options'); tags.each(function() { var tagid = $(this).val(), - tagname = $('.inplaceeditable[data-itemtype=tagname][data-itemid='+tagid+']').attr('data-value'); - fldset.append($('
')); + tagname = $('.inplaceeditable[data-itemtype=tagname][data-itemid=' + tagid + ']').attr('data-value'); + fldset.append($('
')); }); - var panel = new M.core.dialogue ({ + var panel = new M.core.dialogue({ draggable: true, modal: true, closeButton: true, @@ -184,9 +184,9 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' if (exception.errorcode === 'namesalreadybeeingused') { e.preventDefault(); // This will prevent default error dialogue. str.get_strings([ - {key : 'nameuseddocombine', component : 'tag'}, - {key : 'yes'}, - {key : 'cancel'}, + {key: 'nameuseddocombine', component: 'tag'}, + {key: 'yes'}, + {key: 'cancel'}, ]).done(function(s) { notification.confirm(e.message, s[0], s[1], s[2], function() { window.location.href = window.location.href + "&newname=" + encodeURIComponent(newvalue) + @@ -201,10 +201,10 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' $('body').on('click', 'a[data-action=addstandardtag]', function(e) { e.preventDefault(); str.get_strings([ - {key : 'addotags', component : 'tag'}, - {key : 'inputstandardtags', component : 'tag'}, - {key : 'continue'}, - {key : 'cancel'}, + {key: 'addotags', component: 'tag'}, + {key: 'inputstandardtags', component: 'tag'}, + {key: 'continue'}, + {key: 'cancel'}, ]).done(function(s) { var el = $('
' + '' + @@ -217,7 +217,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' el.find('#addtags_form').attr('action', window.location.href); el.find('#addtags_submit').attr('value', s[2]); el.find('#addtags_cancel').attr('value', s[3]); - var panel = new M.core.dialogue ({ + var panel = new M.core.dialogue({ draggable: true, modal: true, closeButton: true, @@ -244,12 +244,12 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' areaid, collid, isenabled; if (ajaxreturn.component === 'core_tag' && ajaxreturn.itemtype === 'tagareaenable') { areaid = $(this).attr('data-itemid'); - $(".tag-collections-table ul[data-collectionid] li[data-areaid="+areaid+"]").addClass('hidden'); + $(".tag-collections-table ul[data-collectionid] li[data-areaid=" + areaid + "]").addClass('hidden'); isenabled = ajaxreturn.value; if (isenabled === '1') { $(this).closest('tr').removeClass('dimmed_text'); collid = $(this).closest('tr').find('[data-itemtype="tagareacollection"]').attr("data-value"); - $(".tag-collections-table ul[data-collectionid="+collid+"] li[data-areaid="+areaid+"]") + $(".tag-collections-table ul[data-collectionid=" + collid + "] li[data-areaid=" + areaid + "]") .removeClass('hidden'); } else { $(this).closest('tr').addClass('dimmed_text'); @@ -257,11 +257,11 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' } if (ajaxreturn.component === 'core_tag' && ajaxreturn.itemtype === 'tagareacollection') { areaid = $(this).attr('data-itemid'); - $(".tag-collections-table ul[data-collectionid] li[data-areaid="+areaid+"]").addClass('hidden'); + $(".tag-collections-table ul[data-collectionid] li[data-areaid=" + areaid + "]").addClass('hidden'); collid = $(this).attr('data-value'); isenabled = $(this).closest('tr').find('[data-itemtype="tagareaenable"]').attr("data-value"); if (isenabled === "1") { - $(".tag-collections-table ul[data-collectionid="+collid+"] li[data-areaid="+areaid+"]") + $(".tag-collections-table ul[data-collectionid=" + collid + "] li[data-areaid=" + areaid + "]") .removeClass('hidden'); } } @@ -271,25 +271,25 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' e.preventDefault(); var href = $(this).attr('data-url') + '&sesskey=' + M.cfg.sesskey; str.get_strings([ - {key : 'addtagcoll', component : 'tag'}, - {key : 'name'}, - {key : 'searchable', component : 'tag'}, - {key : 'create'}, - {key : 'cancel'}, + {key: 'addtagcoll', component: 'tag'}, + {key: 'name'}, + {key: 'searchable', component: 'tag'}, + {key: 'create'}, + {key: 'cancel'}, ]).done(function(s) { - var el = $('
'+ + var el = $('
' + '

: ' + '

' + '

: ' + '

' + - '

'+ + '

' + '

' + '
'); el.find('label[for="addtagcoll_name"]').html(s[1]); el.find('label[for="addtagcoll_searchable"]').html(s[2]); el.find('#addtagcoll_submit').attr('value', s[3]); el.find('#addtagcoll_cancel').attr('value', s[4]); - var panel = new M.core.dialogue ({ + var panel = new M.core.dialogue({ draggable: true, modal: true, closeButton: true, @@ -318,10 +318,10 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' e.preventDefault(); var href = $(this).attr('data-url') + '&sesskey=' + M.cfg.sesskey; str.get_strings([ - {key : 'delete'}, - {key : 'suredeletecoll', component : 'tag', param : $(this).attr('data-collname') }, - {key : 'yes'}, - {key : 'no'}, + {key: 'delete'}, + {key: 'suredeletecoll', component: 'tag', param: $(this).attr('data-collname') }, + {key: 'yes'}, + {key: 'no'}, ]).done(function(s) { notification.confirm(s[0], s[1], s[2], s[3], function() { window.location.href = href; diff --git a/lib/amd/src/templates.js b/lib/amd/src/templates.js index bd43f93602e..9049ed7839a 100644 --- a/lib/amd/src/templates.js +++ b/lib/amd/src/templates.js @@ -23,7 +23,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 2.9 */ -define([ 'core/mustache', +define(['core/mustache', 'jquery', 'core/ajax', 'core/str', @@ -90,7 +90,7 @@ define([ 'core/mustache', // Oh well - load via ajax. var promises = ajax.call([{ methodname: 'core_output_load_template', - args:{ + args: { component: component, template: name, themename: currentThemeName @@ -98,13 +98,13 @@ define([ 'core/mustache', }], async, false); promises[0].done( - function (templateSource) { + function(templateSource) { storage.set('core_template/' + searchKey, templateSource); templateCache[searchKey] = templateSource; deferred.resolve(templateSource); } ).fail( - function (ex) { + function(ex) { deferred.reject(ex); } ); @@ -263,7 +263,7 @@ define([ 'core/mustache', context.pix = function() { return pixHelper; }; context.js = function() { return jsHelper; }; context.quote = function() { return quoteHelper; }; - context.globals = { config : config }; + context.globals = { config: config }; context.currentTheme = themeName; }; @@ -414,7 +414,7 @@ define([ 'core/mustache', */ var runTemplateJS = function(source) { if (source.trim() !== '') { - var newscript = $('