Last active
December 10, 2015 03:48
-
-
Save e-jigsaw/4377027 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
(function() { | |
"use strict"; | |
var app = WinJS.Application; | |
app.onactivate = function(args) { | |
Windows.ApplicationModel.DataTransfer.DataTransferManager.getForCurrentView().addEventlistener("datarequested", shareHandler); | |
// なんやかんや | |
}; | |
app.oncheckpoint = function(args) { | |
Windows.ApplicationModel.DataTransfer.DataTransferManager.getForCurrentView().removeEventlistener("datarequested", shareHandler); | |
// なんやかんや | |
} | |
function shareHandler(e) { | |
var request = e.request; | |
var url = "http://jgs.me/"; | |
var uri = new Windows.Foundation.Uri(url); | |
request.data.properties.title = "タイトル"; | |
request.data.properties.description = "説明"; | |
request.data.setText("Textdayo"); | |
request.data.setUri(uri); | |
url = "http://jgs.me/some.png"; | |
uri = new Windows.Foundation.Uri(url); | |
request.data.setBitmap(Windows.Storage.Streams.RandomAccessStreamReference.createFromUri(uri)); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment