From 0358b6bf80602b4f0bc45f857250b35c8d5daf20 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 6 May 2022 11:52:08 -0400 Subject: [PATCH] feat(community): make on request comm a check box and remove ensOnly Fixes #5660 --- .../modules/main/chat_section/controller.nim | 2 - .../main/chat_section/io_interface.nim | 2 +- src/app/modules/main/chat_section/module.nim | 4 +- src/app/modules/main/chat_section/view.nim | 4 +- .../modules/main/communities/controller.nim | 2 - .../modules/main/communities/io_interface.nim | 2 +- src/app/modules/main/communities/module.nim | 4 +- src/app/modules/main/communities/view.nim | 4 +- src/app_service/service/community/service.nim | 4 - src/backend/communities.nim | 6 +- .../popups/community/CreateCommunityPopup.qml | 112 ++---------- .../community/MembershipRequirementPopup.qml | 167 ------------------ ui/app/AppLayouts/Chat/stores/RootStore.qml | 4 +- .../Chat/views/CommunitySettingsView.qml | 1 - ui/app/AppLayouts/stores/RootStore.qml | 4 +- 15 files changed, 34 insertions(+), 288 deletions(-) delete mode 100644 ui/app/AppLayouts/Chat/popups/community/MembershipRequirementPopup.qml diff --git a/src/app/modules/main/chat_section/controller.nim b/src/app/modules/main/chat_section/controller.nim index d6fcd06fd8..93a21744f3 100644 --- a/src/app/modules/main/chat_section/controller.nim +++ b/src/app/modules/main/chat_section/controller.nim @@ -378,7 +378,6 @@ proc editCommunity*( name: string, description: string, access: int, - ensOnly: bool, color: string, imageUrl: string, aX: int, aY: int, bX: int, bY: int, @@ -388,7 +387,6 @@ proc editCommunity*( name, description, access, - ensOnly, color, imageUrl, aX, aY, bX, bY, diff --git a/src/app/modules/main/chat_section/io_interface.nim b/src/app/modules/main/chat_section/io_interface.nim index ec8fdf847d..ae8c4fa7c4 100644 --- a/src/app/modules/main/chat_section/io_interface.nim +++ b/src/app/modules/main/chat_section/io_interface.nim @@ -241,7 +241,7 @@ method removeUserFromCommunity*(self: AccessInterface, pubKey: string) {.base.} method banUserFromCommunity*(self: AccessInterface, pubKey: string) {.base.} = raise newException(ValueError, "No implementation available") -method editCommunity*(self: AccessInterface, name: string, description: string, access: int, ensOnly: bool, color: string, imagePath: string, aX: int, aY: int, bX: int, bY: int, historyArchiveSupportEnabled: bool) {.base.} = +method editCommunity*(self: AccessInterface, name: string, description: string, access: int, color: string, imagePath: string, aX: int, aY: int, bX: int, bY: int, historyArchiveSupportEnabled: bool) {.base.} = raise newException(ValueError, "No implementation available") method exportCommunity*(self: AccessInterface): string {.base.} = diff --git a/src/app/modules/main/chat_section/module.nim b/src/app/modules/main/chat_section/module.nim index 25c00a65c9..6da8e0d42d 100644 --- a/src/app/modules/main/chat_section/module.nim +++ b/src/app/modules/main/chat_section/module.nim @@ -728,10 +728,10 @@ method banUserFromCommunity*(self: Module, pubKey: string) = self.controller.banUserFromCommunity(pubkey) method editCommunity*(self: Module, name: string, description: string, - access: int, ensOnly: bool, color: string, + access: int, color: string, imagePath: string, aX: int, aY: int, bX: int, bY: int, historyArchiveSupportEnabled: bool) = - self.controller.editCommunity(name, description, access, ensOnly, color, imagePath, aX, aY, bX, bY, historyArchiveSupportEnabled) + self.controller.editCommunity(name, description, access, color, imagePath, aX, aY, bX, bY, historyArchiveSupportEnabled) method exportCommunity*(self: Module): string = self.controller.exportCommunity() diff --git a/src/app/modules/main/chat_section/view.nim b/src/app/modules/main/chat_section/view.nim index 48b1a20451..84ad6d4285 100644 --- a/src/app/modules/main/chat_section/view.nim +++ b/src/app/modules/main/chat_section/view.nim @@ -244,8 +244,8 @@ QtObject: proc banUserFromCommunity*(self: View, pubKey: string) {.slot.} = self.delegate.banUserFromCommunity(pubKey) - proc editCommunity*(self: View, name: string, description: string, access: int, ensOnly: bool, color: string, imagePath: string, aX: int, aY: int, bX: int, bY: int, historyArchiveSupportEnabled: bool) {.slot.} = - self.delegate.editCommunity(name, description, access, ensOnly, color, imagePath, aX, aY, bX, bY, historyArchiveSupportEnabled) + proc editCommunity*(self: View, name: string, description: string, access: int, color: string, imagePath: string, aX: int, aY: int, bX: int, bY: int, historyArchiveSupportEnabled: bool) {.slot.} = + self.delegate.editCommunity(name, description, access, color, imagePath, aX, aY, bX, bY, historyArchiveSupportEnabled) proc exportCommunity*(self: View): string {.slot.} = self.delegate.exportCommunity() diff --git a/src/app/modules/main/communities/controller.nim b/src/app/modules/main/communities/controller.nim index bd31f42f8b..5922787678 100644 --- a/src/app/modules/main/communities/controller.nim +++ b/src/app/modules/main/communities/controller.nim @@ -67,7 +67,6 @@ proc createCommunity*( name: string, description: string, access: int, - ensOnly: bool, color: string, imageUrl: string, aX: int, aY: int, bX: int, bY: int, @@ -76,7 +75,6 @@ proc createCommunity*( name, description, access, - ensOnly, color, imageUrl, aX, aY, bX, bY, diff --git a/src/app/modules/main/communities/io_interface.nim b/src/app/modules/main/communities/io_interface.nim index b8f2c9142a..d8bbedb1da 100644 --- a/src/app/modules/main/communities/io_interface.nim +++ b/src/app/modules/main/communities/io_interface.nim @@ -22,7 +22,7 @@ method getCommunityItem*(self: AccessInterface, community: CommunityDto): Sectio method joinCommunity*(self: AccessInterface, communityId: string): string {.base.} = raise newException(ValueError, "No implementation available") -method createCommunity*(self: AccessInterface, name: string, description: string, access: int, ensOnly: bool, color: string, imagePath: string, aX: int, aY: int, bX: int, bY: int, historyArchiveSupportEnabled: bool) {.base.} = +method createCommunity*(self: AccessInterface, name: string, description: string, access: int, color: string, imagePath: string, aX: int, aY: int, bX: int, bY: int, historyArchiveSupportEnabled: bool) {.base.} = raise newException(ValueError, "No implementation available") method deleteCommunityCategory*(self: AccessInterface, communityId: string, categoryId: string) {.base.} = diff --git a/src/app/modules/main/communities/module.nim b/src/app/modules/main/communities/module.nim index 9c619b2fd4..936cb42951 100644 --- a/src/app/modules/main/communities/module.nim +++ b/src/app/modules/main/communities/module.nim @@ -146,11 +146,11 @@ method communityCategoryDeleted*(self: Module) = discard method createCommunity*(self: Module, name: string, description: string, - access: int, ensOnly: bool, color: string, + access: int, color: string, imagePath: string, aX: int, aY: int, bX: int, bY: int, historyArchiveSupportEnabled: bool) = - self.controller.createCommunity(name, description, access, ensOnly, color, imagePath, aX, aY, bX, bY, historyArchiveSupportEnabled) + self.controller.createCommunity(name, description, access, color, imagePath, aX, aY, bX, bY, historyArchiveSupportEnabled) method deleteCommunityCategory*(self: Module, communityId: string, categoryId: string) = self.controller.deleteCommunityCategory(communityId, categoryId) diff --git a/src/app/modules/main/communities/view.nim b/src/app/modules/main/communities/view.nim index aaed8eea65..8d201e3cc9 100644 --- a/src/app/modules/main/communities/view.nim +++ b/src/app/modules/main/communities/view.nim @@ -66,11 +66,11 @@ QtObject: result = self.delegate.joinCommunity(communityId) proc createCommunity*(self: View, name: string, description: string, - access: int, ensOnly: bool, color: string, + access: int, color: string, imagePath: string, aX: int, aY: int, bX: int, bY: int, historyArchiveSupportEnabled: bool) {.slot.} = - self.delegate.createCommunity(name, description, access, ensOnly, color, imagePath, aX, aY, bX, bY, historyArchiveSupportEnabled) + self.delegate.createCommunity(name, description, access, color, imagePath, aX, aY, bX, bY, historyArchiveSupportEnabled) proc deleteCommunityCategory*(self: View, communityId: string, categoryId: string): string {.slot.} = self.delegate.deleteCommunityCategory(communityId, categoryId) diff --git a/src/app_service/service/community/service.nim b/src/app_service/service/community/service.nim index 3d83009dd1..f317161551 100644 --- a/src/app_service/service/community/service.nim +++ b/src/app_service/service/community/service.nim @@ -528,7 +528,6 @@ QtObject: name: string, description: string, access: int, - ensOnly: bool, color: string, imageUrl: string, aX: int, aY: int, bX: int, bY: int, @@ -539,7 +538,6 @@ QtObject: name, description, access, - ensOnly, color, image, aX, aY, bX, bY, @@ -568,7 +566,6 @@ QtObject: name: string, description: string, access: int, - ensOnly: bool, color: string, imageUrl: string, aX: int, aY: int, bX: int, bY: int, @@ -580,7 +577,6 @@ QtObject: name, description, access, - ensOnly, color, image, aX, aY, bX, bY, diff --git a/src/backend/communities.nim b/src/backend/communities.nim index f72d47b182..ab16f8826c 100644 --- a/src/backend/communities.nim +++ b/src/backend/communities.nim @@ -33,7 +33,6 @@ proc createCommunity*( name: string, description: string, access: int, - ensOnly: bool, color: string, imageUrl: string, aX: int, aY: int, bX: int, bY: int, @@ -44,7 +43,7 @@ proc createCommunity*( "Membership": access, "name": name, "description": description, - "ensOnly": ensOnly, + "ensOnly": false, # TODO ensOnly is no longer supported. Remove this when we remove it in status-go "color": color, "image": imageUrl, "imageAx": aX, @@ -59,7 +58,6 @@ proc editCommunity*( name: string, description: string, access: int, - ensOnly: bool, color: string, imageUrl: string, aX: int, @@ -74,7 +72,7 @@ proc editCommunity*( "Membership": access, "name": name, "description": description, - "ensOnly": ensOnly, + "ensOnly": false, # TODO ensOnly is no longer supported. Remove this when we remove it in status-go "color": color, "image": imageUrl, "imageAx": aX, diff --git a/ui/app/AppLayouts/Chat/popups/community/CreateCommunityPopup.qml b/ui/app/AppLayouts/Chat/popups/community/CreateCommunityPopup.qml index 85945d8336..fcf29a93a2 100644 --- a/ui/app/AppLayouts/Chat/popups/community/CreateCommunityPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/CreateCommunityPopup.qml @@ -37,9 +37,9 @@ StatusModal { if (community.largeImage) { contentItem.communityImage.selectedImage = community.largeImage } - membershipRequirementSettingPopup.checkedMembership = community.access + requestToJoinCheckbox.checked = community.access === Constants.communityChatOnRequestAccess } - contentItem.communityName.input.forceActiveFocus(Qt.MouseFocusReason) + contentItem.communityName.input.edit.forceActiveFocus() } onClosed: destroy() @@ -300,104 +300,35 @@ StatusModal { StatusListItem { anchors.horizontalCenter: parent.horizontalCenter - visible: !isEdit - //% "Membership requirement" - title: qsTrId("membership-title") - label: { - switch (membershipRequirementSettingPopup.checkedMembership) { - //% "Require invite from another member" - case Constants.communityChatInvitationOnlyAccess: return qsTrId("membership-invite") - //% "Require approval" - case Constants.communityChatOnRequestAccess: return qsTrId("membership-approval") - //% "No requirement" - default: return qsTrId("membership-free") + visible: popup.store.isCommunityHistoryArchiveSupportEnabled + title: qsTr("Community history service") + sensor.onClicked: { + if (popup.store.isCommunityHistoryArchiveSupportEnabled) { + historyArchiveSupportToggle.checked = !historyArchiveSupportToggle.checked } } - sensor.onClicked: membershipRequirementSettingPopup.open() components: [ - StatusIcon { - icon: "chevron-down" - rotation: 270 - color: Theme.palette.baseColor1 + StatusCheckBox { + id: historyArchiveSupportToggle + enabled: popup.store.isCommunityHistoryArchiveSupportEnabled + checked: isEdit ? community.historyArchiveSupportEnabled : false } ] } - StatusBaseText { - visible: !isEdit - height: visible ? implicitHeight : 0 - wrapMode: Text.WordWrap - font.pixelSize: 13 - color: Theme.palette.baseColor1 - width: parent.width * 0.78 - //% "You can require new members to meet certain criteria before they can join. This can be changed at any time" - text: qsTrId("membership-none-placeholder") - anchors.left: parent.left - anchors.leftMargin: 16 - } - StatusListItem { anchors.horizontalCenter: parent.horizontalCenter - visible: popup.store.isCommunityHistoryArchiveSupportEnabled - //% "Membership requirement" - title: qsTrId("History Archive Support") + title: qsTr("Request to join required") sensor.onClicked: { - if (popup.store.isCommunityHistoryArchiveSupportEnabled) { - historyArchiveSupportToggle.checked = !historyArchiveSupportToggle.checked - } + requestToJoinCheckbox.checked = !requestToJoinCheckbox.checked } components: [ - StatusSwitch { - id: historyArchiveSupportToggle - enabled: popup.store.isCommunityHistoryArchiveSupportEnabled - checked: isEdit ? community.historyArchiveSupportEnabled : false + StatusCheckBox { + id: requestToJoinCheckbox + checked: false } ] } - - // Feature commented temporarily - /* - StatusSettingsLineButton { - id: ensOnlySwitch - anchors.top: privateExplanation.bottom - anchors.topMargin: Style.current.padding - isEnabled: profileModel.profile.ensVerified - //% "Require ENS username" - text: qsTrId("membership-ens") - isSwitch: true - onClicked: switchChecked = checked - - StatusToolTip { - visible: !ensOnlySwitch.isEnabled && ensMouseArea.isHovered - //% "You can only enable this setting if you have an ENS name" - text: qsTrId("you-can-only-enable-this-setting-if-you-have-an-ens-name") - } - - MouseArea { - property bool isHovered: false - - id: ensMouseArea - enabled: !ensOnlySwitch.isEnabled - visible: enabled - anchors.fill: parent - hoverEnabled: true - onEntered: isHovered = true - onExited: isHovered = false - } - } - - StyledText { - visible: !isEdit - height: visible ? implicitHeight : 0 - id: ensExplanation - anchors.top: ensOnlySwitch.bottom - wrapMode: Text.WordWrap - anchors.topMargin: isEdit ? 0 : Style.current.halfPadding - width: parent.width - //% "Your community requires an ENS username to be able to join" - text: qsTrId("membership-ens-description") - } - */ } } @@ -434,8 +365,7 @@ StatusModal { error = communitySectionModule.editCommunity( Utils.filterXSS(popup.contentItem.communityName.input.text), Utils.filterXSS(popup.contentItem.communityDescription.input.text), - membershipRequirementSettingPopup.checkedMembership, - false, + requestToJoinCheckbox.checked ? Constants.communityChatOnRequestAccess : Constants.communityChatPublicAccess, popup.contentItem.communityColor.color.toString().toUpperCase(), // to retain the existing image, pass "" for the image path popup.contentItem.communityImage.selectedImage === community.largeImage ? "" : @@ -450,8 +380,7 @@ StatusModal { error = popup.store.createCommunity( Utils.filterXSS(popup.contentItem.communityName.input.text), Utils.filterXSS(popup.contentItem.communityDescription.input.text), - membershipRequirementSettingPopup.checkedMembership, - false, // ensOnlySwitch.switchChecked, // TODO: + requestToJoinCheckbox.checked ? Constants.communityChatOnRequestAccess : Constants.communityChatPublicAccess, popup.contentItem.communityColor.color.toString().toUpperCase(), popup.contentItem.communityImage.selectedImage, popup.contentItem.imageCropperModal.aX, @@ -479,10 +408,5 @@ StatusModal { icon: StandardIcon.Critical standardButtons: StandardButton.Ok } - - MembershipRequirementPopup { - anchors.centerIn: parent - id: membershipRequirementSettingPopup - } } diff --git a/ui/app/AppLayouts/Chat/popups/community/MembershipRequirementPopup.qml b/ui/app/AppLayouts/Chat/popups/community/MembershipRequirementPopup.qml deleted file mode 100644 index 822f6d20d6..0000000000 --- a/ui/app/AppLayouts/Chat/popups/community/MembershipRequirementPopup.qml +++ /dev/null @@ -1,167 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.3 - -import StatusQ.Core 0.1 -import StatusQ.Core.Theme 0.1 -import StatusQ.Components 0.1 -import StatusQ.Controls 0.1 -import StatusQ.Popups 0.1 - - -import utils 1.0 - -StatusModal { - property int checkedMembership: Constants.communityChatPublicAccess - - id: popup - - //% "Membership requirement" - header.title: qsTrId("membership-title") - - ButtonGroup { - id: membershipRequirementGroup - } - - contentItem: Column { - width: popup.width - spacing: 8 - - Item { - width: parent.width - height: parent.spacing - } - - StatusListItem { - anchors.horizontalCenter: parent.horizontalCenter - //% "Require approval" - title: qsTrId("membership-approval") - sensor.onClicked: requestAccessRadio.checked = true - components: [ - StatusRadioButton { - id: requestAccessRadio - checked: popup.checkedMembership === Constants.communityChatOnRequestAccess - ButtonGroup.group: membershipRequirementGroup - onCheckedChanged: { - if (checked) { - popup.checkedMembership = Constants.communityChatOnRequestAccess - } - } - } - ] - } - - StatusBaseText { - wrapMode: Text.WordWrap - font.pixelSize: 13 - color: Theme.palette.baseColor1 - width: parent.width * 0.78 - //% "Your community is free to join, but new members are required to be approved by the community creator first" - text: qsTrId("membership-approval-description") - anchors.left: parent.left - anchors.leftMargin: 32 - } - - // TODO: uncomment this when we want to re-enable requiring invite from another member - // for community creation - // StatusListItem { - // anchors.horizontalCenter: parent.horizontalCenter - // //% "Require invite from another member" - // title: qsTrId("membership-invite") - // sensor.onClicked: inviteOnlyRadio.checked = true - // components: [ - // StatusRadioButton { - // id: inviteOnlyRadio - // checked: popup.checkedMembership === Constants.communityChatInvitationOnlyAccess - // ButtonGroup.group: membershipRequirementGroup - // onCheckedChanged: { - // if (checked) { - // popup.checkedMembership = Constants.communityChatInvitationOnlyAccess - // } - // } - // } - // ] - // } - - StatusBaseText { - wrapMode: Text.WordWrap - font.pixelSize: 13 - color: Theme.palette.baseColor1 - width: parent.width * 0.78 - //% "Your community can only be joined by an invitation from existing community members" - text: qsTrId("membership-invite-description") - anchors.left: parent.left - anchors.leftMargin: 32 - } - - /* TODO: add functionality to configure this setting */ - /* StatusListItem { */ - /* anchors.horizontalCenter: parent.horizontalCenter */ - //% "Require ENS username" - /* title: qsTrId("membership-ens") */ - /* components: [ */ - /* StatusRadioButton { */ - /* checked: //... */ - /* ButtonGroup.group: membershipRequirementGroup */ - /* onCheckedChanged: { */ - /* // ... */ - /* } */ - /* } */ - /* ] */ - /* } */ - /* StatusBaseText { */ - /* wrapMode: Text.WordWrap */ - /* font.pixelSize: 13 */ - /* color: Theme.palette.baseColor1 */ - /* width: parent.width * 0.78 */ - //% "Your community requires an ENS username to be able to join" - /* text: qsTrId("membership-ens-description") */ - /* anchors.left: parent.left */ - /* anchors.leftMargin: 32 */ - /* } */ - - StatusListItem { - anchors.horizontalCenter: parent.horizontalCenter - //% "No requirement" - title: qsTrId("membership-free") - sensor.onClicked: publicRadio.checked = true - components: [ - StatusRadioButton { - id: publicRadio - checked: popup.checkedMembership === Constants.communityChatPublicAccess - ButtonGroup.group: membershipRequirementGroup - onCheckedChanged: { - if (checked) { - popup.checkedMembership = Constants.communityChatPublicAccess - } - } - } - ] - } - - StatusBaseText { - wrapMode: Text.WordWrap - font.pixelSize: 13 - color: Theme.palette.baseColor1 - width: parent.width * 0.78 - //% "Your community is free for anyone to join" - text: qsTrId("membership-free-description") - anchors.left: parent.left - anchors.leftMargin: 32 - } - - Item { - width: parent.width - height: parent.spacing - } - } - - leftButtons: [ - StatusRoundButton { - icon.name: "arrow-right" - icon.width: 20 - icon.height: 16 - rotation: 180 - onClicked: popup.close() - } - ] -} diff --git a/ui/app/AppLayouts/Chat/stores/RootStore.qml b/ui/app/AppLayouts/Chat/stores/RootStore.qml index 3246c790d1..1e53613994 100644 --- a/ui/app/AppLayouts/Chat/stores/RootStore.qml +++ b/ui/app/AppLayouts/Chat/stores/RootStore.qml @@ -230,8 +230,8 @@ QtObject { // Not Refactored Yet property var activeCommunityChatsModel: "" //chatsModelInst.communities.activeCommunity.chats - function createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY, historyArchiveSupportEnabled) { - communitiesModuleInst.createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY, historyArchiveSupportEnabled); + function createCommunity(communityName, communityDescription, checkedMembership, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY, historyArchiveSupportEnabled) { + communitiesModuleInst.createCommunity(communityName, communityDescription, checkedMembership, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY, historyArchiveSupportEnabled); } function importCommunity(communityKey) { diff --git a/ui/app/AppLayouts/Chat/views/CommunitySettingsView.qml b/ui/app/AppLayouts/Chat/views/CommunitySettingsView.qml index 6b05f726f2..a5bca36ea1 100644 --- a/ui/app/AppLayouts/Chat/views/CommunitySettingsView.qml +++ b/ui/app/AppLayouts/Chat/views/CommunitySettingsView.qml @@ -125,7 +125,6 @@ StatusAppTwoPanelLayout { Utils.filterXSS(item.name), Utils.filterXSS(item.description), root.community.access, - false, // FIXME item.color.toString().toUpperCase(), item.image === root.community.image ? "" : item.image, item.imageAx, diff --git a/ui/app/AppLayouts/stores/RootStore.qml b/ui/app/AppLayouts/stores/RootStore.qml index 602e32a3df..1bc0885aa2 100644 --- a/ui/app/AppLayouts/stores/RootStore.qml +++ b/ui/app/AppLayouts/stores/RootStore.qml @@ -60,8 +60,8 @@ QtObject { return profileSectionModule.ensUsernamesModule.getEtherscanLink() } - function createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY) { - communitiesModuleInst.createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); + function createCommunity(communityName, communityDescription, checkedMembership, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY) { + communitiesModuleInst.createCommunity(communityName, communityDescription, checkedMembership, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); } function copyToClipboard(text) {