Last active
March 6, 2023 18:55
-
-
Save JuaneloJuanelo/c89557f231e37cc1b3c41c2159b66df5 to your computer and use it in GitHub Desktop.
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
name: Delay Deliver | |
description: '' | |
host: OUTLOOK | |
api_set: {} | |
script: | |
content: | | |
$("#delay").click(delay); | |
function multiselect() { | |
Office.context.mailbox.getSelectedItemsAsync(function(result) { | |
console.log(result.value); | |
}); | |
} | |
function delay() { | |
const date_1 = new Date(); | |
const date_2 = new Date(date_1.getTime() + 10 * 60000); // Sending with 10-minute delay. | |
Office.context.mailbox.item.delayDeliveryTime.setAsync(date_2, function(callback) { | |
console.log(callback); | |
}); | |
} | |
language: typescript | |
template: | |
content: "<section class=\"ms-font-m\">\n\t<p class=\"ms-font-m\">Prepend and Multiselect Demos \n\t</p>\n\t<p><b>Required mode</b>: READ</p>\n</section>\n\n<section class=\"samples ms-font-m\">\n\n\n\t\n\n\t\t\t\t\t\t<button id=\"delay\" class=\"ms-Button\">\n\t\t\t\t\t\t\t\t <span class=\"ms-Button-label\">Delay deliver</span>\n\t\t\t\t\t\t\t\t </button>\n</section>" | |
language: html | |
style: | |
content: |- | |
section.samples { | |
margin-top: 20px; | |
} | |
section.samples .ms-Button, section.setup .ms-Button { | |
display: block; | |
margin-bottom: 5px; | |
margin-left: 20px; | |
min-width: 80px; | |
} | |
language: css | |
libraries: | | |
https://appsforoffice.microsoft.com/lib/beta/hosted/office.js | |
@types/office-js-preview | |
office-ui-fabric-js@1.4.0/dist/css/fabric.min.css | |
office-ui-fabric-js@1.4.0/dist/css/fabric.components.min.css | |
core-js@2.4.1/client/core.min.js | |
@types/core-js | |
jquery@3.1.1 | |
@types/jquery@3.3.1 |
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
name: Multiselect | |
description: Prepends and Multiselect Samples | |
host: OUTLOOK | |
api_set: {} | |
script: | |
content: > | |
$("#multiSelect").click(multiselect); | |
$("#delay").click(delay); | |
function multiselect() { | |
Office.context.mailbox.getSelectedItemsAsync(function(result) { | |
console.log(result.value); | |
}); | |
} | |
Office.context.mailbox.addHandlerAsync(Office.EventType.SelectedItemsChanged, | |
handler); | |
Office.context.mailbox.addHandlerAsync(Office.EventType.ItemChanged, | |
handler2); | |
function handler(e) { | |
console.log("Event happened with "); | |
console.log(e); | |
Office.context.mailbox.getSelectedItemsAsync(function(result) { | |
if (result.status == Office.AsyncResultStatus.Failed) console.log(result.error); | |
else console.log(result.value); | |
}); | |
} | |
function handler2(evt) { | |
console.log("this is item changed"); | |
} | |
function delay() { | |
const date_1 = new Date(); | |
const date_2 = new Date(date_1.getTime() + 10 * 60000); // Sending with 2-minute delay. | |
Office.context.mailbox.item.delayDeliveryTime.setAsync(date_2, function(callback) { | |
console.log(callback); | |
}); | |
} | |
language: typescript | |
template: | |
content: "<section class=\"ms-font-m\">\n\t<p class=\"ms-font-m\">Prepend and Multiselect Demos \n\t</p>\n\t<p><b>Required mode</b>: READ</p>\n</section>\n\n<section class=\"samples ms-font-m\">\n\n\n\t\t<button id=\"multiSelect\" class=\"ms-Button\">\n\t\t <span class=\"ms-Button-label\">Multiselect items</span>\n\t\t </button>\n\n\t\t\t\t\t\t<button id=\"delay\" class=\"ms-Button\">\n\t\t\t\t\t\t\t\t <span class=\"ms-Button-label\">Delay deliver</span>\n\t\t\t\t\t\t\t\t </button>\n</section>" | |
language: html | |
style: | |
content: |- | |
section.samples { | |
margin-top: 20px; | |
} | |
section.samples .ms-Button, section.setup .ms-Button { | |
display: block; | |
margin-bottom: 5px; | |
margin-left: 20px; | |
min-width: 80px; | |
} | |
language: css | |
libraries: | | |
https://appsforoffice.microsoft.com/lib/beta/hosted/office.js | |
@types/office-js-preview | |
office-ui-fabric-js@1.4.0/dist/css/fabric.min.css | |
office-ui-fabric-js@1.4.0/dist/css/fabric.components.min.css | |
core-js@2.4.1/client/core.min.js | |
@types/core-js | |
jquery@3.1.1 | |
@types/jquery@3.3.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment