This file contains hidden or 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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var console = require("consoleit"); | |
var semver = require("semver"); | |
var brickedVer = "1.7.4"; | |
var thisVer = "1.7.3"; // Get this from package.json | |
var showBrick = semver.lte(thisVer, brickedVer); | |
console.log("The app will " + (showBrick ? "" : "NOT ") + "show as bricked"); |
This file contains hidden or 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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var console = require("consoleit"); | |
var compareVersions = require("compare-versions"); | |
function isBricked(appVersion, brickedVersion) { | |
brickedVersion = brickedVersion || "0.0.0"; | |
return compareVersions(appVersion, brickedVersion) < 1; | |
} |
This file contains hidden or 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
// example using the raf module from npm. try changing some values! | |
var requestAnimationFrame = require("raf") | |
var canvas = document.createElement("canvas") | |
canvas.width = 500 | |
canvas.height = 500 | |
document.body.appendChild(canvas) | |
var context = canvas.getContext("2d") |
This file contains hidden or 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
// example using the raf module from npm. try changing some values! | |
var requestAnimationFrame = require("raf") | |
var canvas = document.createElement("canvas") | |
canvas.width = 500 | |
canvas.height = 500 | |
document.body.appendChild(canvas) | |
var context = canvas.getContext("2d") |
This file contains hidden or 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
// example using the raf module from npm. try changing some values! | |
var requestAnimationFrame = require("raf") | |
var canvas = document.createElement("canvas") | |
canvas.width = 500 | |
canvas.height = 500 | |
document.body.appendChild(canvas) | |
var context = canvas.getContext("2d") |
This file contains hidden or 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
// example using the raf module from npm. try changing some values! | |
var requestAnimationFrame = require("raf") | |
var canvas = document.createElement("canvas") | |
canvas.width = 500 | |
canvas.height = 500 | |
document.body.appendChild(canvas) | |
var context = canvas.getContext("2d") |
This file contains hidden or 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
// Utility functions. | |
var console = { | |
log: function log(msg) { | |
var el = document.createElement("div"); | |
el.textContent = msg; | |
document.body.appendChild(el); | |
} | |
} | |
// yuzu-pns-client package. |
This file contains hidden or 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
var xcop = require("xcop"); | |
console.log("** XCOP DEMO **\n"); | |
var options = { | |
xcopDocument: "/host/0B32WZ_OndfDhY0lkSTNaeTNvSzA/xcop.html" | |
}; | |
var origin = "https://googledrive.com"; | |
xcop(origin, options).done(function (xhr) { | |
var request = { url: "message.json" }; |
This file contains hidden or 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
// Takes a snapshot of WebView control (Windows 8.1) and returns a thumbnail URL. | |
function getThumbnailFromWebView(webviewControl, width, height) { | |
return capturePreviewToBlobAsync(webviewControl).then(function (completeEvent) { | |
var blob = completeEvent.target.result; | |
var streamIn = blob.msDetachStream(); | |
var Imaging = Windows.Graphics.Imaging; | |
var transform = new Imaging.BitmapTransform(); | |
transform.scaledHeight = height; | |
transform.scaledWidth = width; |
This file contains hidden or 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> | |
<!-- File > New Project > Templates > JavaScript > Blank App; replace default.html with this --> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>App2</title> | |
<!-- WinJS references --> | |
<link href="//Microsoft.WinJS.1.0.RC/css/ui-dark.css" rel="stylesheet" /> | |
<script src="//Microsoft.WinJS.1.0.RC/js/base.js"></script> |