Created
June 21, 2017 16:03
-
-
Save michael-hawker/ae92239d4f451a080e7382437cfd0e5a to your computer and use it in GitHub Desktop.
Windows 10 JavaScript Example which Simply Opens Native Calendar/Mail/People Applications without any context
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
window.addEventListener("DOMContentLoaded", (ev) => { | |
if (typeof Windows !== 'undefined') { | |
document.getElementById("calendar").addEventListener("click", () => { | |
Windows.ApplicationModel.Appointments.AppointmentManager.showTimeFrameAsync(new Date(Date.now()), 1); | |
}); | |
document.getElementById("mail").addEventListener("click", () => { | |
Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri("mailto:")); | |
}); | |
document.getElementById("people").addEventListener("click", () => { | |
Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri("ms-people:")); | |
}); | |
} else { | |
document.getElementsByTagName("body")[0].innerHTML = "Load within Windows Web App."; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment