You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2013/05/23 23:58:13 UTC
[16/50] Add WP7 and WP8 platform files.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/templates/standalone/www/css/index.css
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/templates/standalone/www/css/index.css b/lib/cordova-wp8/templates/standalone/www/css/index.css
new file mode 100644
index 0000000..f1f9d76
--- /dev/null
+++ b/lib/cordova-wp8/templates/standalone/www/css/index.css
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+* {
+ -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
+ -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
+ -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
+ -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
+}
+
+body {
+ background-color:#E4E4E4;
+ background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+ background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+ background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+ background-image:-webkit-gradient(
+ linear,
+ left top,
+ left bottom,
+ color-stop(0, #A7A7A7),
+ color-stop(0.51, #E4E4E4)
+ );
+ background-attachment:fixed;
+ font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
+ font-size:12px;
+ height:100%;
+ margin:0px;
+ padding:0px;
+ text-transform:uppercase;
+ width:100%;
+}
+
+/* Portrait layout (default) */
+.app {
+ background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
+ position:absolute; /* position in the center of the screen */
+ left:50%;
+ top:50%;
+ height:50px; /* text area height */
+ width:225px; /* text area width */
+ text-align:center;
+ padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */
+ margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */
+ /* offset horizontal: half of text area width */
+}
+
+/* Landscape layout (with min-width) */
+@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
+ .app {
+ background-position:left center;
+ padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */
+ margin:-90px 0px 0px -198px; /* offset vertical: half of image height */
+ /* offset horizontal: half of image width and text area width */
+ }
+}
+
+h1 {
+ font-size:24px;
+ font-weight:normal;
+ margin:0px;
+ overflow:visible;
+ padding:0px;
+ text-align:center;
+}
+
+.event {
+ border-radius:4px;
+ -webkit-border-radius:4px;
+ color:#FFFFFF;
+ font-size:12px;
+ margin:0px 30px;
+ padding:2px 0px;
+}
+
+.event.listening {
+ background-color:#333333;
+ display:block;
+}
+
+.event.received {
+ background-color:#4B946A;
+ display:none;
+}
+
+@keyframes fade {
+ from { opacity: 1.0; }
+ 50% { opacity: 0.4; }
+ to { opacity: 1.0; }
+}
+
+@-webkit-keyframes fade {
+ from { opacity: 1.0; }
+ 50% { opacity: 0.4; }
+ to { opacity: 1.0; }
+}
+
+.blink {
+ animation:fade 3000ms infinite;
+ -webkit-animation:fade 3000ms infinite;
+}
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/templates/standalone/www/img/logo.png
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/templates/standalone/www/img/logo.png b/lib/cordova-wp8/templates/standalone/www/img/logo.png
new file mode 100644
index 0000000..9519e7d
Binary files /dev/null and b/lib/cordova-wp8/templates/standalone/www/img/logo.png differ
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/templates/standalone/www/index.html
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/templates/standalone/www/index.html b/lib/cordova-wp8/templates/standalone/www/index.html
new file mode 100644
index 0000000..31f61f4
--- /dev/null
+++ b/lib/cordova-wp8/templates/standalone/www/index.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="format-detection" content="telephone=no" />
+ <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
+ <link rel="stylesheet" type="text/css" href="css/index.css" />
+ <title>Hello World</title>
+ </head>
+ <body>
+ <div class="app">
+ <h1>Apache Cordova</h1>
+ <div id="deviceready" class="blink">
+ <p class="event listening">Connecting to Device</p>
+ <p class="event received">Device is Ready</p>
+ </div>
+ </div>
+ <script type="text/javascript" src="cordova-2.7.0.js"></script>
+ <script type="text/javascript" src="js/index.js"></script>
+ <script type="text/javascript">
+ app.initialize();
+ </script>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/templates/standalone/www/js/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/templates/standalone/www/js/index.js b/lib/cordova-wp8/templates/standalone/www/js/index.js
new file mode 100644
index 0000000..3b75d3f
--- /dev/null
+++ b/lib/cordova-wp8/templates/standalone/www/js/index.js
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+var app = {
+ // Application Constructor
+ initialize: function() {
+ this.bindEvents();
+ },
+ // Bind Event Listeners
+ //
+ // Bind any events that are required on startup. Common events are:
+ // `load`, `deviceready`, `offline`, and `online`.
+ bindEvents: function() {
+ document.addEventListener('deviceready', this.onDeviceReady, false);
+ },
+ // deviceready Event Handler
+ //
+ // The scope of `this` is the event. In order to call the `receivedEvent`
+ // function, we must explicity call `app.receivedEvent(...);`
+ onDeviceReady: function() {
+ app.receivedEvent('deviceready');
+ },
+ // Update DOM on a Received Event
+ receivedEvent: function(id) {
+ var parentElement = document.getElementById(id);
+ var listeningElement = parentElement.querySelector('.listening');
+ var receivedElement = parentElement.querySelector('.received');
+
+ listeningElement.setAttribute('style', 'display:none;');
+ receivedElement.setAttribute('style', 'display:block;');
+
+ console.log('Received Event: ' + id);
+ }
+};
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/templates/vs/MyTemplateStandAlone.vstemplate
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/templates/vs/MyTemplateStandAlone.vstemplate b/lib/cordova-wp8/templates/vs/MyTemplateStandAlone.vstemplate
new file mode 100644
index 0000000..d7e4a70
--- /dev/null
+++ b/lib/cordova-wp8/templates/vs/MyTemplateStandAlone.vstemplate
@@ -0,0 +1,113 @@
+<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project">
+ <TemplateData>
+ <Name>CordovaWP8_2_7_0</Name>
+ <Description>Cordova 2.7.0 for Windows Phone 8 using the Cordova source code directly.</Description>
+ <ProjectType>CSharp</ProjectType>
+ <ProjectSubType>
+ </ProjectSubType>
+ <SortOrder>1000</SortOrder>
+ <CreateNewFolder>true</CreateNewFolder>
+ <DefaultName>CordovaWP8_2_7_0</DefaultName>
+ <ProvideDefaultName>true</ProvideDefaultName>
+ <LocationField>Enabled</LocationField>
+ <EnableLocationBrowseButton>true</EnableLocationBrowseButton>
+ <Icon>__TemplateIcon.png</Icon>
+ <PreviewImage>__PreviewImage.jpg</PreviewImage>
+ </TemplateData>
+ <TemplateContent>
+ <Project TargetFileName="CordovaAppProj.csproj" File="CordovaAppProj.csproj" ReplaceParameters="true">
+ <ProjectItem ReplaceParameters="true" TargetFileName="App.xaml">App.xaml</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="App.xaml.cs">App.xaml.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="false" TargetFileName="ApplicationIcon.png">ApplicationIcon.png</ProjectItem>
+ <ProjectItem ReplaceParameters="false" TargetFileName="Background.png">Background.png</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="config.xml">config.xml</ProjectItem>
+ <Folder Name="cordovalib" TargetFolderName="cordovalib">
+ <ProjectItem ReplaceParameters="true" TargetFileName="BrowserMouseHelper.cs">BrowserMouseHelper.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="CommandFactory.cs">CommandFactory.cs</ProjectItem>
+ <Folder Name="Commands" TargetFolderName="Commands">
+ <ProjectItem ReplaceParameters="true" TargetFileName="BaseCommand.cs">BaseCommand.cs</ProjectItem>
+ </Folder>
+ <ProjectItem ReplaceParameters="true" TargetFileName="ConfigHandler.cs">ConfigHandler.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="CordovaCommandCall.cs">CordovaCommandCall.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="CordovaView.xaml">CordovaView.xaml</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="CordovaView.xaml.cs">CordovaView.xaml.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="DOMStorageHelper.cs">DOMStorageHelper.cs</ProjectItem>
+ <Folder Name="JSON" TargetFolderName="JSON">
+ <ProjectItem ReplaceParameters="true" TargetFileName="JsonHelper.cs">JsonHelper.cs</ProjectItem>
+ </Folder>
+ <ProjectItem ReplaceParameters="true" TargetFileName="NativeExecution.cs">NativeExecution.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="OrientationHelper.cs">OrientationHelper.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="PluginResult.cs">PluginResult.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="ScriptCallback.cs">ScriptCallback.cs</ProjectItem>
+ </Folder>
+ <Folder Name="Images" TargetFolderName="Images">
+ <ProjectItem ReplaceParameters="false" TargetFileName="appbar.back.rest.png">appbar.back.rest.png</ProjectItem>
+ <ProjectItem ReplaceParameters="false" TargetFileName="appbar.close.rest.png">appbar.close.rest.png</ProjectItem>
+ <ProjectItem ReplaceParameters="false" TargetFileName="appbar.feature.video.rest.png">appbar.feature.video.rest.png</ProjectItem>
+ <ProjectItem ReplaceParameters="false" TargetFileName="appbar.next.rest.png">appbar.next.rest.png</ProjectItem>
+ <ProjectItem ReplaceParameters="false" TargetFileName="appbar.save.rest.png">appbar.save.rest.png</ProjectItem>
+ <ProjectItem ReplaceParameters="false" TargetFileName="appbar.stop.rest.png">appbar.stop.rest.png</ProjectItem>
+ </Folder>
+ <ProjectItem ReplaceParameters="true" TargetFileName="MainPage.xaml">MainPage.xaml</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="MainPage.xaml.cs">MainPage.xaml.cs</ProjectItem>
+ <Folder Name="Plugins" TargetFolderName="Plugins">
+ <ProjectItem ReplaceParameters="true" TargetFileName="Accelerometer.cs">Accelerometer.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="AudioFormatsHelper.cs">AudioFormatsHelper.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="AudioPlayer.cs">AudioPlayer.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="Battery.cs">Battery.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="Camera.cs">Camera.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="Capture.cs">Capture.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="Compass.cs">Compass.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="Contacts.cs">Contacts.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="DebugConsole.cs">DebugConsole.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="Device.cs">Device.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="File.cs">File.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="FileTransfer.cs">FileTransfer.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="GeoLocation.cs">GeoLocation.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="Globalization.cs">Globalization.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="ImageExifHelper.cs">ImageExifHelper.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="InAppBrowser.cs">InAppBrowser.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="Media.cs">Media.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="MimeTypeMapper.cs">MimeTypeMapper.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="NetworkStatus.cs">NetworkStatus.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="Notification.cs">Notification.cs</ProjectItem>
+ <Folder Name="UI" TargetFolderName="UI">
+ <ProjectItem ReplaceParameters="true" TargetFileName="AudioCaptureTask.cs">AudioCaptureTask.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="AudioRecorder.xaml">AudioRecorder.xaml</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="AudioRecorder.xaml.cs">AudioRecorder.xaml.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="ImageCapture.xaml">ImageCapture.xaml</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="ImageCapture.xaml.cs">ImageCapture.xaml.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="NotificationBox.xaml">NotificationBox.xaml</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="NotificationBox.xaml.cs">NotificationBox.xaml.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="VideoCaptureTask.cs">VideoCaptureTask.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="VideoRecorder.xaml">VideoRecorder.xaml</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="VideoRecorder.xaml.cs">VideoRecorder.xaml.cs</ProjectItem>
+ </Folder>
+ </Folder>
+ <Folder Name="Properties" TargetFolderName="Properties">
+ <ProjectItem ReplaceParameters="true" TargetFileName="AppManifest.xml">AppManifest.xml</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="AssemblyInfo.cs">AssemblyInfo.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="true" TargetFileName="WMAppManifest.xml">WMAppManifest.xml</ProjectItem>
+ </Folder>
+ <Folder Name="resources" TargetFolderName="resources">
+ <ProjectItem ReplaceParameters="false" TargetFileName="notification-beep.wav">notification-beep.wav</ProjectItem>
+ </Folder>
+ <Folder Name="Service References" TargetFolderName="Service References" />
+ <ProjectItem ReplaceParameters="false" TargetFileName="SplashScreenImage.jpg">SplashScreenImage.jpg</ProjectItem>
+ <ProjectItem ReplaceParameters="false" TargetFileName="VERSION">VERSION</ProjectItem>
+ <Folder Name="www" TargetFolderName="www">
+ <ProjectItem ReplaceParameters="true" TargetFileName="cordova-2.7.0.js">cordova-2.7.0.js</ProjectItem>
+ <Folder Name="css" TargetFolderName="css">
+ <ProjectItem ReplaceParameters="true" TargetFileName="index.css">index.css</ProjectItem>
+ </Folder>
+ <Folder Name="img" TargetFolderName="img">
+ <ProjectItem ReplaceParameters="false" TargetFileName="logo.png">logo.png</ProjectItem>
+ </Folder>
+ <ProjectItem ReplaceParameters="true" TargetFileName="index.html">index.html</ProjectItem>
+ <Folder Name="js" TargetFolderName="js">
+ <ProjectItem ReplaceParameters="true" TargetFileName="index.js">index.js</ProjectItem>
+ </Folder>
+ </Folder>
+ </Project>
+ </TemplateContent>
+</VSTemplate>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/templates/vs/description.txt
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/templates/vs/description.txt b/lib/cordova-wp8/templates/vs/description.txt
new file mode 100644
index 0000000..b8c91ec
--- /dev/null
+++ b/lib/cordova-wp8/templates/vs/description.txt
@@ -0,0 +1,8 @@
+CordovaWP8_2_6_0_Full
+Apache Cordova 2.7.0 Windows Phone 8 App using a pre-built dll.
+
+CordovaWP8_2_6_0_StandAlone
+Apache Cordova 2.7.0 Windows Phone 8 App including all framework source code.
+
+
+
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/templates/vs/pg_templateIcon.png
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/templates/vs/pg_templateIcon.png b/lib/cordova-wp8/templates/vs/pg_templateIcon.png
new file mode 100644
index 0000000..75c17c7
Binary files /dev/null and b/lib/cordova-wp8/templates/vs/pg_templateIcon.png differ
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/templates/vs/pg_templatePreview.jpg
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/templates/vs/pg_templatePreview.jpg b/lib/cordova-wp8/templates/vs/pg_templatePreview.jpg
new file mode 100644
index 0000000..1d72941
Binary files /dev/null and b/lib/cordova-wp8/templates/vs/pg_templatePreview.jpg differ
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/App.xaml
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/App.xaml b/lib/cordova-wp8/tests/MobileSpecUnitTests/App.xaml
new file mode 100644
index 0000000..ac01322
--- /dev/null
+++ b/lib/cordova-wp8/tests/MobileSpecUnitTests/App.xaml
@@ -0,0 +1,38 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<Application
+ x:Class="MobileSpecUnitTests.App"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
+ xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">
+
+ <!--Application Resources-->
+ <Application.Resources>
+ <MediaElement x:Key="PhoneGapMediaPlayer" Visibility="Collapsed" />
+ </Application.Resources>
+
+ <Application.ApplicationLifetimeObjects>
+ <!--Required object that handles lifetime events for the application-->
+ <shell:PhoneApplicationService
+ Launching="Application_Launching" Closing="Application_Closing"
+ Activated="Application_Activated" Deactivated="Application_Deactivated"/>
+ </Application.ApplicationLifetimeObjects>
+
+</Application>
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/App.xaml.cs
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/App.xaml.cs b/lib/cordova-wp8/tests/MobileSpecUnitTests/App.xaml.cs
new file mode 100644
index 0000000..53d9a90
--- /dev/null
+++ b/lib/cordova-wp8/tests/MobileSpecUnitTests/App.xaml.cs
@@ -0,0 +1,158 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Microsoft.Phone.Controls;
+using Microsoft.Phone.Shell;
+
+namespace MobileSpecUnitTests
+{
+ public partial class App : Application
+ {
+ /// <summary>
+ /// Provides easy access to the root frame of the Phone Application.
+ /// </summary>
+ /// <returns>The root frame of the Phone Application.</returns>
+ public PhoneApplicationFrame RootFrame { get; private set; }
+
+ /// <summary>
+ /// Constructor for the Application object.
+ /// </summary>
+ public App()
+ {
+ // Global handler for uncaught exceptions.
+ UnhandledException += Application_UnhandledException;
+
+ // Show graphics profiling information while debugging.
+ if (System.Diagnostics.Debugger.IsAttached)
+ {
+ // Display the current frame rate counters.
+ Application.Current.Host.Settings.EnableFrameRateCounter = true;
+
+ // Show the areas of the app that are being redrawn in each frame.
+ //Application.Current.Host.Settings.EnableRedrawRegions = true;
+
+ // Enable non-production analysis visualization mode,
+ // which shows areas of a page that are being GPU accelerated with a colored overlay.
+ //Application.Current.Host.Settings.EnableCacheVisualization = true;
+ }
+
+ // Standard Silverlight initialization
+ InitializeComponent();
+
+ // Phone-specific initialization
+ InitializePhoneApplication();
+ }
+
+ // Code to execute when the application is launching (eg, from Start)
+ // This code will not execute when the application is reactivated
+ private void Application_Launching(object sender, LaunchingEventArgs e)
+ {
+ System.Diagnostics.Debug.WriteLine("Application_Launching");
+ }
+
+ // Code to execute when the application is activated (brought to foreground)
+ // This code will not execute when the application is first launched
+ private void Application_Activated(object sender, ActivatedEventArgs e)
+ {
+ System.Diagnostics.Debug.WriteLine("Application_Activated");
+ }
+
+ // Code to execute when the application is deactivated (sent to background)
+ // This code will not execute when the application is closing
+ private void Application_Deactivated(object sender, DeactivatedEventArgs e)
+ {
+ System.Diagnostics.Debug.WriteLine("Application_Deactivated");
+ }
+
+ // Code to execute when the application is closing (eg, user hit Back)
+ // This code will not execute when the application is deactivated
+ private void Application_Closing(object sender, ClosingEventArgs e)
+ {
+ System.Diagnostics.Debug.WriteLine("Application_Closing");
+ }
+
+ // Code to execute if a navigation fails
+ private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
+ {
+ if (System.Diagnostics.Debugger.IsAttached)
+ {
+ // A navigation has failed; break into the debugger
+ System.Diagnostics.Debugger.Break();
+ }
+ }
+
+ // Code to execute on Unhandled Exceptions
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ if (System.Diagnostics.Debugger.IsAttached)
+ {
+ // An unhandled exception has occurred; break into the debugger
+ System.Diagnostics.Debugger.Break();
+ }
+ }
+
+ #region Phone application initialization
+
+ // Avoid double-initialization
+ private bool phoneApplicationInitialized = false;
+
+ // Do not add any additional code to this method
+ private void InitializePhoneApplication()
+ {
+ if (phoneApplicationInitialized)
+ return;
+
+ // Create the frame but don't set it as RootVisual yet; this allows the splash
+ // screen to remain active until the application is ready to render.
+ RootFrame = new PhoneApplicationFrame();
+ RootFrame.Navigated += CompleteInitializePhoneApplication;
+
+ // Handle navigation failures
+ RootFrame.NavigationFailed += RootFrame_NavigationFailed;
+
+ // Ensure we don't initialize again
+ phoneApplicationInitialized = true;
+ }
+
+ // Do not add any additional code to this method
+ private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e)
+ {
+ // Set the root visual to allow the application to render
+ if (RootVisual != RootFrame)
+ RootVisual = RootFrame;
+
+ // Remove this handler since it is no longer needed
+ RootFrame.Navigated -= CompleteInitializePhoneApplication;
+ }
+
+ #endregion
+ }
+}
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/ApplicationIcon.png
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/ApplicationIcon.png b/lib/cordova-wp8/tests/MobileSpecUnitTests/ApplicationIcon.png
new file mode 100644
index 0000000..6b69046
Binary files /dev/null and b/lib/cordova-wp8/tests/MobileSpecUnitTests/ApplicationIcon.png differ
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/Background.png
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/Background.png b/lib/cordova-wp8/tests/MobileSpecUnitTests/Background.png
new file mode 100644
index 0000000..2667df4
Binary files /dev/null and b/lib/cordova-wp8/tests/MobileSpecUnitTests/Background.png differ
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/MainPage.xaml
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/MainPage.xaml b/lib/cordova-wp8/tests/MobileSpecUnitTests/MainPage.xaml
new file mode 100644
index 0000000..4b39b4e
--- /dev/null
+++ b/lib/cordova-wp8/tests/MobileSpecUnitTests/MainPage.xaml
@@ -0,0 +1,52 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<phone:PhoneApplicationPage
+ x:Class="MobileSpecUnitTests.MainPage"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
+ xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:my="clr-namespace:WPCordovaClassLib;assembly=WPCordovaClassLib"
+ FontFamily="{StaticResource PhoneFontFamilyNormal}"
+ FontSize="{StaticResource PhoneFontSizeNormal}"
+ Foreground="{StaticResource PhoneForegroundBrush}"
+ SupportedOrientations="Portrait" Orientation="Portrait"
+ mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
+ shell:SystemTray.IsVisible="True">
+
+ <!--LayoutRoot is the root grid where all page content is placed-->
+ <Grid x:Name="LayoutRoot" Background="Transparent">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="*"/>
+ </Grid.RowDefinitions>
+
+ <my:CordovaView Name="PGView"
+ VerticalAlignment="Stretch"
+ HorizontalAlignment="Stretch"
+ Margin="0,0,0,0">
+ </my:CordovaView>
+
+
+ </Grid>
+
+
+
+</phone:PhoneApplicationPage>
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/MainPage.xaml.cs
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/MainPage.xaml.cs b/lib/cordova-wp8/tests/MobileSpecUnitTests/MainPage.xaml.cs
new file mode 100644
index 0000000..a81888b
--- /dev/null
+++ b/lib/cordova-wp8/tests/MobileSpecUnitTests/MainPage.xaml.cs
@@ -0,0 +1,42 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+using Microsoft.Phone.Controls;
+
+namespace MobileSpecUnitTests
+{
+ public partial class MainPage : PhoneApplicationPage
+ {
+ public MainPage()
+ {
+ InitializeComponent();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/MobileSpecUnitTests.csproj
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/MobileSpecUnitTests.csproj b/lib/cordova-wp8/tests/MobileSpecUnitTests/MobileSpecUnitTests.csproj
new file mode 100644
index 0000000..6c8ce71
--- /dev/null
+++ b/lib/cordova-wp8/tests/MobileSpecUnitTests/MobileSpecUnitTests.csproj
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.20506</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{86DC5E2F-4AEE-42E3-9471-A082B9BEBEAC}</ProjectGuid>
+ <ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>MobileSpecUnitTests</RootNamespace>
+ <AssemblyName>MobileSpecUnitTests</AssemblyName>
+ <TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
+ <SilverlightVersion>
+ </SilverlightVersion>
+ <TargetFrameworkProfile>
+ </TargetFrameworkProfile>
+ <TargetFrameworkIdentifier>WindowsPhone</TargetFrameworkIdentifier>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>MobileSpecUnitTests_$(Configuration)_$(Platform).xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>MobileSpecUnitTests.App</SilverlightAppEntry>
+ <ValidateXaml>true</ValidateXaml>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>Bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>Bin\Release</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>Bin\x86\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <DebugType>full</DebugType>
+ <PlatformTarget>
+ </PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <Optimize>false</Optimize>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+ <OutputPath>Bin\x86\Release</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoStdLib>true</NoStdLib>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>
+ </PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>Bin\ARM\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <DebugType>full</DebugType>
+ <PlatformTarget>
+ </PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <Prefer32Bit>false</Prefer32Bit>
+ <Optimize>false</Optimize>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
+ <OutputPath>Bin\ARM\Release</OutputPath>
+ <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoStdLib>true</NoStdLib>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>
+ </PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="MainPage.xaml.cs">
+ <DependentUpon>MainPage.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ <Page Include="MainPage.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Properties\WMAppManifest.xml">
+ <SubType>Designer</SubType>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="ApplicationIcon.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Background.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="www\accelerometer\index.html" />
+ <Content Include="www\audio\index.html" />
+ <Content Include="www\autotest\html\HtmlReporter.js" />
+ <Content Include="www\autotest\html\HtmlReporterHelpers.js" />
+ <Content Include="www\autotest\html\ReporterView.js" />
+ <Content Include="www\autotest\html\SpecView.js" />
+ <Content Include="www\autotest\html\SuiteView.js" />
+ <Content Include="www\autotest\html\TrivialReporter.js" />
+ <Content Include="www\autotest\index.html" />
+ <Content Include="www\autotest\jasmine.css" />
+ <Content Include="www\autotest\jasmine.js" />
+ <Content Include="www\autotest\pages\accelerometer.html" />
+ <Content Include="www\autotest\pages\all.html" />
+ <Content Include="www\autotest\pages\battery.html" />
+ <Content Include="www\autotest\pages\bridge.html" />
+ <Content Include="www\autotest\pages\camera.html" />
+ <Content Include="www\autotest\pages\capture.html" />
+ <Content Include="www\autotest\pages\compass.html" />
+ <Content Include="www\autotest\pages\contacts.html" />
+ <Content Include="www\autotest\pages\datauri.html" />
+ <Content Include="www\autotest\pages\device.html" />
+ <Content Include="www\autotest\pages\file.html" />
+ <Content Include="www\autotest\pages\filetransfer.html" />
+ <Content Include="www\autotest\pages\geolocation.html" />
+ <Content Include="www\autotest\pages\globalization.html" />
+ <Content Include="www\autotest\pages\media.html" />
+ <Content Include="www\autotest\pages\network.html" />
+ <Content Include="www\autotest\pages\notification.html" />
+ <Content Include="www\autotest\pages\platform.html" />
+ <Content Include="www\autotest\pages\storage.html" />
+ <Content Include="www\autotest\test-runner.js" />
+ <Content Include="www\autotest\tests\accelerometer.tests.js" />
+ <Content Include="www\autotest\tests\battery.tests.js" />
+ <Content Include="www\autotest\tests\bridge.tests.js" />
+ <Content Include="www\autotest\tests\camera.tests.js" />
+ <Content Include="www\autotest\tests\capture.tests.js" />
+ <Content Include="www\autotest\tests\compass.tests.js" />
+ <Content Include="www\autotest\tests\contacts.tests.js" />
+ <Content Include="www\autotest\tests\datauri.tests.js" />
+ <Content Include="www\autotest\tests\device.tests.js" />
+ <Content Include="www\autotest\tests\file.tests.js" />
+ <Content Include="www\autotest\tests\filetransfer.tests.js" />
+ <Content Include="www\autotest\tests\geolocation.tests.js" />
+ <Content Include="www\autotest\tests\globalization.tests.js" />
+ <Content Include="www\autotest\tests\media.tests.js" />
+ <Content Include="www\autotest\tests\network.tests.js" />
+ <Content Include="www\autotest\tests\notification.tests.js" />
+ <Content Include="www\autotest\tests\platform.tests.js" />
+ <Content Include="www\autotest\tests\storage.tests.js" />
+ <Content Include="www\battery\index.html" />
+ <Content Include="www\camera\index.html" />
+ <Content Include="www\compass\index.html" />
+ <Content Include="www\contacts\index.html" />
+ <Content Include="www\cordova-2.5.0.js" />
+ <Content Include="www\cordova.js" />
+ <Content Include="www\events\index.html" />
+ <Content Include="www\index.html">
+ <SubType>Designer</SubType>
+ </Content>
+ <Content Include="www\location\index.html" />
+ <Content Include="www\main.js" />
+ <Content Include="www\master.css" />
+ <Content Include="SplashScreenImage.jpg" />
+ <Content Include="www\misc\index.html" />
+ <Content Include="www\misc\page2.html" />
+ <Content Include="www\network\index.html" />
+ <Content Include="www\notification\index.html" />
+ <Content Include="www\sql\index.html" />
+ <Content Include="www\storage\index.html" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\framework\WPCordovaClassLib.csproj">
+ <Project>{FC6A1A70-892D-46AD-9E4A-9793F72AF780}</Project>
+ <Name>WPCordovaClassLib</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="www\execbenchmark\" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ProjectExtensions />
+ <PropertyGroup>
+ </PropertyGroup>
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/MobileSpecUnitTests.sln
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/MobileSpecUnitTests.sln b/lib/cordova-wp8/tests/MobileSpecUnitTests/MobileSpecUnitTests.sln
new file mode 100644
index 0000000..20257da
--- /dev/null
+++ b/lib/cordova-wp8/tests/MobileSpecUnitTests/MobileSpecUnitTests.sln
@@ -0,0 +1,44 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MobileSpecUnitTests", "MobileSpecUnitTests.csproj", "{86DC5E2F-4AEE-42E3-9471-A082B9BEBEAC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPCordovaClassLib", "..\..\framework\WPCordovaClassLib.csproj", "{FC6A1A70-892D-46AD-9E4A-9793F72AF780}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|ARM = Debug|ARM
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|ARM = Release|ARM
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {86DC5E2F-4AEE-42E3-9471-A082B9BEBEAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {86DC5E2F-4AEE-42E3-9471-A082B9BEBEAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {86DC5E2F-4AEE-42E3-9471-A082B9BEBEAC}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {86DC5E2F-4AEE-42E3-9471-A082B9BEBEAC}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {86DC5E2F-4AEE-42E3-9471-A082B9BEBEAC}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {86DC5E2F-4AEE-42E3-9471-A082B9BEBEAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {86DC5E2F-4AEE-42E3-9471-A082B9BEBEAC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {86DC5E2F-4AEE-42E3-9471-A082B9BEBEAC}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ {86DC5E2F-4AEE-42E3-9471-A082B9BEBEAC}.Release|ARM.ActiveCfg = Release|Any CPU
+ {86DC5E2F-4AEE-42E3-9471-A082B9BEBEAC}.Release|x86.ActiveCfg = Release|Any CPU
+ {FC6A1A70-892D-46AD-9E4A-9793F72AF780}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FC6A1A70-892D-46AD-9E4A-9793F72AF780}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FC6A1A70-892D-46AD-9E4A-9793F72AF780}.Debug|ARM.ActiveCfg = Debug|ARM
+ {FC6A1A70-892D-46AD-9E4A-9793F72AF780}.Debug|ARM.Build.0 = Debug|ARM
+ {FC6A1A70-892D-46AD-9E4A-9793F72AF780}.Debug|x86.ActiveCfg = Debug|x86
+ {FC6A1A70-892D-46AD-9E4A-9793F72AF780}.Debug|x86.Build.0 = Debug|x86
+ {FC6A1A70-892D-46AD-9E4A-9793F72AF780}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FC6A1A70-892D-46AD-9E4A-9793F72AF780}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FC6A1A70-892D-46AD-9E4A-9793F72AF780}.Release|ARM.ActiveCfg = Release|ARM
+ {FC6A1A70-892D-46AD-9E4A-9793F72AF780}.Release|ARM.Build.0 = Release|ARM
+ {FC6A1A70-892D-46AD-9E4A-9793F72AF780}.Release|x86.ActiveCfg = Release|x86
+ {FC6A1A70-892D-46AD-9E4A-9793F72AF780}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/Properties/AppManifest.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/Properties/AppManifest.xml b/lib/cordova-wp8/tests/MobileSpecUnitTests/Properties/AppManifest.xml
new file mode 100644
index 0000000..6712a11
--- /dev/null
+++ b/lib/cordova-wp8/tests/MobileSpecUnitTests/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/Properties/AssemblyInfo.cs b/lib/cordova-wp8/tests/MobileSpecUnitTests/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..5acaa9c
--- /dev/null
+++ b/lib/cordova-wp8/tests/MobileSpecUnitTests/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("MobileSpecUnitTests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("MobileSpecUnitTests")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("ce0ba3ac-f23b-47d7-b37b-09bdd19ebefe")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/Properties/WMAppManifest.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/Properties/WMAppManifest.xml b/lib/cordova-wp8/tests/MobileSpecUnitTests/Properties/WMAppManifest.xml
new file mode 100644
index 0000000..009cc2e
--- /dev/null
+++ b/lib/cordova-wp8/tests/MobileSpecUnitTests/Properties/WMAppManifest.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2012/deployment" AppPlatformVersion="8.0">
+ <DefaultLanguage xmlns="" code="" />
+ <App xmlns="" ProductID="{f2c6c498-143c-44e6-b107-2f71bf3e08b9}" Title="MobileSpecUnitTests" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="MobileSpecUnitTests author" Description="Sample description" Publisher="MobileSpecUnitTests" PublisherID="{8a4bc540-418c-471e-b8fd-184444b00802}">
+ <IconPath IsRelative="true" IsResource="false">ApplicationIcon.png</IconPath>
+ <Capabilities>
+ <Capability Name="ID_CAP_GAMERSERVICES" />
+ <Capability Name="ID_CAP_IDENTITY_DEVICE" />
+ <Capability Name="ID_CAP_IDENTITY_USER" />
+ <Capability Name="ID_CAP_LOCATION" />
+ <Capability Name="ID_CAP_MICROPHONE" />
+ <Capability Name="ID_CAP_NETWORKING" />
+ <Capability Name="ID_CAP_PHONEDIALER" />
+ <Capability Name="ID_CAP_PUSH_NOTIFICATION" />
+ <Capability Name="ID_CAP_SENSORS" />
+ <Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
+ <Capability Name="ID_CAP_CONTACTS" />
+ <Capability Name="ID_CAP_SENSORS" />
+ <Capability Name="ID_CAP_ISV_CAMERA" />
+ <Capability Name="ID_CAP_MEDIALIB_AUDIO" />
+ <Capability Name="ID_CAP_MEDIALIB_PLAYBACK" />
+ <Capability Name="ID_CAP_MEDIALIB_PHOTO" />
+ </Capabilities>
+ <Tasks>
+ <DefaultTask Name="_default" NavigationPage="MainPage.xaml" />
+ </Tasks>
+ <Tokens>
+ <PrimaryToken TokenID="MobileSpecUnitTestsToken" TaskName="_default">
+ <TemplateFlip>
+ <SmallImageURI IsResource="false" IsRelative="true">Background.png</SmallImageURI>
+ <Count>0</Count>
+ <BackgroundImageURI IsResource="false" IsRelative="true">Background.png</BackgroundImageURI>
+ <Title>MobileSpecUnitTests</Title>
+ <BackContent></BackContent>
+ <BackBackgroundImageURI></BackBackgroundImageURI>
+ <BackTitle></BackTitle>
+ <LargeBackgroundImageURI></LargeBackgroundImageURI>
+ <LargeBackContent></LargeBackContent>
+ <LargeBackBackgroundImageURI></LargeBackBackgroundImageURI>
+ <DeviceLockImageURI></DeviceLockImageURI>
+ <HasLarge>false</HasLarge>
+ </TemplateFlip>
+ </PrimaryToken>
+ </Tokens>
+ <ScreenResolutions>
+ <ScreenResolution Name="ID_RESOLUTION_WVGA" />
+ <ScreenResolution Name="ID_RESOLUTION_WXGA" />
+ <ScreenResolution Name="ID_RESOLUTION_HD720P" />
+ </ScreenResolutions>
+ </App>
+</Deployment>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/SplashScreenImage.jpg
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/SplashScreenImage.jpg b/lib/cordova-wp8/tests/MobileSpecUnitTests/SplashScreenImage.jpg
new file mode 100644
index 0000000..479d3e4
Binary files /dev/null and b/lib/cordova-wp8/tests/MobileSpecUnitTests/SplashScreenImage.jpg differ
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/www/accelerometer/index.html
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/www/accelerometer/index.html b/lib/cordova-wp8/tests/MobileSpecUnitTests/www/accelerometer/index.html
new file mode 100644
index 0000000..efa043b
--- /dev/null
+++ b/lib/cordova-wp8/tests/MobileSpecUnitTests/www/accelerometer/index.html
@@ -0,0 +1,138 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,initial-scale=1.0" />
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
+ <title>Cordova Mobile Spec</title>
+ <link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title" charset="utf-8">
+ <script type="text/javascript" charset="utf-8" src="../cordova.js"></script>
+
+
+<script type="text/javascript" charset="utf-8">
+
+ var deviceReady = false;
+
+ function roundNumber(num) {
+ var dec = 3;
+ var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
+ return result;
+ }
+
+ //-------------------------------------------------------------------------
+ // Acceleration
+ //-------------------------------------------------------------------------
+ var watchAccelId = null;
+
+ /**
+ * Start watching acceleration
+ */
+ var watchAccel = function() {
+ console.log("watchAccel()");
+
+ // Success callback
+ var success = function(a){
+ document.getElementById('x').innerHTML = roundNumber(a.x);
+ document.getElementById('y').innerHTML = roundNumber(a.y);
+ document.getElementById('z').innerHTML = roundNumber(a.z);
+ console.log("watchAccel success callback");
+ };
+
+ // Fail callback
+ var fail = function(e){
+ console.log("watchAccel fail callback with error code "+e);
+ stopAccel();
+ setAccelStatus(Accelerometer.ERROR_MSG[e]);
+ };
+
+ // Update acceleration every 1 sec
+ var opt = {};
+ opt.frequency = 1000;
+ watchAccelId = navigator.accelerometer.watchAcceleration(success, fail, opt);
+
+ setAccelStatus("Running");
+ };
+
+ /**
+ * Stop watching the acceleration
+ */
+ var stopAccel = function() {
+ console.log("stopAccel()");
+ setAccelStatus("Stopped");
+ if (watchAccelId) {
+ navigator.accelerometer.clearWatch(watchAccelId);
+ watchAccelId = null;
+ }
+ };
+
+ /**
+ * Get current acceleration
+ */
+ var getAccel = function() {
+ console.log("getAccel()");
+
+ // Stop accel if running
+ stopAccel();
+
+ // Success callback
+ var success = function(a){
+ document.getElementById('x').innerHTML = roundNumber(a.x);
+ document.getElementById('y').innerHTML = roundNumber(a.y);
+ document.getElementById('z').innerHTML = roundNumber(a.z);
+ };
+
+ // Fail callback
+ var fail = function(e){
+ console.log("getAccel fail callback with error code "+e);
+ setAccelStatus(Accelerometer.ERROR_MSG[e]);
+ };
+
+ // Make call
+ var opt = {};
+ navigator.accelerometer.getCurrentAcceleration(success, fail, opt);
+ };
+
+ /**
+ * Set accelerometer status
+ */
+ var setAccelStatus = function(status) {
+ document.getElementById('accel_status').innerHTML = status;
+ };
+
+ /**
+ * Function called when page has finished loading.
+ */
+ function init() {
+ console.log("accelerometer.init()");
+ document.addEventListener("deviceready", function() {
+ deviceReady = true;
+ console.log("Device="+device.platform+" "+device.version);
+ }, false);
+ window.setTimeout(function() {
+ if (!deviceReady) {
+ alert("Error: PhoneGap did not initialize. Demo will not run correctly.");
+ }
+ },1000);
+ }
+
+</script>
+
+ </head>
+ <body onload="init();" id="stage" class="theme">
+
+ <h1>Acceleration</h1>
+ <div id="info">
+ <div id="accel_status">Stopped</div>
+ <div ><table width="100%">
+ <tr><td width="20%">X:</td><td id="x"> </td></tr>
+ <tr><td width="20%">Y:</td><td id="y"> </td></tr>
+ <tr><td width="20%">Z:</td><td id="z"> </td></tr>
+ </table></div>
+ </div>
+
+ <h2>Action</h2>
+ <div class="btn large" onclick="getAccel();">Get Acceleration</div>
+ <div class="btn large" onclick="watchAccel();">Start Watch</div>
+ <div class="btn large" onclick="stopAccel();">Clear Watch</div>
+ <h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/www/audio/index.html
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/www/audio/index.html b/lib/cordova-wp8/tests/MobileSpecUnitTests/www/audio/index.html
new file mode 100644
index 0000000..42cfe83
--- /dev/null
+++ b/lib/cordova-wp8/tests/MobileSpecUnitTests/www/audio/index.html
@@ -0,0 +1,394 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,initial-scale=1.0" />
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
+ <title>Cordova Audio Tests</title>
+ <link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title" charset="utf-8"/>
+ <script type="text/javascript" charset="utf-8" src="../cordova.js"></script>
+
+
+<script type="text/javascript" charset="utf-8">
+
+ var deviceReady = false;
+
+ //-------------------------------------------------------------------------
+ // Audio player
+ //-------------------------------------------------------------------------
+ var media1 = null;
+ var media1Timer = null;
+ var audioSrc = null;
+ var recordSrc = "myRecording.mp3";
+
+ /**
+ * Play audio
+ */
+ function playAudio(url) {
+ console.log("playAudio()");
+ console.log(" -- media="+media1);
+
+ //var src = "http://neuga.s3.amazonaws.com/onclassical/strings-or gan.mp3";
+ var src = "http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3";
+ //var src = "/android_asset/www/Jet_Sledding.mp4"; // no work
+ //var src = "http://vprbbc.streamguys.net/vprbbc24.mp3"; // mp3 streaming
+
+ if (url) {
+ src = url;
+ }
+
+ // Stop playing if src is different from currently playing source
+ if (src != audioSrc) {
+ if (media1 != null) {
+ stopAudio();
+ media1 = null;
+ }
+ }
+
+ if (media1 == null) {
+
+
+ // TEST STREAMING AUDIO PLAYBACK
+ //var src = "http://nunzioweb.com/misc/Bon_Jovi-Crush_Mystery_Train.mp3"; // works
+ //var src = "http://nunzioweb.com/misc/Bon_Jovi-Crush_Mystery_Train.m3u"; // doesn't work
+ //var src = "http://www.wav-sounds.com/cartoon/bugsbunny1.wav"; // works
+ //var src = "http://www.angelfire.com/fl5/html-tutorial/a/couldyou.mid"; // doesn't work
+ //var src = "MusicSearch/mp3/train.mp3"; // works
+ //var src = "bryce.mp3"; // works
+ //var src = "/android_asset/www/bryce.mp3"; // works
+
+ media1 = new Media(src,
+ function() {
+ console.log("playAudio():Audio Success");
+ },
+ function(err) {
+ console.log("playAudio():Audio Error: "+err.code);
+ setAudioStatus("Error: " + err.code);
+ },
+ function(status) {
+ console.log("playAudio():Audio Status: "+status);
+ setAudioStatus(Media.MEDIA_MSG[status]);
+
+ // If stopped, then stop getting current position
+ if (Media.MEDIA_STOPPED == status) {
+ clearInterval(media1Timer);
+ media1Timer = null;
+ setAudioPosition("0 sec");
+ }
+ });
+ }
+ audioSrc = src;
+ document.getElementById('audio_duration').innerHTML = "";
+ // Play audio
+ media1.play();
+ if (media1Timer == null && media1.getCurrentPosition) {
+ media1Timer = setInterval(
+ function() {
+ media1.getCurrentPosition(
+ function(position) {
+ console.log("Pos="+position);
+ if (position >= 0.0) {
+ setAudioPosition(position+" sec");
+ }
+ },
+ function(e) {
+ console.log("Error getting pos="+e);
+ setAudioPosition("Error: "+e);
+ }
+ );
+ },
+ 1000
+ );
+ }
+
+ // Get duration
+ var counter = 0;
+ var timerDur = setInterval(
+ function() {
+ counter = counter + 100;
+ if (counter > 2000) {
+ clearInterval(timerDur);
+ }
+ var dur = media1.getDuration();
+ if (dur > 0) {
+ clearInterval(timerDur);
+ document.getElementById('audio_duration').innerHTML = dur + " sec";
+ }
+ }, 100);
+ }
+
+ /**
+ * Pause audio playback
+ */
+ function pauseAudio() {
+ console.log("pauseAudio()");
+ if (media1) {
+ media1.pause();
+ }
+ }
+
+ /**
+ * Stop audio
+ */
+ function stopAudio() {
+ console.log("stopAudio()");
+ if (media1) {
+ media1.stop();
+ media1.release();
+ }
+ clearInterval(media1Timer);
+ media1Timer = null;
+ }
+
+ /**
+ * Set audio status
+ */
+ var setAudioStatus = function(status) {
+ document.getElementById('audio_status').innerHTML = status;
+ };
+
+ /**
+ * Set audio position
+ */
+ var setAudioPosition = function(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ };
+
+ //-------------------------------------------------------------------------
+ // Audio recorder
+ //-------------------------------------------------------------------------
+ var mediaRec = null;
+ var recTime = 0;
+
+ /**
+ * Record audio
+ */
+ function recordAudio() {
+ console.log("recordAudio()");
+ console.log(" -- media="+mediaRec);
+ if (mediaRec == null) {
+
+ var src = recordSrc;
+ mediaRec = new Media(src,
+ function() {
+ console.log("recordAudio():Audio Success");
+ },
+ function(err) {
+ console.log("recordAudio():Audio Error: "+err.code);
+ setAudioStatus("Error: " + err.code);
+ },
+ function(status) {
+ console.log("recordAudio():Audio Status: "+status);
+ setAudioStatus(Media.MEDIA_MSG[status]);
+ }
+ );
+ }
+
+ navigator.notification.beep(1);
+
+ // Record audio
+ mediaRec.startRecord();
+
+ // Stop recording after 10 sec
+ recTime = 0;
+ var recInterval = setInterval(function() {
+ recTime = recTime + 1;
+ setAudioPosition(recTime+" sec");
+ if (recTime >= 10) {
+ clearInterval(recInterval);
+ if (mediaRec.stopAudioRecord){
+ mediaRec.stopAudioRecord();
+ } else {
+ mediaRec.stopRecord();
+ }
+ console.log("recordAudio(): stop");
+ navigator.notification.beep(1);
+ }
+ }, 1000);
+ }
+
+ /**
+ * Play back recorded audio
+ */
+ function playRecording() {
+ playAudio(recordSrc);
+ }
+
+ /**
+ * Function to create a file for iOS recording
+ */
+ function getRecordSrc() {
+ var fsFail = function(error) {
+ console.log("error creating file for iOS recording");
+ };
+ var gotFile = function(file) {
+ recordSrc = file.fullPath;
+ //console.log("recording Src: " + recordSrc);
+ };
+ var gotFS = function(fileSystem) {
+ fileSystem.root.getFile("iOSRecording.wav", {create: true}, gotFile, fsFail);
+ };
+ window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, gotFS, fsFail);
+ }
+
+ /**
+ * Function to create a file for BB recording
+ */
+ function getRecordSrcBB() {
+ var fsFail = function(error) {
+ console.log("error creating file for BB recording");
+ };
+ var gotFile = function(file) {
+ recordSrc = file.fullPath;
+ };
+ var gotFS = function(fileSystem) {
+ fileSystem.root.getFile("BBRecording.amr", {create: true}, gotFile, fsFail);
+ };
+ window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, gotFS, fsFail);
+ }
+
+ /**
+ * Function called when page has finished loading.
+ */
+ function init() {
+ document.addEventListener("deviceready", function() {
+ deviceReady = true;
+ if (device.platform.indexOf("iPhone") !=-1 || device.platform.indexOf("iPad") !=-1)
+ {
+ getRecordSrc();
+ } else if (typeof blackberry !== 'undefined') {
+ getRecordSrcBB();
+ }
+ console.log("Device="+device.platform+" "+device.version);
+ }, false);
+ window.setTimeout(function() {
+ if (!deviceReady) {
+ alert("Error: PhoneGap did not initialize. Demo will not run correctly.");
+ }
+ },1000);
+ }
+
+ /**
+ * for forced updates of position after a successful seek
+ */
+ function updatePosition() {
+ media1.getCurrentPosition(
+ function(position) {
+ console.log("Pos="+position);
+ if (position >= 0.0) {
+ setAudioPosition(position+" sec");
+ }
+ },
+ function(e) {
+ console.log("Error getting pos="+e);
+ setAudioPosition("Error: "+e);
+ });
+ }
+
+ /**
+ *
+ */
+ function seekAudio(mode) {
+ var time = document.getElementById("seekinput").value;
+ if (time == "") {
+ time = 5000;
+ } else {
+ time = time * 1000; //we expect the input to be in seconds
+ }
+ if (media1 == null) {
+ console.log("seekTo requested while media1 is null");
+ if (audioSrc == null) {
+ audioSrc = "http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3";
+ }
+ media1 = new Media(audioSrc,
+ function() {
+ console.log("seekToAudio():Audio Success");
+ },
+ function(err) {
+ console.log("seekAudio():Audio Error: "+err.code);
+ setAudioStatus("Error: " + err.code);
+ },
+ function(status) {
+ console.log("seekAudio():Audio Status: "+status);
+ setAudioStatus(Media.MEDIA_MSG[status]);
+
+ // If stopped, then stop getting current position
+ if (Media.MEDIA_STOPPED == status) {
+ clearInterval(media1Timer);
+ media1Timer = null;
+ setAudioPosition("0 sec");
+ }
+ });
+ }
+
+ media1.getCurrentPosition(
+ function (position) {
+ var deltat = time;
+ if (mode == "by") {
+ deltat = time + position * 1000;
+ }
+ media1.seekTo(deltat,
+ function () {
+ console.log("seekAudioTo():Audio Success");
+ //force an update on the position display
+ updatePosition();
+ },
+ function (err) {
+ console.log("seekAudioTo():Audio Error: " + err.code);
+ });
+ },
+ function(e) {
+ console.log("Error getting pos="+e);
+ setAudioPosition("Error: "+e);
+ });
+ }
+
+</script>
+
+ </head>
+ <body onload="init();" id="stage" class="theme">
+
+ <h1>Audio</h1>
+ <div id="info">
+ <table width="100%">
+ <tr><td><b>Status:</b></td><td id="audio_status"> </td></tr>
+ <tr><td><b>Duration:</b></td><td id="audio_duration"></td></tr>
+ <tr><td><b>Position:</b></td><td id="audio_position"></td></tr>
+ </table>
+ </div>
+ <h2>Action</h2>
+ <table>
+ <tr>
+ <th colspan=3>Play Sample Audio</th>
+ </tr>
+ <tr>
+ <td><div class="btn large" style="width:100%;" onclick="playAudio();">Play</div></td>
+ <td><div class="btn large" style="width:100%;" onclick="pauseAudio();">Pause</div></td>
+ <td><div class="btn large" style="width:100%;" onclick="stopAudio();">Stop</div></td>
+ </tr>
+ <tr>
+ <td><div class="btn large" style="width:100%;" onclick="seekAudio('by');">Seek By</div></td>
+ <td><div class="btn large" style="width:100%;" onclick="seekAudio('to');">Seek To</div></td>
+ <td>
+ <div style="width:100%;">
+ <input class="input numeric" type="number" id="seekinput" value="in seconds">
+ </div>
+ </td>
+ <td><h2>s</h2></td>
+ </tr>
+ <tr>
+ <th colspan=3><br><br>Record Audio</th>
+ </tr>
+ <tr>
+ <td colspan=3><div class="btn large" onclick="recordAudio();">Record Audio for 10 sec</a></td>
+ </tr>
+ <tr>
+ <td><div class="btn large" style="width:100%;" onclick="playRecording();">Play</div></td>
+ <td><div class="btn large" style="width:100%;" onclick="pauseAudio();">Pause</div></td>
+ <td><div class="btn large" style="width:100%;" onclick="stopAudio();">Stop</div></td>
+ </tr>
+ </table>
+
+ <h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
+
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/www/autotest/html/HtmlReporter.js
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/www/autotest/html/HtmlReporter.js b/lib/cordova-wp8/tests/MobileSpecUnitTests/www/autotest/html/HtmlReporter.js
new file mode 100644
index 0000000..7d9d924
--- /dev/null
+++ b/lib/cordova-wp8/tests/MobileSpecUnitTests/www/autotest/html/HtmlReporter.js
@@ -0,0 +1,101 @@
+jasmine.HtmlReporter = function(_doc) {
+ var self = this;
+ var doc = _doc || window.document;
+
+ var reporterView;
+
+ var dom = {};
+
+ // Jasmine Reporter Public Interface
+ self.logRunningSpecs = false;
+
+ self.reportRunnerStarting = function(runner) {
+ var specs = runner.specs() || [];
+
+ if (specs.length == 0) {
+ return;
+ }
+
+ createReporterDom(runner.env.versionString());
+ doc.body.appendChild(dom.reporter);
+
+ reporterView = new jasmine.HtmlReporter.ReporterView(dom);
+ reporterView.addSpecs(specs, self.specFilter);
+ };
+
+ self.reportRunnerResults = function(runner) {
+ reporterView && reporterView.complete();
+ };
+
+ self.reportSuiteResults = function(suite) {
+ reporterView.suiteComplete(suite);
+ };
+
+ self.reportSpecStarting = function(spec) {
+ if (self.logRunningSpecs) {
+ self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
+ }
+ };
+
+ self.reportSpecResults = function(spec) {
+ reporterView.specComplete(spec);
+ };
+
+ self.log = function() {
+ var console = jasmine.getGlobal().console;
+ if (console && console.log) {
+ if (console.log.apply) {
+ console.log.apply(console, arguments);
+ } else {
+ console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
+ }
+ }
+ };
+
+ self.specFilter = function(spec) {
+ if (!focusedSpecName()) {
+ return true;
+ }
+
+ return spec.getFullName().indexOf(focusedSpecName()) === 0;
+ };
+
+ return self;
+
+ function focusedSpecName() {
+ var specName;
+
+ (function memoizeFocusedSpec() {
+ if (specName) {
+ return;
+ }
+
+ var paramMap = [];
+ var params = doc.location.search.substring(1).split('&');
+
+ for (var i = 0; i < params.length; i++) {
+ var p = params[i].split('=');
+ paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
+ }
+
+ specName = paramMap.spec;
+ })();
+
+ return specName;
+ }
+
+ function createReporterDom(version) {
+ dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },
+ dom.banner = self.createDom('div', { className: 'banner' },
+ self.createDom('span', { className: 'title' }, "Jasmine "),
+ self.createDom('span', { className: 'version' }, version)),
+
+ dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),
+ dom.alert = self.createDom('div', {className: 'alert'}),
+ dom.results = self.createDom('div', {className: 'results'},
+ dom.summary = self.createDom('div', { className: 'summary' }),
+ dom.details = self.createDom('div', { id: 'details' }))
+ );
+ }
+};
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/www/autotest/html/HtmlReporterHelpers.js
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/www/autotest/html/HtmlReporterHelpers.js b/lib/cordova-wp8/tests/MobileSpecUnitTests/www/autotest/html/HtmlReporterHelpers.js
new file mode 100644
index 0000000..745e1e0
--- /dev/null
+++ b/lib/cordova-wp8/tests/MobileSpecUnitTests/www/autotest/html/HtmlReporterHelpers.js
@@ -0,0 +1,60 @@
+jasmine.HtmlReporterHelpers = {};
+
+jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
+ var el = document.createElement(type);
+
+ for (var i = 2; i < arguments.length; i++) {
+ var child = arguments[i];
+
+ if (typeof child === 'string') {
+ el.appendChild(document.createTextNode(child));
+ } else {
+ if (child) {
+ el.appendChild(child);
+ }
+ }
+ }
+
+ for (var attr in attrs) {
+ if (attr == "className") {
+ el[attr] = attrs[attr];
+ } else {
+ el.setAttribute(attr, attrs[attr]);
+ }
+ }
+
+ return el;
+};
+
+jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
+ var results = child.results();
+ var status = results.passed() ? 'passed' : 'failed';
+ if (results.skipped) {
+ status = 'skipped';
+ }
+
+ return status;
+};
+
+jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
+ var parentDiv = this.dom.summary;
+ var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
+ var parent = child[parentSuite];
+
+ if (parent) {
+ if (typeof this.views.suites[parent.id] == 'undefined') {
+ this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
+ }
+ parentDiv = this.views.suites[parent.id].element;
+ }
+
+ parentDiv.appendChild(childElement);
+};
+
+
+jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
+ for(var fn in jasmine.HtmlReporterHelpers) {
+ ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
+ }
+};
+
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0fea2dd2/lib/cordova-wp8/tests/MobileSpecUnitTests/www/autotest/html/ReporterView.js
----------------------------------------------------------------------
diff --git a/lib/cordova-wp8/tests/MobileSpecUnitTests/www/autotest/html/ReporterView.js b/lib/cordova-wp8/tests/MobileSpecUnitTests/www/autotest/html/ReporterView.js
new file mode 100644
index 0000000..6a6d005
--- /dev/null
+++ b/lib/cordova-wp8/tests/MobileSpecUnitTests/www/autotest/html/ReporterView.js
@@ -0,0 +1,164 @@
+jasmine.HtmlReporter.ReporterView = function(dom) {
+ this.startedAt = new Date();
+ this.runningSpecCount = 0;
+ this.completeSpecCount = 0;
+ this.passedCount = 0;
+ this.failedCount = 0;
+ this.skippedCount = 0;
+
+ this.createResultsMenu = function() {
+ this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},
+ this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'),
+ ' | ',
+ this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing'));
+
+ this.summaryMenuItem.onclick = function() {
+ dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');
+ };
+
+ this.detailsMenuItem.onclick = function() {
+ showDetails();
+ };
+ };
+
+ this.addSpecs = function(specs, specFilter) {
+ this.totalSpecCount = specs.length;
+
+ this.views = {
+ specs: {},
+ suites: {}
+ };
+
+ for (var i = 0; i < specs.length; i++) {
+ var spec = specs[i];
+ this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);
+ if (specFilter(spec)) {
+ this.runningSpecCount++;
+ }
+ }
+ };
+
+ this.specComplete = function(spec) {
+ this.completeSpecCount++;
+
+ if (isUndefined(this.views.specs[spec.id])) {
+ this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);
+ }
+
+ var specView = this.views.specs[spec.id];
+
+ switch (specView.status()) {
+ case 'passed':
+ this.passedCount++;
+ break;
+
+ case 'failed':
+ this.failedCount++;
+ break;
+
+ case 'skipped':
+ this.skippedCount++;
+ break;
+ }
+
+ specView.refresh();
+ this.refresh();
+ };
+
+ this.suiteComplete = function(suite) {
+ var suiteView = this.views.suites[suite.id];
+ if (isUndefined(suiteView)) {
+ return;
+ }
+ suiteView.refresh();
+ };
+
+ this.refresh = function() {
+
+ if (isUndefined(this.resultsMenu)) {
+ this.createResultsMenu();
+ }
+
+ // currently running UI
+ if (isUndefined(this.runningAlert)) {
+ this.runningAlert = this.createDom('a', {href: "?", className: "runningAlert bar"});
+ dom.alert.appendChild(this.runningAlert);
+ }
+ this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount);
+
+ // skipped specs UI
+ if (isUndefined(this.skippedAlert)) {
+ this.skippedAlert = this.createDom('a', {href: "?", className: "skippedAlert bar"});
+ }
+
+ this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
+
+ if (this.skippedCount === 1 && isDefined(dom.alert)) {
+ dom.alert.appendChild(this.skippedAlert);
+ }
+
+ // passing specs UI
+ if (isUndefined(this.passedAlert)) {
+ this.passedAlert = this.createDom('span', {href: "?", className: "passingAlert bar"});
+ }
+ this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount);
+
+ // failing specs UI
+ if (isUndefined(this.failedAlert)) {
+ this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"});
+ }
+ this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount);
+
+ if (this.failedCount === 1 && isDefined(dom.alert)) {
+ dom.alert.appendChild(this.failedAlert);
+ dom.alert.appendChild(this.resultsMenu);
+ }
+
+ // summary info
+ this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount);
+ this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing";
+ };
+
+ this.complete = function() {
+ dom.alert.removeChild(this.runningAlert);
+
+ this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
+
+ if (this.failedCount === 0) {
+ dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount)));
+ } else {
+ showDetails();
+ }
+
+ dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"));
+ };
+
+ return this;
+
+ function showDetails() {
+ if (dom.reporter.className.search(/showDetails/) === -1) {
+ dom.reporter.className += " showDetails";
+ }
+ }
+
+ function isUndefined(obj) {
+ return typeof obj === 'undefined';
+ }
+
+ function isDefined(obj) {
+ return !isUndefined(obj);
+ }
+
+ function specPluralizedFor(count) {
+ var str = count + " spec";
+ if (count > 1) {
+ str += "s"
+ }
+ return str;
+ }
+
+};
+
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView);
+
+