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
if(typeof Windows != 'undefined') { | |
var captureUI = new Windows.Media.Capture.CameraCaptureUI(); | |
//Set the format of the picture that's going to be captured (.png, .jpg, ...) | |
captureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.png; | |
//Pop up the camera UI to take a picture | |
captureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).then(function (capturedItem) { | |
// Do something with the picture | |
}); | |
} |
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
function showToast () { | |
if(typeof Windows !== undefined) { | |
var notifications = Windows.UI.Notifications; | |
var template = notifications.ToastTemplateType.toastImageAndText01; | |
var toastXml = notifications.ToastNotificationManager.getTemplateContent(template); | |
var toastTextElements = toastXml.getElementsByTagName("text"); | |
toastTextElements[0].appendChild(toastXml.createTextNode("Toast from Codepen")); | |
var toastImageElements = toastXml.getElementsByTagName("image"); | |
toastImageElements[0].setAttribute("src", "http://assets.codepen.io/assets/social/facebook-default.png"); | |
toastImageElements[0].setAttribute("alt", "red graphic"); |
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
StartPage="http://codepen.io/seksenov/pen/wBbVyb/?editors=101"> | |
<uap:ApplicationContentUriRules> | |
<uap:Rule Match="http://codepen.io/seksenov/pen/wBbVyb/?editors=101" Type="include" WindowsRuntimeAccess="all"/> | |
<uap:Rule Match="http://*.codepen.io/" Type="include" WindowsRuntimeAccess="all"/> | |
</uap:ApplicationContentUriRules> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Cortana Example</title> | |
<!--Cortana meta tag pointing to VCD file on the server--> | |
<meta name="msapplication-cortanavcd" content="https://mysite.com/vcd.xml"/> | |
</head> | |
<body> | |
</body> |
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
if (typeof Windows !== 'undefined' && | |
typeof Windows.UI !== 'undefined' && | |
typeof Windows.UI.Notifications !== 'undefined') { | |
//Call Windows.UI.Notifications | |
} |
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
function updateTile(message, imgUrl, imgAlt) { | |
// Namespace: Windows.UI.Notifications | |
if (typeof Windows !== 'undefined'&& | |
typeof Windows.UI !== 'undefined' && | |
typeof Windows.UI.Notifications !== 'undefined') { | |
var notifications = Windows.UI.Notifications, | |
tile = notifications.TileTemplateType.tileSquare150x150PeekImageAndText01, | |
tileContent = notifications.TileUpdateManager.getTemplateContent(tile), | |
tileText = tileContent.getElementsByTagName('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
function cameraCapture() { | |
if(typeof Windows != 'undefined') { | |
var captureUI = new Windows.Media.Capture.CameraCaptureUI(); | |
//Set the format of the picture that's going to be captured (.png, .jpg, ...) | |
captureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.png; | |
//Pop up the camera UI to take a picture | |
captureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).then(function (capturedItem) { | |
// Do something with the picture | |
}); | |
} |
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
'use strict' | |
var client = null; | |
document.addEventListener("DOMContentLoaded", init); | |
function init() { | |
var btn = document.getElementById("saveFile"); | |
btn.addEventListener("click", () => downloadAndSave("./img/detroitSkyline.jpg")); | |
} |
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 function expects two hexStrings and relies on hexStrToRGBA to convert | |
to a JSON object that represents RGBA for the underlying Windows API to | |
understand. | |
Examples of valid values: | |
setAppBarColors('#FFFFFF','#000000'); | |
setAppBarColors('#FFF','#000'); | |
setAppBarColors('FFFFFF','000000'); | |
setAppBarColors('FFF','000'); |
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
'use strict'; | |
var systemMediaControls; | |
(function () { | |
// Add the event listener to handle Windows activated event | |
if (typeof Windows !== 'undefined') { | |
systemMediaControls = Windows.Media.SystemMediaTransportControls.getForCurrentView(); | |
systemMediaControls.addEventListener("buttonpressed", systemMediaControlsButtonPressed, false); |
OlderNewer