Skip to content

Instantly share code, notes, and snippets.

Avatar

Johan Danforth johandanforth

View GitHub Profile
View Visa workitem (bootstrap 4).OUTLOOK.yaml
name: Visa workitem (bootstrap 4)
description: ''
host: OUTLOOK
api_set: {}
script:
content: "\"use strict\";\n\nvar itemId = null;\nvar item = null;\n\n(function() {\n Office.onReady(function() {\n // Office is ready\n $(document).ready(function() {\n enableTabs();\n run();\n });\n });\n})();\n\nfunction enableTabs() {}\n\n//TODO: get projects - show project name\n\nasync function updateView(workItem) {\n let d1 = loadData(item.subject);\n let d2 = loadData(item.start);\n let d3 = loadData(item.end);\n\n const [subject, start, end] = await Promise.all([d1, d2, d3]);\n\n if (workItem.Name === null || workItem.Name === \"\") {\n console.log(1);\n console.log(subject.toString());\n $(\"#Name\").val(subject.toString());\n } else $(\"#Name\").val(workItem.Name);\n $(\"#Comment\").text(workItem.Comment);\n $(\"#ProjectId\").text(workItem.ProjectId);\n $(\"#InvoiceTime\").attr(\"checked\", workItem.InvoiceTime === \"true\" ? \"checked\" : \"\");\n}\n\nfunction loadData(prop)
View Get workitem (bootstrap 3).OUTLOOK.yaml
name: Get workitem (bootstrap 3)
description: ''
host: OUTLOOK
api_set: {}
script:
content: "\"use strict\";\n\nvar itemId = null;\nvar item = null;\n\n(function() {\n Office.onReady(function() {\n // Office is ready\n $(document).ready(function() {\n enableTabs();\n run();\n });\n });\n})();\n\nfunction enableTabs() {}\n\n//TODO: get projects - show project name\n\nasync function updateView(workItem) {\n let d1 = loadData(item.subject);\n let d2 = loadData(item.start);\n let d3 = loadData(item.end);\n\n const [subject, start, end] = await Promise.all([d1, d2, d3]);\n\n if (workItem.Name === null || workItem.Name === \"\") {\n console.log(1);\n console.log(subject.toString());\n $(\"#Name\").val(subject.toString());\n } else $(\"#Name\").val(workItem.Name);\n $(\"#Comment\").text(workItem.Comment);\n $(\"#ProjectId\").text(workItem.ProjectId);\n $(\"#InvoiceTime\").attr(\"checked\", workItem.InvoiceTime === \"true\" ? \"checked\" : \"\");\n}\n\nfunction loadData(prop)
View bootstrap 3.OUTLOOK.yaml
name: bootstrap 3
description: ''
host: OUTLOOK
api_set: {}
script:
content: "var itemId = null;\nvar item = null;\n\n(function() {\n Office.onReady(function() {\n // Office is ready\n $(document).ready(function() {\n enableTabs();\n //run();\n });\n });\n})();\n\nfunction enableTabs() {\n var firstTabEl = document.querySelector(\"#myTab li:last-child a\");\n console.log(firstTabEl )\n //var firstTab = new bootstrap.Tab(firstTabEl);\n // console.log(firstTab)\n // firstTab.show()\n}\n\n//TODO: get projects - show project name\n\nasync function updateView(workItem) {\n let d1 = loadData(item.subject);\n let d2 = loadData(item.start);\n let d3 = loadData(item.end);\n\n const [subject, start, end] = await Promise.all([d1, d2, d3]);\n\n if (workItem.Name === null || workItem.Name === \"\") {\n console.log(1);\n console.log(subject.toString());\n $(\"#Name\").val(subject.toString());\n } else $(\"#Name\").val(workItem.Name);\n $(\"#Comment\").text(workItem.Comment);\n $
View Get workitem.OUTLOOK.yaml
name: Get workitem
description: ''
host: OUTLOOK
api_set: {}
script:
content: "\"use strict\";\n\nvar itemId = null;\nvar item = null;\n\n(function() {\n Office.onReady(function() {\n // Office is ready\n $(document).ready(function() {\n enableTabs();\n run();\n });\n });\n})();\n\nfunction enableTabs() {\n\n\n \n}\n\n//TODO: get projects - show project name\n\nasync function updateView(workItem) {\n let d1 = loadData(item.subject);\n let d2 = loadData(item.start);\n let d3 = loadData(item.end);\n\n const [subject, start, end] = await Promise.all([d1, d2, d3]);\n\n if (workItem.Name === null || workItem.Name === \"\") {\n console.log(1);\n console.log(subject.toString());\n $(\"#Name\").val(subject.toString());\n } else $(\"#Name\").val(workItem.Name);\n $(\"#Comment\").text(workItem.Comment);\n $(\"#ProjectId\").text(workItem.ProjectId);\n $(\"#InvoiceTime\").attr(\"checked\", workItem.InvoiceTime === \"true\" ? \"checked\" : \"\");\n}\n\nfunction loadData(prop) {\n
View Get attachment content.OUTLOOK.yaml
name: Get attachment content
description: ''
host: OUTLOOK
api_set: {}
script:
content: "$(\"#read\").click(read);\n\nfunction read() {\n Office.context.mailbox.getCallbackTokenAsync({ isRest: true }, function(asyncResult) {\n getCurrentItem(asyncResult.value);\n });\n}\n\nfunction getItemRestId() {\n if (Office.context.mailbox.diagnostics.hostName === 'OutlookIOS') {\n // itemId is already REST-formatted.\n return Office.context.mailbox.item.itemId;\n } else {\n // Convert to an item ID for API v2.0.\n return Office.context.mailbox.convertToRestId(\n Office.context.mailbox.item.itemId,\n Office.MailboxEnums.RestVersion.v2_0\n );\n }\n}\n\nfunction getCurrentItem(accessToken) {\n // Get the item's REST ID.\n var itemId = getItemRestId();\n \n var getMessageUrl = Office.context.mailbox.restUrl + '/v2.0/me/events/' + itemId + '?expand=attachments';\n\n $.ajax({\n url: getMessageUrl,\n dataType: 'json',\n headers: { 'Authorization': 'Bearer ' + accessToken }\n })
View Get attachment content.OUTLOOK.yaml
name: Get attachment content
description: Gets the attachment content.
host: OUTLOOK
api_set: {}
script:
content: |
$("#read").click(read);
$("#write").click(write);
var serviceRequest = {
View Get attachment content.OUTLOOK.yaml
name: Get attachment content
description: Gets the attachment content.
host: OUTLOOK
api_set: {}
script:
content: |
$("#read").click(read);
$("#write").click(write);
var serviceRequest = {
@johandanforth
johandanforth / .block
Last active Apr 13, 2018 — forked from christianbriggs/.block
D3 v4 ES6 Class Force Layout Focus on Clicked Node
View .block
license: mit