diff --git a/corehq/apps/builds/static/builds/js/edit_builds.js b/corehq/apps/builds/static/builds/js/edit_builds.js index 4aaa1064064b..a6e4e134b388 100644 --- a/corehq/apps/builds/static/builds/js/edit_builds.js +++ b/corehq/apps/builds/static/builds/js/edit_builds.js @@ -1,4 +1,4 @@ -"use strict"; + hqDefine('builds/js/edit_builds', [ 'jquery', 'underscore', @@ -34,7 +34,7 @@ hqDefine('builds/js/edit_builds', [ _.each(doc.menu, function (version) { self.versions.push(versionModel( - version.build.version, version.label, version.superuser_only + version.build.version, version.label, version.superuser_only, )); }); _.each(doc.defaults, function (versionDoc) { @@ -98,7 +98,7 @@ hqDefine('builds/js/edit_builds', [ $('#menu-form .btn-primary').click(function () { postGo( $('#menu-form')[0].action, - {'doc': JSON.stringify(outputJSON(buildsMenu))} + {'doc': JSON.stringify(outputJSON(buildsMenu))}, ); }); }); diff --git a/corehq/apps/case_search/static/case_search/js/case_search.js b/corehq/apps/case_search/static/case_search/js/case_search.js index 8bdcfcfd6179..0d0103b4c468 100644 --- a/corehq/apps/case_search/static/case_search/js/case_search.js +++ b/corehq/apps/case_search/static/case_search/js/case_search.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine('case_search/js/case_search', [ 'jquery', @@ -12,7 +12,7 @@ hqDefine('case_search/js/case_search', [ _, ko, alertUser, - initialPageData + initialPageData, ) { var caseSearchModel = function (caseDataUrl) { var self = {}; @@ -72,7 +72,7 @@ hqDefine('case_search/js/case_search', [ parameters: self.parameters(), customQueryAddition: self.customQueryAddition(), xpath_expressions: _.pluck(self.xpath_expressions(), 'xpath'), - } + }, )}), success: function (data) { self.results(data.values); diff --git a/corehq/apps/case_search/static/case_search/js/profile_case_search.js b/corehq/apps/case_search/static/case_search/js/profile_case_search.js index 7a8968f5f8c1..0f131d41a545 100644 --- a/corehq/apps/case_search/static/case_search/js/profile_case_search.js +++ b/corehq/apps/case_search/static/case_search/js/profile_case_search.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine('case_search/js/profile_case_search', [ 'jquery', @@ -10,7 +10,7 @@ hqDefine('case_search/js/profile_case_search', [ $, _, ko, - alertUser + alertUser, ) { var caseSearchModel = function () { var self = {}; diff --git a/corehq/apps/commtrack/static/commtrack/js/base_list_view_model.js b/corehq/apps/commtrack/static/commtrack/js/base_list_view_model.js index 4037dc07fac0..558e33e02fc4 100644 --- a/corehq/apps/commtrack/static/commtrack/js/base_list_view_model.js +++ b/corehq/apps/commtrack/static/commtrack/js/base_list_view_model.js @@ -1,4 +1,4 @@ -"use strict"; + hqDefine("commtrack/js/base_list_view_model", [ 'jquery', 'knockout', @@ -8,10 +8,9 @@ hqDefine("commtrack/js/base_list_view_model", [ $, ko, _, - bootstrap + bootstrap, ) { var BaseListViewModel = function (o) { - 'use strict'; var self = {}; self.initialLoad = ko.observable(false); diff --git a/corehq/apps/commtrack/static/commtrack/js/products_and_programs_main.js b/corehq/apps/commtrack/static/commtrack/js/products_and_programs_main.js index 125b33e9a9b1..67130f9090f0 100644 --- a/corehq/apps/commtrack/static/commtrack/js/products_and_programs_main.js +++ b/corehq/apps/commtrack/static/commtrack/js/products_and_programs_main.js @@ -1,4 +1,4 @@ -"use strict"; + hqDefine('commtrack/js/products_and_programs_main', [ 'jquery', 'knockout', @@ -15,7 +15,7 @@ hqDefine('commtrack/js/products_and_programs_main', [ _, initialPageData, bootstrap, - models + models, ) { var commtrackProductsProgramsViewModel = function (o) { var self = models.BaseListViewModel(o); diff --git a/corehq/apps/commtrack/static/commtrack/js/sms.js b/corehq/apps/commtrack/static/commtrack/js/sms.js index f16d485c673c..d8ee9abbd963 100644 --- a/corehq/apps/commtrack/static/commtrack/js/sms.js +++ b/corehq/apps/commtrack/static/commtrack/js/sms.js @@ -6,9 +6,8 @@ hqDefine('commtrack/js/sms', [ ], function ( $, ko, - initialPageData + initialPageData, ) { - 'use strict'; function commtrackSettingsViewModel(otherSmsCodes) { var self = {}; self.actions = ko.observableArray(); diff --git a/corehq/apps/custom_data_fields/static/custom_data_fields/js/custom_data_fields.js b/corehq/apps/custom_data_fields/static/custom_data_fields/js/custom_data_fields.js index f0e700f60e8a..e899860805fc 100644 --- a/corehq/apps/custom_data_fields/static/custom_data_fields/js/custom_data_fields.js +++ b/corehq/apps/custom_data_fields/static/custom_data_fields/js/custom_data_fields.js @@ -13,7 +13,7 @@ hqDefine('custom_data_fields/js/custom_data_fields', [ _, assertProperties, initialPageData, - uiElementKeyValueList + uiElementKeyValueList, ) { function Choice(choice) { var self = {}; @@ -40,7 +40,7 @@ hqDefine('custom_data_fields/js/custom_data_fields', [ // Compare stringified arrays to match contents, not references. // Direct assignment of the observable to options.required_for won't match requiredForOptions const matchingOption = parent.requiredForOptions.find(option => - JSON.stringify(option.value) === JSON.stringify(options.required_for || []) + JSON.stringify(option.value) === JSON.stringify(options.required_for || []), ); const initialRequiredFor = matchingOption ? matchingOption.value : ((parent.requiredForOptions.find(option => option.isDefault) || {}).value || []); @@ -147,7 +147,7 @@ hqDefine('custom_data_fields/js/custom_data_fields', [ self.fields = uiElementKeyValueList.new( String(Math.random()).slice(2), - gettext("Edit Profile") + gettext("Edit Profile"), ); self.fields.setEdit(self.isEditable()); @@ -263,10 +263,10 @@ hqDefine('custom_data_fields/js/custom_data_fields', [ if (options.current_profile_required_for_user_type) { const currentProfileRequiredForList = options.current_profile_required_for_user_type; let profileReqiredForMatch = self.profileRequiredForOptions.find(option => - JSON.stringify(option.value) === JSON.stringify(currentProfileRequiredForList || []) + JSON.stringify(option.value) === JSON.stringify(currentProfileRequiredForList || []), ); initialRequiredFor = _.has(profileReqiredForMatch, 'value') ? profileReqiredForMatch.value : - (self.profileRequiredForOptions.find(function (option) {return option && option.isDefault;}) || {}).value || []; + (self.profileRequiredForOptions.find(function (option) {return option && option.isDefault;}) || {}).value || []; } else { // If no user type already requires a profile selection set to default initialRequiredFor = (self.profileRequiredForOptions.find(function (option) {return option && option.isDefault;}) || {}).value || []; @@ -340,7 +340,7 @@ hqDefine('custom_data_fields/js/custom_data_fields', [ can_edit_linked_data: initialPageData.get('can_edit_linked_data'), required_for_options: initialPageData.get('required_for_options'), profile_required_for_options: initialPageData.get('profile_required_for_options'), - current_profile_required_for_user_type: initialPageData.get('profile_required_for_user_type') + current_profile_required_for_user_type: initialPageData.get('profile_required_for_user_type'), }); customDataFieldsModel.data_fields.subscribe(function () { $("#save-custom-fields").prop("disabled", false); diff --git a/corehq/apps/data_interfaces/static/data_interfaces/js/archive_forms.js b/corehq/apps/data_interfaces/static/data_interfaces/js/archive_forms.js index 417b72f41ef6..9e38b032e85e 100644 --- a/corehq/apps/data_interfaces/static/data_interfaces/js/archive_forms.js +++ b/corehq/apps/data_interfaces/static/data_interfaces/js/archive_forms.js @@ -5,7 +5,7 @@ hqDefine("data_interfaces/js/archive_forms", [ ], function ( $, ko, - googleAnalytics + googleAnalytics, ) { var managementSelector = '#data-interfaces-archive-forms', allFormsButtonSelector = managementSelector + ' input[name="select_all"]', diff --git a/corehq/apps/data_interfaces/static/data_interfaces/js/auto_update_rules.js b/corehq/apps/data_interfaces/static/data_interfaces/js/auto_update_rules.js index 534f91d0ce9c..ce4c45f1160c 100644 --- a/corehq/apps/data_interfaces/static/data_interfaces/js/auto_update_rules.js +++ b/corehq/apps/data_interfaces/static/data_interfaces/js/auto_update_rules.js @@ -12,7 +12,7 @@ hqDefine("data_interfaces/js/auto_update_rules", [ ko, _, initialPageData, - googleAnalytics + googleAnalytics, ) { var RuleViewModel = function (data, parent) { diff --git a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/case_dedupe_main.js b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/case_dedupe_main.js index 24851d9a71a6..2dc2743fe2da 100644 --- a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/case_dedupe_main.js +++ b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/case_dedupe_main.js @@ -13,7 +13,7 @@ hqDefine("data_interfaces/js/bootstrap3/case_dedupe_main", [ _, initialPageData, casePropertyInput, - CaseRuleCriteria + CaseRuleCriteria, ) { /* @@ -163,7 +163,7 @@ hqDefine("data_interfaces/js/bootstrap3/case_dedupe_main", [ initialCaseProperties, initialIncludeClosed, initialPropertiesToUpdate, - allCaseProperties + allCaseProperties, ) { var self = {}; self.name = ko.observable(initialName); @@ -248,7 +248,7 @@ hqDefine("data_interfaces/js/bootstrap3/case_dedupe_main", [ initialPageData.get('case_properties'), initialPageData.get('include_closed'), initialPageData.get('properties_to_update'), - initialPageData.get('all_case_properties') + initialPageData.get('all_case_properties'), ); $("#case-dedupe-rule-definition").koApplyBindings(caseDedupe); @@ -257,7 +257,7 @@ hqDefine("data_interfaces/js/bootstrap3/case_dedupe_main", [ $('#rule-criteria-panel').koApplyBindings(CaseRuleCriteria( initialPageData.get('criteria_initial'), initialPageData.get('criteria_constants'), - caseDedupe.caseType + caseDedupe.caseType, )); }); }); diff --git a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/case_management.js b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/case_management.js index 433df55e16b1..87cac365f5fe 100644 --- a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/case_management.js +++ b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/case_management.js @@ -129,7 +129,7 @@ hqDefine("data_interfaces/js/bootstrap3/case_management",[ var bulkReassignUrl = window.location.href.replace("data/edit", "data/edit/bulk"); $.postGo( bulkReassignUrl, - paramsObject + paramsObject, ); }; diff --git a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/deduplication_rules.js b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/deduplication_rules.js index aaa5e2354707..dee9b429c3ab 100644 --- a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/deduplication_rules.js +++ b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/deduplication_rules.js @@ -12,7 +12,7 @@ hqDefine("data_interfaces/js/bootstrap3/deduplication_rules", [ _, initialPageData, CRUDPaginatedList, - googleAnalytics + googleAnalytics, ) { var showActionError = function (rule, error) { var newItemData = _.extend({}, rule.itemData(), { diff --git a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/manage_case_groups.js b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/manage_case_groups.js index 78b2850f4ed6..97ebc96733c8 100644 --- a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/manage_case_groups.js +++ b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap3/manage_case_groups.js @@ -7,7 +7,7 @@ hqDefine("data_interfaces/js/bootstrap3/manage_case_groups", [ ], function ( $, _, - initialPageData + initialPageData, ) { $(function () { var bulkUploadId = initialPageData.get("bulk_upload_id"); @@ -39,13 +39,13 @@ hqDefine("data_interfaces/js/bootstrap3/manage_case_groups", [ isPollingActive = true; attempts = 0; $('#upload-progress').html( - _.template($('#template-upload-progress').text())(data) + _.template($('#template-upload-progress').text())(data), ); retry(); } else { isPollingActive = false; $('#upload-notice').html( - _.template($('#template-bulk-status').text())(data) + _.template($('#template-bulk-status').text())(data), ); } } else { diff --git a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/case_dedupe_main.js b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/case_dedupe_main.js index 8b4ffbd14b21..d6d5cdbb76f4 100644 --- a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/case_dedupe_main.js +++ b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/case_dedupe_main.js @@ -13,7 +13,7 @@ hqDefine("data_interfaces/js/bootstrap5/case_dedupe_main", [ _, initialPageData, casePropertyInput, - CaseRuleCriteria + CaseRuleCriteria, ) { /* @@ -163,7 +163,7 @@ hqDefine("data_interfaces/js/bootstrap5/case_dedupe_main", [ initialCaseProperties, initialIncludeClosed, initialPropertiesToUpdate, - allCaseProperties + allCaseProperties, ) { var self = {}; self.name = ko.observable(initialName); @@ -248,7 +248,7 @@ hqDefine("data_interfaces/js/bootstrap5/case_dedupe_main", [ initialPageData.get('case_properties'), initialPageData.get('include_closed'), initialPageData.get('properties_to_update'), - initialPageData.get('all_case_properties') + initialPageData.get('all_case_properties'), ); $("#case-dedupe-rule-definition").koApplyBindings(caseDedupe); @@ -257,7 +257,7 @@ hqDefine("data_interfaces/js/bootstrap5/case_dedupe_main", [ $('#rule-criteria-panel').koApplyBindings(CaseRuleCriteria( initialPageData.get('criteria_initial'), initialPageData.get('criteria_constants'), - caseDedupe.caseType + caseDedupe.caseType, )); }); }); diff --git a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/case_management.js b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/case_management.js index dda620bc5833..498395ebc1b4 100644 --- a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/case_management.js +++ b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/case_management.js @@ -129,7 +129,7 @@ hqDefine("data_interfaces/js/bootstrap5/case_management",[ var bulkReassignUrl = window.location.href.replace("data/edit", "data/edit/bulk"); $.postGo( bulkReassignUrl, - paramsObject + paramsObject, ); }; diff --git a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/deduplication_rules.js b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/deduplication_rules.js index 7564e92bbc42..73ebb0610837 100644 --- a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/deduplication_rules.js +++ b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/deduplication_rules.js @@ -12,7 +12,7 @@ hqDefine("data_interfaces/js/bootstrap5/deduplication_rules", [ _, initialPageData, CRUDPaginatedList, - googleAnalytics + googleAnalytics, ) { var showActionError = function (rule, error) { var newItemData = _.extend({}, rule.itemData(), { diff --git a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/manage_case_groups.js b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/manage_case_groups.js index f4037e8f14e5..5752ae959bb0 100644 --- a/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/manage_case_groups.js +++ b/corehq/apps/data_interfaces/static/data_interfaces/js/bootstrap5/manage_case_groups.js @@ -7,7 +7,7 @@ hqDefine("data_interfaces/js/bootstrap5/manage_case_groups", [ ], function ( $, _, - initialPageData + initialPageData, ) { $(function () { var bulkUploadId = initialPageData.get("bulk_upload_id"); @@ -39,13 +39,13 @@ hqDefine("data_interfaces/js/bootstrap5/manage_case_groups", [ isPollingActive = true; attempts = 0; $('#upload-progress').html( - _.template($('#template-upload-progress').text())(data) + _.template($('#template-upload-progress').text())(data), ); retry(); } else { isPollingActive = false; $('#upload-notice').html( - _.template($('#template-bulk-status').text())(data) + _.template($('#template-bulk-status').text())(data), ); } } else { diff --git a/corehq/apps/data_interfaces/static/data_interfaces/js/case_property_input.js b/corehq/apps/data_interfaces/static/data_interfaces/js/case_property_input.js index 39fcbef5a08c..13bdc9f4f021 100644 --- a/corehq/apps/data_interfaces/static/data_interfaces/js/case_property_input.js +++ b/corehq/apps/data_interfaces/static/data_interfaces/js/case_property_input.js @@ -35,7 +35,7 @@ hqDefine('data_interfaces/js/case_property_input', [ ko, _, initialPageData, - privileges + privileges, ) { var component = { viewModel: function (params) { diff --git a/corehq/apps/data_interfaces/static/data_interfaces/js/case_rule_actions.js b/corehq/apps/data_interfaces/static/data_interfaces/js/case_rule_actions.js index d1a66138ff48..abf8dff7e91e 100644 --- a/corehq/apps/data_interfaces/static/data_interfaces/js/case_rule_actions.js +++ b/corehq/apps/data_interfaces/static/data_interfaces/js/case_rule_actions.js @@ -5,7 +5,7 @@ hqDefine("data_interfaces/js/case_rule_actions", [ ], function ( $, ko, - initialPageData + initialPageData, ) { var CaseRuleActions = function (initial, caseTypeObservable) { var self = {}; diff --git a/corehq/apps/data_interfaces/static/data_interfaces/js/case_rule_main.js b/corehq/apps/data_interfaces/static/data_interfaces/js/case_rule_main.js index 3cbe44528997..38bc0627feb1 100644 --- a/corehq/apps/data_interfaces/static/data_interfaces/js/case_rule_main.js +++ b/corehq/apps/data_interfaces/static/data_interfaces/js/case_rule_main.js @@ -11,20 +11,20 @@ hqDefine("data_interfaces/js/case_rule_main", [ initialPageData, casePropertyInput, CaseRuleCriteria, - CaseRuleActions + CaseRuleActions, ) { $(function () { casePropertyInput.register(); var criteriaModel = CaseRuleCriteria( initialPageData.get('criteria_initial'), - initialPageData.get('criteria_constants') + initialPageData.get('criteria_constants'), ); $('#rule-criteria-panel').koApplyBindings(criteriaModel); $('#rule-actions').koApplyBindings(CaseRuleActions( initialPageData.get('actions_initial'), - criteriaModel.caseType + criteriaModel.caseType, )); }); }); diff --git a/corehq/apps/data_interfaces/static/data_interfaces/js/find_by_id.js b/corehq/apps/data_interfaces/static/data_interfaces/js/find_by_id.js index fd1acdde3d93..3c6d7bfc6d9f 100644 --- a/corehq/apps/data_interfaces/static/data_interfaces/js/find_by_id.js +++ b/corehq/apps/data_interfaces/static/data_interfaces/js/find_by_id.js @@ -12,7 +12,7 @@ hqDefine("data_interfaces/js/find_by_id", [ ko, assertProperties, initialPageData, - kissmetrics + kissmetrics, ) { var findModel = function (options) { assertProperties.assert(options, ['errorMessage', 'eventName', 'header', 'help', 'placeholder', 'successMessage']); diff --git a/corehq/apps/enterprise/static/enterprise/js/enterprise_settings.js b/corehq/apps/enterprise/static/enterprise/js/enterprise_settings.js index 47eddc5dac51..9ff5690ad72e 100644 --- a/corehq/apps/enterprise/static/enterprise/js/enterprise_settings.js +++ b/corehq/apps/enterprise/static/enterprise/js/enterprise_settings.js @@ -10,7 +10,7 @@ hqDefine("enterprise/js/enterprise_settings", [ ko, _, assertProperties, - initialPageData + initialPageData, ) { var settingsFormModel = function (options) { assertProperties.assert(options, ['accounts_email'], ['restrict_signup', 'restricted_domains']); diff --git a/corehq/apps/enterprise/static/enterprise/js/project_dashboard.js b/corehq/apps/enterprise/static/enterprise/js/project_dashboard.js index a12d27097066..bef655d9b93a 100644 --- a/corehq/apps/enterprise/static/enterprise/js/project_dashboard.js +++ b/corehq/apps/enterprise/static/enterprise/js/project_dashboard.js @@ -18,7 +18,7 @@ hqDefine("enterprise/js/project_dashboard", [ alertUser, kissmetrics, tempusDominus, - moment + moment, ) { const PRESET_LAST_30 = "last_30"; const PRESET_PREV_MONTH = "prev_month"; @@ -214,7 +214,7 @@ hqDefine("enterprise/js/project_dashboard", [ const number = input.slice(0, -1); return Number(number).toLocaleString( undefined, - {minimumFractionDigits: 1, maximumFractionDigits: 1} + {minimumFractionDigits: 1, maximumFractionDigits: 1}, ) + '%'; } else if (input === "--") { return input; @@ -254,7 +254,7 @@ hqDefine("enterprise/js/project_dashboard", [ const datePicker = tempusDominus.createDefaultDateRangePicker( document.getElementById("id_date_range"), moment().subtract(30, "days"), - moment() + moment(), ); const $dateRangeModal = $('#enterpriseFormsDaterange'); @@ -276,7 +276,7 @@ hqDefine("enterprise/js/project_dashboard", [ $("#sms_dateRangeDisplay").koApplyBindings(smsDisplay); } $dateRangeModal.koApplyBindings( - dateRangeModal + dateRangeModal, ); kissmetrics.track.event(`[${metricType}] Visited page`); diff --git a/corehq/apps/events/static/events/js/event_attendees.js b/corehq/apps/events/static/events/js/event_attendees.js index cd75c551a353..5b1dcc2e2d85 100644 --- a/corehq/apps/events/static/events/js/event_attendees.js +++ b/corehq/apps/events/static/events/js/event_attendees.js @@ -15,10 +15,8 @@ hqDefine("events/js/event_attendees",[ _, initialPageData, RMI, - locationsWidgets + locationsWidgets, ) { - 'use strict'; - var STATUS_CSS = { NONE: '', PENDING: 'pending', @@ -200,7 +198,7 @@ hqDefine("events/js/event_attendees",[ $(function () { var rmiInvoker = RMI( initialPageData.reverse('event_attendees'), - $("#csrfTokenContainer").val() + $("#csrfTokenContainer").val(), ); rmi = function (remoteMethod, data) { return rmiInvoker("", data, { diff --git a/corehq/apps/events/static/events/js/new_event.js b/corehq/apps/events/static/events/js/new_event.js index 68d369f4f70a..380fda5e7080 100644 --- a/corehq/apps/events/static/events/js/new_event.js +++ b/corehq/apps/events/static/events/js/new_event.js @@ -12,7 +12,7 @@ hqDefine("events/js/new_event", [ ko, multiselectUtils, initialPageData, - locationsWidgets + locationsWidgets, ) { $(function () { const ATTENDEE_PROPS = { @@ -41,7 +41,6 @@ hqDefine("events/js/new_event", [ multiselectUtils.createFullMultiselectWidget('id_attendance_takers', ATTENDANCE_TAKER_PROPS); function eventViewModel(initialData) { - 'use strict'; var self = {}; // Disable the submit button unless attendance takers are present @@ -84,7 +83,7 @@ hqDefine("events/js/new_event", [ $expectedList.empty(); for (const item of data) { $expectedList.append( - `` + ``, ); } } diff --git a/corehq/apps/fixtures/static/fixtures/js/lookup-manage.js b/corehq/apps/fixtures/static/fixtures/js/lookup-manage.js index ace49da31263..09fe3c613455 100644 --- a/corehq/apps/fixtures/static/fixtures/js/lookup-manage.js +++ b/corehq/apps/fixtures/static/fixtures/js/lookup-manage.js @@ -15,9 +15,8 @@ hqDefine("fixtures/js/lookup-manage", [ _, ko, assertProperties, - initialPageData + initialPageData, ) { - "use strict"; var somethingWentWrong = $("#FailText").text(); function log(x) { diff --git a/corehq/apps/fixtures/static/fixtures/js/view-table.js b/corehq/apps/fixtures/static/fixtures/js/view-table.js index 776dd285b756..5037ac0ff0af 100644 --- a/corehq/apps/fixtures/static/fixtures/js/view-table.js +++ b/corehq/apps/fixtures/static/fixtures/js/view-table.js @@ -11,7 +11,7 @@ hqDefine("fixtures/js/view-table", [ initialPageData, standardHQReportModule, datatablesConfig, - filters + filters, ) { if (initialPageData.get('renderReportTables')) { var reportTables = datatablesConfig.HQReportDataTables(initialPageData.get('dataTablesOptions')), diff --git a/corehq/apps/geospatial/static/geospatial/js/case_grouping_map.js b/corehq/apps/geospatial/static/geospatial/js/case_grouping_map.js index cf1974b6f931..ca881d990eec 100644 --- a/corehq/apps/geospatial/static/geospatial/js/case_grouping_map.js +++ b/corehq/apps/geospatial/static/geospatial/js/case_grouping_map.js @@ -18,7 +18,7 @@ hqDefine("geospatial/js/case_grouping_map", [ alertUser, models, utils, - mapboxgl + mapboxgl, ) { const MAPBOX_LAYER_VISIBILITY = { @@ -200,7 +200,7 @@ hqDefine("geospatial/js/case_grouping_map", [ "type": "Point", "coordinates": [coordinates.lng, coordinates.lat], }, - } + }, ); } }); diff --git a/corehq/apps/geospatial/static/geospatial/js/case_management.js b/corehq/apps/geospatial/static/geospatial/js/case_management.js index 6a8a875c7a7f..106ccfb62e49 100644 --- a/corehq/apps/geospatial/static/geospatial/js/case_management.js +++ b/corehq/apps/geospatial/static/geospatial/js/case_management.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine("geospatial/js/case_management", [ "jquery", @@ -18,7 +18,7 @@ hqDefine("geospatial/js/case_management", [ ko, models, utils, - alertUser + alertUser, ) { const MAP_CONTAINER_ID = 'geospatial-map'; const SHOW_USERS_QUERY_PARAM = 'show_users'; @@ -120,7 +120,7 @@ hqDefine("geospatial/js/case_management", [ if (parameters.max_case_travel_time_seconds) { const travelParamValue = `${parameters.max_case_travel_time_seconds / 60} ${gettext("minutes")}`; parametersList.push( - {name: gettext("Max travel time"), value: travelParamValue} + {name: gettext("Max travel time"), value: travelParamValue}, ); } @@ -161,7 +161,7 @@ hqDefine("geospatial/js/case_management", [ }, error: function () { alertUser.alert_user( - gettext("Oops! Something went wrong! Please check that your geospatial settings are configured correctly or contact admin if the problem persists."), 'danger' + gettext("Oops! Something went wrong! Please check that your geospatial settings are configured correctly or contact admin if the problem persists."), 'danger', ); self.setBusy(false); }, @@ -191,7 +191,7 @@ hqDefine("geospatial/js/case_management", [ type: 'Feature', properties: {}, geometry: { type: 'LineString', coordinates: lineCoordinates }, - } + }, ); } } @@ -523,7 +523,7 @@ hqDefine("geospatial/js/case_management", [ } else { alertUser.alert_user( gettext('Oops! Something went wrong! Please report an issue if the problem persists.'), - 'danger' + 'danger', ); } } else if (xhr.responseJSON.aaData.length && mapModel.mapInstance) { diff --git a/corehq/apps/geospatial/static/geospatial/js/geo_config.js b/corehq/apps/geospatial/static/geospatial/js/geo_config.js index fab320728e53..03783ced8486 100644 --- a/corehq/apps/geospatial/static/geospatial/js/geo_config.js +++ b/corehq/apps/geospatial/static/geospatial/js/geo_config.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine("geospatial/js/geo_config", [ "jquery", @@ -10,7 +10,7 @@ hqDefine("geospatial/js/geo_config", [ $, ko, initialPageData, - alertUser + alertUser, ) { const ROAD_NETWORK_ALGORITHM = initialPageData.get('road_network_algorithm_slug'); @@ -80,7 +80,7 @@ hqDefine("geospatial/js/geo_config", [ }).fail(function () { alertUser.alert_user( gettext("Invalid API token. Please verify that the token matches the one on your Mapbox account and has the correct scope configured."), - "danger" + "danger", ); }); }; diff --git a/corehq/apps/geospatial/static/geospatial/js/gps_capture.js b/corehq/apps/geospatial/static/geospatial/js/gps_capture.js index 3d3756524304..f2d10189283e 100644 --- a/corehq/apps/geospatial/static/geospatial/js/gps_capture.js +++ b/corehq/apps/geospatial/static/geospatial/js/gps_capture.js @@ -16,9 +16,8 @@ hqDefine("geospatial/js/gps_capture", [ _, initialPageData, mapboxgl, - MapboxGeocoder + MapboxGeocoder, ) { - 'use strict'; const MAP_CONTAINER_ID = "geospatial-map"; const USERS_PER_PAGE = 10; @@ -316,8 +315,6 @@ hqDefine("geospatial/js/gps_capture", [ } var initMap = function () { - 'use strict'; - mapboxgl.accessToken = initialPageData.get('mapbox_access_token'); let centerCoordinates = [2.43333330, 9.750]; // should be domain specific @@ -340,7 +337,7 @@ hqDefine("geospatial/js/gps_capture", [ marker: false, }).on('result', function (resultObject) { updateGPSCoordinates(resultObject.result.center[0], resultObject.result.center[1]); - }) + }), ); map.on('click', (event) => { diff --git a/corehq/apps/geospatial/static/geospatial/js/models.js b/corehq/apps/geospatial/static/geospatial/js/models.js index ddf68c56e076..51ea1c616730 100644 --- a/corehq/apps/geospatial/static/geospatial/js/models.js +++ b/corehq/apps/geospatial/static/geospatial/js/models.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine('geospatial/js/models', [ 'jquery', 'knockout', @@ -19,7 +19,7 @@ hqDefine('geospatial/js/models', [ alertUser, mapboxgl, MapboxDraw, - turf + turf, ) { const FEATURE_QUERY_PARAM = 'features'; const SELECTED_FEATURE_ID_QUERY_PARAM = 'selected_feature_id'; @@ -27,7 +27,7 @@ hqDefine('geospatial/js/models', [ const DISBURSEMENT_LAYER_PREFIX = 'route-'; const unexpectedErrorMessage = gettext( "Oops! Something went wrong!" + - " Please report an issue if the problem persists." + " Please report an issue if the problem persists.", ); const caseMarkerColors = { 'default': "#808080", // Gray @@ -210,7 +210,7 @@ hqDefine('geospatial/js/models', [ self.removeItemTypeFromSource = function (itemType) { self.sourceData.features = self.sourceData.features.filter( - feature => feature.properties.type !== itemType + feature => feature.properties.type !== itemType, ); self.refreshSource(); }; @@ -253,7 +253,7 @@ hqDefine('geospatial/js/models', [ self.mapInstance.on('click', 'user-points', (e) => { markerClickEvent(e, 'user'); }); - } + }, ); } @@ -721,7 +721,7 @@ hqDefine('geospatial/js/models', [ const sourceName = String(polygonObj.id) + '-source'; self.mapObj.mapInstance.addSource( sourceName, - {'type': 'geojson', 'data': polygonObj.geoJson} + {'type': 'geojson', 'data': polygonObj.geoJson}, ); self.mapObj.mapInstance.addLayer({ 'id': layerName, @@ -775,7 +775,7 @@ hqDefine('geospatial/js/models', [ function confirmForClearingDisbursement() { return confirm( gettext("Warning! This action will clear the current disbursement. " + - "Please confirm if you want to proceed.") + "Please confirm if you want to proceed."), ); } @@ -829,7 +829,7 @@ hqDefine('geospatial/js/models', [ const selectedId = parseInt(self.selectedSavedPolygonId()); const polygonObj = self.savedPolygons().find( - function (o) { return o.id === selectedId; } + function (o) { return o.id === selectedId; }, ); if (!polygonObj) { return; @@ -902,7 +902,7 @@ hqDefine('geospatial/js/models', [ name: name, id: ret.id, geo_json: data, - }) + }), ); // redraw using mapControlsModelInstance self.selectedSavedPolygonId(ret.id); @@ -1027,8 +1027,8 @@ hqDefine('geospatial/js/models', [ } self.caseData.push( new AssignmentRow( - item.name, item.itemId, assignedUserId, assignedUsername, primaryLocName, item - ) + item.name, item.itemId, assignedUserId, assignedUsername, primaryLocName, item, + ), ); } diff --git a/corehq/apps/geospatial/static/geospatial/js/utils.js b/corehq/apps/geospatial/static/geospatial/js/utils.js index d78292603c57..53bc75baf0db 100644 --- a/corehq/apps/geospatial/static/geospatial/js/utils.js +++ b/corehq/apps/geospatial/static/geospatial/js/utils.js @@ -1,10 +1,10 @@ -'use strict'; + hqDefine('geospatial/js/utils', [ 'mapbox-gl', 'underscore', ], function ( mapboxgl, - _ + _, ) { const DEFAULT_MARKER_OPACITY = 1.0; @@ -21,7 +21,7 @@ hqDefine('geospatial/js/utils', [ var uuidv4 = function () { // https://stackoverflow.com/questions/105034/how-do-i-create-a-guid-uuid/2117523#2117523 return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, c => - (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16) + (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16), ); }; diff --git a/corehq/apps/hqadmin/static/hqadmin/js/hqadmin_base_report.js b/corehq/apps/hqadmin/static/hqadmin/js/hqadmin_base_report.js index 687970a3f1e8..e5dfff1a1f6a 100644 --- a/corehq/apps/hqadmin/static/hqadmin/js/hqadmin_base_report.js +++ b/corehq/apps/hqadmin/static/hqadmin/js/hqadmin_base_report.js @@ -5,7 +5,7 @@ hqDefine('hqadmin/js/hqadmin_base_report', [ ], function ( $, initialPageData, - datatablesConfig + datatablesConfig, ) { $(function () { var aoColumns = initialPageData.get('aoColumns'); diff --git a/corehq/apps/hqadmin/static/hqadmin/js/mass_email.js b/corehq/apps/hqadmin/static/hqadmin/js/mass_email.js index 586b2819f267..9f20e8e6049c 100644 --- a/corehq/apps/hqadmin/static/hqadmin/js/mass_email.js +++ b/corehq/apps/hqadmin/static/hqadmin/js/mass_email.js @@ -2,7 +2,7 @@ hqDefine("hqadmin/js/mass_email", [ 'jquery', 'commcarehq', ], function ( - $ + $, ) { $(function () { $('#real_email').click(function (e) { diff --git a/corehq/apps/hqadmin/static/hqadmin/js/system_info.js b/corehq/apps/hqadmin/static/hqadmin/js/system_info.js index f934e7503a79..3b38362d73a3 100644 --- a/corehq/apps/hqadmin/static/hqadmin/js/system_info.js +++ b/corehq/apps/hqadmin/static/hqadmin/js/system_info.js @@ -10,7 +10,7 @@ hqDefine('hqadmin/js/system_info', [ ko, _, initialPageData, - alertUser + alertUser, ) { function formatDate(datestring) { //parse and format the date timestamps - seconds since epoch into date object diff --git a/corehq/apps/hqcase/static/hqcase/js/explode_cases.js b/corehq/apps/hqcase/static/hqcase/js/explode_cases.js index e16e0cb12418..1413b4dd8930 100644 --- a/corehq/apps/hqcase/static/hqcase/js/explode_cases.js +++ b/corehq/apps/hqcase/static/hqcase/js/explode_cases.js @@ -7,7 +7,7 @@ hqDefine('hqcase/js/explode_cases', [ ], function ( $, ko, - initialPageData + initialPageData, ) { $(function () { $('#explode').koApplyBindings({ diff --git a/corehq/apps/hqmedia/static/hqmedia/js/manage_paths_main.js b/corehq/apps/hqmedia/static/hqmedia/js/manage_paths_main.js index cff390c8cf43..74d7154e4b95 100644 --- a/corehq/apps/hqmedia/static/hqmedia/js/manage_paths_main.js +++ b/corehq/apps/hqmedia/static/hqmedia/js/manage_paths_main.js @@ -7,7 +7,7 @@ hqDefine("hqmedia/js/manage_paths_main", [ ], function ( $, ko, - assertProperties + assertProperties, ) { var pathsModel = function (options) { assertProperties.assertRequired(options, ['baseUrl', 'only_missing']); diff --git a/corehq/apps/hqmedia/static/hqmedia/js/media_reference_models.js b/corehq/apps/hqmedia/static/hqmedia/js/media_reference_models.js index 0efc9f16e051..1e8dbd874f5f 100644 --- a/corehq/apps/hqmedia/static/hqmedia/js/media_reference_models.js +++ b/corehq/apps/hqmedia/static/hqmedia/js/media_reference_models.js @@ -11,10 +11,9 @@ hqDefine("hqmedia/js/media_reference_models", [ _, assertProperties, mediaUploaders, - initialPageData + initialPageData, ) { function BaseMediaReference(ref, uploaderSlug) { - 'use strict'; let self = {}; self.media_class = ref.media_class; @@ -112,7 +111,6 @@ hqDefine("hqmedia/js/media_reference_models", [ } function ImageReference(ref, uploaderSlug) { - 'use strict'; let self = {}; self = BaseMediaReference(ref, uploaderSlug || "hqimage"); self.preview_template = "image-preview-template"; @@ -127,7 +125,6 @@ hqDefine("hqmedia/js/media_reference_models", [ ImageReference.prototype.constructor = ImageReference; function AudioReference(ref, uploaderSlug) { - 'use strict'; let self = {}; self = BaseMediaReference(ref, uploaderSlug || "hqaudio"); self.preview_template = "audio-preview-template"; @@ -138,7 +135,6 @@ hqDefine("hqmedia/js/media_reference_models", [ AudioReference.prototype.constructor = AudioReference; function VideoReference(ref, uploaderSlug) { - 'use strict'; let self = {}; self = BaseMediaReference(ref, uploaderSlug || "hqvideo"); self.preview_template = "video-preview-template"; diff --git a/corehq/apps/hqmedia/static/hqmedia/js/references_main.js b/corehq/apps/hqmedia/static/hqmedia/js/references_main.js index bc6868c25f2a..f6b896ab4f0a 100644 --- a/corehq/apps/hqmedia/static/hqmedia/js/references_main.js +++ b/corehq/apps/hqmedia/static/hqmedia/js/references_main.js @@ -13,7 +13,7 @@ hqDefine("hqmedia/js/references_main", [ _, alertUser, initialPageData, - mediaReferenceModels + mediaReferenceModels, ) { function MultimediaReferenceController() { var self = {}; diff --git a/corehq/apps/hqmedia/static/hqmedia/js/uploaders.js b/corehq/apps/hqmedia/static/hqmedia/js/uploaders.js index fe2d6396f120..f2195427674f 100644 --- a/corehq/apps/hqmedia/static/hqmedia/js/uploaders.js +++ b/corehq/apps/hqmedia/static/hqmedia/js/uploaders.js @@ -7,7 +7,7 @@ hqDefine("hqmedia/js/uploaders", [ $, _, assertProperties, - initialPageData + initialPageData, ) { const uploader = function (slug, options) { assertProperties.assertRequired(options, [ diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/500.js b/corehq/apps/hqwebapp/static/hqwebapp/js/500.js index 12dfaa11cc1a..81d2716ac2d6 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/500.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/500.js @@ -6,7 +6,7 @@ hqDefine("hqwebapp/js/500",[ $(function () { new bootstrap.Popover('#sad-danny', { title: gettext("This is Danny, one of our best developers."), - content: gettext("Danny is pretty sad that you had to encounter this issue. He's making sure it gets fixed as soon as possible.") + content: gettext("Danny is pretty sad that you had to encounter this issue. He's making sure it gets fixed as soon as possible."), }); $('#refresh').click(function () { window.location.reload(true); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/atwho.js b/corehq/apps/hqwebapp/static/hqwebapp/js/atwho.js index d15abb125209..02eb4e083678 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/atwho.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/atwho.js @@ -6,7 +6,7 @@ hqDefine('hqwebapp/js/atwho', [ ], function ( ko, - _ + _, ) { var _init = function ($input, options, afterInsert, replaceValue) { $input.atwho(options).on("inserted.atwho", function () { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/base_ace.js b/corehq/apps/hqwebapp/static/hqwebapp/js/base_ace.js index 312bd9c2206d..2336394a4fb3 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/base_ace.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/base_ace.js @@ -9,7 +9,7 @@ hqDefine('hqwebapp/js/base_ace', [ _, ko, ace, - initialPageData + initialPageData, ) { var self = {}; self.editor = []; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/alert_user.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/alert_user.js index 35654dacde46..6ebaf09365e2 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/alert_user.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/alert_user.js @@ -20,13 +20,13 @@ hqDefine("hqwebapp/js/bootstrap3/alert_user", [ ], function ( $, - ko + ko, ) { var MessageAlert = function (message, tags, fadeOut) { var self = { "message": ko.observable(message), "alert_class": ko.observable( - "alert fade in message-alert" + "alert fade in message-alert", ), }; if (tags) { @@ -40,7 +40,7 @@ function ( clearTimeout(self.timer); self.timer = setTimeout(removeAlertTimerFunc(self), 5000); } - } + }; return self; }; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list.js index 7cb43ea9e5c3..31df2f5d9adf 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list.js @@ -7,16 +7,15 @@ hqDefine("hqwebapp/js/bootstrap3/crud_paginated_list", [ ], function ( $, ko, - _ + _, ) { var CRUDPaginatedListModel = function ( total, pageLimit, currentPage, options, - paginatedItem + paginatedItem, ) { - 'use strict'; options = options || {}; var self = {}; @@ -114,7 +113,7 @@ hqDefine("hqwebapp/js/bootstrap3/crud_paginated_list", [ data.paginatedList, function (listItem) { return self.PaginatedItem(listItem, self.initRow); - } + }, )); self.deletedList([]); self.newList([]); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list_init.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list_init.js index 408cde784ad8..11bf6b18dedb 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list_init.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/crud_paginated_list_init.js @@ -8,7 +8,7 @@ hqDefine("hqwebapp/js/bootstrap3/crud_paginated_list_init", [ $, ko, initialPageData, - CRUDPaginatedList + CRUDPaginatedList, ) { var paginatedListModel = CRUDPaginatedList.CRUDPaginatedListModel( initialPageData.get('total'), @@ -19,7 +19,7 @@ hqDefine("hqwebapp/js/bootstrap3/crud_paginated_list_init", [ allowItemCreation: initialPageData.get('allow_item_creation'), createItemForm: initialPageData.get('create_item_form'), createItemFormClass: initialPageData.get('create_item_form_class'), - } + }, ); $(function () { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/downgrade_modal.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/downgrade_modal.js index 906b82a8602b..82335601fc87 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/downgrade_modal.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/downgrade_modal.js @@ -9,7 +9,7 @@ hqDefine("hqwebapp/js/bootstrap3/downgrade_modal", [ ], function ( kissmetrics, initialPageData, - $ + $, ) { function snooze(slug, domain) { $.cookie(cookieName(slug, domain), true, { expires: 1, path: '/', secure: initialPageData.get('secure_cookies') }); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/email-request.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/email-request.js index a8f004e8684c..c989fb85bd42 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/email-request.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/email-request.js @@ -130,14 +130,14 @@ hqDefine('hqwebapp/js/bootstrap3/email-request', [ if (issueReportModal.length) { issueReportModal.koApplyBindings(new EmailRequest( "modalReportIssue", - "hqwebapp-bugReportForm" + "hqwebapp-bugReportForm", )); } const featureRequestModal = $("#modalSolutionsFeatureRequest"); if (featureRequestModal.length) { featureRequestModal.koApplyBindings(new EmailRequest( "modalSolutionsFeatureRequest", - "hqwebapp-requestReportForm" + "hqwebapp-requestReportForm", )); } }); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/hq.helpers.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/hq.helpers.js index 2ec600963bf9..ef57d8c75b7f 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/hq.helpers.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/hq.helpers.js @@ -9,7 +9,7 @@ hqDefine("hqwebapp/js/bootstrap3/hq.helpers", [ $, ko, _, - googleAnalytics + googleAnalytics, ) { // disable-on-submit is a class for form submit buttons so they're automatically disabled when the form is submitted $(document).on('submit', 'form', function (ev) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/inactivity.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/inactivity.js index 06d055a8d36e..6d22e8dc9cac 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/inactivity.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/inactivity.js @@ -11,7 +11,7 @@ hqDefine('hqwebapp/js/bootstrap3/inactivity', [ $, _, assertProperties, - initialPageData + initialPageData, ) { var log = function (message) { console.log("[" + (new Date()).toLocaleTimeString() + "] " + message); // eslint-disable-line no-console @@ -147,7 +147,7 @@ hqDefine('hqwebapp/js/bootstrap3/inactivity', [ selectedAppId = urlParams.appId; } } catch (error) { - log("Could not parse app id out of " + window.location.hash) + log("Could not parse app id out of " + window.location.hash); return; } var domain = initialPageData.get('domain'); @@ -161,7 +161,7 @@ hqDefine('hqwebapp/js/bootstrap3/inactivity', [ success: function (data) { log( "ping_login response: " + (data.success ? "User is logged in" : "User is logged out") - + ", " + (data.new_app_version_available ? "new app version available" : "no new app version") + + ", " + (data.new_app_version_available ? "new app version available" : "no new app version"), ); if (!data.success) { _.each($(".select2-hidden-accessible"), function (el) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/knockout_bindings.ko.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/knockout_bindings.ko.js index 9e04b2d399e2..fcefdfb26f46 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/knockout_bindings.ko.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/knockout_bindings.ko.js @@ -6,7 +6,7 @@ hqDefine("hqwebapp/js/bootstrap3/knockout_bindings.ko", [ ], function ( $, _, - ko + ko, ) { // Need this due to https://github.com/knockout/knockout/pull/2324 // so that ko.bindingHandlers.foreach.update works properly @@ -16,10 +16,7 @@ hqDefine("hqwebapp/js/bootstrap3/knockout_bindings.ko", [ ko.bindingHandlers.hqbSubmitReady = { update: function (element, valueAccessor) { var value = (valueAccessor()) ? valueAccessor()() : null; - if (value) - $(element).addClass("btn-primary").removeClass("disabled"); - else - $(element).addClass("disabled").removeClass("btn-primary"); + if (value) {$(element).addClass("btn-primary").removeClass("disabled");} else {$(element).addClass("disabled").removeClass("btn-primary");} }, }; @@ -122,7 +119,7 @@ hqDefine("hqwebapp/js/bootstrap3/knockout_bindings.ko", [ "NOT UPDATING THE SORT OF THE ACTUAL LIST! " + "Did you forget to add `attr: {'data-order': _sortableOrder}` " + "to the data-bind attribute of your main sorting " + - "element?" + "element?", ); return; } @@ -190,7 +187,7 @@ hqDefine("hqwebapp/js/bootstrap3/knockout_bindings.ko", [ var list = ko.bindingHandlers.multirow_sortable.getList(valueAccessor); var forceUpdate = function () { ko.bindingHandlers.multirow_sortable.update( - element, valueAccessor, allBindingsAccessor, viewModel, bindingContext + element, valueAccessor, allBindingsAccessor, viewModel, bindingContext, ); }; list.subscribe(forceUpdate); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/main.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/main.js index 432d0d9158a3..9569f4b51e1c 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/main.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/main.js @@ -15,10 +15,9 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ modernizr, initialPageData, alertUser, - googleAnalytics + googleAnalytics, ) { var eventize = function (that) { - 'use strict'; var events = {}; that.on = function (tag, callback) { if (events[tag] === undefined) { @@ -40,12 +39,11 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ }; var makeHqHelp = function (opts, wrap) { - 'use strict'; wrap = wrap === undefined ? true : wrap; var el = $( '
' + '' + - '
' + '', ); _.each(['content', 'title', 'html', 'placement', 'container'], function (attr) { $('a', el).data(attr, opts[attr]); @@ -57,7 +55,6 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ }; var transformHelpTemplate = function ($template, wrap) { - 'use strict'; if ($template.data()) { var $help = makeHqHelp($template.data(), wrap); $help.insertAfter($template); @@ -104,8 +101,6 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ ko.virtualElements.allowedBindings.allowDescendantBindings = true; var initBlock = function ($elem) { - 'use strict'; - $('.submit').click(function (e) { var $form = $(this).closest('.form, form'), data = $form.find('[name]').serialize(), @@ -126,7 +121,6 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ }; var updateDOM = function (update) { - 'use strict'; var key; for (key in update) { if (_.has(update, key)) { @@ -136,7 +130,6 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ }; var makeSaveButton = function (messageStrings, cssClass, barClass) { - 'use strict'; var BAR_STATE = { SAVE: 'savebtn-bar-save', SAVING: 'savebtn-bar-saving', @@ -380,7 +373,6 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ }; $(function () { - 'use strict'; $(window).on('beforeunload', beforeUnloadCallback); initBlock($("body")); @@ -430,7 +422,7 @@ hqDefine('hqwebapp/js/bootstrap3/main', [ } else { setUpAlert(alert, closedAlerts, alertCookie); } - } + }, ); } diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/mobile_experience_warning.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/mobile_experience_warning.js index ccd686a3ef47..504c1d32f0a8 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/mobile_experience_warning.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/mobile_experience_warning.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine('hqwebapp/js/bootstrap3/mobile_experience_warning', [ "jquery", "hqwebapp/js/initial_page_data", @@ -7,7 +7,7 @@ hqDefine('hqwebapp/js/bootstrap3/mobile_experience_warning', [ ], function ( $, initialPageData, - kissmetrix + kissmetrix, ) { $(function () { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/prepaid_modal.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/prepaid_modal.js index e74cebea245c..38e92c5ef3a2 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/prepaid_modal.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/prepaid_modal.js @@ -9,7 +9,7 @@ hqDefine("hqwebapp/js/bootstrap3/prepaid_modal", [ ], function ( kissmetrics, initialPageData, - $ + $, ) { function snooze(slug, domain) { $.cookie(cookieName(slug, domain), true, { expires: 30, path: '/', secure: initialPageData.get('secure_cookies') }); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/requirejs_config.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/requirejs_config.js index eee2ead479c2..73ee3ac8b7b5 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/requirejs_config.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/requirejs_config.js @@ -1,4 +1,4 @@ -"use strict"; + requirejs.config({ baseUrl: '/static/', paths: { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/rollout_modal.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/rollout_modal.js index 71b9b5cc3fa5..4e1c62ba8695 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/rollout_modal.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/rollout_modal.js @@ -12,7 +12,7 @@ hqDefine("hqwebapp/js/bootstrap3/rollout_modal", [ alertUser, initialPageData, googleAnalytics, - kissmetricsAnalytics + kissmetricsAnalytics, ) { var _trackSoftRollout = googleAnalytics.trackCategory("Soft Rollout"); function snooze(slug) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/sticky_tabs.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/sticky_tabs.js index d8da44ac533b..ac2fc4da6f4c 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/sticky_tabs.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/sticky_tabs.js @@ -6,7 +6,7 @@ hqDefine("hqwebapp/js/bootstrap3/sticky_tabs", [ "jquery", "bootstrap", // needed for $.tab ], function ( - $ + $, ) { var getHash = function () { if (window.location.hash) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/validators.ko.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/validators.ko.js index 1f7ff498edfc..0d7aae67ef8c 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/validators.ko.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/validators.ko.js @@ -4,11 +4,11 @@ hqDefine("hqwebapp/js/bootstrap3/validators.ko", [ 'knockout-validation/dist/knockout.validation.min', // needed for ko.validation ], function ( $, - ko + ko, ) { ko.validation.rules['emailRFC2822'] = { validator: function (val) { - if (val === undefined || val.length === 0) return true; // do separate validation for required + if (val === undefined || val.length === 0) {return true;} // do separate validation for required var re = /(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/; return re.test(val || '') && val.indexOf(' ') < 0; }, diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/widgets.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/widgets.js index 8c55247e67c6..dcbf7b7723c0 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/widgets.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap3/widgets.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine("hqwebapp/js/bootstrap3/widgets",[ 'jquery', 'underscore', @@ -10,7 +10,7 @@ hqDefine("hqwebapp/js/bootstrap3/widgets",[ ], function ($, _, MapboxGeocoder, initialPageData) { var init = function () { var MAPBOX_ACCESS_TOKEN = initialPageData.get( - "mapbox_access_token" + "mapbox_access_token", ); // .hqwebapp-select2 is a basic select2-based dropdown or multiselect _.each($(".hqwebapp-select2"), function (element) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/alert_user.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/alert_user.js index 0a49aa895943..723e1d0ffbd6 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/alert_user.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/alert_user.js @@ -1,4 +1,4 @@ -"use strict"; + /* This is the knockout-based, javascript analog of messages in Django. @@ -21,13 +21,13 @@ hqDefine("hqwebapp/js/bootstrap5/alert_user", [ ], function ( $, - ko + ko, ) { var MessageAlert = function (message, tags, fadeOut) { var self = { "message": ko.observable(message), "alert_class": ko.observable( - "alert alert-dismissible message-alert mt-3 mb-2" + "alert alert-dismissible message-alert mt-3 mb-2", ), }; if (tags) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list.js index 2f60ffa30e9e..08c2f0d62e07 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list.js @@ -9,16 +9,15 @@ hqDefine("hqwebapp/js/bootstrap5/crud_paginated_list", [ $, ko, _, - bootstrap + bootstrap, ) { var CRUDPaginatedListModel = function ( total, pageLimit, currentPage, options, - paginatedItem + paginatedItem, ) { - 'use strict'; options = options || {}; var self = {}; @@ -116,7 +115,7 @@ hqDefine("hqwebapp/js/bootstrap5/crud_paginated_list", [ data.paginatedList, function (listItem) { return self.PaginatedItem(listItem, self.initRow); - } + }, )); self.deletedList([]); self.newList([]); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list_init.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list_init.js index cbc4aa2f98f3..c1b9004738f6 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list_init.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/crud_paginated_list_init.js @@ -8,7 +8,7 @@ hqDefine("hqwebapp/js/bootstrap5/crud_paginated_list_init", [ $, ko, initialPageData, - CRUDPaginatedList + CRUDPaginatedList, ) { var paginatedListModel = CRUDPaginatedList.CRUDPaginatedListModel( initialPageData.get('total'), @@ -19,7 +19,7 @@ hqDefine("hqwebapp/js/bootstrap5/crud_paginated_list_init", [ allowItemCreation: initialPageData.get('allow_item_creation'), createItemForm: initialPageData.get('create_item_form'), createItemFormClass: initialPageData.get('create_item_form_class'), - } + }, ); $(function () { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/downgrade_modal.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/downgrade_modal.js index 20cd598b7be8..084ba91329fd 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/downgrade_modal.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/downgrade_modal.js @@ -9,7 +9,7 @@ hqDefine("hqwebapp/js/bootstrap5/downgrade_modal", [ ], function ( kissmetrics, initialPageData, - $ + $, ) { function snooze(slug, domain) { $.cookie(cookieName(slug, domain), true, { expires: 1, path: '/', secure: initialPageData.get('secure_cookies') }); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/email-request.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/email-request.js index 05e0021a4bcf..d81cfa98f3f8 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/email-request.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/email-request.js @@ -4,8 +4,6 @@ hqDefine('hqwebapp/js/bootstrap5/email-request', [ "es6!hqwebapp/js/bootstrap5_loader", "hqwebapp/js/bootstrap5/hq.helpers", ], function ($, ko, bootstrap) { - 'use strict'; - var EmailRequest = function (modalId, formId) { let self = {}; @@ -133,14 +131,14 @@ hqDefine('hqwebapp/js/bootstrap5/email-request', [ if (issueReportModal.length) { issueReportModal.koApplyBindings(new EmailRequest( "modalReportIssue", - "hqwebapp-bugReportForm" + "hqwebapp-bugReportForm", )); } const featureRequestModal = $("#modalSolutionsFeatureRequest"); if (featureRequestModal.length) { featureRequestModal.koApplyBindings(new EmailRequest( "modalSolutionsFeatureRequest", - "hqwebapp-requestReportForm" + "hqwebapp-requestReportForm", )); } }); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/hq.helpers.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/hq.helpers.js index 4ded285f7893..cf802851a31f 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/hq.helpers.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/hq.helpers.js @@ -10,7 +10,7 @@ hqDefine("hqwebapp/js/bootstrap5/hq.helpers", [ ko, _, googleAnalytics, - bootstrap + bootstrap, ) { // disable-on-submit is a class for form submit buttons so they're automatically disabled when the form is submitted $(document).on('submit', 'form', function (ev) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/inactivity.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/inactivity.js index c97ca8511c57..1a5d8c4f0e75 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/inactivity.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/inactivity.js @@ -13,7 +13,7 @@ hqDefine('hqwebapp/js/bootstrap5/inactivity', [ _, bootstrap, assertProperties, - initialPageData + initialPageData, ) { var log = function (message) { console.log("[" + (new Date()).toLocaleTimeString() + "] " + message); // eslint-disable-line no-console @@ -213,7 +213,7 @@ hqDefine('hqwebapp/js/bootstrap5/inactivity', [ success: function (data) { log( "ping_login response: " + (data.success ? "User is logged in" : "User is logged out") - + ", " + (data.new_app_version_available ? "new app version available" : "no new app version") + + ", " + (data.new_app_version_available ? "new app version available" : "no new app version"), ); $button.enableButton(); var error = ""; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/knockout_bindings.ko.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/knockout_bindings.ko.js index 6ef647991a8b..3051862afa3a 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/knockout_bindings.ko.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/knockout_bindings.ko.js @@ -8,7 +8,7 @@ hqDefine("hqwebapp/js/bootstrap5/knockout_bindings.ko", [ $, _, ko, - bootstrap + bootstrap, ) { // Need this due to https://github.com/knockout/knockout/pull/2324 // so that ko.bindingHandlers.foreach.update works properly @@ -18,10 +18,7 @@ hqDefine("hqwebapp/js/bootstrap5/knockout_bindings.ko", [ ko.bindingHandlers.hqbSubmitReady = { update: function (element, valueAccessor) { var value = (valueAccessor()) ? valueAccessor()() : null; - if (value) - $(element).addClass("btn-primary").removeClass("disabled"); - else - $(element).addClass("disabled").removeClass("btn-primary"); + if (value) {$(element).addClass("btn-primary").removeClass("disabled");} else {$(element).addClass("disabled").removeClass("btn-primary");} }, }; @@ -124,7 +121,7 @@ hqDefine("hqwebapp/js/bootstrap5/knockout_bindings.ko", [ "NOT UPDATING THE SORT OF THE ACTUAL LIST! " + "Did you forget to add `attr: {'data-order': _sortableOrder}` " + "to the data-bind attribute of your main sorting " + - "element?" + "element?", ); return; } @@ -192,7 +189,7 @@ hqDefine("hqwebapp/js/bootstrap5/knockout_bindings.ko", [ var list = ko.bindingHandlers.multirow_sortable.getList(valueAccessor); var forceUpdate = function () { ko.bindingHandlers.multirow_sortable.update( - element, valueAccessor, allBindingsAccessor, viewModel, bindingContext + element, valueAccessor, allBindingsAccessor, viewModel, bindingContext, ); }; list.subscribe(forceUpdate); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/main.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/main.js index 48c6b5cb583d..af862a6c1d81 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/main.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/main.js @@ -17,10 +17,9 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ initialPageData, alertUser, googleAnalytics, - bootstrap + bootstrap, ) { var eventize = function (that) { - 'use strict'; var events = {}; that.on = function (tag, callback) { if (events[tag] === undefined) { @@ -42,12 +41,11 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ }; var makeHqHelp = function (opts, wrap) { - 'use strict'; wrap = wrap === undefined ? true : wrap; var el = $( '
' + '' + - '
' + '', ); _.each(['content', 'title', 'html', 'placement', 'container'], function (attr) { $('a', el).attr('data-bs-' + attr, opts[attr]); @@ -59,7 +57,6 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ }; var transformHelpTemplate = function ($template, wrap) { - 'use strict'; if ($template.data()) { var $help = makeHqHelp($template.data(), wrap); $help.insertAfter($template); @@ -106,7 +103,6 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ ko.virtualElements.allowedBindings.allowDescendantBindings = true; var initBlock = function ($elem) { - 'use strict'; $('.submit').click(function (e) { var $form = $(this).closest('.form, form'), @@ -126,7 +122,6 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ }; var updateDOM = function (update) { - 'use strict'; var key; for (key in update) { if (update.hasOwnProperty(key)) { @@ -136,7 +131,6 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ }; var makeSaveButton = function (messageStrings, cssClass, barClass) { - 'use strict'; var BAR_STATE = { SAVE: 'savebtn-bar-save', SAVING: 'savebtn-bar-saving', @@ -257,7 +251,7 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ if (lastParent) { var stillAttached = lastParent.tagName.toLowerCase() == 'html'; if (button.state !== 'saved' && stillAttached) { - if ($('.js-unhide-on-unsaved').length > 0) $('.js-unhide-on-unsaved').removeClass('hide'); + if ($('.js-unhide-on-unsaved').length > 0) {$('.js-unhide-on-unsaved').removeClass('hide');} return options.unsavedMessage || ""; } } @@ -378,7 +372,6 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ }; $(function () { - 'use strict'; $(window).on('beforeunload', beforeUnloadCallback); initBlock($("body")); @@ -433,7 +426,7 @@ hqDefine('hqwebapp/js/bootstrap5/main', [ } else { setUpAlert(alert, closedAlerts, alertCookie); } - } + }, ); } diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/mobile_experience_warning.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/mobile_experience_warning.js index 856ac6ba39a5..5af681a69f0c 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/mobile_experience_warning.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/mobile_experience_warning.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine('hqwebapp/js/bootstrap5/mobile_experience_warning', [ "jquery", "hqwebapp/js/initial_page_data", @@ -9,7 +9,7 @@ hqDefine('hqwebapp/js/bootstrap5/mobile_experience_warning', [ $, initialPageData, kissmetrix, - bootstrap + bootstrap, ) { $(function () { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/prepaid_modal.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/prepaid_modal.js index 1d2c26294396..be4b79a4ecb4 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/prepaid_modal.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/prepaid_modal.js @@ -9,7 +9,7 @@ hqDefine("hqwebapp/js/bootstrap5/prepaid_modal", [ ], function ( kissmetrics, initialPageData, - $ + $, ) { function snooze(slug, domain) { $.cookie(cookieName(slug, domain), true, { expires: 30, path: '/', secure: initialPageData.get('secure_cookies') }); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/requirejs_config.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/requirejs_config.js index dc0c1680b65a..a0fa63c50c80 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/requirejs_config.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/requirejs_config.js @@ -1,4 +1,4 @@ -"use strict"; + requirejs.config({ baseUrl: '/static/', paths: { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/rollout_modal.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/rollout_modal.js index d95567a48839..36795d60f458 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/rollout_modal.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/rollout_modal.js @@ -12,7 +12,7 @@ hqDefine("hqwebapp/js/bootstrap5/rollout_modal", [ alertUser, initialPageData, googleAnalytics, - kissmetricsAnalytics + kissmetricsAnalytics, ) { var _trackSoftRollout = googleAnalytics.trackCategory("Soft Rollout"); function snooze(slug) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/sticky_tabs.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/sticky_tabs.js index 815d29c65dbc..d4b982b78139 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/sticky_tabs.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/sticky_tabs.js @@ -6,7 +6,7 @@ hqDefine("hqwebapp/js/bootstrap5/sticky_tabs", [ "jquery", "es6!hqwebapp/js/bootstrap5_loader", // needed for $.tab ], function ( - $, bootstrap + $, bootstrap, ) { var getHash = function () { if (window.location.hash) { @@ -25,7 +25,7 @@ hqDefine("hqwebapp/js/bootstrap5/sticky_tabs", [ tabController; // make sure we don't treat all anchor tags as a sticky tab - if ($tabFromUrl && $tabFromUrl.parents('.sticky-tabs').length === 0) return; + if ($tabFromUrl && $tabFromUrl.parents('.sticky-tabs').length === 0) {return;} if ($tabFromUrl && $tabFromUrl.length) { tabController = new bootstrap.Tab($tabFromUrl); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/validators.ko.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/validators.ko.js index 4581636d9ce1..9e45539420ad 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/validators.ko.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/validators.ko.js @@ -4,10 +4,8 @@ hqDefine("hqwebapp/js/bootstrap5/validators.ko", [ 'knockout-validation/dist/knockout.validation.min', // needed for ko.validation ], function ( $, - ko + ko, ) { - 'use strict'; - ko.validation.init({ errorMessageClass: 'invalid-feedback', errorElementClass: 'is-invalid', @@ -17,7 +15,7 @@ hqDefine("hqwebapp/js/bootstrap5/validators.ko", [ ko.validation.rules['emailRFC2822'] = { validator: function (val) { - if (val === undefined || val.length === 0) return true; // do separate validation for required + if (val === undefined || val.length === 0) {return true;} // do separate validation for required var re = /(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/; return re.test(val || '') && val.indexOf(' ') < 0; }, @@ -67,7 +65,7 @@ hqDefine("hqwebapp/js/bootstrap5/validators.ko", [ if (options.delayedValidator === undefined) { isValid = options.validator.isValid(); isValidating = options.validator.isValidating !== undefined && options.validator.isValidating(); - if (isValid !== undefined && !isValid) $(element).addClass('is-invalid'); + if (isValid !== undefined && !isValid) {$(element).addClass('is-invalid');} } else { isValidating = options.validator.isValid() && options.delayedValidator.isValidating(); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/widgets.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/widgets.js index 102dd7422e5c..834d35fdcdba 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/widgets.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bootstrap5/widgets.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine("hqwebapp/js/bootstrap5/widgets",[ 'jquery', 'underscore', @@ -10,7 +10,7 @@ hqDefine("hqwebapp/js/bootstrap5/widgets",[ ], function ($, _, MapboxGeocoder, initialPageData, tempusDominus) { var init = function () { var MAPBOX_ACCESS_TOKEN = initialPageData.get( - "mapbox_access_token" + "mapbox_access_token", ); // .hqwebapp-select2 is a basic select2-based dropdown or multiselect _.each($(".hqwebapp-select2"), function (element) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/bulk_upload_file.js b/corehq/apps/hqwebapp/static/hqwebapp/js/bulk_upload_file.js index 33aaf98a4baf..1ec0a75f8096 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/bulk_upload_file.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/bulk_upload_file.js @@ -4,10 +4,9 @@ hqDefine("hqwebapp/js/bulk_upload_file", [ "commcarehq", ], function ( $, - ko + ko, ) { $(function () { - "use strict"; var $form = $("#bulk_upload_form"); if ($form.length) { $form.koApplyBindings({ diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/captcha.js b/corehq/apps/hqwebapp/static/hqwebapp/js/captcha.js index 0ef7e5441ffd..a9f07bdf8335 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/captcha.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/captcha.js @@ -1,14 +1,14 @@ -'use strict'; + hqDefine("hqwebapp/js/captcha", [ 'jquery', ],function ( - $ + $, ) { $(function () { // http://stackoverflow.com/a/20371801 $('img.captcha').after( $(' ') + ''), ); $('.captcha-refresh').click(function () { var $form = $(this).parent().closest('form'); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/components.ko.js b/corehq/apps/hqwebapp/static/hqwebapp/js/components.ko.js index 8e60ba56c22d..fa103b56b28d 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/components.ko.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/components.ko.js @@ -3,7 +3,7 @@ hqDefine("hqwebapp/js/components.ko", [ 'knockout', ], function ( $, - ko + ko, ) { return { register: function (name, component) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap3/feedback.js b/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap3/feedback.js index 9beadc6bfc20..edabcf20b6e9 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap3/feedback.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap3/feedback.js @@ -1,4 +1,4 @@ -'use strict'; + /** * Knockout Feedback Component * @@ -24,7 +24,7 @@ hqDefine('hqwebapp/js/components/bootstrap3/feedback', [ $, _, initialPageData, - koComponents + koComponents, ) { const component = { viewModel: function (params) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap5/feedback.js b/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap5/feedback.js index 43f258e96864..a1afcd5c9d20 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap5/feedback.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/components/bootstrap5/feedback.js @@ -1,4 +1,4 @@ -'use strict'; + /** * Knockout Feedback Component * diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/components/inline_edit.js b/corehq/apps/hqwebapp/static/hqwebapp/js/components/inline_edit.js index 5b89d0c0bf1e..605c629bf28c 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/components/inline_edit.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/components/inline_edit.js @@ -1,4 +1,4 @@ -'use strict'; + /* * Component for an inline editing widget: a piece of text that, when clicked on, turns into an input (textarea or * text input). The input is accompanied by a save button capable of saving the new value to the server via ajax. @@ -32,7 +32,7 @@ hqDefine('hqwebapp/js/components/inline_edit', [ ko, _, DOMPurify, - koComponents + koComponents, ) { const component = { viewModel: function (params) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/components/pagination.js b/corehq/apps/hqwebapp/static/hqwebapp/js/components/pagination.js index e1e010581144..e6a83ed62896 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/components/pagination.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/components/pagination.js @@ -1,4 +1,4 @@ -'use strict'; + /** * Knockout Pagination Component * @@ -39,7 +39,7 @@ hqDefine('hqwebapp/js/components/pagination', [ ko, _, initialPageData, - koComponents + koComponents, ) { const component = { viewModel: function (params) { @@ -97,7 +97,7 @@ hqDefine('hqwebapp/js/components/pagination', [ self.itemsText = ko.computed(function () { var lastItem = Math.min(self.currentPage() * self.perPage(), self.totalItems()); return _.template( - params.itemsTextTemplate || gettext('Showing <%- firstItem %> to <%- lastItem %> of <%- maxItems %> entries') + params.itemsTextTemplate || gettext('Showing <%- firstItem %> to <%- lastItem %> of <%- maxItems %> entries'), )({ firstItem: self.totalItems() > 0 ? ((self.currentPage() - 1) * self.perPage()) + 1 : 0, lastItem: isNaN(lastItem) ? 1 : lastItem, diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/components/search_box.js b/corehq/apps/hqwebapp/static/hqwebapp/js/components/search_box.js index 136df83ffdd5..b62a351c8d8e 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/components/search_box.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/components/search_box.js @@ -1,4 +1,4 @@ -'use strict'; + /* * Component for displaying a search box. Almost certainly included within a a larger knockout template. * @@ -20,7 +20,7 @@ hqDefine('hqwebapp/js/components/search_box', [ $, ko, _, - koComponents + koComponents, ) { const component = { viewModel: function (params) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/components/select_toggle.js b/corehq/apps/hqwebapp/static/hqwebapp/js/components/select_toggle.js index 8f94749ac062..ec5aafef6e58 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/components/select_toggle.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/components/select_toggle.js @@ -1,4 +1,4 @@ -'use strict'; + /* * Component for displaying a selection as a set of buttons. * Creates an invisible ' + - '' + '', ); return input({ searchInputId: inputId, @@ -85,12 +85,12 @@ hqDefine('hqwebapp/js/multiselect_utils', [ selectableHeader: _renderHeader( selectableHeaderTitle, _renderAction(selectAllId, defaultBtnClass, 'fa fa-plus', gettext("Add All"), disableModifyAllActions), - _renderSearch(searchSelectableId, searchItemTitle) + _renderSearch(searchSelectableId, searchItemTitle), ), selectionHeader: _renderHeader( selectedHeaderTitle, _renderAction(removeAllId, defaultBtnClass, 'fa fa-remove', gettext("Remove All"), disableModifyAllActions), - _renderSearch(searchSelectedId, searchItemTitle) + _renderSearch(searchSelectedId, searchItemTitle), ), afterInit: function () { var that = this, diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/password_validators.ko.js b/corehq/apps/hqwebapp/static/hqwebapp/js/password_validators.ko.js index 3c071f642cf2..f7487ca2405e 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/password_validators.ko.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/password_validators.ko.js @@ -1,11 +1,11 @@ -'use strict'; + hqDefine('hqwebapp/js/password_validators.ko', [ 'knockout', 'zxcvbn/dist/zxcvbn', 'knockout-validation/dist/knockout.validation.min', // needed for ko.validation ], function ( ko, - zxcvbn + zxcvbn, ) { ko.validation.rules['zxcvbnPassword'] = { validator: function (val, minScore, penalizedWords) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/privileges.js b/corehq/apps/hqwebapp/static/hqwebapp/js/privileges.js index 99d09353d642..0570a5b731c9 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/privileges.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/privileges.js @@ -1,10 +1,10 @@ -'use strict'; + hqDefine('hqwebapp/js/privileges', [ 'underscore', 'hqwebapp/js/initial_page_data', ], function ( _, - initialPageData + initialPageData, ) { var privilegePresent = function (allPrivileges, privilegeName) { return allPrivileges.includes(privilegeName); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/resource_versions.js b/corehq/apps/hqwebapp/static/hqwebapp/js/resource_versions.js index 7fa772abe5ca..86ffaab2cd68 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/resource_versions.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/resource_versions.js @@ -1,4 +1,4 @@ -'use strict'; + requirejs.config({ paths: { // This file gets auto-generated during deploy. diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/select2_handler.js b/corehq/apps/hqwebapp/static/hqwebapp/js/select2_handler.js index 836a05c3f0c6..eddc93e59556 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/select2_handler.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/select2_handler.js @@ -6,12 +6,11 @@ hqDefine("hqwebapp/js/select2_handler", [ ], function ( $, ko, - _ + _, ) { var baseSelect2Handler = function (options) { // For use with BaseAsyncHandler // todo: documentation (biyeun) - 'use strict'; var self = {}; self.fieldName = options.fieldName; self.placeholder = options.placeholder; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/select2_knockout_bindings.ko.js b/corehq/apps/hqwebapp/static/hqwebapp/js/select2_knockout_bindings.ko.js index f5d2094e1cb1..d7cec1197e94 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/select2_knockout_bindings.ko.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/select2_knockout_bindings.ko.js @@ -1,4 +1,4 @@ -"use strict"; + hqDefine("hqwebapp/js/select2_knockout_bindings.ko", [ 'jquery', 'underscore', @@ -9,7 +9,7 @@ hqDefine("hqwebapp/js/select2_knockout_bindings.ko", [ $, _, ko, - DOMPurify + DOMPurify, ) { /** * Converts the bound element to a select2 widget, using the element's existing diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/select_2_ajax_widget.js b/corehq/apps/hqwebapp/static/hqwebapp/js/select_2_ajax_widget.js index 2c3186b789d1..a27d85b273f8 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/select_2_ajax_widget.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/select_2_ajax_widget.js @@ -1,4 +1,4 @@ -"use strict"; + hqDefine("hqwebapp/js/select_2_ajax_widget", [ 'jquery', 'underscore', diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/soil.js b/corehq/apps/hqwebapp/static/hqwebapp/js/soil.js index 849397e49026..98077d444c07 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/soil.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/soil.js @@ -1,11 +1,11 @@ -"use strict"; + hqDefine("hqwebapp/js/soil", [ "jquery", "hqwebapp/js/initial_page_data", "commcarehq", ], function ( $, - initialPageData + initialPageData, ) { $(function () { var downloadId = initialPageData.get("download_id"), diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/sso_inactivity.js b/corehq/apps/hqwebapp/static/hqwebapp/js/sso_inactivity.js index 97dbaa858996..246c5210c7ed 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/sso_inactivity.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/sso_inactivity.js @@ -1,4 +1,4 @@ -"use strict"; + /* * Handles communication about the status of SSO login after the inactivity * timer has requested a re-login diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/tempus_dominus.js b/corehq/apps/hqwebapp/static/hqwebapp/js/tempus_dominus.js index 18f0e5485531..c2e8acb75161 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/tempus_dominus.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/tempus_dominus.js @@ -1,4 +1,4 @@ -"use strict"; + /** * This replaces hqwebapp/js/daterangepicker.config, which is tied to bootstrap3 * @@ -14,7 +14,7 @@ hqDefine("hqwebapp/js/tempus_dominus", [ _, Popper, tempusDominus, - initialPageData + initialPageData, ) { // https://github.com/Eonasdan/tempus-dominus/discussions/2698 if (!window.USE_WEBPACK) { @@ -76,7 +76,7 @@ hqDefine("hqwebapp/js/tempus_dominus", [ localization: _.extend(defaultTranslations, { format: 'yyyy-MM-dd', }), - } + }, ); if (start && end) { diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/toggles.js b/corehq/apps/hqwebapp/static/hqwebapp/js/toggles.js index d408c5b36b37..534156a5ad82 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/toggles.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/toggles.js @@ -1,17 +1,17 @@ -"use strict"; + hqDefine('hqwebapp/js/toggles', [ 'underscore', 'hqwebapp/js/initial_page_data', ], function ( _, - initialPageData + initialPageData, ) { var genericToggleEnabled = function (allToggles, toggleName) { var value = allToggles[toggleName]; if (typeof value === 'undefined') { throw new Error( 'Toggle ' + toggleName + ' not recognized. Must be one of: \n\n' + - _.sortBy(_.keys(allToggles)).join("\n") + _.sortBy(_.keys(allToggles)).join("\n"), ); } return value; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-checkbox.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-checkbox.js index 32d60c8b0552..86f7ed998b2a 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-checkbox.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-checkbox.js @@ -1,10 +1,10 @@ -"use strict"; + hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-checkbox', [ 'jquery', 'hqwebapp/js/bootstrap3/main', ], function ( $, - hqMain + hqMain, ) { var module = {}; @@ -36,9 +36,9 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-checkbox', [ this.value = value; this.$edit_view.prop('checked', this.value); this.$noedit_view.removeClass( - this.value ? Checkbox.UNCHECKED : Checkbox.CHECKED + this.value ? Checkbox.UNCHECKED : Checkbox.CHECKED, ).addClass( - this.value ? Checkbox.CHECKED : Checkbox.UNCHECKED + this.value ? Checkbox.CHECKED : Checkbox.UNCHECKED, ); return this; } diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input-map.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input-map.js index bf02fc35bc91..1055ed3f8b75 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input-map.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input-map.js @@ -1,4 +1,4 @@ -"use strict"; + hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-input-map', [ 'jquery', 'underscore', @@ -8,7 +8,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-input-map', [ $, _, hqMain, - DOMPurify + DOMPurify, ) { var module = {}; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input.js index 31fb28100d83..c4e411d53cb7 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-input.js @@ -1,4 +1,4 @@ -"use strict"; + hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-input', [ 'jquery', 'hqwebapp/js/bootstrap3/main', @@ -6,7 +6,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-input', [ ], function ( $, hqMain, - langcodeButton + langcodeButton, ) { var module = {}; @@ -59,7 +59,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-input', [ this.ui.css("position", "relative"); var button = langcodeButton.new( $(''), - translated.lang + translated.lang, ); this.ui.append(button.button); this.setPlaceholderValue(translated.value); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-list.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-list.js index cfa9cafbfdcb..3f935eb55b09 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-list.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-list.js @@ -1,4 +1,4 @@ -"use strict"; + hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-list', [ 'jquery', 'underscore', @@ -8,7 +8,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-list', [ $, _, hqMain, - uiInputMap + uiInputMap, ) { var module = {}; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-select.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-select.js index 17048d84c5cf..6025a07fe57c 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-select.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap3/ui-element-select.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-select', [ 'jquery', 'underscore', @@ -6,7 +6,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-select', [ ], function ( $, _, - hqMain + hqMain, ) { var module = {}; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-checkbox.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-checkbox.js index 8c01911fe01b..87b07af75336 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-checkbox.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-checkbox.js @@ -1,10 +1,10 @@ -'use strict'; + hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-checkbox', [ 'jquery', 'hqwebapp/js/bootstrap5/main', ], function ( $, - hqMain + hqMain, ) { var module = {}; @@ -36,9 +36,9 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-checkbox', [ this.value = value; this.$edit_view.prop('checked', this.value); this.$noedit_view.removeClass( - this.value ? Checkbox.UNCHECKED : Checkbox.CHECKED + this.value ? Checkbox.UNCHECKED : Checkbox.CHECKED, ).addClass( - this.value ? Checkbox.CHECKED : Checkbox.UNCHECKED + this.value ? Checkbox.CHECKED : Checkbox.UNCHECKED, ); return this; } diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input-map.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input-map.js index e2dea40700f6..2e3c19f1fe7e 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input-map.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input-map.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-input-map', [ 'jquery', 'underscore', @@ -8,7 +8,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-input-map', [ $, _, hqMain, - DOMPurify + DOMPurify, ) { var module = {}; diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input.js index 0d69f66c7165..dbe54b86b4e0 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-input.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-input', [ 'jquery', 'hqwebapp/js/bootstrap5/main', @@ -6,7 +6,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-input', [ ], function ( $, hqMain, - langcodeButton + langcodeButton, ) { var module = {}; @@ -59,7 +59,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-input', [ this.ui.css("position", "relative"); var button = langcodeButton.new( $(''), - translated.lang + translated.lang, ); this.ui.append(button.button); this.setPlaceholderValue(translated.value); diff --git a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list.js b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list.js index 4c9c8b75a161..8ba648860714 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list.js +++ b/corehq/apps/hqwebapp/static/hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list.js @@ -1,4 +1,4 @@ -'use strict'; + hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list', [ 'jquery', 'underscore', @@ -8,7 +8,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list', [ $, _, hqMain, - uiInputMap + uiInputMap, ) { var module = {}; @@ -47,7 +47,7 @@ hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list', [ + '' + this.sub_title + '' - + '' + + '', ); var $modalEditor = $('
'), $modalBody = $('', ); _.each(['content', 'title', 'html', 'placement', 'container'], function (attr) { - $('a', el).data(attr, opts[attr]); @@ -39,7 +37,15 @@ }); if (wrap) { el.hqHelp(); -@@ -115,8 +117,6 @@ +@@ -101,6 +103,7 @@ + ko.virtualElements.allowedBindings.allowDescendantBindings = true; + + var initBlock = function ($elem) { ++ + $('.submit').click(function (e) { + var $form = $(this).closest('.form, form'), + data = $form.find('[name]').serialize(), +@@ -110,8 +113,6 @@ $.postGo(action, $.unparam(data)); }); @@ -48,8 +54,8 @@ $("input[type='text'], input[type='password'], textarea", $elem); $('.config', $elem).wrap('
').parent().addClass('container block ui-corner-all'); -@@ -129,7 +129,7 @@ - 'use strict'; +@@ -123,7 +124,7 @@ + var updateDOM = function (update) { var key; for (key in update) { - if (_.has(update, key)) { @@ -57,7 +63,7 @@ $(key).text(update[key]).val(update[key]); } } -@@ -161,7 +161,7 @@ +@@ -154,7 +155,7 @@ }).addClass(cssClass), $saving: $('
').text(SaveButton.message.SAVING).addClass('btn btn-primary disabled'), $saved: $('
').text(SaveButton.message.SAVED).addClass('btn btn-primary disabled'), @@ -66,7 +72,7 @@ setStateWhenReady: function (state) { if (this.state === 'saving') { this.nextState = state; -@@ -179,7 +179,7 @@ +@@ -172,7 +173,7 @@ this.$saved.detach(); this.$retry.detach(); var buttonUi = this.ui; @@ -75,7 +81,7 @@ buttonUi.removeClass(v); }); if (state === 'save') { -@@ -207,7 +207,7 @@ +@@ -200,7 +201,7 @@ $.ajaxSettings.beforeSend(jqXHR, settings); beforeSend.apply(this, arguments); }; @@ -84,7 +90,7 @@ that.setState(that.nextState); success.apply(this, arguments); }; -@@ -255,11 +255,9 @@ +@@ -248,11 +249,9 @@ $(window).on('beforeunload', function () { var lastParent = button.ui.parents()[button.ui.parents().length - 1]; if (lastParent) { @@ -94,11 +100,11 @@ - if ($('.js-unhide-on-unsaved').length > 0) { - $('.js-unhide-on-unsaved').removeClass('hide'); - } -+ if ($('.js-unhide-on-unsaved').length > 0) $('.js-unhide-on-unsaved').removeClass('hide'); ++ if ($('.js-unhide-on-unsaved').length > 0) {$('.js-unhide-on-unsaved').removeClass('hide');} return options.unsavedMessage || ""; } } -@@ -384,7 +382,12 @@ +@@ -376,7 +375,12 @@ $(window).on('beforeunload', beforeUnloadCallback); initBlock($("body")); @@ -112,7 +118,7 @@ $(document).on('click', '.track-usage-link', function (e) { var $link = $(e.currentTarget), -@@ -460,8 +463,13 @@ +@@ -452,8 +456,13 @@ // EULA modal var eulaCookie = "gdpr_rollout"; if (!$.cookie(eulaCookie)) { @@ -128,7 +134,7 @@ $("body").addClass("has-eula"); $("#eula-agree").click(function () { $(this).disableButton(); -@@ -469,7 +477,7 @@ +@@ -461,7 +470,7 @@ url: initialPageData.reverse("agree_to_eula"), method: "POST", success: function () { @@ -137,7 +143,7 @@ $("body").removeClass("has-eula"); }, error: function (xhr) { -@@ -485,21 +493,22 @@ +@@ -477,21 +486,22 @@ }, }); }); diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/mobile_experience_warning.js.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/mobile_experience_warning.js.diff.txt index f9a06bfadac4..3d81ce4bd06b 100644 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/mobile_experience_warning.js.diff.txt +++ b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/mobile_experience_warning.js.diff.txt @@ -1,7 +1,7 @@ --- +++ @@ -1,47 +1,47 @@ - 'use strict'; + -hqDefine('hqwebapp/js/bootstrap3/mobile_experience_warning', [ +hqDefine('hqwebapp/js/bootstrap5/mobile_experience_warning', [ "jquery", @@ -12,9 +12,8 @@ ], function ( $, initialPageData, -- kissmetrix -+ kissmetrix, -+ bootstrap + kissmetrix, ++ bootstrap, ) { $(function () { diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/sticky_tabs.js.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/sticky_tabs.js.diff.txt index ac0ebb20ea8a..06d308a39169 100644 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/sticky_tabs.js.diff.txt +++ b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/sticky_tabs.js.diff.txt @@ -10,8 +10,8 @@ - "bootstrap", // needed for $.tab + "es6!hqwebapp/js/bootstrap5_loader", // needed for $.tab ], function ( -- $ -+ $, bootstrap +- $, ++ $, bootstrap, ) { var getHash = function () { if (window.location.hash) { @@ -31,7 +31,7 @@ + tabController; + + // make sure we don't treat all anchor tags as a sticky tab -+ if ($tabFromUrl && $tabFromUrl.parents('.sticky-tabs').length === 0) return; ++ if ($tabFromUrl && $tabFromUrl.parents('.sticky-tabs').length === 0) {return;} if ($tabFromUrl && $tabFromUrl.length) { - $tabFromUrl.tab('show'); diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-checkbox.js.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-checkbox.js.diff.txt index f4fee0f8d1a1..4af3e0322b27 100644 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-checkbox.js.diff.txt +++ b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-checkbox.js.diff.txt @@ -1,13 +1,12 @@ --- +++ @@ -1,7 +1,7 @@ --"use strict"; + -hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-checkbox', [ -+'use strict'; +hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-checkbox', [ 'jquery', - 'hqwebapp/js/bootstrap3/main', + 'hqwebapp/js/bootstrap5/main', ], function ( $, - hqMain + hqMain, diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input-map.js.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input-map.js.diff.txt index d93b9e838810..212668e80385 100644 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input-map.js.diff.txt +++ b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input-map.js.diff.txt @@ -1,9 +1,8 @@ --- +++ @@ -1,8 +1,8 @@ --"use strict"; + -hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-input-map', [ -+'use strict'; +hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-input-map', [ 'jquery', 'underscore', diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input.js.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input.js.diff.txt index 16f98f9209fd..987578aeb6fa 100644 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input.js.diff.txt +++ b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-input.js.diff.txt @@ -1,9 +1,8 @@ --- +++ @@ -1,7 +1,7 @@ --"use strict"; + -hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-input', [ -+'use strict'; +hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-input', [ 'jquery', - 'hqwebapp/js/bootstrap3/main', diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-key-val-list.js.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-key-val-list.js.diff.txt index 9c81f8641a2a..b74ba7c3ac51 100644 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-key-val-list.js.diff.txt +++ b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/javascript/hqwebapp/js/ui_elements/ui-element-key-val-list.js.diff.txt @@ -1,9 +1,8 @@ --- +++ @@ -1,9 +1,9 @@ --"use strict"; + -hqDefine('hqwebapp/js/ui_elements/bootstrap3/ui-element-key-val-list', [ -+'use strict'; +hqDefine('hqwebapp/js/ui_elements/bootstrap5/ui-element-key-val-list', [ 'jquery', 'underscore', @@ -47,7 +46,7 @@ + + '' + + this.sub_title + + '' -+ + '
' ++ + '
', + ); + var $modalEditor = $('
'), $modalBody = $('