Skip to content

Commit

Permalink
Add widgets for clipboard APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
ydogandjiev committed Oct 24, 2024
1 parent 0b831ae commit 2ca307a
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1898,6 +1898,43 @@ const initializeAppModules = () => {
},
});

addModule({
name: "clipboard.read",
initializedRequired: true,
hasOutput: true,
action: function (output) {
microsoftTeams.clipboard.read()
.then((result) => {
output(result);
})
.catch((error) => {
output(error);
});
},
});

addModule({
name: "clipboard.write",
initializedRequired: true,
hasOutput: true,
inputs: [
{
type: "string",
name: "content",
defaultValue: "Hello World"
}
],
action: function (content, output) {
microsoftTeams.clipboard.write(content)
.then((result) => {
output(result);
})
.catch((error) => {
output(error);
});
},
})

// Get the modal
var modal = document.getElementById("myModal");

Expand Down

0 comments on commit 2ca307a

Please sign in to comment.