diff --git a/android/app/capacitor.build.gradle b/android/app/capacitor.build.gradle index d4727695..5e31cfb0 100644 --- a/android/app/capacitor.build.gradle +++ b/android/app/capacitor.build.gradle @@ -11,6 +11,7 @@ apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle" dependencies { implementation project(':aashu-dubey-capacitor-statusbar-safe-area') implementation project(':capacitor-app') + implementation project(':capacitor-clipboard') implementation project(':capacitor-device') implementation project(':capacitor-filesystem') implementation project(':capacitor-geolocation') diff --git a/android/capacitor.settings.gradle b/android/capacitor.settings.gradle index 85ad2624..7c91bce7 100644 --- a/android/capacitor.settings.gradle +++ b/android/capacitor.settings.gradle @@ -8,6 +8,9 @@ project(':aashu-dubey-capacitor-statusbar-safe-area').projectDir = new File('../ include ':capacitor-app' project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android') +include ':capacitor-clipboard' +project(':capacitor-clipboard').projectDir = new File('../node_modules/@capacitor/clipboard/android') + include ':capacitor-device' project(':capacitor-device').projectDir = new File('../node_modules/@capacitor/device/android') diff --git a/ios/App/Podfile b/ios/App/Podfile index e02c9c37..10f7f676 100644 --- a/ios/App/Podfile +++ b/ios/App/Podfile @@ -13,6 +13,7 @@ def capacitor_pods pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios' pod 'AashuDubeyCapacitorStatusbarSafeArea', :path => '../../node_modules/@aashu-dubey/capacitor-statusbar-safe-area' pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app' + pod 'CapacitorClipboard', :path => '../../node_modules/@capacitor/clipboard' pod 'CapacitorDevice', :path => '../../node_modules/@capacitor/device' pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem' pod 'CapacitorGeolocation', :path => '../../node_modules/@capacitor/geolocation' diff --git a/package-lock.json b/package-lock.json index dfb1120a..c3d6852d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@aashu-dubey/capacitor-statusbar-safe-area": "^3.0.0", "@capacitor/android": "^6.0.0", "@capacitor/app": "^6.0.0", + "@capacitor/clipboard": "^6.0.0", "@capacitor/core": "^6.0.0", "@capacitor/device": "^6.0.0", "@capacitor/filesystem": "^6.0.0", @@ -2049,6 +2050,14 @@ "node": ">=10" } }, + "node_modules/@capacitor/clipboard": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@capacitor/clipboard/-/clipboard-6.0.0.tgz", + "integrity": "sha512-NjcGr2jncSZy9NM9grePo8zz0hhBYYBYZV71xXjLvJhVY4PSdZD/Sj+4jm0pvlOKSK8vAXYyF6VcWT4/Kh/xmw==", + "peerDependencies": { + "@capacitor/core": "^6.0.0" + } + }, "node_modules/@capacitor/core": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-6.0.0.tgz", diff --git a/package.json b/package.json index 9cf766a4..fcacedbe 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "@aashu-dubey/capacitor-statusbar-safe-area": "^3.0.0", "@capacitor/android": "^6.0.0", "@capacitor/app": "^6.0.0", + "@capacitor/clipboard": "^6.0.0", "@capacitor/core": "^6.0.0", "@capacitor/device": "^6.0.0", "@capacitor/filesystem": "^6.0.0", diff --git a/src/css/assets/copy.svg b/src/css/assets/copy.svg new file mode 100644 index 00000000..0a01dbe8 --- /dev/null +++ b/src/css/assets/copy.svg @@ -0,0 +1,18 @@ + + + + diff --git a/src/css/position.css b/src/css/position.css index da801521..5880fc50 100644 --- a/src/css/position.css +++ b/src/css/position.css @@ -190,6 +190,24 @@ margin: 0; color: var(--darkish-grey); font-size: 13px; + display: flex; +} + +#positionCoordsSpan { + text-decoration: underline; + display: flex; + align-items: center; +} + +#positionCoordsSpan::after { + content: ""; + display: inline-block; + background-image: url("assets/copy.svg"); + width: 20px; + height: 18px; + background-repeat: no-repeat; + background-position: center; + background-size: 10px; } /* diff --git a/src/js/position.js b/src/js/position.js index 16f4a7d3..7196fc8a 100644 --- a/src/js/position.js +++ b/src/js/position.js @@ -12,8 +12,9 @@ import Globals from "./globals"; import DomUtils from "./utils/dom-utils"; import { Share } from "@capacitor/share"; import { Toast } from "@capacitor/toast"; -import ActionSheet from "./action-sheet"; +import { Clipboard } from "@capacitor/clipboard"; +import ActionSheet from "./action-sheet"; import PopupUtils from "./utils/popup-utils"; import LoadingDark from "../css/assets/loading-darkgrey.svg"; @@ -103,7 +104,7 @@ class Position { var address = this.address; var latitude = this.coordinates.lat; var longitude = this.coordinates.lon; - var altitudeHtml = ``; + var altitudeHtml = ``; var templateAddress; // adresse disponible @@ -169,7 +170,7 @@ class Position {