diff --git a/abilian/sbe/static/js/document_viewer.js b/abilian/sbe/static/js/document_viewer.js index d835eb3e..1e6d62d7 100644 --- a/abilian/sbe/static/js/document_viewer.js +++ b/abilian/sbe/static/js/document_viewer.js @@ -1,4 +1,4 @@ -define("SBEDocumentViewerSetup", ["Abilian", "jquery"], function (Abilian, $) { +define("SBEDocumentViewerSetup", ["Abilian", "jquery"], (Abilian, $) => { "use strict"; function setupDocumentViewer() { const container = $(".preview-container"); diff --git a/abilian/sbe/static/js/folder.js b/abilian/sbe/static/js/folder.js index 08d2ceab..2080419f 100644 --- a/abilian/sbe/static/js/folder.js +++ b/abilian/sbe/static/js/folder.js @@ -3,14 +3,10 @@ define("SBEFolderListingSetup", [ "jquery", "jquery.dataTables", "bootbox", -], function (Abilian, $, jqDT, bootbox) { +], (Abilian, $, jqDT, bootbox) => { "use strict"; function setupFolderListing() { - $.fn.dataTableExt.afnFiltering.push(function ( - oSettings, - aData, - iDataIndex - ) { + $.fn.dataTableExt.afnFiltering.push((oSettings, aData, iDataIndex) => { const filter_value = $("#filter").val(); const row_text = aData[2].trim(); return row_text.match(new RegExp(filter_value, "i")); @@ -77,12 +73,12 @@ define("SBEFolderListingSetup", [ $("input[name='object-selected']").prop("checked", checked); } - $("a[href='#select-all']").click(function (e) { + $("a[href='#select-all']").click(e => { setSelected(true); e.preventDefault(); }); - $("a[href='#unselect-all']").click(function (e) { + $("a[href='#unselect-all']").click(e => { setSelected(false); e.preventDefault(); }); @@ -122,7 +118,7 @@ define("SBEFolderListingSetup", [ }); msg += $("
").append(elList).html(); - bootbox.confirm(msg, function (confirm) { + bootbox.confirm(msg, confirm => { if (confirm) { const actionVal = $("", { type: "hidden", @@ -138,7 +134,7 @@ define("SBEFolderListingSetup", [ $('button.btn-danger[value="delete"]').click(onClickDelete); /* Move file functions */ - const moveFileFillListing = function (modal, folder_url) { + const moveFileFillListing = (modal, folder_url) => { const tbody = modal.find("tbody"); const breadcrumbs = modal.find("ul.breadcrumb"); diff --git a/abilian/sbe/static/js/folder_edit.js b/abilian/sbe/static/js/folder_edit.js index 412a32a8..11749a78 100644 --- a/abilian/sbe/static/js/folder_edit.js +++ b/abilian/sbe/static/js/folder_edit.js @@ -1,4 +1,4 @@ -define("SBEFolderEditSetup", ["Abilian", "jquery"], function (Abilian, $) { +define("SBEFolderEditSetup", ["Abilian", "jquery"], (Abilian, $) => { "use strict"; function setupModalFolderInputnameCheck(modal, object_id, action) { const $submit = modal.find("button.btn-primary"); @@ -7,7 +7,7 @@ define("SBEFolderEditSetup", ["Abilian", "jquery"], function (Abilian, $) { const $help_span = $input.next("span.help-block"); const $control_group = $input.closest("div.form-group"); - $submit.on("click", function (e) { + $submit.on("click", e => { const title = $input.val(); $.ajax(checkUrl, { async: false, diff --git a/abilian/sbe/static/js/folder_gallery.js b/abilian/sbe/static/js/folder_gallery.js index 9ebdfef2..3e3825bc 100644 --- a/abilian/sbe/static/js/folder_gallery.js +++ b/abilian/sbe/static/js/folder_gallery.js @@ -3,14 +3,10 @@ define("SBEFolderGalleryListingSetup", [ "jquery", "jquery.dataTables", "bootbox", -], function (Abilian, $, jqDT, bootbox) { +], (Abilian, $, jqDT, bootbox) => { "use strict"; function setupFolderListing() { - $.fn.dataTableExt.afnFiltering.push(function ( - oSettings, - aData, - iDataIndex - ) { + $.fn.dataTableExt.afnFiltering.push((oSettings, aData, iDataIndex) => { const filter_value = $("#filter").val(); const row_text = aData[2].trim(); return row_text.match(new RegExp(filter_value, "i")); @@ -21,12 +17,12 @@ define("SBEFolderGalleryListingSetup", [ $("input[name='object-selected']").prop("checked", checked); } - $("a[href='#select-all']").click(function (e) { + $("a[href='#select-all']").click(e => { setSelected(true); e.preventDefault(); }); - $("a[href='#unselect-all']").click(function (e) { + $("a[href='#unselect-all']").click(e => { setSelected(false); e.preventDefault(); }); @@ -50,7 +46,7 @@ define("SBEFolderGalleryListingSetup", [ }); msg += $("
").append(elList).html(); - bootbox.confirm(msg, function (confirm) { + bootbox.confirm(msg, confirm => { if (confirm) { const actionVal = $("", { type: "hidden", @@ -66,7 +62,7 @@ define("SBEFolderGalleryListingSetup", [ $('button.btn-danger[value="delete"]').click(onClickDelete); /* Move file functions */ - const moveFileFillListing = function (modal, folder_url) { + const moveFileFillListing = (modal, folder_url) => { const tbody = modal.find("tbody"); const breadcrumbs = modal.find("ul.breadcrumb"); diff --git a/abilian/sbe/static/js/folder_upload.js b/abilian/sbe/static/js/folder_upload.js index e8ec0ddb..801619a9 100644 --- a/abilian/sbe/static/js/folder_upload.js +++ b/abilian/sbe/static/js/folder_upload.js @@ -3,7 +3,7 @@ define("SBEFolderUploadSetup", [ "jquery", "FileAPI", "jquery.fileapi", -], function (Abilian, $, FileAPI) { +], (Abilian, $, FileAPI) => { "use strict"; function setupModalFolderUpload(modalId, url, messages) { let hasErrors = false; diff --git a/abilian/sbe/static/js/sbe-datatable.js b/abilian/sbe/static/js/sbe-datatable.js index 732b9a68..79be8e16 100644 --- a/abilian/sbe/static/js/sbe-datatable.js +++ b/abilian/sbe/static/js/sbe-datatable.js @@ -1,5 +1,5 @@ /* datatable: sort types and filters */ -require(["jquery", "jquery.dataTables"], function ($) { +require(["jquery", "jquery.dataTables"], $ => { "use strict"; const FOLDER_TYPE = "abilian.sbe.apps.documents.models.folder";