From 7ee6692a52f297a3954f9e3c75c31ea633c6802b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87otur?= Date: Mon, 13 Jul 2020 12:29:50 +0300 Subject: [PATCH] tab usage is removed --- modules/account/.prettierrc | 3 +- .../Pages/Account/LoggedOut.js | 14 +- .../Pages/Account/Manage.js | 68 +- modules/audit-logging/.prettierrc | 5 + modules/background-jobs/.prettierrc | 5 + modules/blob-storing-database/.prettierrc | 5 + modules/blogging/.prettierrc | 3 +- .../Pages/Blogging/Admin/Blogs/create.js | 16 +- .../Pages/Blogging/Admin/Blogs/edit.js | 16 +- .../Pages/Blogging/Admin/Blogs/index.js | 168 +++-- .../Pages/Blogs/Posts/detail.js | 369 ++++----- .../Pages/Blogs/Posts/edit.js | 244 +++--- .../Pages/Blogs/Posts/new.js | 85 ++- .../Pages/Blogs/Shared/Scripts/blog.js | 118 +-- modules/client-simulation/.prettierrc | 5 +- .../Pages/ClientSimulation/Index.js | 6 +- .../Pages/ClientSimulation/SimulationArea.js | 28 +- modules/cms-kit/.prettierrc | 5 + modules/docs/.prettierrc | 5 +- .../Pages/Docs/Admin/Documents/index.js | 352 ++++----- .../Pages/Docs/Admin/Projects/Pull.js | 34 +- .../Pages/Docs/Admin/Projects/create.js | 16 +- .../Pages/Docs/Admin/Projects/edit.js | 16 +- .../Pages/Docs/Admin/Projects/index.js | 310 ++++---- .../Pages/Documents/Project/bootstrap-toc.js | 23 +- .../Pages/Documents/Project/index.js | 702 +++++++++--------- .../Documents/Shared/ErrorComponent/error.js | 30 +- .../Pages/Documents/Shared/Scripts/vs.js | 326 ++++---- modules/feature-management/.prettierrc | 5 +- .../feature-management-modal.js | 20 +- modules/identity/.prettierrc | 5 +- .../Pages/Identity/Roles/index.js | 218 +++--- .../Pages/Identity/Users/index.js | 186 ++--- modules/identityserver/.prettierrc | 5 + modules/permission-management/.prettierrc | 5 +- .../permission-management-modal.js | 460 ++++++------ modules/setting-management/.prettierrc | 5 +- .../Pages/SettingManagement/Index.js | 8 +- modules/tenant-management/.prettierrc | 5 +- .../Tenants/ConnectionStringsModal.js | 32 +- .../Pages/TenantManagement/Tenants/Index.js | 203 ++--- modules/users/.prettierrc | 5 + modules/virtual-file-explorer/.prettierrc | 3 +- .../Pages/VirtualFileExplorer/index.js | 8 +- 44 files changed, 2138 insertions(+), 2012 deletions(-) create mode 100644 modules/audit-logging/.prettierrc create mode 100644 modules/background-jobs/.prettierrc create mode 100644 modules/blob-storing-database/.prettierrc create mode 100644 modules/cms-kit/.prettierrc create mode 100644 modules/identityserver/.prettierrc create mode 100644 modules/users/.prettierrc diff --git a/modules/account/.prettierrc b/modules/account/.prettierrc index 7d1b8aa7216..56af76bd946 100644 --- a/modules/account/.prettierrc +++ b/modules/account/.prettierrc @@ -1,4 +1,5 @@ { "singleQuote": true, - "useTabs": true + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js index 6b5d0bb0aff..164399e4ceb 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js @@ -1,7 +1,7 @@ -document.addEventListener('DOMContentLoaded', function (event) { - setTimeout(function () { - window.location = document - .getElementById('redirectButton') - .getAttribute('href'); - }, 3000); -}); +document.addEventListener('DOMContentLoaded', function (event) { + setTimeout(function () { + window.location = document + .getElementById('redirectButton') + .getAttribute('href'); + }, 3000); +}); diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js index 015d481df4f..68109eb6da0 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js @@ -1,47 +1,47 @@ (function ($) { - var l = abp.localization.getResource('AbpAccount'); + var l = abp.localization.getResource('AbpAccount'); - var _profileService = volo.abp.identity.profile; + var _profileService = volo.abp.identity.profile; - $('#ChangePasswordForm').submit(function (e) { - e.preventDefault(); + $('#ChangePasswordForm').submit(function (e) { + e.preventDefault(); - if (!$('#ChangePasswordForm').valid()) { - return false; - } + if (!$('#ChangePasswordForm').valid()) { + return false; + } - var input = $('#ChangePasswordForm').serializeFormToObject() - .changePasswordInfoModel; + var input = $('#ChangePasswordForm').serializeFormToObject() + .changePasswordInfoModel; - if ( - input.newPassword != input.newPasswordConfirm || - input.currentPassword == '' - ) { - abp.message.error(l('NewPasswordConfirmFailed')); - return; - } + if ( + input.newPassword != input.newPasswordConfirm || + input.currentPassword == '' + ) { + abp.message.error(l('NewPasswordConfirmFailed')); + return; + } - if (input.currentPassword == '') { - return; - } + if (input.currentPassword == '') { + return; + } - _profileService.changePassword(input).then(function (result) { - abp.message.success(l('PasswordChanged')); - }); - }); + _profileService.changePassword(input).then(function (result) { + abp.message.success(l('PasswordChanged')); + }); + }); - $('#PersonalSettingsForm').submit(function (e) { - e.preventDefault(); + $('#PersonalSettingsForm').submit(function (e) { + e.preventDefault(); - if (!$('#PersonalSettingsForm').valid()) { - return false; - } + if (!$('#PersonalSettingsForm').valid()) { + return false; + } - var input = $('#PersonalSettingsForm').serializeFormToObject() - .personalSettingsInfoModel; + var input = $('#PersonalSettingsForm').serializeFormToObject() + .personalSettingsInfoModel; - _profileService.update(input).then(function (result) { - abp.notify.success(l('PersonalSettingsSaved')); - }); - }); + _profileService.update(input).then(function (result) { + abp.notify.success(l('PersonalSettingsSaved')); + }); + }); })(jQuery); diff --git a/modules/audit-logging/.prettierrc b/modules/audit-logging/.prettierrc new file mode 100644 index 00000000000..56af76bd946 --- /dev/null +++ b/modules/audit-logging/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/modules/background-jobs/.prettierrc b/modules/background-jobs/.prettierrc new file mode 100644 index 00000000000..56af76bd946 --- /dev/null +++ b/modules/background-jobs/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/modules/blob-storing-database/.prettierrc b/modules/blob-storing-database/.prettierrc new file mode 100644 index 00000000000..56af76bd946 --- /dev/null +++ b/modules/blob-storing-database/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/modules/blogging/.prettierrc b/modules/blogging/.prettierrc index 7d1b8aa7216..56af76bd946 100644 --- a/modules/blogging/.prettierrc +++ b/modules/blogging/.prettierrc @@ -1,4 +1,5 @@ { "singleQuote": true, - "useTabs": true + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js index 7e6c7117e9b..599b2ad1f26 100644 --- a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js @@ -1,12 +1,12 @@ var abp = abp || {}; $(function () { - abp.modals.blogCreate = function () { - var initModal = function (publicApi, args) { - var $form = publicApi.getForm(); - }; + abp.modals.blogCreate = function () { + var initModal = function (publicApi, args) { + var $form = publicApi.getForm(); + }; - return { - initModal: initModal, - }; - }; + return { + initModal: initModal, + }; + }; }); diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js index dd0712ec277..a459f7ff09c 100644 --- a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js @@ -1,12 +1,12 @@ var abp = abp || {}; $(function () { - abp.modals.blogEdit = function () { - var initModal = function (publicApi, args) { - var $form = publicApi.getForm(); - }; + abp.modals.blogEdit = function () { + var initModal = function (publicApi, args) { + var $form = publicApi.getForm(); + }; - return { - initModal: initModal, - }; - }; + return { + initModal: initModal, + }; + }; }); diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js index 46751de899c..fe1da6c3a93 100644 --- a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js @@ -1,88 +1,92 @@ $(function () { - var l = abp.localization.getResource('Blogging'); - var _createModal = new abp.ModalManager( - abp.appPath + 'Blogging/Admin/Blogs/Create' - ); - var _editModal = new abp.ModalManager( - abp.appPath + 'Blogging/Admin/Blogs/Edit' - ); + var l = abp.localization.getResource('Blogging'); + var _createModal = new abp.ModalManager( + abp.appPath + 'Blogging/Admin/Blogs/Create' + ); + var _editModal = new abp.ModalManager( + abp.appPath + 'Blogging/Admin/Blogs/Edit' + ); - var _dataTable = $('#BlogsTable').DataTable( - abp.libs.datatables.normalizeConfiguration({ - processing: true, - serverSide: true, - paging: false, - info: false, - scrollX: true, - searching: false, - autoWidth: false, - scrollCollapse: true, - order: [[3, 'desc']], - ajax: abp.libs.datatables.createAjax( - volo.blogging.admin.blogManagement.getList - ), - columnDefs: [ - { - rowAction: { - items: [ - { - text: l('Edit'), - visible: abp.auth.isGranted('Blogging.Blog.Update'), - action: function (data) { - _editModal.open({ - blogId: data.record.id, - }); - }, - }, - { - text: l('Delete'), - visible: abp.auth.isGranted('Blogging.Blog.Delete'), - confirmMessage: function (data) { - return l('BlogDeletionWarningMessage'); - }, - action: function (data) { - volo.blogging.admin.blogManagement - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - }, - }, - ], - }, - }, - { - target: 1, - data: 'name', - }, - { - target: 2, - data: 'shortName', - }, - { - target: 3, - data: 'creationTime', - render: function (date) { - return date; - }, - }, - { - target: 4, - data: 'description', - }, - ], - }) - ); + var _dataTable = $('#BlogsTable').DataTable( + abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + paging: false, + info: false, + scrollX: true, + searching: false, + autoWidth: false, + scrollCollapse: true, + order: [[3, 'desc']], + ajax: abp.libs.datatables.createAjax( + volo.blogging.admin.blogManagement.getList + ), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('Edit'), + visible: abp.auth.isGranted( + 'Blogging.Blog.Update' + ), + action: function (data) { + _editModal.open({ + blogId: data.record.id, + }); + }, + }, + { + text: l('Delete'), + visible: abp.auth.isGranted( + 'Blogging.Blog.Delete' + ), + confirmMessage: function (data) { + return l('BlogDeletionWarningMessage'); + }, + action: function (data) { + volo.blogging.admin.blogManagement + .delete(data.record.id) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + ], + }, + }, + { + target: 1, + data: 'name', + }, + { + target: 2, + data: 'shortName', + }, + { + target: 3, + data: 'creationTime', + render: function (date) { + return date; + }, + }, + { + target: 4, + data: 'description', + }, + ], + }) + ); - $('#CreateNewBlogButtonId').click(function () { - _createModal.open(); - }); + $('#CreateNewBlogButtonId').click(function () { + _createModal.open(); + }); - _createModal.onClose(function () { - _dataTable.ajax.reload(); - }); + _createModal.onClose(function () { + _dataTable.ajax.reload(); + }); - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _editModal.onResult(function () { + _dataTable.ajax.reload(); + }); }); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js index a5061457d0f..debd2941c9a 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js @@ -1,184 +1,189 @@ (function ($) { - var l = abp.localization.getResource('Blogging'); - - var initSocialShareLinks = function () { - var re = new RegExp(/^.*\//); - var rootUrl = re.exec(window.location.href); - - var pageHeader = $('#PostTitle').text(); - var blogName = $('#BlogFullName').attr('name'); - - $('#TwitterShareLink').attr( - 'href', - 'https://twitter.com/intent/tweet?text=' + - encodeURI(pageHeader + ' | ' + blogName + ' | ' + window.location.href) - ); - - $('#LinkedinShareLink').attr( - 'href', - 'https://www.linkedin.com/shareArticle?' + - 'url=' + - encodeURI(window.location.href) + - '&' + - 'mini=true&' + - 'summary=' + - encodeURI(blogName) + - '&' + - 'title=' + - encodeURI(pageHeader) + - '&' + - 'source=' + - encodeURI(rootUrl) - ); - - $('#EmailShareLink').attr( - 'href', - 'mailto:?' + - 'body=' + - encodeURI('I want you to look at ' + window.location.href) + - '&' + - 'subject=' + - encodeURI(pageHeader + ' | ' + blogName) + - '&' - ); - }; - - $('div .replyForm').hide(); - - $('div .editForm').hide(); - - $('form[class="editFormClass"]').submit(function (event) { - event.preventDefault(); - var form = $(this).serializeFormToObject(); - - $.ajax({ - type: 'POST', - url: '/Blog/Comments/Update', - data: { - id: form.commentId, - commentDto: { - text: form.text, - }, - }, - success: function (response) { - $('div .editForm').hide(); - $('#' + form.commentId).text(form.text); - }, - }); - }); - - $('.editCancelButton').click(function (event) { - event.preventDefault(); - $('div .editForm').hide(); - }); - - $('.replyCancelButton').click(function (event) { - event.preventDefault(); - $('div .replyForm').hide(); - }); - - $('.replyLink').click(function (event) { - event.preventDefault(); - $('div .editForm').hide(); - var linkElement = $(this); - var replyCommentId = linkElement.attr('data-relpyid'); - - if (replyCommentId != '' && replyCommentId !== undefined) { - var div = linkElement.parent().next(); - - if (div.is(':hidden')) { - $('div .replyForm').hide(); - div.show(); - } else { - div.hide(); - } - return; - } - }); - - $('.deleteLink').click(function (event) { - event.preventDefault(); - var linkElement = $(this); - var deleteCommentId = linkElement.attr('data-deleteid'); - - if (deleteCommentId != '' && deleteCommentId !== undefined) { - abp.message.confirm( - l('CommentDeletionWarningMessage'), // TODO: localize - l('Are you sure?'), - function (isConfirmed) { - if (isConfirmed) { - $.ajax({ - type: 'POST', - url: '/Blog/Comments/Delete', - data: { id: deleteCommentId }, - success: function (response) { - linkElement.parent().parent().parent().remove(); - }, - }); - } - } - ); - } - }); - - $('#DeletePostLink').click(function (event) { - event.preventDefault(); - var linkElement = $(this); - var deleteCommentId = linkElement.attr('data-postid'); - var blogShortName = linkElement.attr('data-blogShortName'); - - if (deleteCommentId != '' && deleteCommentId !== undefined) { - abp.message.confirm( - l('PostDeletionWarningMessage'), - l('AreYouSure'), - function (isConfirmed) { - if (isConfirmed) { - $.ajax({ - type: 'POST', - url: '/Blog/Posts/Delete', - data: { id: deleteCommentId }, - success: function () { - var url = window.location.pathname; - var postNameBeginning = url.lastIndexOf('/'); - window.location.replace(url.substring(0, postNameBeginning)); - }, - }); - } - } - ); - } - }); - - $('.updateLink').click(function (event) { - event.preventDefault(); - $('div .replyForm').hide(); - - var linkElement = $(this); - var updateCommentId = $(this).attr('data-updateid'); - - if (updateCommentId != '' && updateCommentId !== undefined) { - var div = linkElement.parent().next().next(); - - if (div.is(':hidden')) { - $('div .editForm').hide(); - div.show(); - } else { - div.hide(); - } - return; - } - }); - - if ($('#FocusCommentId').val() != '00000000-0000-0000-0000-000000000000') { - $('html, body').animate( - { - scrollTop: $('#' + $('#FocusCommentId').val()).offset().top - 150, - }, - 500 - ); - } - - $(".post-content a[href^='http']").attr('target', '_blank'); - - initSocialShareLinks(); + var l = abp.localization.getResource('Blogging'); + + var initSocialShareLinks = function () { + var re = new RegExp(/^.*\//); + var rootUrl = re.exec(window.location.href); + + var pageHeader = $('#PostTitle').text(); + var blogName = $('#BlogFullName').attr('name'); + + $('#TwitterShareLink').attr( + 'href', + 'https://twitter.com/intent/tweet?text=' + + encodeURI( + pageHeader + ' | ' + blogName + ' | ' + window.location.href + ) + ); + + $('#LinkedinShareLink').attr( + 'href', + 'https://www.linkedin.com/shareArticle?' + + 'url=' + + encodeURI(window.location.href) + + '&' + + 'mini=true&' + + 'summary=' + + encodeURI(blogName) + + '&' + + 'title=' + + encodeURI(pageHeader) + + '&' + + 'source=' + + encodeURI(rootUrl) + ); + + $('#EmailShareLink').attr( + 'href', + 'mailto:?' + + 'body=' + + encodeURI('I want you to look at ' + window.location.href) + + '&' + + 'subject=' + + encodeURI(pageHeader + ' | ' + blogName) + + '&' + ); + }; + + $('div .replyForm').hide(); + + $('div .editForm').hide(); + + $('form[class="editFormClass"]').submit(function (event) { + event.preventDefault(); + var form = $(this).serializeFormToObject(); + + $.ajax({ + type: 'POST', + url: '/Blog/Comments/Update', + data: { + id: form.commentId, + commentDto: { + text: form.text, + }, + }, + success: function (response) { + $('div .editForm').hide(); + $('#' + form.commentId).text(form.text); + }, + }); + }); + + $('.editCancelButton').click(function (event) { + event.preventDefault(); + $('div .editForm').hide(); + }); + + $('.replyCancelButton').click(function (event) { + event.preventDefault(); + $('div .replyForm').hide(); + }); + + $('.replyLink').click(function (event) { + event.preventDefault(); + $('div .editForm').hide(); + var linkElement = $(this); + var replyCommentId = linkElement.attr('data-relpyid'); + + if (replyCommentId != '' && replyCommentId !== undefined) { + var div = linkElement.parent().next(); + + if (div.is(':hidden')) { + $('div .replyForm').hide(); + div.show(); + } else { + div.hide(); + } + return; + } + }); + + $('.deleteLink').click(function (event) { + event.preventDefault(); + var linkElement = $(this); + var deleteCommentId = linkElement.attr('data-deleteid'); + + if (deleteCommentId != '' && deleteCommentId !== undefined) { + abp.message.confirm( + l('CommentDeletionWarningMessage'), // TODO: localize + l('Are you sure?'), + function (isConfirmed) { + if (isConfirmed) { + $.ajax({ + type: 'POST', + url: '/Blog/Comments/Delete', + data: { id: deleteCommentId }, + success: function (response) { + linkElement.parent().parent().parent().remove(); + }, + }); + } + } + ); + } + }); + + $('#DeletePostLink').click(function (event) { + event.preventDefault(); + var linkElement = $(this); + var deleteCommentId = linkElement.attr('data-postid'); + var blogShortName = linkElement.attr('data-blogShortName'); + + if (deleteCommentId != '' && deleteCommentId !== undefined) { + abp.message.confirm( + l('PostDeletionWarningMessage'), + l('AreYouSure'), + function (isConfirmed) { + if (isConfirmed) { + $.ajax({ + type: 'POST', + url: '/Blog/Posts/Delete', + data: { id: deleteCommentId }, + success: function () { + var url = window.location.pathname; + var postNameBeginning = url.lastIndexOf('/'); + window.location.replace( + url.substring(0, postNameBeginning) + ); + }, + }); + } + } + ); + } + }); + + $('.updateLink').click(function (event) { + event.preventDefault(); + $('div .replyForm').hide(); + + var linkElement = $(this); + var updateCommentId = $(this).attr('data-updateid'); + + if (updateCommentId != '' && updateCommentId !== undefined) { + var div = linkElement.parent().next().next(); + + if (div.is(':hidden')) { + $('div .editForm').hide(); + div.show(); + } else { + div.hide(); + } + return; + } + }); + + if ($('#FocusCommentId').val() != '00000000-0000-0000-0000-000000000000') { + $('html, body').animate( + { + scrollTop: + $('#' + $('#FocusCommentId').val()).offset().top - 150, + }, + 500 + ); + } + + $(".post-content a[href^='http']").attr('target', '_blank'); + + initSocialShareLinks(); })(jQuery); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/edit.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/edit.js index c8d0bb9b263..718d5c4bc4a 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/edit.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/edit.js @@ -1,124 +1,124 @@ $(function () { - var $container = $('#edit-post-container'); - var $editorContainer = $container.find('.edit-post-editor'); - var $submitButton = $container.find('button[type=submit]'); - var $form = $container.find('form#edit-post-form'); - var editorDataKey = 'tuiEditor'; - var $titleLengthWarning = $('#title-length-warning'); - var maxTitleLength = parseInt($titleLengthWarning.data('max-length')); - - var $title = $('#Post_Title'); - var $coverImage = $('#CoverImage'); - var $postCoverImage = $('#Post_CoverImage'); - var $coverImageFile = $('#CoverImageFile'); - var $postFormSubmitButton = $('#PostFormSubmitButton'); - - var setCoverImage = function (file) { - $postCoverImage.val(file.fileUrl); - $coverImage.attr('src', file.fileUrl); - $postFormSubmitButton.removeAttr('disabled'); - }; - - var uploadCoverImage = function (file) { - var formData = new FormData(); - formData.append('file', file); - - $.ajax({ - type: 'POST', - url: '/api/blogging/files/images/upload', - data: formData, - contentType: false, - processData: false, - success: function (response) { - setCoverImage(response); - }, - }); - }; - - var checkTitleLength = function () { - var title = $title.val(); - - if (title.length > maxTitleLength) { - $titleLengthWarning.show(); - } else { - $titleLengthWarning.hide(); - } - }; - - checkTitleLength(); - - $title.on('change paste keyup', function () { - checkTitleLength(); - }); - - $coverImageFile.change(function () { - if (!$coverImageFile.prop('files').length) { - return; - } - - $postFormSubmitButton.attr('disabled', true); - var file = $coverImageFile.prop('files')[0]; - uploadCoverImage(file); - }); - - var uploadImage = function (file, callbackFn) { - var formData = new FormData(); - formData.append('file', file); - - $.ajax({ - type: 'POST', - url: '/api/blogging/files/images/upload', - data: formData, - contentType: false, - processData: false, - success: function (response) { - callbackFn(response.fileUrl); - }, - }); - }; - - var newPostEditor = $editorContainer - .tuiEditor({ - usageStatistics: false, - initialEditType: 'markdown', - previewStyle: 'tab', - height: 'auto', - initialValue: $form.find("input[name='Post.Content']").val(), - hooks: { - addImageBlobHook: function (blob, callback, source) { - var imageAltText = blob.name; - - uploadImage(blob, function (fileUrl) { - callback(fileUrl, imageAltText); - }); - }, - }, - events: { - load: function () { - $editorContainer.find('.loading-cover').remove(); - $submitButton.prop('disabled', false); - $form.data('validator').settings.ignore = '.ignore'; - $editorContainer.find(':input').addClass('ignore'); - }, - }, - }) - .data(editorDataKey); - - $container.find('form#edit-post-form').submit(function (e) { - var $postTextInput = $form.find("input[name='Post.Content']"); - - var postText = newPostEditor.getMarkdown(); - $postTextInput.val(postText); - - if (!$form.valid()) { - var validationResult = $form.validate(); - abp.message.warn(validationResult.errorList[0].message); //TODO: errors can be merged into lines. make sweetalert accept HTML. - e.preventDefault(); - return false; //for old browsers - } - - $submitButton.buttonBusy(); - $(this).off('submit').submit(); - return true; - }); + var $container = $('#edit-post-container'); + var $editorContainer = $container.find('.edit-post-editor'); + var $submitButton = $container.find('button[type=submit]'); + var $form = $container.find('form#edit-post-form'); + var editorDataKey = 'tuiEditor'; + var $titleLengthWarning = $('#title-length-warning'); + var maxTitleLength = parseInt($titleLengthWarning.data('max-length')); + + var $title = $('#Post_Title'); + var $coverImage = $('#CoverImage'); + var $postCoverImage = $('#Post_CoverImage'); + var $coverImageFile = $('#CoverImageFile'); + var $postFormSubmitButton = $('#PostFormSubmitButton'); + + var setCoverImage = function (file) { + $postCoverImage.val(file.fileUrl); + $coverImage.attr('src', file.fileUrl); + $postFormSubmitButton.removeAttr('disabled'); + }; + + var uploadCoverImage = function (file) { + var formData = new FormData(); + formData.append('file', file); + + $.ajax({ + type: 'POST', + url: '/api/blogging/files/images/upload', + data: formData, + contentType: false, + processData: false, + success: function (response) { + setCoverImage(response); + }, + }); + }; + + var checkTitleLength = function () { + var title = $title.val(); + + if (title.length > maxTitleLength) { + $titleLengthWarning.show(); + } else { + $titleLengthWarning.hide(); + } + }; + + checkTitleLength(); + + $title.on('change paste keyup', function () { + checkTitleLength(); + }); + + $coverImageFile.change(function () { + if (!$coverImageFile.prop('files').length) { + return; + } + + $postFormSubmitButton.attr('disabled', true); + var file = $coverImageFile.prop('files')[0]; + uploadCoverImage(file); + }); + + var uploadImage = function (file, callbackFn) { + var formData = new FormData(); + formData.append('file', file); + + $.ajax({ + type: 'POST', + url: '/api/blogging/files/images/upload', + data: formData, + contentType: false, + processData: false, + success: function (response) { + callbackFn(response.fileUrl); + }, + }); + }; + + var newPostEditor = $editorContainer + .tuiEditor({ + usageStatistics: false, + initialEditType: 'markdown', + previewStyle: 'tab', + height: 'auto', + initialValue: $form.find("input[name='Post.Content']").val(), + hooks: { + addImageBlobHook: function (blob, callback, source) { + var imageAltText = blob.name; + + uploadImage(blob, function (fileUrl) { + callback(fileUrl, imageAltText); + }); + }, + }, + events: { + load: function () { + $editorContainer.find('.loading-cover').remove(); + $submitButton.prop('disabled', false); + $form.data('validator').settings.ignore = '.ignore'; + $editorContainer.find(':input').addClass('ignore'); + }, + }, + }) + .data(editorDataKey); + + $container.find('form#edit-post-form').submit(function (e) { + var $postTextInput = $form.find("input[name='Post.Content']"); + + var postText = newPostEditor.getMarkdown(); + $postTextInput.val(postText); + + if (!$form.valid()) { + var validationResult = $form.validate(); + abp.message.warn(validationResult.errorList[0].message); //TODO: errors can be merged into lines. make sweetalert accept HTML. + e.preventDefault(); + return false; //for old browsers + } + + $submitButton.buttonBusy(); + $(this).off('submit').submit(); + return true; + }); }); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/new.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/new.js index 798430f6cd7..6b8c8277227 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/new.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/new.js @@ -1,22 +1,21 @@ $(function () { - - var $container = $("#qa-new-post-container"); - var $editorContainer = $container.find(".new-post-editor"); - var $submitButton = $container.find("button[type=submit]"); - var $form = $container.find("form#new-post-form"); - var editorDataKey = "tuiEditor"; - var $titleLengthWarning = $("#title-length-warning"); - var maxTitleLength = parseInt($titleLengthWarning.data("max-length")); + var $container = $('#qa-new-post-container'); + var $editorContainer = $container.find('.new-post-editor'); + var $submitButton = $container.find('button[type=submit]'); + var $form = $container.find('form#new-post-form'); + var editorDataKey = 'tuiEditor'; + var $titleLengthWarning = $('#title-length-warning'); + var maxTitleLength = parseInt($titleLengthWarning.data('max-length')); var $title = $('#Post_Title'); var $url = $('#Post_Url'); - var $coverImage = $("#CoverImage"); + var $coverImage = $('#CoverImage'); var $postCoverImage = $('#Post_CoverImage'); var $coverImageFile = $('#CoverImageFile'); var $postFormSubmitButton = $('#PostFormSubmitButton'); var setCoverImage = function (file) { $postCoverImage.val(file.fileUrl); - $coverImage.attr("src", file.fileUrl); + $coverImage.attr('src', file.fileUrl); $coverImage.show(); $postFormSubmitButton.removeAttr('disabled'); }; @@ -26,14 +25,14 @@ formData.append('file', file); $.ajax({ - type: "POST", - url: "/api/blogging/files/images/upload", + type: 'POST', + url: '/api/blogging/files/images/upload', data: formData, contentType: false, processData: false, success: function (response) { setCoverImage(response); - } + }, }); }; @@ -41,7 +40,7 @@ if (!$coverImageFile.prop('files').length) { return; } - $postFormSubmitButton.attr('disabled',true); + $postFormSubmitButton.attr('disabled', true); var file = $coverImageFile.prop('files')[0]; uploadCoverImage(file); }); @@ -51,43 +50,44 @@ formData.append('file', file); $.ajax({ - type: "POST", - url: "/api/blogging/files/images/upload", + type: 'POST', + url: '/api/blogging/files/images/upload', data: formData, contentType: false, processData: false, success: function (response) { callbackFn(response.fileUrl); - } + }, }); }; - var newPostEditor = $editorContainer.tuiEditor({ - usageStatistics: false, - initialEditType: 'markdown', - previewStyle: 'tab', - height: "auto", - hooks: { - addImageBlobHook: function (blob, callback, source) { - var imageAltText = blob.name; - - uploadImage(blob, - function (fileUrl) { + var newPostEditor = $editorContainer + .tuiEditor({ + usageStatistics: false, + initialEditType: 'markdown', + previewStyle: 'tab', + height: 'auto', + hooks: { + addImageBlobHook: function (blob, callback, source) { + var imageAltText = blob.name; + + uploadImage(blob, function (fileUrl) { callback(fileUrl, imageAltText); }); - } - }, - events: { - load: function () { - $editorContainer.find(".loading-cover").remove(); - $submitButton.prop("disabled", false); - $form.data("validator").settings.ignore = '.ignore'; - $editorContainer.find(':input').addClass('ignore'); - } - } - }).data(editorDataKey); - - $container.find("form#new-post-form").submit(function (e) { + }, + }, + events: { + load: function () { + $editorContainer.find('.loading-cover').remove(); + $submitButton.prop('disabled', false); + $form.data('validator').settings.ignore = '.ignore'; + $editorContainer.find(':input').addClass('ignore'); + }, + }, + }) + .data(editorDataKey); + + $container.find('form#new-post-form').submit(function (e) { var $postTextInput = $form.find("input[name='Post.Content']"); var postText = newPostEditor.getMarkdown(); @@ -108,7 +108,7 @@ var urlEdited = false; var reflectedChange = false; - $title.on("change paste keyup", function () { + $title.on('change paste keyup', function () { if (urlEdited) { return; } @@ -137,5 +137,4 @@ urlEdited = true; } }); - }); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Scripts/blog.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Scripts/blog.js index 53eadbf21c0..ca0b21d2036 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Scripts/blog.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Scripts/blog.js @@ -1,67 +1,67 @@ (function () { - function handleArrows() { - var herosWidth = $('.hero-articles').width(); - var arrowsPosition = herosWidth / 2 - 90; - $('.owl-next').css('right', arrowsPosition); - $('.owl-prev').css('left', arrowsPosition); - } + function handleArrows() { + var herosWidth = $('.hero-articles').width(); + var arrowsPosition = herosWidth / 2 - 90; + $('.owl-next').css('right', arrowsPosition); + $('.owl-prev').css('left', arrowsPosition); + } - function handleImages() { - //if ($(window).width() > 767) { - // $(".box-articles .img-container").each(function () { - // var squareWidth = $(this).width(); - // $(this).css("height", squareWidth); - // }); - //} - //else { - // $(".box-articles .img-container").css("height", "auto"); - //} - } + function handleImages() { + //if ($(window).width() > 767) { + // $(".box-articles .img-container").each(function () { + // var squareWidth = $(this).width(); + // $(this).css("height", squareWidth); + // }); + //} + //else { + // $(".box-articles .img-container").css("height", "auto"); + //} + } - function handleOwlCarousel() { - $('.hero-section .owl-carousel').owlCarousel({ - loop: true, - margin: 0, - nav: false, - dots: false, - //center: true, - autoplay: true, - autoHeight: true, - autoplaySpeed: 1000, - items: 1, - }); - $('.card-article-container .owl-carousel').owlCarousel({ - loop: true, - margin: 0, - nav: false, - dots: false, - autoplay: true, - autoplaySpeed: 1000, - responsive: { - 0: { - items: 1, - }, - }, - }); - } + function handleOwlCarousel() { + $('.hero-section .owl-carousel').owlCarousel({ + loop: true, + margin: 0, + nav: false, + dots: false, + //center: true, + autoplay: true, + autoHeight: true, + autoplaySpeed: 1000, + items: 1, + }); + $('.card-article-container .owl-carousel').owlCarousel({ + loop: true, + margin: 0, + nav: false, + dots: false, + autoplay: true, + autoplaySpeed: 1000, + responsive: { + 0: { + items: 1, + }, + }, + }); + } - $(function () { - handleImages(); - handleOwlCarousel(); + $(function () { + handleImages(); + handleOwlCarousel(); - $('.nav-link').on('click', function () { - $(this).parent().parent(); - }); + $('.nav-link').on('click', function () { + $(this).parent().parent(); + }); - $(window).resize(function () { - setTimeout(function () { - handleArrows(); - handleImages(); - }, 500); - }); + $(window).resize(function () { + setTimeout(function () { + handleArrows(); + handleImages(); + }, 500); + }); - setTimeout(function () { - handleArrows(); - }, 500); - }); + setTimeout(function () { + handleArrows(); + }, 500); + }); })(); diff --git a/modules/client-simulation/.prettierrc b/modules/client-simulation/.prettierrc index 7d1b8aa7216..34a0e1ecde4 100644 --- a/modules/client-simulation/.prettierrc +++ b/modules/client-simulation/.prettierrc @@ -1,4 +1,5 @@ { - "singleQuote": true, - "useTabs": true + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/Index.js b/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/Index.js index fbdf917f916..7c4cf805c11 100644 --- a/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/Index.js +++ b/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/Index.js @@ -1,5 +1,5 @@ (function ($) { - $(function () { - SimulationArea.init($('#SimulationArea')); - }); + $(function () { + SimulationArea.init($('#SimulationArea')); + }); })(jQuery); diff --git a/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/SimulationArea.js b/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/SimulationArea.js index de15f8a63c0..0a404900c97 100644 --- a/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/SimulationArea.js +++ b/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/SimulationArea.js @@ -1,19 +1,19 @@ var SimulationArea = {}; (function ($) { - var $mainContainer = null; + var $mainContainer = null; - function refreshSimulationArea() { - $.get('/ClientSimulation/SimulationArea') - .done(function (result) { - $mainContainer.html(result); - }) - .always(function () { - setTimeout(refreshSimulationArea, 1000); - }); - } + function refreshSimulationArea() { + $.get('/ClientSimulation/SimulationArea') + .done(function (result) { + $mainContainer.html(result); + }) + .always(function () { + setTimeout(refreshSimulationArea, 1000); + }); + } - SimulationArea.init = function ($container) { - $mainContainer = $container; - setTimeout(refreshSimulationArea, 1000); - }; + SimulationArea.init = function ($container) { + $mainContainer = $container; + setTimeout(refreshSimulationArea, 1000); + }; })(jQuery); diff --git a/modules/cms-kit/.prettierrc b/modules/cms-kit/.prettierrc new file mode 100644 index 00000000000..56af76bd946 --- /dev/null +++ b/modules/cms-kit/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/modules/docs/.prettierrc b/modules/docs/.prettierrc index 7d1b8aa7216..34a0e1ecde4 100644 --- a/modules/docs/.prettierrc +++ b/modules/docs/.prettierrc @@ -1,4 +1,5 @@ { - "singleQuote": true, - "useTabs": true + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js index 03d6fee8507..3f0f30270fa 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js @@ -1,178 +1,196 @@ $(function () { - var l = abp.localization.getResource('Docs'); - var service = window.volo.docs.admin.documentsAdmin; + var l = abp.localization.getResource('Docs'); + var service = window.volo.docs.admin.documentsAdmin; - var getFormattedDate = function ($datePicker) { - return $datePicker.data().datepicker.getFormattedDate('yyyy-mm-dd'); - }; + var getFormattedDate = function ($datePicker) { + return $datePicker.data().datepicker.getFormattedDate('yyyy-mm-dd'); + }; - var getFilter = function () { - return { - projectId: $('#ProjectId').val(), - name: $('#Name').val(), - version: $('#Version').val(), - languageCode: $('#LanguageCode').val(), - fileName: $('#FileName').val(), - format: $('#Format').val(), - creationTimeMin: getFormattedDate($('#CreationTimeMin')), - creationTimeMax: getFormattedDate($('#CreationTimeMax')), - lastUpdatedTimeMin: getFormattedDate($('#LastUpdatedTimeMin')), - lastUpdatedTimeMax: getFormattedDate($('#LastUpdatedTimeMax')), - lastSignificantUpdateTimeMin: getFormattedDate( - $('#LastSignificantUpdateTimeMin') - ), - lastSignificantUpdateTimeMax: getFormattedDate( - $('#LastSignificantUpdateTimeMax') - ), - lastCachedTimeMin: getFormattedDate($('#LastCachedTimeMin')), - lastCachedTimeMax: getFormattedDate($('#LastCachedTimeMax')), - }; - }; + var getFilter = function () { + return { + projectId: $('#ProjectId').val(), + name: $('#Name').val(), + version: $('#Version').val(), + languageCode: $('#LanguageCode').val(), + fileName: $('#FileName').val(), + format: $('#Format').val(), + creationTimeMin: getFormattedDate($('#CreationTimeMin')), + creationTimeMax: getFormattedDate($('#CreationTimeMax')), + lastUpdatedTimeMin: getFormattedDate($('#LastUpdatedTimeMin')), + lastUpdatedTimeMax: getFormattedDate($('#LastUpdatedTimeMax')), + lastSignificantUpdateTimeMin: getFormattedDate( + $('#LastSignificantUpdateTimeMin') + ), + lastSignificantUpdateTimeMax: getFormattedDate( + $('#LastSignificantUpdateTimeMax') + ), + lastCachedTimeMin: getFormattedDate($('#LastCachedTimeMin')), + lastCachedTimeMax: getFormattedDate($('#LastCachedTimeMax')), + }; + }; - var dataTable = $('#DocumentsTable').DataTable( - abp.libs.datatables.normalizeConfiguration({ - processing: true, - serverSide: true, - scrollX: true, - paging: true, - searching: false, - autoWidth: false, - scrollCollapse: true, - ajax: abp.libs.datatables.createAjax(service.getAll, getFilter), - columnDefs: [ - { - rowAction: { - items: [ - { - text: l('RemoveFromCache'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - confirmMessage: function (data) { - return l('RemoveFromCacheConfirmation'); - }, - action: function (data) { - service.removeFromCache(data.record.id).then(function () { - abp.message.success(l('RemovedFromCache')); - dataTable.ajax.reload(); - }); - }, - }, - { - text: l('ReIndex'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - confirmMessage: function (data) { - return l('ReIndexDocumentConfirmation'); - }, - action: function (data) { - service.reindex(data.record.id).then(function () { - abp.message.success(l('ReindexCompleted')); - dataTable.ajax.reload(); - }); - }, - }, - { - text: l('DeleteFromDatabase'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - confirmMessage: function (data) { - return l('DeleteDocumentFromDbConfirmation'); - }, - action: function (data) { - service.deleteFromDatabase(data.record.id).then(function () { - abp.message.success(l('Deleted')); - dataTable.ajax.reload(); - }); - }, - }, - ], - }, - }, - { - target: 1, - data: 'name', - }, - { - target: 2, - data: 'version', - }, - { - target: 3, - data: 'languageCode', - }, - { - target: 4, - data: 'fileName', - }, - { - target: 5, - data: 'format', - }, - { - target: 6, - data: 'creationTime', - render: function (creationTime) { - if (!creationTime) { - return ''; - } + var dataTable = $('#DocumentsTable').DataTable( + abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + scrollX: true, + paging: true, + searching: false, + autoWidth: false, + scrollCollapse: true, + ajax: abp.libs.datatables.createAjax(service.getAll, getFilter), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('RemoveFromCache'), + visible: abp.auth.isGranted( + 'Docs.Admin.Documents' + ), + confirmMessage: function (data) { + return l('RemoveFromCacheConfirmation'); + }, + action: function (data) { + service + .removeFromCache(data.record.id) + .then(function () { + abp.message.success( + l('RemovedFromCache') + ); + dataTable.ajax.reload(); + }); + }, + }, + { + text: l('ReIndex'), + visible: abp.auth.isGranted( + 'Docs.Admin.Documents' + ), + confirmMessage: function (data) { + return l('ReIndexDocumentConfirmation'); + }, + action: function (data) { + service + .reindex(data.record.id) + .then(function () { + abp.message.success( + l('ReindexCompleted') + ); + dataTable.ajax.reload(); + }); + }, + }, + { + text: l('DeleteFromDatabase'), + visible: abp.auth.isGranted( + 'Docs.Admin.Documents' + ), + confirmMessage: function (data) { + return l( + 'DeleteDocumentFromDbConfirmation' + ); + }, + action: function (data) { + service + .deleteFromDatabase(data.record.id) + .then(function () { + abp.message.success(l('Deleted')); + dataTable.ajax.reload(); + }); + }, + }, + ], + }, + }, + { + target: 1, + data: 'name', + }, + { + target: 2, + data: 'version', + }, + { + target: 3, + data: 'languageCode', + }, + { + target: 4, + data: 'fileName', + }, + { + target: 5, + data: 'format', + }, + { + target: 6, + data: 'creationTime', + render: function (creationTime) { + if (!creationTime) { + return ''; + } - var date = Date.parse(creationTime); - return new Date(date).toLocaleDateString( - abp.localization.currentCulture.name - ); - }, - }, - { - target: 7, - data: 'lastUpdatedTime', - render: function (lastUpdatedTime) { - if (!lastUpdatedTime) { - return ''; - } + var date = Date.parse(creationTime); + return new Date(date).toLocaleDateString( + abp.localization.currentCulture.name + ); + }, + }, + { + target: 7, + data: 'lastUpdatedTime', + render: function (lastUpdatedTime) { + if (!lastUpdatedTime) { + return ''; + } - var date = Date.parse(lastUpdatedTime); - return new Date(date).toLocaleDateString( - abp.localization.currentCulture.name - ); - }, - }, - { - target: 8, - data: 'lastSignificantUpdateTime', - render: function (lastSignificantUpdateTime) { - if (!lastSignificantUpdateTime) { - return ''; - } + var date = Date.parse(lastUpdatedTime); + return new Date(date).toLocaleDateString( + abp.localization.currentCulture.name + ); + }, + }, + { + target: 8, + data: 'lastSignificantUpdateTime', + render: function (lastSignificantUpdateTime) { + if (!lastSignificantUpdateTime) { + return ''; + } - var date = Date.parse(lastSignificantUpdateTime); - return new Date(date).toLocaleDateString( - abp.localization.currentCulture.name - ); - }, - }, - { - target: 9, - data: 'lastCachedTime', - render: function (lastCachedTime) { - if (!lastCachedTime) { - return ''; - } + var date = Date.parse(lastSignificantUpdateTime); + return new Date(date).toLocaleDateString( + abp.localization.currentCulture.name + ); + }, + }, + { + target: 9, + data: 'lastCachedTime', + render: function (lastCachedTime) { + if (!lastCachedTime) { + return ''; + } - var date = Date.parse(lastCachedTime); - return new Date(date).toLocaleDateString( - abp.localization.currentCulture.name - ); - }, - }, - ], - }) - ); + var date = Date.parse(lastCachedTime); + return new Date(date).toLocaleDateString( + abp.localization.currentCulture.name + ); + }, + }, + ], + }) + ); - $("#FilterForm input[type='text']").keypress(function (e) { - if (e.which === 13) { - dataTable.ajax.reload(); - } - }); + $("#FilterForm input[type='text']").keypress(function (e) { + if (e.which === 13) { + dataTable.ajax.reload(); + } + }); - $('#SearchButton').click(function (e) { - e.preventDefault(); - dataTable.ajax.reload(); - }); + $('#SearchButton').click(function (e) { + e.preventDefault(); + dataTable.ajax.reload(); + }); }); diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.js index db4fa9b6622..e3f4032d184 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.js @@ -1,23 +1,23 @@ var abp = abp || {}; $(function () { - abp.modals.projectPull = function () { - var initModal = function (publicApi, args) { - var $form = publicApi.getForm(); - var fg = $form.find('#PullDocument_Name').parent(); - var nameInput = fg.html(); + abp.modals.projectPull = function () { + var initModal = function (publicApi, args) { + var $form = publicApi.getForm(); + var fg = $form.find('#PullDocument_Name').parent(); + var nameInput = fg.html(); - $form.find('input:checkbox').change(function () { - if ($(this).prop('checked')) { - fg.html(''); - } else { - fg.html(nameInput); - } - }); - }; + $form.find('input:checkbox').change(function () { + if ($(this).prop('checked')) { + fg.html(''); + } else { + fg.html(nameInput); + } + }); + }; - return { - initModal: initModal, - }; - }; + return { + initModal: initModal, + }; + }; }); diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/create.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/create.js index 1b78f447916..c29927fde77 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/create.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/create.js @@ -1,12 +1,12 @@ var abp = abp || {}; $(function () { - abp.modals.projectCreate = function () { - var initModal = function (publicApi, args) { - var $form = publicApi.getForm(); - }; + abp.modals.projectCreate = function () { + var initModal = function (publicApi, args) { + var $form = publicApi.getForm(); + }; - return { - initModal: initModal, - }; - }; + return { + initModal: initModal, + }; + }; }); diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/edit.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/edit.js index 287ea898d73..71785164175 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/edit.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/edit.js @@ -1,12 +1,12 @@ var abp = abp || {}; $(function () { - abp.modals.projectEdit = function () { - var initModal = function (publicApi, args) { - var $form = publicApi.getForm(); - }; + abp.modals.projectEdit = function () { + var initModal = function (publicApi, args) { + var $form = publicApi.getForm(); + }; - return { - initModal: initModal, - }; - }; + return { + initModal: initModal, + }; + }; }); diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js index e7b57b116e8..45554eb356e 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js @@ -1,155 +1,177 @@ $(function () { - var l = abp.localization.getResource('Docs'); + var l = abp.localization.getResource('Docs'); - var _createModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'Docs/Admin/Projects/Create', - modalClass: 'projectCreate', - }); + var _createModal = new abp.ModalManager({ + viewUrl: abp.appPath + 'Docs/Admin/Projects/Create', + modalClass: 'projectCreate', + }); - var _editModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'Docs/Admin/Projects/Edit', - modalClass: 'projectEdit', - }); + var _editModal = new abp.ModalManager({ + viewUrl: abp.appPath + 'Docs/Admin/Projects/Edit', + modalClass: 'projectEdit', + }); - var _pullModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'Docs/Admin/Projects/Pull', - modalClass: 'projectPull', - }); + var _pullModal = new abp.ModalManager({ + viewUrl: abp.appPath + 'Docs/Admin/Projects/Pull', + modalClass: 'projectPull', + }); - var _dataTable = $('#ProjectsTable').DataTable( - abp.libs.datatables.normalizeConfiguration({ - processing: true, - serverSide: true, - scrollX: true, - paging: true, - searching: false, - autoWidth: false, - scrollCollapse: true, - order: [[2, 'desc']], - ajax: abp.libs.datatables.createAjax( - volo.docs.admin.projectsAdmin.getList - ), - columnDefs: [ - { - rowAction: { - items: [ - { - text: l('Edit'), - visible: abp.auth.isGranted('Docs.Admin.Projects.Update'), - action: function (data) { - _editModal.open({ - Id: data.record.id, - }); - }, - }, - { - text: l('Delete'), - visible: abp.auth.isGranted('Docs.Admin.Projects.Delete'), - confirmMessage: function (data) { - return l('ProjectDeletionWarningMessage'); - }, - action: function (data) { - volo.docs.admin.projectsAdmin - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - }, - }, - { - text: l('Pull'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - action: function (data) { - _pullModal.open({ - Id: data.record.id, - }); - }, - }, - { - text: l('ClearCache'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - confirmMessage: function (data) { - return l('ClearCacheConfirmationMessage', data.record.name); - }, - action: function (data) { - volo.docs.admin.documentsAdmin - .clearCache({ projectId: data.record.id }) - .then(function () { - _dataTable.ajax.reload(); - }); - }, - }, - { - text: l('ReIndexProject'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - confirmMessage: function (data) { - return l( - 'ReIndexProjectConfirmationMessage', - data.record.name - ); - }, - action: function (data) { - volo.docs.admin.projectsAdmin - .reindex({ projectId: data.record.id }) - .then(function () { - abp.message.success( - l('SuccessfullyReIndexProject', data.record.name) - ); - }); - }, - }, - ], - }, - }, - { - target: 1, - data: 'name', - }, - { - target: 2, - data: 'shortName', - }, - { - target: 3, - data: 'documentStoreType', - }, - { - target: 4, - data: 'format', - render: function (data) { - if (data === 'md') { - return 'markdown'; - } + var _dataTable = $('#ProjectsTable').DataTable( + abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + scrollX: true, + paging: true, + searching: false, + autoWidth: false, + scrollCollapse: true, + order: [[2, 'desc']], + ajax: abp.libs.datatables.createAjax( + volo.docs.admin.projectsAdmin.getList + ), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('Edit'), + visible: abp.auth.isGranted( + 'Docs.Admin.Projects.Update' + ), + action: function (data) { + _editModal.open({ + Id: data.record.id, + }); + }, + }, + { + text: l('Delete'), + visible: abp.auth.isGranted( + 'Docs.Admin.Projects.Delete' + ), + confirmMessage: function (data) { + return l('ProjectDeletionWarningMessage'); + }, + action: function (data) { + volo.docs.admin.projectsAdmin + .delete(data.record.id) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + { + text: l('Pull'), + visible: abp.auth.isGranted( + 'Docs.Admin.Documents' + ), + action: function (data) { + _pullModal.open({ + Id: data.record.id, + }); + }, + }, + { + text: l('ClearCache'), + visible: abp.auth.isGranted( + 'Docs.Admin.Documents' + ), + confirmMessage: function (data) { + return l( + 'ClearCacheConfirmationMessage', + data.record.name + ); + }, + action: function (data) { + volo.docs.admin.documentsAdmin + .clearCache({ + projectId: data.record.id, + }) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + { + text: l('ReIndexProject'), + visible: abp.auth.isGranted( + 'Docs.Admin.Documents' + ), + confirmMessage: function (data) { + return l( + 'ReIndexProjectConfirmationMessage', + data.record.name + ); + }, + action: function (data) { + volo.docs.admin.projectsAdmin + .reindex({ projectId: data.record.id }) + .then(function () { + abp.message.success( + l( + 'SuccessfullyReIndexProject', + data.record.name + ) + ); + }); + }, + }, + ], + }, + }, + { + target: 1, + data: 'name', + }, + { + target: 2, + data: 'shortName', + }, + { + target: 3, + data: 'documentStoreType', + }, + { + target: 4, + data: 'format', + render: function (data) { + if (data === 'md') { + return 'markdown'; + } - return data; - }, - }, - ], - }) - ); + return data; + }, + }, + ], + }) + ); - $('#CreateNewGithubProjectButtonId').click(function (event) { - event.preventDefault(); - _createModal.open({ source: 'GitHub' }); - }); + $('#CreateNewGithubProjectButtonId').click(function (event) { + event.preventDefault(); + _createModal.open({ source: 'GitHub' }); + }); - $('#ReIndexAllProjects').click(function (event) { - abp.message - .confirm(l('ReIndexAllProjectConfirmationMessage')) - .done(function (accepted) { - if (accepted) { - volo.docs.admin.projectsAdmin.reindexAll().then(function () { - abp.message.success(l('SuccessfullyReIndexAllProject')); - }); - } - }); - }); + $('#ReIndexAllProjects').click(function (event) { + abp.message + .confirm(l('ReIndexAllProjectConfirmationMessage')) + .done(function (accepted) { + if (accepted) { + volo.docs.admin.projectsAdmin + .reindexAll() + .then(function () { + abp.message.success( + l('SuccessfullyReIndexAllProject') + ); + }); + } + }); + }); - _createModal.onClose(function () { - _dataTable.ajax.reload(); - }); + _createModal.onClose(function () { + _dataTable.ajax.reload(); + }); - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _editModal.onResult(function () { + _dataTable.ajax.reload(); + }); }); diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/bootstrap-toc.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/bootstrap-toc.js index 3b92bf5e7e1..1bf1d139a92 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/bootstrap-toc.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/bootstrap-toc.js @@ -12,12 +12,18 @@ // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ // http://stackoverflow.com/a/12731439/358804 var $descendants = $el.find(selector); - return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + return $el + .filter(selector) + .add($descendants) + .filter(':not([data-toc-skip])'); }, generateUniqueIdBase: function (el) { var text = $(el).text(); - var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + var anchor = text + .trim() + .toLowerCase() + .replace(/[^A-Za-z0-9]+/g, '-'); return anchor || el.tagName.toLowerCase(); }, @@ -91,7 +97,10 @@ var secondaryLevel = topLevel + 1; var secondarySelector = 'h' + secondaryLevel; - return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + return this.findOrFilter( + $scope, + topSelector + ',' + secondarySelector + ); }, getNavLevel: function (el) { @@ -126,14 +135,14 @@ var opts; if (arg.jquery) { opts = { - $nav: arg + $nav: arg, }; } else { opts = arg; } opts.$scope = opts.$scope || $(document.body); return opts; - } + }, }, // accepts a jQuery object, or an options object @@ -147,7 +156,7 @@ var topLevel = this.helpers.getTopLevel(opts.$scope); var $headings = this.helpers.getHeadings(opts.$scope, topLevel); this.helpers.populateNav($topContext, topLevel, $headings); - } + }, }; $(function () { @@ -156,4 +165,4 @@ Toc.init($nav); }); }); -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js index 915428048fb..bbb97b041cb 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js @@ -1,343 +1,363 @@ (function ($) { - $(function () { - var initNavigationFilter = function (navigationContainerId) { - var $navigation = $('#' + navigationContainerId); - - var getShownDocumentLinks = function () { - return $navigation - .find('.mCSB_container > li a:visible') - .not('.tree-toggle'); - }; - - var gotoFilteredDocumentIfThereIsOnlyOne = function () { - var $links = getShownDocumentLinks(); - if ($links.length === 1) { - var url = $links.first().attr('href'); - if (url === 'javascript:;') { - return; - } - - window.location = url; - } - }; - - var filterDocumentItems = function (filterText) { - $navigation.find('.mCSB_container .opened').removeClass('opened'); - $navigation - .find('.mCSB_container > li, .mCSB_container > li ul') - .hide(); - - if (!filterText) { - $navigation.find('.mCSB_container > li').show(); - $navigation.find('.mCSB_container .selected-tree > ul').show(); - return; - } - - var filteredItems = $navigation.find('li > a').filter(function () { - return ( - $(this).text().toUpperCase().indexOf(filterText.toUpperCase()) > -1 - ); - }); - - filteredItems.each(function () { - var $el = $(this); - $el.show(); - var $parent = $el.parent(); - - var hasParent = true; - while (hasParent) { - if ($parent.attr('id') === navigationContainerId) { - break; - } - - $parent.show(); - $parent.find('> li > label').not('.last-link').addClass('opened'); - - $parent = $parent.parent(); - hasParent = $parent.length > 0; - } - }); - }; - - $('#filter').keyup(function (e) { - filterDocumentItems(e.target.value); - - if (e.key === 'Enter') { - gotoFilteredDocumentIfThereIsOnlyOne(); - } - }); - - $('#fullsearch').keyup(function (e) { - if (e.key === 'Enter') { - window.open($(this).data('fullsearch-url') + this.value); - } - }); - }; - - var initAnchorTags = function (container) { - anchors.options = { - placement: 'left', - }; - - var anchorTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; - anchorTags.forEach(function (tag) { - anchors.add(container + ' ' + tag); - }); - }; - - var initSocialShareLinks = function () { - var pageHeader = $('.docs-body').find('h1, h2').first().text(); - - var projectName = $('#ProjectName')[0].innerText; - - $('#TwitterShareLink').attr( - 'href', - 'https://twitter.com/intent/tweet?text=' + - encodeURI( - pageHeader + ' | ' + projectName + ' | ' + window.location.href - ) - ); - - $('#LinkedinShareLink').attr( - 'href', - 'https://www.linkedin.com/shareArticle?' + - 'url=' + - encodeURI(window.location.href) + - '&' + - 'mini=true&' + - 'summary=' + - encodeURI(projectName) + - '&' + - 'title=' + - encodeURI(pageHeader) + - '&' + - 'source=' + - encodeURI($('#GoToMainWebSite').attr('href')) - ); - - $('#EmailShareLink').attr( - 'href', - 'mailto:?' + - 'body=' + - encodeURI('I want you to look at ' + window.location.href) + - '&' + - 'subject=' + - encodeURI(pageHeader + ' | ' + projectName) + - '&' - ); - }; - - var initSections = function () { - var clearQueryString = function () { - var uri = window.location.href.toString(); - - if (uri.indexOf('?') > 0) { - uri = uri.substring(0, uri.indexOf('?')); - } - - window.history.replaceState({}, document.title, uri); - }; - - var setQueryString = function () { - var comboboxes = $('.doc-section-combobox'); - if (comboboxes.length < 1) { - return; - } - - var hash = document.location.hash; - - clearQueryString(); - - var uri = window.location.href.toString(); - - var new_uri = uri + '?'; - - for (var i = 0; i < comboboxes.length; i++) { - var key = $(comboboxes[i]).data('key'); - var value = comboboxes[i].value; - - new_uri += key + '=' + value; - - if (i !== comboboxes.length - 1) { - new_uri += '&'; - } - } - - window.history.replaceState({}, document.title, new_uri + hash); - }; - - var getTenYearsLater = function () { - var tenYearsLater = new Date(); - tenYearsLater.setTime( - tenYearsLater.getTime() + 365 * 10 * 24 * 60 * 60 * 1000 - ); - return tenYearsLater; - }; - - var setCookies = function () { - var cookie = abp.utils.getCookieValue('AbpDocsPreferences'); - - if (!cookie || cookie == null || cookie === null) { - cookie = ''; - } - var keyValues = cookie.split('|'); - - var comboboxes = $('.doc-section-combobox'); - - for (var i = 0; i < comboboxes.length; i++) { - var key = $(comboboxes[i]).data('key'); - var value = comboboxes[i].value; - - var changed = false; - var keyValueslength = keyValues.length; - for (var k = 0; k < keyValueslength; k++) { - var splitted = keyValues[k].split('='); - - if (splitted.length > 0 && splitted[0] === key) { - keyValues[k] = key + '=' + value; - changed = true; - } - } - - if (!changed) { - keyValues.push(key + '=' + value); - } - } - - abp.utils.setCookieValue( - 'AbpDocsPreferences', - keyValues.join('|'), - getTenYearsLater(), - '/' - ); - }; - - $('.doc-section-combobox').change(function () { - setCookies(); - clearQueryString(); - location.reload(); - }); - - setQueryString(); - }; - - var initCrawlerLinks = function () { - var isCrawler = function () { - var crawlers = [ - 'Google', - 'Googlebot', - 'YandexBot', - 'msnbot', - 'Rambler', - 'Yahoo', - 'AbachoBOT', - 'accoona', - 'AcoiRobot', - 'ASPSeek', - 'CrocCrawler', - 'Dumbot', - 'FAST-WebCrawler', - 'GeonaBot', - 'Gigabot', - 'Lycos', - 'MSRBOT', - 'Scooter', - 'AltaVista', - 'IDBot', - 'eStyle', - 'Scrubby', - 'Slurp', - 'DuckDuckBot', - 'Baiduspider', - 'VoilaBot', - 'ExaLead', - 'Search Dog', - 'MSN Bot', - 'BingBot', - ]; - - var agent = navigator.userAgent; - - for (var i = 0; i < crawlers.length; i++) { - if (agent.indexOf(crawlers[i]) >= 0) { - return true; - } - } - - return false; - }; - - if (!isCrawler()) { - return; - } - - var comboboxes = $('.doc-section-combobox'); - - if (comboboxes.length <= 0) { - return; - } - - $('#crawler_link').show(); - - var html = ''; - - var currentUrl = window.location.href.toString(); - - if (currentUrl.indexOf('?') > 0) { - currentUrl = currentUrl.substring(0, currentUrl.indexOf('?')); - } - - var getQueryStringsFromComboboxes = function (x) { - if (x >= comboboxes.length) { - return []; - } - - var key = $(comboboxes[x]).data('key'); - - var queryStrings = getQueryStringsFromComboboxes(x + 1); - var returnList = []; - - $(comboboxes[x]) - .find('option') - .each(function () { - if (queryStrings.length <= 0) { - returnList.push(key + '=' + $(this).val()); - } else { - for (var k = 0; k < queryStrings.length; k++) { - returnList.push( - key + '=' + $(this).val() + '&' + queryStrings[k] - ); - } - } - }); - - return returnList; - }; - - var queryStrings = getQueryStringsFromComboboxes(0); - - for (var i = 0; i < queryStrings.length; i++) { - html += - '' + - queryStrings[i] + - ' '; - } - - $('#crawler_link').html(html); - }; - - initNavigationFilter('sidebar-scroll'); - - initAnchorTags('.docs-page .docs-body'); - - initSocialShareLinks(); - - initSections(); - - initCrawlerLinks(); - }); + $(function () { + var initNavigationFilter = function (navigationContainerId) { + var $navigation = $('#' + navigationContainerId); + + var getShownDocumentLinks = function () { + return $navigation + .find('.mCSB_container > li a:visible') + .not('.tree-toggle'); + }; + + var gotoFilteredDocumentIfThereIsOnlyOne = function () { + var $links = getShownDocumentLinks(); + if ($links.length === 1) { + var url = $links.first().attr('href'); + if (url === 'javascript:;') { + return; + } + + window.location = url; + } + }; + + var filterDocumentItems = function (filterText) { + $navigation + .find('.mCSB_container .opened') + .removeClass('opened'); + $navigation + .find('.mCSB_container > li, .mCSB_container > li ul') + .hide(); + + if (!filterText) { + $navigation.find('.mCSB_container > li').show(); + $navigation + .find('.mCSB_container .selected-tree > ul') + .show(); + return; + } + + var filteredItems = $navigation + .find('li > a') + .filter(function () { + return ( + $(this) + .text() + .toUpperCase() + .indexOf(filterText.toUpperCase()) > -1 + ); + }); + + filteredItems.each(function () { + var $el = $(this); + $el.show(); + var $parent = $el.parent(); + + var hasParent = true; + while (hasParent) { + if ($parent.attr('id') === navigationContainerId) { + break; + } + + $parent.show(); + $parent + .find('> li > label') + .not('.last-link') + .addClass('opened'); + + $parent = $parent.parent(); + hasParent = $parent.length > 0; + } + }); + }; + + $('#filter').keyup(function (e) { + filterDocumentItems(e.target.value); + + if (e.key === 'Enter') { + gotoFilteredDocumentIfThereIsOnlyOne(); + } + }); + + $('#fullsearch').keyup(function (e) { + if (e.key === 'Enter') { + window.open($(this).data('fullsearch-url') + this.value); + } + }); + }; + + var initAnchorTags = function (container) { + anchors.options = { + placement: 'left', + }; + + var anchorTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; + anchorTags.forEach(function (tag) { + anchors.add(container + ' ' + tag); + }); + }; + + var initSocialShareLinks = function () { + var pageHeader = $('.docs-body').find('h1, h2').first().text(); + + var projectName = $('#ProjectName')[0].innerText; + + $('#TwitterShareLink').attr( + 'href', + 'https://twitter.com/intent/tweet?text=' + + encodeURI( + pageHeader + + ' | ' + + projectName + + ' | ' + + window.location.href + ) + ); + + $('#LinkedinShareLink').attr( + 'href', + 'https://www.linkedin.com/shareArticle?' + + 'url=' + + encodeURI(window.location.href) + + '&' + + 'mini=true&' + + 'summary=' + + encodeURI(projectName) + + '&' + + 'title=' + + encodeURI(pageHeader) + + '&' + + 'source=' + + encodeURI($('#GoToMainWebSite').attr('href')) + ); + + $('#EmailShareLink').attr( + 'href', + 'mailto:?' + + 'body=' + + encodeURI('I want you to look at ' + window.location.href) + + '&' + + 'subject=' + + encodeURI(pageHeader + ' | ' + projectName) + + '&' + ); + }; + + var initSections = function () { + var clearQueryString = function () { + var uri = window.location.href.toString(); + + if (uri.indexOf('?') > 0) { + uri = uri.substring(0, uri.indexOf('?')); + } + + window.history.replaceState({}, document.title, uri); + }; + + var setQueryString = function () { + var comboboxes = $('.doc-section-combobox'); + if (comboboxes.length < 1) { + return; + } + + var hash = document.location.hash; + + clearQueryString(); + + var uri = window.location.href.toString(); + + var new_uri = uri + '?'; + + for (var i = 0; i < comboboxes.length; i++) { + var key = $(comboboxes[i]).data('key'); + var value = comboboxes[i].value; + + new_uri += key + '=' + value; + + if (i !== comboboxes.length - 1) { + new_uri += '&'; + } + } + + window.history.replaceState({}, document.title, new_uri + hash); + }; + + var getTenYearsLater = function () { + var tenYearsLater = new Date(); + tenYearsLater.setTime( + tenYearsLater.getTime() + 365 * 10 * 24 * 60 * 60 * 1000 + ); + return tenYearsLater; + }; + + var setCookies = function () { + var cookie = abp.utils.getCookieValue('AbpDocsPreferences'); + + if (!cookie || cookie == null || cookie === null) { + cookie = ''; + } + var keyValues = cookie.split('|'); + + var comboboxes = $('.doc-section-combobox'); + + for (var i = 0; i < comboboxes.length; i++) { + var key = $(comboboxes[i]).data('key'); + var value = comboboxes[i].value; + + var changed = false; + var keyValueslength = keyValues.length; + for (var k = 0; k < keyValueslength; k++) { + var splitted = keyValues[k].split('='); + + if (splitted.length > 0 && splitted[0] === key) { + keyValues[k] = key + '=' + value; + changed = true; + } + } + + if (!changed) { + keyValues.push(key + '=' + value); + } + } + + abp.utils.setCookieValue( + 'AbpDocsPreferences', + keyValues.join('|'), + getTenYearsLater(), + '/' + ); + }; + + $('.doc-section-combobox').change(function () { + setCookies(); + clearQueryString(); + location.reload(); + }); + + setQueryString(); + }; + + var initCrawlerLinks = function () { + var isCrawler = function () { + var crawlers = [ + 'Google', + 'Googlebot', + 'YandexBot', + 'msnbot', + 'Rambler', + 'Yahoo', + 'AbachoBOT', + 'accoona', + 'AcoiRobot', + 'ASPSeek', + 'CrocCrawler', + 'Dumbot', + 'FAST-WebCrawler', + 'GeonaBot', + 'Gigabot', + 'Lycos', + 'MSRBOT', + 'Scooter', + 'AltaVista', + 'IDBot', + 'eStyle', + 'Scrubby', + 'Slurp', + 'DuckDuckBot', + 'Baiduspider', + 'VoilaBot', + 'ExaLead', + 'Search Dog', + 'MSN Bot', + 'BingBot', + ]; + + var agent = navigator.userAgent; + + for (var i = 0; i < crawlers.length; i++) { + if (agent.indexOf(crawlers[i]) >= 0) { + return true; + } + } + + return false; + }; + + if (!isCrawler()) { + return; + } + + var comboboxes = $('.doc-section-combobox'); + + if (comboboxes.length <= 0) { + return; + } + + $('#crawler_link').show(); + + var html = ''; + + var currentUrl = window.location.href.toString(); + + if (currentUrl.indexOf('?') > 0) { + currentUrl = currentUrl.substring(0, currentUrl.indexOf('?')); + } + + var getQueryStringsFromComboboxes = function (x) { + if (x >= comboboxes.length) { + return []; + } + + var key = $(comboboxes[x]).data('key'); + + var queryStrings = getQueryStringsFromComboboxes(x + 1); + var returnList = []; + + $(comboboxes[x]) + .find('option') + .each(function () { + if (queryStrings.length <= 0) { + returnList.push(key + '=' + $(this).val()); + } else { + for (var k = 0; k < queryStrings.length; k++) { + returnList.push( + key + + '=' + + $(this).val() + + '&' + + queryStrings[k] + ); + } + } + }); + + return returnList; + }; + + var queryStrings = getQueryStringsFromComboboxes(0); + + for (var i = 0; i < queryStrings.length; i++) { + html += + '' + + queryStrings[i] + + ' '; + } + + $('#crawler_link').html(html); + }; + + initNavigationFilter('sidebar-scroll'); + + initAnchorTags('.docs-page .docs-body'); + + initSocialShareLinks(); + + initSections(); + + initCrawlerLinks(); + }); })(jQuery); diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/error.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/error.js index 6b4fc7a217a..e0b6f1c1e3e 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/error.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/error.js @@ -1,18 +1,18 @@ (function ($) { - $(function () { - var errorPageRedirect = function () { - var second = 3; - var close = setInterval(() => { - $('#ErrorRedirectSeconds').text(`(${--second})`); - if (second === 0) { - clearInterval(close); - $('#ErrorRedirect')[0].click(); - } - }, 1000); - }; + $(function () { + var errorPageRedirect = function () { + var second = 3; + var close = setInterval(() => { + $('#ErrorRedirectSeconds').text(`(${--second})`); + if (second === 0) { + clearInterval(close); + $('#ErrorRedirect')[0].click(); + } + }, 1000); + }; - if (document.getElementById('ErrorRedirect')) { - errorPageRedirect(); - } - }); + if (document.getElementById('ErrorRedirect')) { + errorPageRedirect(); + } + }); })(jQuery); diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js index 2d185498a12..32d31088b2e 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js @@ -1,165 +1,165 @@ (function ($) { - $(function () { - $('li:not(.last-link) a.tree-toggle').click(function () { - $(this).parent().children('ul.tree').toggle(100); - $(this).closest('li').toggleClass('selected-tree'); - }); - - $('li:not(.last-link) span.plus-icon i.fa-chevron-right').click( - function () { - var $element = $(this).parent(); - - $element.parent().children('ul.tree').toggle(100); - $element.closest('li').toggleClass('selected-tree'); - } - ); - - var scrollTopBtn = $('.scroll-top-btn'); - var enoughHeight = $('.docs-sidebar-wrapper > .docs-top').height() + 60; - var enoughHeightPlus = 500; - - $(window).scroll(function () { - var topPos = $(window).scrollTop(); - if (topPos > enoughHeight) { - $(scrollTopBtn).addClass('showup'); - $('body').addClass('scrolled'); - } else { - $(scrollTopBtn).removeClass('showup'); - $('body').removeClass('scrolled'); - } - if (topPos > enoughHeightPlus) { - $('body').addClass('scrolledMore'); - } else { - $('body').removeClass('scrolledMore'); - } - }); - - $(scrollTopBtn).click(function () { - $('html, body').animate( - { - scrollTop: 0, - }, - 500 - ); - return false; - }); - - var scrollToHashLink = function () { - var hash = window.location.hash; - - if (!hash || hash === '#') { - return; - } - - var $targetElement = $(decodeURIComponent(hash)); - - $targetElement = $targetElement.length - ? $targetElement - : $('[name=' + this.hash.slice(1) + ']'); - - if (!$targetElement.length) { - return; - } - - $('html,body').stop().animate( - { - scrollTop: $targetElement.offset().top, - }, - 200 - ); - - return; - }; - - $(document).ready(function () { - handleCustomScrolls(); - - var $myNav = $('#docs-sticky-index'); - Toc.init($myNav); - - $('body').scrollspy({ - target: $myNav, - }); - - $('#docs-sticky-index a').on('click', function (event) { - if (this.hash !== '') { - event.preventDefault(); - var hash = this.hash; - $('html, body').animate( - { - scrollTop: $(decodeURIComponent(hash)).offset().top, - }, - 500, - function () { - window.location.hash = hash; - } - ); - } - }); - - $('.btn-toggle').on('click', function () { - $('.toggle-row').slideToggle(400); - $(this).toggleClass('less'); - }); - - $('.close-mmenu').on('click', function () { - $('.navbar-collapse').removeClass('show'); - }); - - $('.open-dmenu').on('click', function () { - $('.docs-tree-list').slideToggle(); - }); - - scrollToHashLink(); - }); - - $(window).resize(function () { - handleCustomScrolls(); - }); - }); - - function handleCustomScrolls() { - var wWidth = $(window).width(); - if (wWidth > 766) { - $('#sidebar-scroll').mCustomScrollbar({ - theme: 'minimal', - alwaysShowScrollbar: 0, - }); - - $('#scroll-index').mCustomScrollbar({ - theme: 'minimal-dark', - alwaysShowScrollbar: 0, - }); - } - } - - window.Toc.helpers.createNavList = function () { - return $(''); - }; - - window.Toc.helpers.createChildNavList = function ($parent) { - var $childList = this.createNavList(); - $parent.append($childList); - return $childList; - }; - - window.Toc.helpers.generateNavEl = function (anchor, text) { - var $a = $(''); - $a.attr('href', '#' + anchor); - $a.text(text); - var $li = $(''); - $li.append($a); - return $li; - }; - - function docsCriteria() { - var docsContentWidth = $('.docs-content').width() - 20; - $('.alert-criteria').width(docsContentWidth); - } - $(document).ready(function () { - docsCriteria(); - }); - $(window).resize(function () { - docsCriteria(); - }); + $(function () { + $('li:not(.last-link) a.tree-toggle').click(function () { + $(this).parent().children('ul.tree').toggle(100); + $(this).closest('li').toggleClass('selected-tree'); + }); + + $('li:not(.last-link) span.plus-icon i.fa-chevron-right').click( + function () { + var $element = $(this).parent(); + + $element.parent().children('ul.tree').toggle(100); + $element.closest('li').toggleClass('selected-tree'); + } + ); + + var scrollTopBtn = $('.scroll-top-btn'); + var enoughHeight = $('.docs-sidebar-wrapper > .docs-top').height() + 60; + var enoughHeightPlus = 500; + + $(window).scroll(function () { + var topPos = $(window).scrollTop(); + if (topPos > enoughHeight) { + $(scrollTopBtn).addClass('showup'); + $('body').addClass('scrolled'); + } else { + $(scrollTopBtn).removeClass('showup'); + $('body').removeClass('scrolled'); + } + if (topPos > enoughHeightPlus) { + $('body').addClass('scrolledMore'); + } else { + $('body').removeClass('scrolledMore'); + } + }); + + $(scrollTopBtn).click(function () { + $('html, body').animate( + { + scrollTop: 0, + }, + 500 + ); + return false; + }); + + var scrollToHashLink = function () { + var hash = window.location.hash; + + if (!hash || hash === '#') { + return; + } + + var $targetElement = $(decodeURIComponent(hash)); + + $targetElement = $targetElement.length + ? $targetElement + : $('[name=' + this.hash.slice(1) + ']'); + + if (!$targetElement.length) { + return; + } + + $('html,body').stop().animate( + { + scrollTop: $targetElement.offset().top, + }, + 200 + ); + + return; + }; + + $(document).ready(function () { + handleCustomScrolls(); + + var $myNav = $('#docs-sticky-index'); + Toc.init($myNav); + + $('body').scrollspy({ + target: $myNav, + }); + + $('#docs-sticky-index a').on('click', function (event) { + if (this.hash !== '') { + event.preventDefault(); + var hash = this.hash; + $('html, body').animate( + { + scrollTop: $(decodeURIComponent(hash)).offset().top, + }, + 500, + function () { + window.location.hash = hash; + } + ); + } + }); + + $('.btn-toggle').on('click', function () { + $('.toggle-row').slideToggle(400); + $(this).toggleClass('less'); + }); + + $('.close-mmenu').on('click', function () { + $('.navbar-collapse').removeClass('show'); + }); + + $('.open-dmenu').on('click', function () { + $('.docs-tree-list').slideToggle(); + }); + + scrollToHashLink(); + }); + + $(window).resize(function () { + handleCustomScrolls(); + }); + }); + + function handleCustomScrolls() { + var wWidth = $(window).width(); + if (wWidth > 766) { + $('#sidebar-scroll').mCustomScrollbar({ + theme: 'minimal', + alwaysShowScrollbar: 0, + }); + + $('#scroll-index').mCustomScrollbar({ + theme: 'minimal-dark', + alwaysShowScrollbar: 0, + }); + } + } + + window.Toc.helpers.createNavList = function () { + return $(''); + }; + + window.Toc.helpers.createChildNavList = function ($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }; + + window.Toc.helpers.generateNavEl = function (anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $(''); + $li.append($a); + return $li; + }; + + function docsCriteria() { + var docsContentWidth = $('.docs-content').width() - 20; + $('.alert-criteria').width(docsContentWidth); + } + $(document).ready(function () { + docsCriteria(); + }); + $(window).resize(function () { + docsCriteria(); + }); })(jQuery); diff --git a/modules/feature-management/.prettierrc b/modules/feature-management/.prettierrc index 7d1b8aa7216..34a0e1ecde4 100644 --- a/modules/feature-management/.prettierrc +++ b/modules/feature-management/.prettierrc @@ -1,4 +1,5 @@ { - "singleQuote": true, - "useTabs": true + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js index 0df9d507759..7e4960999cd 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js @@ -1,14 +1,14 @@ var abp = abp || {}; (function ($) { - abp.modals = abp.modals || {}; + abp.modals = abp.modals || {}; - abp.modals.FeatureManagement = function () { - $('.FeatureValueCheckbox').change(function () { - if (this.checked) { - $(this).val('true'); - } else { - $(this).val('false'); - } - }); - }; + abp.modals.FeatureManagement = function () { + $('.FeatureValueCheckbox').change(function () { + if (this.checked) { + $(this).val('true'); + } else { + $(this).val('false'); + } + }); + }; })(jQuery); diff --git a/modules/identity/.prettierrc b/modules/identity/.prettierrc index 7d1b8aa7216..34a0e1ecde4 100644 --- a/modules/identity/.prettierrc +++ b/modules/identity/.prettierrc @@ -1,4 +1,5 @@ { - "singleQuote": true, - "useTabs": true + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js index c5c15136e3a..4331ab4229e 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js @@ -1,114 +1,120 @@ (function ($) { - var l = abp.localization.getResource('AbpIdentity'); + var l = abp.localization.getResource('AbpIdentity'); - var _identityRoleAppService = volo.abp.identity.identityRole; - var _permissionsModal = new abp.ModalManager( - abp.appPath + 'AbpPermissionManagement/PermissionManagementModal' - ); - var _editModal = new abp.ModalManager( - abp.appPath + 'Identity/Roles/EditModal' - ); - var _createModal = new abp.ModalManager( - abp.appPath + 'Identity/Roles/CreateModal' - ); + var _identityRoleAppService = volo.abp.identity.identityRole; + var _permissionsModal = new abp.ModalManager( + abp.appPath + 'AbpPermissionManagement/PermissionManagementModal' + ); + var _editModal = new abp.ModalManager( + abp.appPath + 'Identity/Roles/EditModal' + ); + var _createModal = new abp.ModalManager( + abp.appPath + 'Identity/Roles/CreateModal' + ); - $(function () { - var _$wrapper = $('#IdentityRolesWrapper'); - var _$table = _$wrapper.find('table'); + $(function () { + var _$wrapper = $('#IdentityRolesWrapper'); + var _$table = _$wrapper.find('table'); - var _dataTable = _$table.DataTable( - abp.libs.datatables.normalizeConfiguration({ - order: [[1, 'asc']], - searching: false, - processing: true, - serverSide: true, - scrollX: true, - paging: true, - ajax: abp.libs.datatables.createAjax(_identityRoleAppService.getList), - columnDefs: [ - { - rowAction: { - items: [ - { - text: l('Edit'), - visible: abp.auth.isGranted('AbpIdentity.Roles.Update'), - action: function (data) { - _editModal.open({ - id: data.record.id, - }); - }, - }, - { - text: l('Permissions'), - visible: abp.auth.isGranted( - 'AbpIdentity.Roles.ManagePermissions' - ), - action: function (data) { - _permissionsModal.open({ - providerName: 'R', - providerKey: data.record.name, - }); - }, - }, - { - text: l('Delete'), - visible: function (data) { - return ( - !data.isStatic && - abp.auth.isGranted('AbpIdentity.Roles.Delete') - ); //TODO: Check permission - }, - confirmMessage: function (data) { - return l( - 'RoleDeletionConfirmationMessage', - data.record.name - ); - }, - action: function (data) { - _identityRoleAppService - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - }, - }, - ], - }, - }, - { - data: 'name', - render: function (data, type, row) { - var name = '' + data + ''; - if (row.isDefault) { - name += - '' + - l('DisplayName:IsDefault') + - ''; - } - if (row.isPublic) { - name += - '' + - l('DisplayName:IsPublic') + - ''; - } - return name; - }, - }, - ], - }) - ); + var _dataTable = _$table.DataTable( + abp.libs.datatables.normalizeConfiguration({ + order: [[1, 'asc']], + searching: false, + processing: true, + serverSide: true, + scrollX: true, + paging: true, + ajax: abp.libs.datatables.createAjax( + _identityRoleAppService.getList + ), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('Edit'), + visible: abp.auth.isGranted( + 'AbpIdentity.Roles.Update' + ), + action: function (data) { + _editModal.open({ + id: data.record.id, + }); + }, + }, + { + text: l('Permissions'), + visible: abp.auth.isGranted( + 'AbpIdentity.Roles.ManagePermissions' + ), + action: function (data) { + _permissionsModal.open({ + providerName: 'R', + providerKey: data.record.name, + }); + }, + }, + { + text: l('Delete'), + visible: function (data) { + return ( + !data.isStatic && + abp.auth.isGranted( + 'AbpIdentity.Roles.Delete' + ) + ); //TODO: Check permission + }, + confirmMessage: function (data) { + return l( + 'RoleDeletionConfirmationMessage', + data.record.name + ); + }, + action: function (data) { + _identityRoleAppService + .delete(data.record.id) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + ], + }, + }, + { + data: 'name', + render: function (data, type, row) { + var name = '' + data + ''; + if (row.isDefault) { + name += + '' + + l('DisplayName:IsDefault') + + ''; + } + if (row.isPublic) { + name += + '' + + l('DisplayName:IsPublic') + + ''; + } + return name; + }, + }, + ], + }) + ); - _createModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _createModal.onResult(function () { + _dataTable.ajax.reload(); + }); - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _editModal.onResult(function () { + _dataTable.ajax.reload(); + }); - _$wrapper.find('button[name=CreateRole]').click(function (e) { - e.preventDefault(); - _createModal.open(); - }); - }); + _$wrapper.find('button[name=CreateRole]').click(function (e) { + e.preventDefault(); + _createModal.open(); + }); + }); })(jQuery); diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js index 40e1c1b3c15..53f66ddb5ee 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js @@ -1,97 +1,103 @@ (function ($) { - var l = abp.localization.getResource('AbpIdentity'); + var l = abp.localization.getResource('AbpIdentity'); - var _identityUserAppService = volo.abp.identity.identityUser; - var _editModal = new abp.ModalManager( - abp.appPath + 'Identity/Users/EditModal' - ); - var _createModal = new abp.ModalManager( - abp.appPath + 'Identity/Users/CreateModal' - ); - var _permissionsModal = new abp.ModalManager( - abp.appPath + 'AbpPermissionManagement/PermissionManagementModal' - ); + var _identityUserAppService = volo.abp.identity.identityUser; + var _editModal = new abp.ModalManager( + abp.appPath + 'Identity/Users/EditModal' + ); + var _createModal = new abp.ModalManager( + abp.appPath + 'Identity/Users/CreateModal' + ); + var _permissionsModal = new abp.ModalManager( + abp.appPath + 'AbpPermissionManagement/PermissionManagementModal' + ); - $(function () { - var _$wrapper = $('#IdentityUsersWrapper'); - var _$table = _$wrapper.find('table'); - var _dataTable = _$table.DataTable( - abp.libs.datatables.normalizeConfiguration({ - order: [[1, 'asc']], - processing: true, - serverSide: true, - scrollX: true, - paging: true, - ajax: abp.libs.datatables.createAjax(_identityUserAppService.getList), - columnDefs: [ - { - rowAction: { - items: [ - { - text: l('Edit'), - visible: abp.auth.isGranted('AbpIdentity.Users.Update'), - action: function (data) { - _editModal.open({ - id: data.record.id, - }); - }, - }, - { - text: l('Permissions'), - visible: abp.auth.isGranted( - 'AbpIdentity.Users.ManagePermissions' - ), - action: function (data) { - _permissionsModal.open({ - providerName: 'U', - providerKey: data.record.id, - }); - }, - }, - { - text: l('Delete'), - visible: abp.auth.isGranted('AbpIdentity.Users.Delete'), - confirmMessage: function (data) { - return l( - 'UserDeletionConfirmationMessage', - data.record.userName - ); - }, - action: function (data) { - _identityUserAppService - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - }, - }, - ], - }, - }, - { - data: 'userName', - }, - { - data: 'email', - }, - { - data: 'phoneNumber', - }, - ], - }) - ); + $(function () { + var _$wrapper = $('#IdentityUsersWrapper'); + var _$table = _$wrapper.find('table'); + var _dataTable = _$table.DataTable( + abp.libs.datatables.normalizeConfiguration({ + order: [[1, 'asc']], + processing: true, + serverSide: true, + scrollX: true, + paging: true, + ajax: abp.libs.datatables.createAjax( + _identityUserAppService.getList + ), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('Edit'), + visible: abp.auth.isGranted( + 'AbpIdentity.Users.Update' + ), + action: function (data) { + _editModal.open({ + id: data.record.id, + }); + }, + }, + { + text: l('Permissions'), + visible: abp.auth.isGranted( + 'AbpIdentity.Users.ManagePermissions' + ), + action: function (data) { + _permissionsModal.open({ + providerName: 'U', + providerKey: data.record.id, + }); + }, + }, + { + text: l('Delete'), + visible: abp.auth.isGranted( + 'AbpIdentity.Users.Delete' + ), + confirmMessage: function (data) { + return l( + 'UserDeletionConfirmationMessage', + data.record.userName + ); + }, + action: function (data) { + _identityUserAppService + .delete(data.record.id) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + ], + }, + }, + { + data: 'userName', + }, + { + data: 'email', + }, + { + data: 'phoneNumber', + }, + ], + }) + ); - _createModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _createModal.onResult(function () { + _dataTable.ajax.reload(); + }); - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _editModal.onResult(function () { + _dataTable.ajax.reload(); + }); - _$wrapper.find('button[name=CreateUser]').click(function (e) { - e.preventDefault(); - _createModal.open(); - }); - }); + _$wrapper.find('button[name=CreateUser]').click(function (e) { + e.preventDefault(); + _createModal.open(); + }); + }); })(jQuery); diff --git a/modules/identityserver/.prettierrc b/modules/identityserver/.prettierrc new file mode 100644 index 00000000000..56af76bd946 --- /dev/null +++ b/modules/identityserver/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/modules/permission-management/.prettierrc b/modules/permission-management/.prettierrc index 7d1b8aa7216..34a0e1ecde4 100644 --- a/modules/permission-management/.prettierrc +++ b/modules/permission-management/.prettierrc @@ -1,4 +1,5 @@ { - "singleQuote": true, - "useTabs": true + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js index 6cba3cdb353..ca03b5abae7 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js @@ -1,268 +1,260 @@ var abp = abp || {}; (function ($) { - abp.modals = abp.modals || {}; + abp.modals = abp.modals || {}; - abp.modals.PermissionManagement = function () { - function checkParents($tab, $checkBox) { - var parentName = $checkBox - .closest('.custom-checkbox') - .attr('data-parent-name'); - if (!parentName) { - return; - } + abp.modals.PermissionManagement = function () { + function checkParents($tab, $checkBox) { + var parentName = $checkBox + .closest('.custom-checkbox') + .attr('data-parent-name'); + if (!parentName) { + return; + } - $tab - .find('.custom-checkbox') - .filter('[data-permission-name="' + parentName + '"]') - .find('input[type="checkbox"]') - .each(function () { - var $parent = $(this); - $parent.prop('checked', true); - checkParents($tab, $parent); - }); - } + $tab.find('.custom-checkbox') + .filter('[data-permission-name="' + parentName + '"]') + .find('input[type="checkbox"]') + .each(function () { + var $parent = $(this); + $parent.prop('checked', true); + checkParents($tab, $parent); + }); + } - function uncheckChildren($tab, $checkBox) { - var permissionName = $checkBox - .closest('.custom-checkbox') - .attr('data-permission-name'); - if (!permissionName) { - return; - } + function uncheckChildren($tab, $checkBox) { + var permissionName = $checkBox + .closest('.custom-checkbox') + .attr('data-permission-name'); + if (!permissionName) { + return; + } - $tab - .find('.custom-checkbox') - .filter('[data-parent-name="' + permissionName + '"]') - .find('input[type="checkbox"]') - .each(function () { - var $child = $(this); - $child.prop('checked', false); - uncheckChildren($tab, $child); - }); - } + $tab.find('.custom-checkbox') + .filter('[data-parent-name="' + permissionName + '"]') + .find('input[type="checkbox"]') + .each(function () { + var $child = $(this); + $child.prop('checked', false); + uncheckChildren($tab, $child); + }); + } - function handleTabCheckedCheckboxCount($tab) { - var newCount = 0; - $tab - .find('input[type="checkbox"]') - .not('[name="SelectAllInThisTab"]') - .each(function () { - if ($(this).is(':checked') === true) { - newCount++; - } - }); + function handleTabCheckedCheckboxCount($tab) { + var newCount = 0; + $tab.find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]') + .each(function () { + if ($(this).is(':checked') === true) { + newCount++; + } + }); - var $tabTitle = $('#' + $tab.attr('id') + '-tab'); - var title = $tabTitle - .html() - .replace('', '') - .replace('', '') - .replace('', '') - .replace('', ''); + var $tabTitle = $('#' + $tab.attr('id') + '-tab'); + var title = $tabTitle + .html() + .replace('', '') + .replace('', '') + .replace('', '') + .replace('', ''); - var titleSplitted = title.split(' '); - if (titleSplitted[titleSplitted.length - 1].startsWith('(')) { - titleSplitted.pop(); - } - var titleWithoutCount = titleSplitted.join(' '); - var newTitle = titleWithoutCount + ' (' + newCount + ')'; - if (newCount > 0) { - newTitle = '' + newTitle + ''; - } else { - newTitle = '' + newTitle + ''; - } - $tabTitle.html(newTitle); - } + var titleSplitted = title.split(' '); + if (titleSplitted[titleSplitted.length - 1].startsWith('(')) { + titleSplitted.pop(); + } + var titleWithoutCount = titleSplitted.join(' '); + var newTitle = titleWithoutCount + ' (' + newCount + ')'; + if (newCount > 0) { + newTitle = '' + newTitle + ''; + } else { + newTitle = '' + newTitle + ''; + } + $tabTitle.html(newTitle); + } - function handleUncheck($tab) { - var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); + function handleUncheck($tab) { + var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); - if ($checkBox.is(':checked')) { - if ( - $tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]') - .length > 1 - ) { - $($checkBox).prop('indeterminate', true); - } else { - $checkBox.prop('checked', false); - } - } else if ($checkBox.is(':indeterminate')) { - var allUnchecked = true; + if ($checkBox.is(':checked')) { + if ( + $tab + .find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]').length > 1 + ) { + $($checkBox).prop('indeterminate', true); + } else { + $checkBox.prop('checked', false); + } + } else if ($checkBox.is(':indeterminate')) { + var allUnchecked = true; - $tab - .find('input[type="checkbox"]') - .not('[name="SelectAllInThisTab"]') - .each(function () { - if ($(this).is(':checked') === true) { - allUnchecked = false; - } - }); + $tab.find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]') + .each(function () { + if ($(this).is(':checked') === true) { + allUnchecked = false; + } + }); - if (allUnchecked) { - $($checkBox).prop('indeterminate', false); - $checkBox.prop('checked', false); - } - } - } + if (allUnchecked) { + $($checkBox).prop('indeterminate', false); + $checkBox.prop('checked', false); + } + } + } - function handleCheck($tab) { - var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); + function handleCheck($tab) { + var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); - var allChecked = true; + var allChecked = true; - $tab - .find('input[type="checkbox"]') - .not('[name="SelectAllInThisTab"]') - .each(function () { - if ($(this).is(':checked') === false) { - allChecked = false; - } - }); + $tab.find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]') + .each(function () { + if ($(this).is(':checked') === false) { + allChecked = false; + } + }); - if (allChecked) { - $($checkBox).prop('indeterminate', false); - $checkBox.prop('checked', true); - } else { - $($checkBox).prop('indeterminate', true); - } - } + if (allChecked) { + $($checkBox).prop('indeterminate', false); + $checkBox.prop('checked', true); + } else { + $($checkBox).prop('indeterminate', true); + } + } - function initSelectAllInThisTab() { - var tabs = $('.tab-pane'); - for (var i = 0; i < tabs.length; i++) { - var $tab = $(tabs[i]); - var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); + function initSelectAllInThisTab() { + var tabs = $('.tab-pane'); + for (var i = 0; i < tabs.length; i++) { + var $tab = $(tabs[i]); + var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); - var allChecked = true; - var allUnChecked = true; + var allChecked = true; + var allUnChecked = true; - $tab - .find('input[type="checkbox"]') - .not('[name="SelectAllInThisTab"]') - .each(function () { - if ($(this).is(':checked') === true) { - allUnChecked = false; - } else { - allChecked = false; - } - }); + $tab.find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]') + .each(function () { + if ($(this).is(':checked') === true) { + allUnChecked = false; + } else { + allChecked = false; + } + }); - if (allChecked) { - $($checkBox).prop('checked', true); - } else if (allUnChecked) { - $($checkBox).prop('checked', false); - } else { - $($checkBox).prop('indeterminate', true); - } - } - } + if (allChecked) { + $($checkBox).prop('checked', true); + } else if (allUnChecked) { + $($checkBox).prop('checked', false); + } else { + $($checkBox).prop('indeterminate', true); + } + } + } - function setSelectAllInAllTabs() { - var $checkBox = $('#SelectAllInAllTabs'); + function setSelectAllInAllTabs() { + var $checkBox = $('#SelectAllInAllTabs'); - var anyIndeterminate = false; - var allChecked = true; - var allUnChecked = true; + var anyIndeterminate = false; + var allChecked = true; + var allUnChecked = true; - $('input[name="SelectAllInThisTab"]').each(function () { - if ($(this).is(':checked') === true) { - allUnChecked = false; - } else { - allChecked = false; - } + $('input[name="SelectAllInThisTab"]').each(function () { + if ($(this).is(':checked') === true) { + allUnChecked = false; + } else { + allChecked = false; + } - if ($(this).is(':indeterminate') === true) { - anyIndeterminate = true; - } - }); + if ($(this).is(':indeterminate') === true) { + anyIndeterminate = true; + } + }); - if (anyIndeterminate) { - $($checkBox).prop('indeterminate', true); - return; - } else { - $($checkBox).prop('indeterminate', false); - } + if (anyIndeterminate) { + $($checkBox).prop('indeterminate', true); + return; + } else { + $($checkBox).prop('indeterminate', false); + } - if (allChecked) { - $($checkBox).prop('checked', true); - } else if (allUnChecked) { - $($checkBox).prop('checked', false); - } else { - $($checkBox).prop('indeterminate', true); - } - } + if (allChecked) { + $($checkBox).prop('checked', true); + } else if (allUnChecked) { + $($checkBox).prop('checked', false); + } else { + $($checkBox).prop('indeterminate', true); + } + } - this.initDom = function ($el) { - $el.find('.tab-pane').each(function () { - var $tab = $(this); - handleTabCheckedCheckboxCount($tab); - $tab - .find('input[type="checkbox"]') - .not('[name="SelectAllInThisTab"]') - .each(function () { - var $checkBox = $(this); - $checkBox.change(function () { - if ($checkBox.is(':checked')) { - checkParents($tab, $checkBox); - handleCheck($tab); - } else { - uncheckChildren($tab, $checkBox); - handleUncheck($tab); - } - setSelectAllInAllTabs(); - handleTabCheckedCheckboxCount($tab); - }); - }); - }); + this.initDom = function ($el) { + $el.find('.tab-pane').each(function () { + var $tab = $(this); + handleTabCheckedCheckboxCount($tab); + $tab.find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]') + .each(function () { + var $checkBox = $(this); + $checkBox.change(function () { + if ($checkBox.is(':checked')) { + checkParents($tab, $checkBox); + handleCheck($tab); + } else { + uncheckChildren($tab, $checkBox); + handleUncheck($tab); + } + setSelectAllInAllTabs(); + handleTabCheckedCheckboxCount($tab); + }); + }); + }); - $('input[name="SelectAllInThisTab"]').change(function () { - var $checkBox = $(this); - var $tab = $('#' + $checkBox.attr('data-tab-id')); - if ($checkBox.is(':checked')) { - $tab - .find('input[type="checkbox"]') - .not(':disabled') - .prop('checked', true); - } else { - $tab - .find('input[type="checkbox"]') - .not(':disabled') - .prop('checked', false); - } - $($checkBox).prop('indeterminate', false); - setSelectAllInAllTabs(); - handleTabCheckedCheckboxCount($tab); - }); + $('input[name="SelectAllInThisTab"]').change(function () { + var $checkBox = $(this); + var $tab = $('#' + $checkBox.attr('data-tab-id')); + if ($checkBox.is(':checked')) { + $tab.find('input[type="checkbox"]') + .not(':disabled') + .prop('checked', true); + } else { + $tab.find('input[type="checkbox"]') + .not(':disabled') + .prop('checked', false); + } + $($checkBox).prop('indeterminate', false); + setSelectAllInAllTabs(); + handleTabCheckedCheckboxCount($tab); + }); - $('input[name="SelectAllInAllTabs"]').change(function () { - var $checkBox = $(this); - if ($checkBox.is(':checked')) { - $('.tab-pane input[type="checkbox"]') - .not(':disabled') - .prop('checked', true); - } else { - $('.tab-pane input[type="checkbox"]') - .not(':disabled') - .prop('checked', false); - } - $($checkBox).prop('indeterminate', false); + $('input[name="SelectAllInAllTabs"]').change(function () { + var $checkBox = $(this); + if ($checkBox.is(':checked')) { + $('.tab-pane input[type="checkbox"]') + .not(':disabled') + .prop('checked', true); + } else { + $('.tab-pane input[type="checkbox"]') + .not(':disabled') + .prop('checked', false); + } + $($checkBox).prop('indeterminate', false); - $el.find('.tab-pane').each(function () { - handleTabCheckedCheckboxCount($(this)); - }); - }); + $el.find('.tab-pane').each(function () { + handleTabCheckedCheckboxCount($(this)); + }); + }); - $(function () { - $('.custom-scroll-content').mCustomScrollbar({ - theme: 'minimal-dark', - }); - $('.custom-scroll-container > .col-4').mCustomScrollbar({ - theme: 'minimal-dark', - }); - }); + $(function () { + $('.custom-scroll-content').mCustomScrollbar({ + theme: 'minimal-dark', + }); + $('.custom-scroll-container > .col-4').mCustomScrollbar({ + theme: 'minimal-dark', + }); + }); - initSelectAllInThisTab(); - setSelectAllInAllTabs(); - }; - }; + initSelectAllInThisTab(); + setSelectAllInAllTabs(); + }; + }; })(jQuery); diff --git a/modules/setting-management/.prettierrc b/modules/setting-management/.prettierrc index 7d1b8aa7216..34a0e1ecde4 100644 --- a/modules/setting-management/.prettierrc +++ b/modules/setting-management/.prettierrc @@ -1,4 +1,5 @@ { - "singleQuote": true, - "useTabs": true + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js index 6a72d6872ef..32ea1a27cc1 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js @@ -1,7 +1,7 @@ (function ($) { - var l = abp.localization.getResource('AbpSettingManagement'); + var l = abp.localization.getResource('AbpSettingManagement'); - $(document).on('AbpSettingSaved', function () { - abp.notify.success(l('SuccessfullySaved')); - }); + $(document).on('AbpSettingSaved', function () { + abp.notify.success(l('SuccessfullySaved')); + }); })(jQuery); diff --git a/modules/tenant-management/.prettierrc b/modules/tenant-management/.prettierrc index 7d1b8aa7216..34a0e1ecde4 100644 --- a/modules/tenant-management/.prettierrc +++ b/modules/tenant-management/.prettierrc @@ -1,4 +1,5 @@ { - "singleQuote": true, - "useTabs": true + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.js b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.js index 0fdba0a6607..de01d1cfdd3 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.js +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.js @@ -1,18 +1,20 @@ (function ($) { - abp.modals.TenantConnectionStringManagement = function () { - var initModal = function (publicApi, args) { - publicApi - .getModal() - .find('input[name="Tenant.UseSharedDatabase"]') - .change(function () { - var $this = $(this); - $('#Tenant_DefaultConnectionString_Wrap').toggleClass('d-none'); - $this.val($this.prop('checked')); - }); - }; + abp.modals.TenantConnectionStringManagement = function () { + var initModal = function (publicApi, args) { + publicApi + .getModal() + .find('input[name="Tenant.UseSharedDatabase"]') + .change(function () { + var $this = $(this); + $('#Tenant_DefaultConnectionString_Wrap').toggleClass( + 'd-none' + ); + $this.val($this.prop('checked')); + }); + }; - return { - initModal: initModal, - }; - }; + return { + initModal: initModal, + }; + }; })(jQuery); diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.js b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.js index c3f00dcd242..65fedcad230 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.js +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.js @@ -1,108 +1,111 @@ (function () { - var l = abp.localization.getResource('AbpTenantManagement'); - var _tenantAppService = volo.abp.tenantManagement.tenant; + var l = abp.localization.getResource('AbpTenantManagement'); + var _tenantAppService = volo.abp.tenantManagement.tenant; - var _editModal = new abp.ModalManager( - abp.appPath + 'TenantManagement/Tenants/EditModal' - ); - var _createModal = new abp.ModalManager( - abp.appPath + 'TenantManagement/Tenants/CreateModal' - ); - var _featuresModal = new abp.ModalManager( - abp.appPath + 'FeatureManagement/FeatureManagementModal' - ); - var _connectionStringsModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'TenantManagement/Tenants/ConnectionStringsModal', - modalClass: 'TenantConnectionStringManagement', - }); + var _editModal = new abp.ModalManager( + abp.appPath + 'TenantManagement/Tenants/EditModal' + ); + var _createModal = new abp.ModalManager( + abp.appPath + 'TenantManagement/Tenants/CreateModal' + ); + var _featuresModal = new abp.ModalManager( + abp.appPath + 'FeatureManagement/FeatureManagementModal' + ); + var _connectionStringsModal = new abp.ModalManager({ + viewUrl: + abp.appPath + 'TenantManagement/Tenants/ConnectionStringsModal', + modalClass: 'TenantConnectionStringManagement', + }); - $(function () { - var _$wrapper = $('#TenantsWrapper'); + $(function () { + var _$wrapper = $('#TenantsWrapper'); - var _dataTable = _$wrapper.find('table').DataTable( - abp.libs.datatables.normalizeConfiguration({ - order: [[1, 'asc']], - processing: true, - paging: true, - scrollX: true, - serverSide: true, - ajax: abp.libs.datatables.createAjax(_tenantAppService.getList), - columnDefs: [ - { - rowAction: { - items: [ - { - text: l('Edit'), - visible: abp.auth.isGranted( - 'AbpTenantManagement.Tenants.Update' - ), - action: function (data) { - _editModal.open({ - id: data.record.id, - }); - }, - }, - { - text: l('ConnectionStrings'), - visible: abp.auth.isGranted( - 'AbpTenantManagement.Tenants.ManageConnectionStrings' - ), - action: function (data) { - _connectionStringsModal.open({ - id: data.record.id, - }); - }, - }, - { - text: l('Features'), - visible: abp.auth.isGranted( - 'AbpTenantManagement.Tenants.ManageFeatures' - ), - action: function (data) { - _featuresModal.open({ - providerName: 'T', - providerKey: data.record.id, - }); - }, - }, - { - text: l('Delete'), - visible: abp.auth.isGranted( - 'AbpTenantManagement.Tenants.Delete' - ), - confirmMessage: function (data) { - return l( - 'TenantDeletionConfirmationMessage', - data.record.name - ); - }, - action: function (data) { - _tenantAppService.delete(data.record.id).then(function () { - _dataTable.ajax.reload(); - }); - }, - }, - ], - }, - }, - { - data: 'name', - }, - ], - }) - ); + var _dataTable = _$wrapper.find('table').DataTable( + abp.libs.datatables.normalizeConfiguration({ + order: [[1, 'asc']], + processing: true, + paging: true, + scrollX: true, + serverSide: true, + ajax: abp.libs.datatables.createAjax(_tenantAppService.getList), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('Edit'), + visible: abp.auth.isGranted( + 'AbpTenantManagement.Tenants.Update' + ), + action: function (data) { + _editModal.open({ + id: data.record.id, + }); + }, + }, + { + text: l('ConnectionStrings'), + visible: abp.auth.isGranted( + 'AbpTenantManagement.Tenants.ManageConnectionStrings' + ), + action: function (data) { + _connectionStringsModal.open({ + id: data.record.id, + }); + }, + }, + { + text: l('Features'), + visible: abp.auth.isGranted( + 'AbpTenantManagement.Tenants.ManageFeatures' + ), + action: function (data) { + _featuresModal.open({ + providerName: 'T', + providerKey: data.record.id, + }); + }, + }, + { + text: l('Delete'), + visible: abp.auth.isGranted( + 'AbpTenantManagement.Tenants.Delete' + ), + confirmMessage: function (data) { + return l( + 'TenantDeletionConfirmationMessage', + data.record.name + ); + }, + action: function (data) { + _tenantAppService + .delete(data.record.id) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + ], + }, + }, + { + data: 'name', + }, + ], + }) + ); - _createModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _createModal.onResult(function () { + _dataTable.ajax.reload(); + }); - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _editModal.onResult(function () { + _dataTable.ajax.reload(); + }); - _$wrapper.find('button[name=CreateTenant]').click(function (e) { - e.preventDefault(); - _createModal.open(); - }); - }); + _$wrapper.find('button[name=CreateTenant]').click(function (e) { + e.preventDefault(); + _createModal.open(); + }); + }); })(); diff --git a/modules/users/.prettierrc b/modules/users/.prettierrc new file mode 100644 index 00000000000..56af76bd946 --- /dev/null +++ b/modules/users/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/modules/virtual-file-explorer/.prettierrc b/modules/virtual-file-explorer/.prettierrc index 7d1b8aa7216..56af76bd946 100644 --- a/modules/virtual-file-explorer/.prettierrc +++ b/modules/virtual-file-explorer/.prettierrc @@ -1,4 +1,5 @@ { "singleQuote": true, - "useTabs": true + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/index.js b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/index.js index e535b810e8d..0e05e3be4bc 100644 --- a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/index.js +++ b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/index.js @@ -1,9 +1,9 @@ var _fileContentModal = new abp.ModalManager( - abp.appPath + 'VirtualFileExplorer/FileContentModal' + abp.appPath + 'VirtualFileExplorer/FileContentModal' ); function showContent(filePath) { - _fileContentModal.open({ - filePath: filePath, - }); + _fileContentModal.open({ + filePath: filePath, + }); }