-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLT-8277 - Add a button to copy to the clipboard a link to the curren…
…t contract in the Marlowe editor
- Loading branch information
Showing
9 changed files
with
148 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!-- | ||
A new scriv changelog fragment. | ||
Uncomment the section that is right (remove the HTML comment wrapper). | ||
--> | ||
|
||
<!-- | ||
### Removed | ||
- A bullet item for the Removed category. | ||
--> | ||
|
||
### Added | ||
|
||
- Added a button to copy to the clipboard a link to the current contract in the Marlowe editor | ||
|
||
<!-- | ||
### Changed | ||
- A bullet item for the Changed category. | ||
--> | ||
<!-- | ||
### Deprecated | ||
- A bullet item for the Deprecated category. | ||
--> | ||
<!-- | ||
### Fixed | ||
- A bullet item for the Fixed category. | ||
--> | ||
<!-- | ||
### Security | ||
- A bullet item for the Security category. | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"use strict"; | ||
|
||
export function copyToClipboardImpl(text, onFulfilled, onRejected) { | ||
return navigator.clipboard.writeText(text); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module Web.Blob.Clipboard (copyToClipboard) where | ||
|
||
import Prelude | ||
|
||
import Control.Promise (Promise, toAffE) | ||
import Effect.Aff (Aff) | ||
import Effect.Uncurried (EffectFn1, runEffectFn1) | ||
|
||
foreign import copyToClipboardImpl :: EffectFn1 String (Promise Unit) | ||
|
||
copyToClipboard :: String -> Aff Unit | ||
copyToClipboard str = toAffE (runEffectFn1 copyToClipboardImpl str) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"use strict"; | ||
|
||
export function getUrlImpl() { | ||
return window.location.href; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Web.Blob.Window (getUrl) where | ||
|
||
import Prelude | ||
|
||
import Effect (Effect) | ||
import Effect.Uncurried (EffectFn1, runEffectFn1) | ||
|
||
foreign import getUrlImpl :: EffectFn1 Unit String | ||
|
||
getUrl :: Effect String | ||
getUrl = runEffectFn1 getUrlImpl unit |