Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffblankenburg committed Nov 27, 2012
2 parents 77c28d2 + 67cda5d commit b235d8e
Show file tree
Hide file tree
Showing 21 changed files with 879 additions and 14 deletions.
Binary file not shown.
Binary file not shown.
9 changes: 2 additions & 7 deletions source/HTML5/Day27-Inclinometer/app/js/default.js
Expand Up @@ -23,18 +23,14 @@
_timestamp.innerText = e.reading.timestamp;
}

function onShaken(e) {
_wasShaken.innerText = e.timestamp;
}

function getDomElements() {
_pitch = document.querySelector("#pitch");
_yaw = document.querySelector("#yaw");
_roll = document.querySelector("#roll");
_timestamp = document.querySelector("#timestamp");
}

function startAccelerometer() {
function startInclinometer() {
var inclinometer = Windows.Devices.Sensors.Inclinometer.getDefault()

if (inclinometer) {
Expand All @@ -44,12 +40,11 @@

inclinometer.addEventListener("readingchanged", onReadingChanged);
}

}

app.onloaded = function () {
getDomElements();
startAccelerometer();
startInclinometer();
}

app.start();
Expand Down
46 changes: 46 additions & 0 deletions source/HTML5/Day28-PushNotifications/app/app.sln
@@ -0,0 +1,46 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "app", "app/app.jsproj", "{53657140-D0DA-4374-9606-B653E55DFD93}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{53657140-D0DA-4374-9606-B653E55DFD93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{53657140-D0DA-4374-9606-B653E55DFD93}.Debug|Any CPU.Build.0 = Debug|Any CPU
{53657140-D0DA-4374-9606-B653E55DFD93}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{53657140-D0DA-4374-9606-B653E55DFD93}.Debug|ARM.ActiveCfg = Debug|ARM
{53657140-D0DA-4374-9606-B653E55DFD93}.Debug|ARM.Build.0 = Debug|ARM
{53657140-D0DA-4374-9606-B653E55DFD93}.Debug|ARM.Deploy.0 = Debug|ARM
{53657140-D0DA-4374-9606-B653E55DFD93}.Debug|x64.ActiveCfg = Debug|x64
{53657140-D0DA-4374-9606-B653E55DFD93}.Debug|x64.Build.0 = Debug|x64
{53657140-D0DA-4374-9606-B653E55DFD93}.Debug|x64.Deploy.0 = Debug|x64
{53657140-D0DA-4374-9606-B653E55DFD93}.Debug|x86.ActiveCfg = Debug|x86
{53657140-D0DA-4374-9606-B653E55DFD93}.Debug|x86.Build.0 = Debug|x86
{53657140-D0DA-4374-9606-B653E55DFD93}.Debug|x86.Deploy.0 = Debug|x86
{53657140-D0DA-4374-9606-B653E55DFD93}.Release|Any CPU.ActiveCfg = Release|Any CPU
{53657140-D0DA-4374-9606-B653E55DFD93}.Release|Any CPU.Build.0 = Release|Any CPU
{53657140-D0DA-4374-9606-B653E55DFD93}.Release|Any CPU.Deploy.0 = Release|Any CPU
{53657140-D0DA-4374-9606-B653E55DFD93}.Release|ARM.ActiveCfg = Release|ARM
{53657140-D0DA-4374-9606-B653E55DFD93}.Release|ARM.Build.0 = Release|ARM
{53657140-D0DA-4374-9606-B653E55DFD93}.Release|ARM.Deploy.0 = Release|ARM
{53657140-D0DA-4374-9606-B653E55DFD93}.Release|x64.ActiveCfg = Release|x64
{53657140-D0DA-4374-9606-B653E55DFD93}.Release|x64.Build.0 = Release|x64
{53657140-D0DA-4374-9606-B653E55DFD93}.Release|x64.Deploy.0 = Release|x64
{53657140-D0DA-4374-9606-B653E55DFD93}.Release|x86.ActiveCfg = Release|x86
{53657140-D0DA-4374-9606-B653E55DFD93}.Release|x86.Build.0 = Release|x86
{53657140-D0DA-4374-9606-B653E55DFD93}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions source/HTML5/Day28-PushNotifications/app/app/app.jsproj
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|AnyCPU">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU">
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>53657140-d0da-4374-9606-b653e55dfd93</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '11.0'">
<VisualStudioVersion>11.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).props" />
<PropertyGroup>
<TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
<TargetPlatformVersion>8.0</TargetPlatformVersion>
<DefaultLanguage>en-US</DefaultLanguage>
<PackageCertificateKeyFile>app_StoreKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>D5C2E3F4B420B4A463AC9269F32593BD6124139B</PackageCertificateThumbprint>
</PropertyGroup>
<ItemGroup>
<AppxManifest Include="package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="app_TemporaryKey.pfx" />
<None Include="app_StoreKey.pfx" />
<Content Include="default.html" />
<Content Include="images\logo.png" />
<Content Include="images\smalllogo.png" />
<Content Include="images\splashscreen.png" />
<Content Include="images\storelogo.png" />
<Content Include="images\WideLogo.png" />
<Content Include="js\default.js" />
<Content Include="css\default.css" />
<None Include="Package.StoreAssociation.xml" />
</ItemGroup>
<ItemGroup>
<SDKReference Include="Microsoft.WinJS.1.0, Version=1.0" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets" />
<!-- To modify your build process, add your task inside one of the targets below then uncomment
that target and the DisableFastUpToDateCheck PropertyGroup.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
<PropertyGroup>
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
</PropertyGroup>
-->
</Project>
Binary file not shown.
Binary file not shown.
28 changes: 28 additions & 0 deletions source/HTML5/Day28-PushNotifications/app/app/css/default.css
@@ -0,0 +1,28 @@
body {

width: 100%;
height: 100%;

display: -ms-grid;
-ms-grid-columns: 1fr;
-ms-grid-rows: 1fr 1fr 1fr;

}

#content {
-ms-grid-column: 1;
-ms-grid-row: 2;

text-align: center;
}
@media screen and (-ms-view-state: fullscreen-landscape) {
}

@media screen and (-ms-view-state: filled) {
}

@media screen and (-ms-view-state: snapped) {
}

@media screen and (-ms-view-state: fullscreen-portrait) {
}
24 changes: 24 additions & 0 deletions source/HTML5/Day28-PushNotifications/app/app/default.html
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Day6</title>

<!-- WinJS references -->
<link href="//Microsoft.WinJS.1.0/css/ui-dark.css" rel="stylesheet" />
<script src="//Microsoft.WinJS.1.0/js/base.js"></script>
<script src="//Microsoft.WinJS.1.0/js/ui.js"></script>

<!-- Day6 references -->
<link href="/css/default.css" rel="stylesheet" />
<script src="/js/default.js"></script>
</head>
<body>
<div id="content">
<h1>Day #28 - Push Notifications</h1>

<br />
<label contenteditable id="uri"></label>
</div>
</body>
</html>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions source/HTML5/Day28-PushNotifications/app/app/js/default.js
@@ -0,0 +1,52 @@
// For an introduction to the Blank template, see the following documentation:
// http://go.microsoft.com/fwlink/?LinkId=232509
(function () {
"use strict";

WinJS.Binding.optimizeBindingReferences = true;

var app = WinJS.Application;
var activation = Windows.ApplicationModel.Activation;

var notify = Windows.UI.Notifications;
var push = Windows.Networking.PushNotifications;
var net = Windows.Networking.Connectivity;
var wsc = Windows.Security.Cryptography;
var popups = Windows.UI.Popups;

app.onactivated = function (args) {
if (args.detail.kind === activation.ActivationKind.launch) {
if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) {
// TODO: This application has been newly launched. Initialize
// your application here.
} else {
// TODO: This application has been reactivated from suspension.
// Restore application state here.
}

notify.TileUpdateManager.createTileUpdaterForApplication().clear();
notify.BadgeUpdateManager.createBadgeUpdaterForApplication().clear();

var profile = net.NetworkInformation.getInternetConnectionProfile();

if (profile.getNetworkConnectivityLevel() === net.NetworkConnectivityLevel.internetAccess) {
push.PushNotificationChannelManager.createPushNotificationChannelForApplicationAsync().then(function (channel) {
document.querySelector("#uri").innerText = channel.uri
})
}

args.setPromise(WinJS.UI.processAll());
}
};

app.oncheckpoint = function (args) {
// TODO: This application is about to be suspended. Save any state
// that needs to persist across suspensions here. You might use the
// WinJS.Application.sessionState object, which is automatically
// saved and restored across suspension. If you need to complete an
// asynchronous operation before your application is suspended, call
// args.setPromise().
};

app.start();
})();
28 changes: 28 additions & 0 deletions source/HTML5/Day28-PushNotifications/app/app/package.appxmanifest
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
<Identity Name="32361ClarkSell.ClarkTest" Version="1.0.0.0" Publisher="CN=E52C30A2-E897-42F9-8D37-1F9E26313F35" />
<Properties>
<DisplayName>ClarkTest</DisplayName>
<PublisherDisplayName>Clark Sell</PublisherDisplayName>
<Logo>images\storelogo.png</Logo>
</Properties>
<Prerequisites>
<OSMinVersion>6.2.1</OSMinVersion>
<OSMaxVersionTested>6.2.1</OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" StartPage="default.html">
<VisualElements DisplayName="Day 28" Logo="images\logo.png" SmallLogo="images\smalllogo.png" Description="Day 28 - Topic" ForegroundText="light" BackgroundColor="#464646" ToastCapable="true">
<DefaultTile ShowName="allLogos" WideLogo="images\WideLogo.png" />
<SplashScreen Image="images\splashscreen.png" BackgroundColor="#ff0000" />
</VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClientServer" />
<Capability Name="privateNetworkClientServer" />
</Capabilities>
</Package>
Binary file not shown.

0 comments on commit b235d8e

Please sign in to comment.