incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [75/78] [abbrv] [partial] added platform specs and basic work
Date Fri, 27 Jul 2012 00:29:17 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/example/www/events.html
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/example/www/events.html b/lib/cordova-1.9.0/lib/windows-phone/example/www/events.html
deleted file mode 100755
index 76db76c..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/example/www/events.html
+++ /dev/null
@@ -1,146 +0,0 @@
-<!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 name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=2.0, maximum-scale=4.0, minimum-scale=1.0" / -->
-    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
-    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> <!-- ISO-8859-1 -->
-    <title>Cordova</title>
-
-
-    <link rel="stylesheet" href="master.css" type="text/css" media="screen"/>
-    <script type="text/javascript" charset="utf-8" src="cordova-1.9.0.js"></script>
-
-
-<script type="text/javascript" charset="utf-8">
-
-
-    function interceptBackbutton() {
-    	eventOutput("Back button intercepted");
-    }
-    function interceptMenubutton() {
-    	eventOutput("Menu button intercepted");
-    }
-    function interceptSearchbutton() {
-    	eventOutput("Search button intercepted");
-    }
-
-    var eventOutput = function(s) {
-		console.log("eventOutput :: " + s);
-        var el = document.getElementById("results");
-        el.innerHTML = el.innerHTML + s + "<br/>";
-    };
-
-
-    /**
-     * Function called when page has finished loading.
-     */
-    function init()
-    {
-        document.addEventListener("deviceready", function() {
-                console.log("Device="+device.platform+" "+device.version);
-                eventOutput("deviceready event: "+device.platform+" "+device.version);
-            }, false);
-
-
-        document.addEventListener("resume", function() {eventOutput("resume event");}, false);
-        document.addEventListener("pause", function() {eventOutput("pause event");}, false);
-        window.addEventListener("online", function() {eventOutput("online event");});
-        window.addEventListener("offline", function() {eventOutput("offline event");});
-
-        window.addEventListener("orientationchange", onOrientationChangedA);
-
-        window.onorientationchange  = onOrientationChangedB;
-
-        console.log("window.orientation = " + window.orientation);
-    }
-
-    function tryCallback(orientation)
-    {
-        var evt = document.createEvent('HTMLEvents')
-        evt.initEvent( 'orientationchange', true, false );
-        window.dispatchEvent(evt);
-    }
-
-    function onOrientationChangedA(e)
-    {
-      console.log("A OrientationChange event received!!!!!! " + window.orientation);
-    }
-
-    function onOrientationChangedB(e)
-    {
-      console.log("B OrientationChange event received!!!!!! " + window.orientation);
-    }
-
-	function onInterceptClicked(bAdd)
-	{
-		console.log("onInterceptClicked " + bAdd);
-		if(bAdd)
-		{
-			document.addEventListener('backbutton', interceptBackbutton, false);
-		}
-		else
-		{
-			document.removeEventListener('backbutton', interceptBackbutton, false);
-		}
-	}
-
-	function goBack()
-	{
-		document.location = "index.html";
-	}
-
-	function doBlur()
-	{
-		console.log("doBlur");
-	}
-
-	function doUnload()
-	{
-		console.log("doUnload");
-	}
-
-	function doFocus()
-	{
-		console.log("doFocus");
-	}
-
-</script>
-
-  </head>
-  <body onLoad="init();" onBlur="doBlur()" onUnload="doUnload()" onFocus="doFocus()" id="stage" class="theme">
-
-    <h1>Events</h1>
-    <div id="info">
-        Results:<br/>
-        <span id="results"></span>
-    </div>
-
-    <h2>Action</h2>
-    <div class="btn large" onclick="onInterceptClicked(1);">Intercept backbutton</div>
-    <div class="btn large" onclick="onInterceptClicked(0);">Stop intercept of backbutton</div>
-    <div class="btn large" onclick="document.addEventListener('menubutton', interceptMenubutton, false);">Intercept menubutton</div>
-    <div class="btn large" onclick="document.removeEventListener('menubutton', interceptMenubutton, false);">Stop intercept of menubutton</div>
-    <div class="btn large" onclick="document.addEventListener('searchbutton', interceptSearchbutton, false);">Intercept searchbutton</div>
-    <div class="btn large" onclick="document.removeEventListener('searchbutton', interceptSearchbutton, false);">Stop intercept of searchbutton</div>
-    <div/>
-    <a href="index.html" class="backBtn">Back</a>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/example/www/file.html
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/example/www/file.html b/lib/cordova-1.9.0/lib/windows-phone/example/www/file.html
deleted file mode 100755
index 5f3043f..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/example/www/file.html
+++ /dev/null
@@ -1,284 +0,0 @@
-<!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 name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=2.0, maximum-scale=4.0, minimum-scale=1.0" / -->
-    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
-    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> <!-- ISO-8859-1 -->
-    <title>Cordova</title>
-    <link rel="stylesheet" href="master.css" type="text/css" media="screen"/>
-
-
-    <script type="text/javascript" charset="utf-8" src="cordova-1.9.0.js"></script>
-
-
-<script type="text/javascript" charset="utf-8">
-
-    var deviceReady = false;
-    var persistent_root;
-
-    var getFileSystemRoot = (function () {
-
-        var onError = function (error) {
-            console.log('unable to retrieve file system: ' + error.code);
-        };
-
-        // one-time retrieval of the root file system entry
-        if (typeof persistent_root === 'undefined') {
-            window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
-                function (fileSystem) {
-                    persistent_root = fileSystem.root;
-                }, onError);
-        }
-
-        // public function returns private root entry
-        return persistent_root;
-
-    });
-
-
-    /**
-    * Gets file or directory
-    */
-    function getEntry(isFile, onSuccess, options) {
-
-        var root = getFileSystemRoot();
-        //TODO
-        console.log(typeof root);
-        var filePath = document.getElementById('filePath');
-
-        var onGetEntryError = function (fileError) {
-        console.log("Error creating/opening file/directory: " + fileError.code);
-        document.getElementById('file_status').innerHTML = "Error creating/opening file/directory: " + fileError.code;
-        };
-
-        if (isFile == true) {
-            console.log('Creating file');
-            root.getFile(
-            filePath.value,
-            options,
-            onSuccess,
-            onGetEntryError);
-        } else {
-            console.log('Creating directory');
-            root.getDirectory(
-            filePath.value,
-            options,
-            onSuccess,
-            onGetEntryError);
-        }
-    };
-
-    /**
-    * Creates or opens file/directory
-    */
-    function createOrOpen(isFile) {
-        var onGetEntrySuccess = function (fileEntry) {
-        document.getElementById('file_status').innerHTML = "isFile: " + fileEntry.isFile + "; isDirectory: " + fileEntry.isDirectory + "; name: " + fileEntry.name + "; path: " + fileEntry.fullPath;
-        entry = fileEntry;
-        };
-        getEntry(isFile, onGetEntrySuccess, {create: true, exclusive: true});
-    };
-
-    /**
-    * Check if file/directory exists
-    */
-    function isExists(isFile) {
-
-        console.log("Start checking...");
-
-        var root = getFileSystemRoot();
-
-        var onError = function (fileError) {
-            console.log("Error checking file/directory: " + fileError.code);
-            document.getElementById('file_status').innerHTML = "Error checking file/directory: " + fileError.code;
-        };
-
-        var onSuccess = function (isExist) {
-            document.getElementById('file_status').innerHTML = "is exists: " + isExist;
-        };
-
-        var filePath = document.getElementById('filePath');
-
-        if (isFile == true) {
-            console.log('check if file exists');
-            navigator.fileMgr.testFileExists(
-            filePath.value,
-            onSuccess,
-            onError);
-        } else {
-            navigator.fileMgr.testDirectoryExists(
-            filePath.value,
-            onSuccess,
-            onError);
-        }
-    };
-
-
-
-    /**
-    * Remove file or directory
-    */
-    function remove(isFile) {
-
-        var onSuccess = function (fileEntry) {
-
-            var onRemoveError = function (fileError) {
-            console.log("Error removing file/directory: " + fileError.code);
-            document.getElementById('file_status').innerHTML = "Error removing file/directory: " + fileError.code;
-            };
-
-            var onRemoveSuccess = function () {
-                document.getElementById('file_status').innerHTML = "file/directory was removed";
-            };
-
-            fileEntry.remove(onRemoveSuccess, onRemoveError);
-        };
-
-        getEntry(isFile, onSuccess, {create: false});
-
-    };
-
-    /**
-    * Writes data in file
-    */
-    function writeInFile() {
-        var onSuccess = function (fileEntry) {
-
-            var writer = new FileWriter(fileEntry);
-
-            writer.onwrite = function (evt) {
-                console.log("End writing...");
-                document.getElementById('file_status').innerHTML = writer.length + " bytes was written";
-            };
-            writer.onerror = function (evt) {
-                console.log("writing error");
-                document.getElementById('file_status').innerHTML = "writing error: " + evt.target.error;
-            };
-            writer.write(textToWrite.value);
-            console.log("End writing");
-        };
-        console.log("Start getting entry");
-        getEntry(true, onSuccess, { create: false });
-    };
-
-    /**
-    * Reads file as base64 string
-    */
-    function readAsBase64() {
-        var onSuccess = function (fileEntry) {
-            var reader = new FileReader();
-            reader.onloadend = function (evt) {
-                console.log("read success");
-                document.getElementById('file_status').innerHTML = evt.target.result;
-            };
-            reader.onerror = function (evt) {
-                console.log("read error");
-                document.getElementById('file_status').innerHTML = "read error: " + evt.target.error;
-            };
-
-            reader.readAsDataURL(fileEntry);
-        };
-
-        console.log("Start getting entry");
-        getEntry(true, onSuccess, { create: false });
-
-    };
-
-    /**
-    * Uploads selected file to specified server
-    */
-    function uploadFile() {
-
-        var onSuccess = function (fileUploadResult) {
-            console.log("Upload success");
-            document.getElementById('file_status').innerHTML = "Code: " + fileUploadResult.responseCode + "; Sent = " + fileUploadResult.bytesSent + "; Response:  " + fileUploadResult.response;
-        };
-
-        var onError = function (error) {
-            document.getElementById('file_status').innerHTML = "Upload error: " + error.code;
-        };
-
-        console.log("Set upload parameters");
-        var options = new FileUploadOptions();
-
-        options.fileKey = "file";
-        options.fileName = "newFile.txt";
-        options.mimeType = "text/plain";
-        var filePath = document.getElementById('filePath').value;
-        var server = document.getElementById('server').value;
-
-        var params = new Object();
-        params.key1 = "value1";
-        params.key2 = "value2";
-        options.params = params;
-
-        var fileTransfer = new FileTransfer();
-
-        fileTransfer.upload(filePath, server, onSuccess, onError, options);
-    };
-
-    /**
-    * Function called when page has finished loading.
-    */
-    function init() {
-        document.addEventListener("deviceready", function () {
-            deviceReady = true;
-            console.log("Device=" + device.platform + " " + device.version);
-            getFileSystemRoot();
-        }, false);
-        window.setTimeout(function () {
-            if (!deviceReady) {
-                alert("Error: Cordova did not initialize.  Demo will not run correctly.");
-            }
-        }, 1000);
-    }
-
-</script>
-
-  </head>
-  <body onLoad="init();" id="stage" class="theme">
-
-    <h1>File</h1>
-    <div id="info">
-        <span class='tb-label'>Enter file/directory name here:</span> <span id="Span1"></span>
-        <input type="text" id="filePath" style="width:250px;height:20px;"/>
-        <br/>
-        <span class='tb-label'>Enter text to write in file :</span> <span id="Span2"></span>
-        <input type="text" id="textToWrite" style="width:250px;height:20px;"/>
-        <br/>
-        <span class='tb-label'>Enter URL to upload file to: </span> <span id="Span3"></span>
-        <input type="text" id="server" value='http://posttestserver.com/post.php?dir=phonegapTest' style="width:250px;height:20px;"/>
-        <br/>
-        Result: <span id="file_status"></span>
-    </div>
-    <h2>Action</h2>
-    <a href="#" class="btn large" onclick="createOrOpen(true);">Create/Open file</a>
-    <a href="#" class="btn large" onclick="createOrOpen(false);">Create/Open directory</a>
-    <a href="#" class="btn large" onclick="isExists(true);">Check if file exists</a>
-    <a href="#" class="btn large" onclick="isExists(false);">Check if directory exists</a>
-    <a href="#" class="btn large" onclick="remove(true);">Remove file</a>
-    <a href="#" class="btn large" onclick="remove(false);">Remove directory</a>
-    <a href="#" class="btn large" onclick="writeInFile();">Write in file (type text in the second field)</a>
-    <a href="#" class="btn large" onclick="readAsBase64();">Read file as base64</a>
-    <a href="#" class="btn large" onclick="uploadFile();">Upload file</a>
-    <h2> </h2><a href="index.html" class="backBtn">Back</a>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/example/www/index.html
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/example/www/index.html b/lib/cordova-1.9.0/lib/windows-phone/example/www/index.html
deleted file mode 100755
index 4eb0c83..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/example/www/index.html
+++ /dev/null
@@ -1,108 +0,0 @@
-<!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 name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
-    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
-
-    <title>Cordova WP7</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-1.9.0.js"></script>
-
-      <script type="text/javascript">
-
-
-        document.addEventListener("deviceready",onDeviceReady,false);
-        document.addEventListener("backbutton",onBackButton,false);
-
-        // once the device ready event fires, you can safely do your thing! -jm
-        function onDeviceReady()
-        {
-        // IE does NOT provide an alert method, you can patch it with this line after deviceready.
-        window.alert = window.alert || navigator.notification.alert;
-
-        console.log("onDeviceReady. You should see this message in Visual Studio's output window.");
-        updateDeviceInfo();
-
-        }
-
-        function onBackButton()
-        {
-        console.log("onBackButton");
-        }
-
-        function updateDeviceInfo()
-        {
-        document.getElementById("platform").innerHTML = device.platform;
-        document.getElementById("version").innerHTML = device.version;
-        document.getElementById("uuid").innerHTML = device.uuid;
-        document.getElementById("name").innerHTML = device.name;
-        document.getElementById("width").innerHTML = screen.width;
-        document.getElementById("height").innerHTML = screen.height;
-        document.getElementById("colorDepth").innerHTML = screen.colorDepth;
-        };
-
-      </script>
-
-
-
-
-  </head>
-  <body>
-    <h1>Cordova Tests</h1>
-    <div id="info">
-      <h4>
-        Platform: <span id="platform"> </span>
-      </h4>
-      <h4>
-        Version: <span id="version"></span>
-      </h4>
-      <h4>
-        UUID: <span id="uuid"> </span>
-      </h4>
-      <h4>
-        Name: <span id="name"></span>
-      </h4>
-      <h4>
-        Width: <span id="width"></span>,   Height: <span id="height">
-          
-        </span>, Color Depth: <span id="colorDepth"></span>
-      </h4>
-    </div>
-
-    <a href="accelerometer.html" class="btn large">Accelerometer</a>
-    <a href="accelerometer2.html" class="btn large">Accel Game</a>
-    <a href="audio.html" class="btn large">Audio Play/Record</a>
-    <a href="camera.html" class="btn large">Camera</a>
-    <a href="capture.html" class="btn large">Capture</a>
-    <a href="compass.html" class="btn large">Compass</a>
-    <a href="network.html" class="btn large">Connection</a>
-    <a href="contacts.html" class="btn large">Contacts</a>
-    <a href="events.html" class="btn large">Events</a>
-    <a href="file.html" class="btn large">File</a>
-    <a href="location.html" class="btn large">Location</a>
-    <a href="notification.html" class="btn large">Notification</a>
-    <a href="storage.html" class="btn large">Local Storage</a>
-    <a href="calculator.html" class="btn large">Calculator (custom plugin)</a>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/example/www/location.html
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/example/www/location.html b/lib/cordova-1.9.0/lib/windows-phone/example/www/location.html
deleted file mode 100755
index dd6a752..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/example/www/location.html
+++ /dev/null
@@ -1,165 +0,0 @@
-<!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 name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=2.0, maximum-scale=4.0, minimum-scale=1.0" / -->
-    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
-    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
-    <title>Cordova</title>
-    <link rel="stylesheet" href="master.css" type="text/css" media="screen"/>
-
-
-    <script type="text/javascript" charset="utf-8" src="cordova-1.9.0.js"></script>
-
-
-
-
-<script type="text/javascript" charset="utf-8">
-
-    var deviceReady = false;
-
-    //-------------------------------------------------------------------------
-    // Location
-    //-------------------------------------------------------------------------
-    var watchLocationId = null;
-
-    /**
-     * Start watching location
-     */
-    var watchLocation = function() {
-        console.log("watchLocation()");
-
-        // Success callback
-        var success = function(p){
-            document.getElementById('latitude').innerHTML = p.coords.latitude;
-            document.getElementById('longitude').innerHTML = p.coords.longitude;
-
-			document.getElementById('tdAlt').innerHTML = p.coords.altitude;
-			document.getElementById('tdAcc').innerHTML = p.coords.accuracy;
-			document.getElementById('tdAltAcc').innerHTML = p.coords.altitudeAccuracy;
-			document.getElementById('tdHeading').innerHTML = p.coords.heading;
-			document.getElementById('tdSpeed').innerHTML = p.coords.speed;
-        };
-
-        // Fail callback
-        var fail = function(e){
-            console.log("watchLocation fail callback with error code "+e);
-            stopLocation();
-        };
-
-        // Get location
-        watchLocationId = navigator.geolocation.watchPosition(success, fail, {enableHighAccuracy: true});
-        setLocationStatus("Running");
-    };
-
-    /**
-     * Stop watching the location
-     */
-    var stopLocation = function() {
-        setLocationStatus("Stopped");
-        if (watchLocationId) {
-            navigator.geolocation.clearWatch(watchLocationId);
-            watchLocationId = null;
-        }
-    };
-
-    /**
-     * Get current location
-     */
-    var getLocation = function() {
-        console.log("getLocation()");
-
-        // Stop location if running
-        stopLocation();
-
-        // Success callback
-        var success = function(p)
-		{
-            document.getElementById('latitude').innerHTML = p.coords.latitude;
-            document.getElementById('longitude').innerHTML = p.coords.longitude;
-
-			document.getElementById('tdAlt').innerHTML = p.coords.altitude;
-			document.getElementById('tdAcc').innerHTML = p.coords.accuracy;
-			document.getElementById('tdAltAcc').innerHTML = p.coords.altitudeAccuracy;
-			document.getElementById('tdHeading').innerHTML = p.coords.heading;
-			document.getElementById('tdSpeed').innerHTML = p.coords.speed;
-
-            setLocationStatus("Done");
-        };
-
-        // Fail callback
-        var fail = function(e){
-            console.log("getLocation fail callback with error code "+e.code);
-            setLocationStatus("Error: "+e.code);
-        };
-
-        // Get location
-        navigator.geolocation.getCurrentPosition(success, fail, {enableHighAccuracy: true}); //, {timeout: 10000});
-        setLocationStatus("Retrieving location...");
-
-    };
-
-    /**
-     * Set location status
-     */
-    var setLocationStatus = function(status) {
-        document.getElementById('location_status').innerHTML = status;
-    };
-
-    /**
-     * Function called when page has finished loading.
-     */
-    function init() {
-        document.addEventListener("deviceready", function() {
-                deviceReady = true;
-                console.log("Device="+device.platform+" "+device.version);
-            }, false);
-        window.setTimeout(function() {
-        	if (!deviceReady) {
-        		alert("Error: Cordova did not initialize.  Demo will not run correctly.");
-        	}
-        },1000);
-    }
-
-</script>
-
-  </head>
-  <body onLoad="init();" id="stage" class="theme">
-
-    <h1>Location</h1>
-    <div id="info">
-        <b>Status:</b> <span id="location_status">Stopped</span>
-        <table width="100%">
-            <tr><td><b>Latitude:</b></td><td id="latitude"> </td></tr>
-            <tr><td><b>Longitude:</b></td><td id="longitude"> </td></tr>
-            <tr><td><b>Altitude:</b></td><td id="tdAlt"> </td></tr>
-            <tr><td><b>Accuracy:</b></td><td id="tdAcc"> </td></tr>
-            <tr><td><b>Altitude Accuracy:</b></td><td id="tdAltAcc"> </td></tr>
-            <tr><td><b>Heading:</b></td><td id="tdHeading"> </td></tr>
-            <tr><td><b>Speed:</b></td><td id="tdSpeed"> </td></tr>
-        </table>
-    </div>
-    <h2>Action</h2>
-    <a href="#" class="btn large" onClick="getLocation();">Get Location</a>
-    <a href="#" class="btn large" onClick="watchLocation();">Start Watching Location</a>
-    <a href="#" class="btn large" onClick="stopLocation();">Stop Watching Location</a>
-    <h2> </h2><a href="index.html" class="backBtn">Back</a>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/example/www/master.css
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/example/www/master.css b/lib/cordova-1.9.0/lib/windows-phone/example/www/master.css
deleted file mode 100755
index 7898afa..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/example/www/master.css
+++ /dev/null
@@ -1,156 +0,0 @@
-/**
-    PhoneFontSizeSmall=14pt
-    PhoneFontSizeNormal = 15pt
-    PhoneFontSizeMedium=17pt
-    PhoneFontSizeMediumLarge=19pt
-    PhoneFontSizeLarge=24pt
-    PhoneFontSizeExtraLarge=32pt
-    PhoneFontSizeExtraExtraLarge=54pt
-    PhoneFontSizeHuge=140pt
-*/
-
-/** 
-
-main wp7 color and fonts 
-
-*/
-  
-body, input, div
-{
-    background: black;
-    color: White;
-    font-family: Segoe WP;
-    font-size: 15pt; /* PhoneFontSizeNormal */
-    margin-left:0.1em;
-    filter: progid:DXImageTransform.Microsoft.Shadow(color=#000000,direction=45);
-}
-
-h1, h2, h3, h4 
-{    
-    display: block;
-    font-family: Segoe WP Light;
-    font-weight: bold;
-    margin: 0 0.1em;
-    min-height: 1.1em;
-    outline: 0 none;
-    overflow: hidden;
-    padding: 0;
-    text-align: left;
-    white-space: nowrap;
- }
-
-h1
-{
-    font-size: 32pt; /* PhoneFontSizeExtraLarge */ 
-}
-
-h2
-{
-    font-size: 24pt; /* PhoneFontSizeLarge */
-    font-weight: normal;
-}
-
-h3
-{
-    font-size: 17pt; /* PhoneFontSizeMedium */
-}
-
-h4
-{
-    font-size: 15pt; /* PhoneFontSizeNormal */
-    font-weight: normal;
-}
-
-h4 > span
-{
-    color: gray;
-}
-
-/** 
-
-Buttons
-
-*/
-
-a.btn, div.btn
-{
-    background: black;
-    color: white;
-    text-decoration: none;
-    display:block;
-    font-size: 15pt;
-    text-decoration:none;
-    padding:0.7em 0;
-    margin:3px 0px 3px 5px;
-}
-
-a.backBtn, input[type="button"], input[type="submit"]
-{
-    background: black;
-    color: white;
-    border-color: white;
-    border-style: solid;
-    padding: 4px 10px;
-    border-width: 3px; /* PhoneBorderThickness */
-    font-size: 17pt; /* PhoneFontSizeMedium */
-    display: block;
-    text-decoration:none;
-    text-transform:lowercase;
-  
-}
-
-input[type="button"]:active, input[type="submit"]:active
-{
-    background: white;
-    color: black;
-}
-
-/** 
-
-Input fields 
-
-*/
-
-input[type="text"]
-{
-    width: 150px;
-    padding:4px;
-    margin-bottom: 14px;
-    box-shadow: 0px 0px 12px #387bbe;
-    background-color: #8c8e8b;
-    border: 1px solid #B3B3B3;
-    color: #3e3e3e;
-    text-shadow: 0 1px 0 #FFFFFF;
-}
-
-input[type="text"]:focus,
-input[type="text"]:active {
-    box-shadow: 0 0 12px #387BBE;
-    background-color: #f0f0f0;
-}
-
-span.tb-label
-{
-    padding: 4px 10px 8px 4px;
-    font-size: 12pt;
-    color: grey; 
-    display: block;
-}
-
-/** 
-
-application specific styles
-
-*/
-
-#info {
-    border-bottom: 1px solid #666666;
-    border-top: 1px solid #666666;
-}
-
-#info table
-{
-    font-family: Segoe WP Light;
-}
-
-  

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/example/www/network.html
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/example/www/network.html b/lib/cordova-1.9.0/lib/windows-phone/example/www/network.html
deleted file mode 100755
index 0ea71d9..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/example/www/network.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!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 name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=2.0, maximum-scale=4.0, minimum-scale=1.0" / -->
-    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
-    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> <!-- ISO-8859-1 -->
-    <title>Cordova</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-1.9.0.js"></script>
-
-
-    <script type="text/javascript" charset="utf-8">
-
-    var deviceReady = false;
-
-    //-------------------------------------------------------------------------
-    // Notifications
-    //-------------------------------------------------------------------------
-
-    function getConnectionState()
-	{
-        var networkState = navigator.network.connection.type;
-
-        var states = {};
-        states[Connection.UNKNOWN]  = 'Unknown connection';
-        states[Connection.ETHERNET] = 'Ethernet connection';
-        states[Connection.WIFI]     = 'WiFi connection';
-        states[Connection.CELL_2G]  = 'Cell 2G connection';
-        states[Connection.CELL_3G]  = 'Cell 3G connection';
-        states[Connection.CELL_4G]  = 'Cell 4G connection';
-        states[Connection.NONE]     = 'No network connection';
-
-
-        document.getElementById("info").innerHTML = 'Connection type: ' + networkState;
-    };
-
-
-
-
-
-
-    /**
-     * Function called when page has finished loading.
-     */
-    function init() {
-
-
-
-        document.addEventListener("deviceready", function() {
-                deviceReady = true;
-                console.log("Device="+device.platform+" "+device.version);
-
-				Cordova.onCordovaConnectionReady.subscribeOnce(getConnectionState);
-
-            }, false);
-        window.setTimeout(function() {
-        	if (!deviceReady) {
-        		console.log("Error: Cordova did not initialize.  Demo will not run correctly.");
-        	}
-        },1000);
-    }
-
-</script>
-
-  </head>
-  <body onLoad="init();" id="stage" class="theme">
-
-    <h1>Network Connection</h1>
-    <div id="info">
-    </div>
-
-    <h2>Action</h2>
-    <a href="#" class="btn large" onClick="getConnectionState();">Get Connection State</a>
-
-    <a href="index.html" class="backBtn">Back</a>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/example/www/notification.html
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/example/www/notification.html b/lib/cordova-1.9.0/lib/windows-phone/example/www/notification.html
deleted file mode 100755
index 43b3710..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/example/www/notification.html
+++ /dev/null
@@ -1,112 +0,0 @@
-<!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 name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=2.0, maximum-scale=4.0, minimum-scale=1.0" / -->
-    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
-    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> <!-- ISO-8859-1 -->
-    <title>Cordova</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-1.9.0.js"></script>
-
-    <script type="text/javascript" charset="utf-8">
-
-      var deviceReady = false;
-
-      //-------------------------------------------------------------------------
-      // Notifications
-      //-------------------------------------------------------------------------
-
-      function doBeep(x)
-      {
-
-      navigator.notification.beep(x || 1);
-      };
-
-      function doVibrate()
-      {
-      navigator.notification.vibrate(0);
-      };
-
-      function doAlert()
-      {
-      var message = "This is an Alert dialog";
-      var title = "Attention!";
-
-      navigator.notification.alert(message,
-      function()
-      {
-      console.log("Alert dismissed.");
-      },
-      title);
-
-      console.log("After alert");
-      };
-
-      function doConfirm()
-      {
-      var message = "This is a confirm dialog";
-      var title = "Please Confirm";
-      var buttons = "OK,Cancel";
-      navigator.notification.confirm(message,
-      function(r) {
-      console.log("You selected " + r);
-
-      },
-      title,
-      buttons);
-      }
-
-
-      /**
-      * Function called when page has finished loading.
-      */
-      function init() {
-      document.addEventListener("deviceready", function() {
-      deviceReady = true;
-      console.log("Device="+device.platform+" "+device.version);
-      }, false);
-      window.setTimeout(function() {
-      if (!deviceReady) {
-      console.log("Error: Cordova did not initialize.  Demo will not run correctly.");
-      }
-      },3000);
-      }
-
-    </script>
-
-  </head>
-  <body onLoad="init();" id="stage" class="theme">
-
-    <h1>Notifications and Dialogs</h1>
-    <div id="info">
-    </div>
-
-    <h2>Action</h2>
-    <a class="btn large" onClick="doBeep();">Beep Once</a>
-    <a class="btn large" onClick="doBeep(3);">Beep 3X</a>
-    <a class="btn large" onClick="doVibrate();">Vibrate</a>
-    <a class="btn large" onClick="doAlert();">Show Alert Dialog</a>
-    <a class="btn large" onClick="doConfirm();">Show Confirm Dialog</a>
-    <h2> </h2><a href="index.html" class="backBtn">Back</a>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/example/www/storage.html
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/example/www/storage.html b/lib/cordova-1.9.0/lib/windows-phone/example/www/storage.html
deleted file mode 100755
index dd47550..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/example/www/storage.html
+++ /dev/null
@@ -1,78 +0,0 @@
-<!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 name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=2.0, maximum-scale=4.0, minimum-scale=1.0" / -->
-    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
-    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
-    <title>Cordova</title>
-    <link rel="stylesheet" href="master.css" type="text/css" media="screen"/>
-
-
-    <script type="text/javascript" charset="utf-8" src="cordova-1.9.0.js"></script>
-
-
-<script type="text/javascript" charset="utf-8">
-
-    var deviceReady = false;
-
-    /**
-     * Function called when page has finished loading.
-     */
-    function init() {
-        document.addEventListener("deviceready", function() {
-                deviceReady = true;
-                console.log("Device="+device.platform+" "+device.version);
-            }, false);
-        window.setTimeout(function() {
-        	if (!deviceReady) {
-        		alert("Error: Cordova did not initialize.  Demo will not run correctly.");
-        	}
-        },1000);
-    }
-
-</script>
-
-  </head>
-  <body onLoad="init();" id="stage" class="theme">
-
-    <h1>Local Storage</h1>
-    <div id="info">
-        You have loaded this view <span id="count">an untold number of</span> time(s).
-    </div>
-
-    <script>
-
-	    console.log("sessionStorage = " + (  'sessionStorage' in window && window.sessionStorage != null ));
-	    console.log("localStorage = " + (  'localStorage' in window && window.localStorage != null ));
-
-      if (!localStorage.pageLoadCount)
-      {
-        localStorage.setItem("pageLoadCount",0);
-      }
-
-      localStorage.setItem("pageLoadCount",parseInt(localStorage.pageLoadCount) + 1);
-
-      document.getElementById('count').textContent = localStorage.pageLoadCount;
-    </script>
-
-      <h2> </h2><a href="index.html" class="backBtn">Back</a>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/BrowserMouseHelper.cs
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/BrowserMouseHelper.cs b/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/BrowserMouseHelper.cs
deleted file mode 100755
index 6c8f541..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/BrowserMouseHelper.cs
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- 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.Linq;
-using System.Windows;
-using System.Windows.Controls;
-using Microsoft.Phone.Controls;
-using System.Windows.Input;
-using System.Diagnostics;
-using System.Windows.Media;
-using System;
-using System.Collections.Generic;
-
-namespace WP7CordovaClassLib
-{
-
-    /// <summary>
-    /// Suppresses pinch zoom and optionally scrolling of the WebBrowser control
-    /// </summary>
-    public class BrowserMouseHelper
-    {
-
-        /**
-         * 
-         * Full Script below, in use it is minified.
-        */
-        /*
-        private static string mouseScript =
-        @"(function(win,doc){
-            var mPro = MouseEvent.prototype;
-            var def = Object.defineProperty;
-            def( mPro, 'pageX', {
-               configurable: true,
-               get: function(){ return this.clientX }
-            });
-            def( mPro, 'pageY', {
-               configurable: true,
-               get: function(){ return this.clientY }
-            });
-
-            win.onNativeMouseEvent = function(type,x,y){
-                try {
-                    var xMod = screen.logicalXDPI / screen.deviceXDPI;
-                    var yMod = screen.logicalYDPI / screen.deviceYDPI;
-                    var evt = doc.createEvent('MouseEvents');
-                    var xPos =  doc.body.scrollLeft + Math.round(xMod * x);
-                    var yPos =  doc.body.scrollTop + Math.round(yMod * y);
-                    var element = doc.elementFromPoint(xPos,yPos);
-                    
-                    evt.initMouseEvent(type, true, true, win, 1, xPos, yPos, xPos, yPos, false, false, false, false, -1, null);
-                    evt.timeStamp = +new Date;
-                    evt.isCordovaEvent = true;
-                    
-                    var canceled = element ? !element.dispatchEvent(evt) : !doc.dispatchEvent(evt);
-                    return canceled ? 'true' : 'false';
-                }
-                catch(e) { return e;}
-            }
-        })(window,document);";
-        */
-
-        private static string MinifiedMouseScript = "(function(g,a){var c=MouseEvent.prototype,d=Object.defineProperty;d(c,'pageX',{configurable:!0,get:function(){return this.clientX}});d(c,'pageY',{configurable:!0,get:function(){return this.clientY}});g.onNativeMouseEvent=function(c,d,i)"
-        + "{try{var j=screen.logicalXDPI/screen.deviceXDPI,k=screen.logicalYDPI/screen.deviceYDPI,b=a.createEvent('MouseEvents'),e=a.body.scrollLeft+Math.round(j*d),f=a.body.scrollTop+Math.round(k*i),h=a.elementFromPoint(e,f);b.initMouseEvent(c,!0,!0,g,1,e,f,e,f,!1,!1,!1,!1,-1,"
-        + "null);b.timeStamp=+new Date;b.isCordovaEvent=!0;return(h?!h.dispatchEvent(b):!a.dispatchEvent(b))?'true':'false'}catch(l){return l}}})(window,document);";
-
-
-        private WebBrowser _browser;
-
-        /// <summary>
-        /// Gets or sets whether to suppress the scrolling of
-        /// the WebBrowser control;
-        /// </summary>
-        public bool ScrollDisabled { get; set; }
-
-        private bool userScalable = true;
-        private double maxScale = 2.0;
-        private double minScale = 0.5;
-        protected Border border;
-        private bool firstMouseMove = false;
-
-        /// <summary>
-        /// Represents last known mouse down position. 
-        /// Used to determine mouse move delta to avoid duplicate mouse events.
-        /// </summary>
-        private Point mouseDownPos;
-
-        /// <summary>
-        /// Represent min delta value to consider event as a mouse move. Experimental calculated.
-        /// </summary>
-        private const int MouseMoveDeltaThreshold = 10;
-
-
-        public BrowserMouseHelper(ref WebBrowser browser)
-        {
-            _browser = browser;
-            browser.Loaded += new RoutedEventHandler(browser_Loaded);
-        }
-
-        private void browser_Loaded(object sender, RoutedEventArgs e)
-        {
-            var border0 = VisualTreeHelper.GetChild(_browser, 0);
-            var border1 = VisualTreeHelper.GetChild(border0, 0);
-            var panZoom = VisualTreeHelper.GetChild(border1, 0);
-            var grid = VisualTreeHelper.GetChild(panZoom, 0);
-            border = VisualTreeHelper.GetChild(grid, 0) as Border;
-
-            if (border != null)
-            {
-                border.ManipulationStarted += Border_ManipulationStarted;
-                border.ManipulationDelta += Border_ManipulationDelta;
-                border.ManipulationCompleted += Border_ManipulationCompleted;
-                border.DoubleTap += Border_DoubleTap;
-                border.Tap += Border_Tap;
-                border.Hold += Border_Hold;
-                border.MouseLeftButtonDown += Border_MouseLeftButtonDown;
-            }
-
-            _browser.LoadCompleted += Browser_LoadCompleted;
-
-        }
-
-
-
-
-        void ParseViewportMeta()
-        {
-            string metaScript = "(function() { return document.querySelector('meta[name=viewport]').content; })()";
-
-            try
-            {
-                string metaContent = _browser.InvokeScript("eval", new string[] { metaScript }) as string;
-                string[] arr = metaContent.Split(new[] { ' ', ',', ';' }, StringSplitOptions.RemoveEmptyEntries);
-                Dictionary<string, string> metaDictionary = new Dictionary<string, string>();
-                foreach (string val in arr)
-                {
-                    string[] keyVal = val.Split('=');
-                    metaDictionary.Add(keyVal[0], keyVal[1]);
-                }
-
-                this.userScalable = false; // reset to default
-                if (metaDictionary.ContainsKey("user-scalable"))
-                {
-                    this.userScalable = metaDictionary["user-scalable"] == "yes";
-                }
-
-                this.maxScale = 2.0;// reset to default
-                if (metaDictionary.ContainsKey("maximum-scale"))
-                {
-                    this.maxScale = double.Parse(metaDictionary["maximum-scale"]);
-                }
-
-                this.minScale = 0.5;// reset to default
-                if (metaDictionary.ContainsKey("minimum-scale"))
-                {
-                    this.minScale = double.Parse(metaDictionary["minimum-scale"]);
-                }
-            }
-            catch (Exception)
-            {
-
-            }
-        }
-
-        void Browser_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
-        {
-            ParseViewportMeta();
-
-            try
-            {
-                _browser.InvokeScript("execScript", MinifiedMouseScript);
-            }
-            catch (Exception)
-            {
-                Debug.WriteLine("BrowserHelper Failed to install mouse script in WebBrowser");
-            }
-        }
-
-        bool InvokeSimulatedMouseEvent(string eventName, Point pos)
-        {
-            bool bCancelled = false;
-            try
-            {
-                string strCancelled = _browser.InvokeScript("onNativeMouseEvent", new string[] { eventName, pos.X.ToString(), pos.Y.ToString() }) as string;                
-                if (bool.TryParse(strCancelled, out bCancelled))
-                {
-                    return bCancelled;
-                }
-            }
-            catch (Exception)
-            {
-                // script error
-            }
-
-            return bCancelled;
-        }
-
-        #region Hold
-
-        void Border_Hold(object sender, GestureEventArgs e)
-        {
-            //Debug.WriteLine("Border_Hold");
-            e.Handled = true;
-        }
-
-        #endregion
-
-        #region DoubleTap
-
-        void Border_DoubleTap(object sender, GestureEventArgs e)
-        {
-            //Debug.WriteLine("Border_DoubleTap");
-            e.Handled = true;
-        }
-
-        #endregion
-
-        #region Tap
-
-        void Border_Tap(object sender, GestureEventArgs e)
-        {
-            // prevents generating duplicated mouse events
-            // firstMouseMove == FALSE means we already handled this situation and generated mouse events
-            e.Handled = ! this.firstMouseMove;
-        }
-        #endregion
-
-        #region MouseEvents
-
-        void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
-        {
-            //Debug.WriteLine("Border_MouseLeftButtonDown");
-            border.MouseMove += new MouseEventHandler(Border_MouseMove);
-            border.MouseLeftButtonUp += new MouseButtonEventHandler(Border_MouseLeftButtonUp);
-            
-            this.mouseDownPos = e.GetPosition(_browser);
-            // don't fire the down event until we know if this is a 'move' or not
-            firstMouseMove = true;
-        }
-        //
-        void Border_MouseMove(object sender, MouseEventArgs e)
-        {
-            //Debug.WriteLine("Border_MouseMove");
-            Point pos = e.GetPosition(_browser);
-            // only the return value from the first mouse move event should be used to determine if scrolling is prevented.
-            if (firstMouseMove)
-            {
-                // even for simple tap there are situations where ui control generates move with some little delta value
-                // we should avoid such situations allowing to browser control generate native js mousedown/up/click events
-                if (Math.Abs(pos.X - mouseDownPos.X) + Math.Abs(pos.Y - mouseDownPos.Y) <= MouseMoveDeltaThreshold)
-                {
-                    return;
-                }
-                
-                InvokeSimulatedMouseEvent("mousedown", pos);
-                firstMouseMove = false;
-                ScrollDisabled = InvokeSimulatedMouseEvent("mousemove", pos);
-            }
-            else
-            {
-                InvokeSimulatedMouseEvent("mousemove", pos);
-            }
-
-        }
-
-        void Border_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
-        {
-            //Debug.WriteLine("Border_MouseLeftButtonUp");
-            border.MouseMove -= new MouseEventHandler(Border_MouseMove);
-            border.MouseLeftButtonUp -= new MouseButtonEventHandler(Border_MouseLeftButtonUp);
-            // if firstMouseMove is false, then we have sent our simulated mousedown, so we should also send a matching mouseup 
-            if (!firstMouseMove)
-            {
-                Point pos = e.GetPosition(_browser);
-                e.Handled = InvokeSimulatedMouseEvent("mouseup", pos);
-            }
-            ScrollDisabled = false;
-        }
-
-
-        #endregion
-
-        #region ManipulationEvents
-
-        void Border_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
-        {
-            //Debug.WriteLine("Border_ManipulationStarted");
-            
-            if (ScrollDisabled)
-            {
-                e.Handled = true;
-                e.Complete();
-            }
-        }
-
-        private void Border_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
-        {
-            //Debug.WriteLine("Border_ManipulationDelta");
-            // optionally suppress zoom
-            if ((ScrollDisabled || !userScalable) && (e.DeltaManipulation.Scale.X != 0.0 || e.DeltaManipulation.Scale.Y != 0.0))
-            {
-                e.Handled = true;
-                e.Complete();
-            }
-            // optionally suppress scrolling
-            if (ScrollDisabled && (e.DeltaManipulation.Translation.X != 0.0 || e.DeltaManipulation.Translation.Y != 0.0))
-            {
-                e.Handled = true;
-                e.Complete();
-            }
-        }
-
-        private void Border_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
-        {
-            //Debug.WriteLine("Border_ManipulationCompleted");
-            // suppress zoom
-            if (!userScalable && e.FinalVelocities != null)
-            {
-                if (e.FinalVelocities.ExpansionVelocity.X != 0.0 ||
-                   e.FinalVelocities.ExpansionVelocity.Y != 0.0)
-                {
-                    e.Handled = true;
-                }
-            }
-        }
-
-
-        #endregion
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/CommandFactory.cs
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/CommandFactory.cs b/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/CommandFactory.cs
deleted file mode 100755
index 1718816..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/CommandFactory.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-/*  
-	Licensed 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.Net;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Documents;
-using System.Windows.Ink;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
-using System.Windows.Shapes;
-using System.Collections.Generic;
-using WP7CordovaClassLib.Cordova.Commands;
-using System.Reflection;
-using System.Diagnostics;
-
-namespace WP7CordovaClassLib.Cordova
-{
-    /// <summary>
-    /// Provides functionality to create phone gap command by name.
-    /// </summary>
-    public static class CommandFactory
-    {
-        /// <summary>
-        /// Represents predefined namespace name for custom plugins
-        /// </summary>
-        private static readonly string CustomPluginNamespacePrefix = "Cordova.Extension.Commands.";
-
-        private static readonly string BaseCommandNamespacePrefix  = "WP7CordovaClassLib.Cordova.Commands.";
-
-        /// <summary>
-        /// Cache instantiated commands in a map.
-        /// </summary>
-
-        private static Dictionary<string, BaseCommand> commandMap = new Dictionary<string, BaseCommand>();
- 
-        /// <summary>
-        /// Creates command using command class name. Returns null for unknown commands.
-        /// </summary>
-        /// <param name="service">Command class name, for example Device or Notification</param>
-        /// <returns>Command class instance or null</returns>
-        public static BaseCommand CreateByServiceName(string service)
-        {
-
-            if (string.IsNullOrEmpty(service))
-            {
-                throw new ArgumentNullException("service", "service to create can't be null");
-            }
-
-            if (!commandMap.ContainsKey(service))
-            {
-
-                Type t = Type.GetType(BaseCommandNamespacePrefix + service);
-
-                // custom plugin could be defined in own namespace and assembly
-                if (t == null)
-                {
-                    string serviceFullName = service.Contains(".") ? service : CustomPluginNamespacePrefix + service;
-                    
-                    foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies())
-                    {
-                        // in this case service name represents full type name including namespace
-                        t = a.GetType(serviceFullName);
-
-                        if (t == null) // try the Commands Namespace
-                        {
-                            t = a.GetType(BaseCommandNamespacePrefix + service);
-                        }
-
-                        if (t != null)
-                        {
-                            break;
-                        }
-                    }
-
-                }
-
-                // unknown command, still didn't find it
-                if (t == null)
-                {
-                    Debug.WriteLine("Unable to locate command :: " + service);
-                    return null;
-                }
-
-                commandMap[service] = Activator.CreateInstance(t) as BaseCommand;
-            }
-
-            return commandMap[service];
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/Commands/Accelerometer.cs
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/Commands/Accelerometer.cs b/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/Commands/Accelerometer.cs
deleted file mode 100755
index ae1e860..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/Commands/Accelerometer.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-/*  
-	Licensed 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.Runtime.Serialization;
-using System.Threading;
-using Microsoft.Devices.Sensors;
-using System.Globalization;
-
-namespace WP7CordovaClassLib.Cordova.Commands
-{
-    /// <summary>
-    /// Captures device motion in the x, y, and z direction.
-    /// </summary>
-    public class Accelerometer : BaseCommand
-    {
-        #region AccelerometerOptions class
-        /// <summary>
-        /// Represents Accelerometer options.
-        /// </summary>
-        [DataContract]
-        public class AccelerometerOptions
-        {
-            /// <summary>
-            /// How often to retrieve the Acceleration in milliseconds
-            /// </summary>
-            [DataMember(IsRequired = false, Name = "frequency")]
-            public int Frequency { get; set; }
-
-            /// <summary>
-            /// Watcher id
-            /// </summary>
-            [DataMember(IsRequired = false, Name = "id")]
-            public string Id { get; set; }
-
-            /// <summary>
-            /// Creates options object with default parameters
-            /// </summary>
-            public AccelerometerOptions()
-            {
-                this.SetDefaultValues(new StreamingContext());
-            }
-
-            /// <summary>
-            /// Initializes default values for class fields.
-            /// Implemented in separate method because default constructor is not invoked during deserialization.
-            /// </summary>
-            /// <param name="context"></param>
-            [OnDeserializing()]
-            public void SetDefaultValues(StreamingContext context)
-            {
-                this.Frequency = 10000;
-            }
-        }
-
-        #endregion
-
-        #region Status codes and Constants
-
-        public const int Stopped = 0;
-        public const int Starting = 1;
-        public const int Running = 2;
-        public const int ErrorFailedToStart = 3;
-
-        public const double gConstant = -9.81;
-
-        #endregion
-
-        #region Static members
-
-        /// <summary>
-        /// Status of listener
-        /// </summary>
-        private static int currentStatus;
-
-        /// <summary>
-        /// Accelerometer
-        /// </summary>
-        private static Microsoft.Devices.Sensors.Accelerometer accelerometer = new Microsoft.Devices.Sensors.Accelerometer();
-
-        private static DateTime StartOfEpoch = new DateTime(1970, 1, 1, 0, 0, 0);
-
-        #endregion
-
-        /// <summary>
-        /// Sensor listener event
-        /// </summary>        
-        private void accelerometer_CurrentValueChanged(object sender, SensorReadingEventArgs<AccelerometerReading> e)
-        {
-            this.SetStatus(Running);
-
-            PluginResult result = new PluginResult(PluginResult.Status.OK, GetCurrentAccelerationFormatted());
-            result.KeepCallback = true;
-            DispatchCommandResult(result);
-        }
-
-        /// <summary>
-        /// Starts listening for acceleration sensor
-        /// </summary>
-        /// <returns>status of listener</returns>
-        public void start(string options)
-        {
-            if ((currentStatus == Running) || (currentStatus == Starting))
-            {
-                return;
-            }
-            try
-            {
-                lock (accelerometer)
-                {
-                    accelerometer.CurrentValueChanged += accelerometer_CurrentValueChanged;
-                    accelerometer.Start();
-                    this.SetStatus(Starting);
-                }
-
-                long timeout = 2000;
-                while ((currentStatus == Starting) && (timeout > 0))
-                {
-                    timeout = timeout - 100;
-                    Thread.Sleep(100);
-                }
-
-                if (currentStatus != Running)
-                {
-                    this.SetStatus(ErrorFailedToStart);
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, ErrorFailedToStart));
-                    return;
-                }
-            }
-            catch (Exception)
-            {
-                this.SetStatus(ErrorFailedToStart);
-                DispatchCommandResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, ErrorFailedToStart));
-                return;
-            }
-            PluginResult result = new PluginResult(PluginResult.Status.NO_RESULT);
-            result.KeepCallback = true;
-            DispatchCommandResult(result);
-        }
-
-        public void stop(string options)
-        {
-            if (currentStatus == Running)
-            {
-                lock (accelerometer)
-                {
-                    accelerometer.CurrentValueChanged -= accelerometer_CurrentValueChanged;
-                    accelerometer.Stop();
-                    this.SetStatus(Stopped);
-                }
-            }
-            DispatchCommandResult(new PluginResult(PluginResult.Status.OK));
-        }
-
-        /// <summary>
-        /// Formats current coordinates into JSON format
-        /// </summary>
-        /// <returns>Coordinates in JSON format</returns>
-        private string GetCurrentAccelerationFormatted()
-        {
-            // convert to unix timestamp
-            long timestamp = ((accelerometer.CurrentValue.Timestamp.DateTime - StartOfEpoch).Ticks) / 10000;
-            string resultCoordinates = String.Format("\"x\":{0},\"y\":{1},\"z\":{2},\"timestamp\":{3}",
-                            (accelerometer.CurrentValue.Acceleration.X * gConstant).ToString("0.00000", CultureInfo.InvariantCulture),
-                            (accelerometer.CurrentValue.Acceleration.Y * gConstant).ToString("0.00000", CultureInfo.InvariantCulture),
-                            (accelerometer.CurrentValue.Acceleration.Z * gConstant).ToString("0.00000", CultureInfo.InvariantCulture),
-                            timestamp.ToString());
-            resultCoordinates = "{" + resultCoordinates + "}";
-            return resultCoordinates;
-        }
-
-        /// <summary>
-        /// Sets current status
-        /// </summary>
-        /// <param name="status">current status</param>
-        private void SetStatus(int status)
-        {
-            currentStatus = status;
-        }
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/Commands/AudioPlayer.cs
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/Commands/AudioPlayer.cs b/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/Commands/AudioPlayer.cs
deleted file mode 100755
index d1fcb52..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/framework/Cordova/Commands/AudioPlayer.cs
+++ /dev/null
@@ -1,601 +0,0 @@
-/*  
-	Licensed 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.IO;
-using System.IO.IsolatedStorage;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Threading;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Audio;
-using Microsoft.Xna.Framework.Media;
-using Microsoft.Phone.Controls;
-using System.Diagnostics;
-
-namespace WP7CordovaClassLib.Cordova.Commands
-{    
-    /// <summary>
-    /// Implements audio record and play back functionality.
-    /// </summary>
-    internal class AudioPlayer : IDisposable
-    {
-        #region Constants
-        
-        // AudioPlayer states
-        private const int MediaNone = 0;
-        private const int MediaStarting = 1;
-        private const int MediaRunning = 2;
-        private const int MediaPaused = 3;
-        private const int MediaStopped = 4;
-                           
-        // AudioPlayer messages
-        private const int MediaState = 1;
-        private const int MediaDuration = 2;
-        private const int MediaPosition = 3;
-        private const int MediaError = 9;
-
-        // AudioPlayer errors
-        private const int MediaErrorPlayModeSet = 1;
-        private const int MediaErrorAlreadyRecording = 2;
-        private const int MediaErrorStartingRecording = 3;
-        private const int MediaErrorRecordModeSet = 4;
-        private const int MediaErrorStartingPlayback = 5;
-        private const int MediaErrorResumeState = 6;
-        private const int MediaErrorPauseState = 7;
-        private const int MediaErrorStopState = 8;
-
-        //TODO: get rid of this callback, it should be universal
-        private const string CallbackFunction = "CordovaMediaonStatus";
-
-        #endregion
-
-        /// <summary>
-        /// The AudioHandler object
-        /// </summary>
-        private Media handler;					
-        
-        /// <summary>
-        /// Temporary buffer to store audio chunk
-        /// </summary>
-        private byte[] buffer;
-
-        /// <summary>
-        /// Xna game loop dispatcher
-        /// </summary>
-        DispatcherTimer dtXna;
-
-        /// <summary>
-        /// Output buffer
-        /// </summary>
-        private MemoryStream memoryStream;
-
-        /// <summary>
-        /// The id of this player (used to identify Media object in JavaScript)
-        /// </summary>
-        private String id;								
-        
-        /// <summary>
-        /// State of recording or playback
-        /// </summary>
-        private int state = MediaNone;					
-        
-        /// <summary>
-        /// File name to play or record to
-        /// </summary>
-        private String audioFile = null;				
-        
-        /// <summary>
-        /// Duration of audio
-        /// </summary>
-        private double duration = -1;								
-
-        /// <summary>
-        /// Audio player object
-        /// </summary>
-        private MediaElement player = null;
-
-        /// <summary>
-        /// Audio source
-        /// </summary>
-        private Microphone recorder;
-        
-        /// <summary>
-        /// Internal flag specified that we should only open audio w/o playing it
-        /// </summary>
-        private bool prepareOnly = false;
-
-        /// <summary>
-        /// Creates AudioPlayer instance
-        /// </summary>
-        /// <param name="handler">Media object</param>
-        /// <param name="id">player id</param>
-        public AudioPlayer(Media handler, String id)
-        {
-            this.handler = handler;
-            this.id = id;
-        }	
-
-        /// <summary>
-        /// Destroys player and stop audio playing or recording
-        /// </summary>
-        public void Dispose()
-        {
-            Debug.WriteLine("Dispose :: " + this.audioFile);
-            if (this.player != null)
-            {
-                this.stopPlaying();
-                this.player = null;
-            }
-            if (this.recorder != null)
-            {
-                this.stopRecording();
-                this.recorder = null;
-            }
-
-            this.FinalizeXnaGameLoop();
-        }
-
-        /// <summary>
-        /// Starts recording, data is stored in memory
-        /// </summary>
-        /// <param name="filePath"></param>
-        public void startRecording(string filePath)
-        {
-            if (this.player != null)
-            {
-                this.handler.InvokeCustomScript(new ScriptCallback(CallbackFunction, this.id, MediaError, MediaErrorPlayModeSet));
-            }
-            else if (this.recorder == null)
-            {
-                try
-                {
-                        this.audioFile = filePath;
-                        this.InitializeXnaGameLoop();
-                        this.recorder = Microphone.Default;
-                        this.recorder.BufferDuration = TimeSpan.FromMilliseconds(500);
-                        this.buffer = new byte[recorder.GetSampleSizeInBytes(this.recorder.BufferDuration)];
-                        this.recorder.BufferReady += new EventHandler<EventArgs>(recorderBufferReady);
-                        this.memoryStream = new MemoryStream();
-                        this.WriteWavHeader(this.memoryStream, this.recorder.SampleRate);
-                        this.recorder.Start();
-                        FrameworkDispatcher.Update();
-                        this.SetState(MediaRunning);
-                }
-                catch (Exception)
-                {
-                        this.handler.InvokeCustomScript(new ScriptCallback(CallbackFunction, this.id, MediaError, MediaErrorStartingRecording));
-                }
-            } else 
-            {
-
-                this.handler.InvokeCustomScript(new ScriptCallback(CallbackFunction, this.id, MediaError, MediaErrorAlreadyRecording));
-            }
-        }
-
-        /// <summary>
-        /// Stops recording
-        /// </summary>
-        public void stopRecording()
-        {
-            if (this.recorder != null)
-            { 
-                if (this.state == MediaRunning)
-                {
-                    try
-                    {
-                        this.recorder.Stop();
-                        this.recorder.BufferReady -= recorderBufferReady;
-                        this.recorder = null;
-                        SaveAudioClipToLocalStorage();
-                        this.FinalizeXnaGameLoop();
-                        this.SetState(MediaStopped);
-                    }
-                    catch (Exception)
-                    {                
-                        //TODO 
-                    }
-                }
-            }
-        }
-        
-        /// <summary>
-        /// Starts or resume playing audio file
-        /// </summary>
-        /// <param name="filePath">The name of the audio file</param>
-        /// <summary>
-        /// Starts or resume playing audio file
-        /// </summary>
-        /// <param name="filePath">The name of the audio file</param>
-        public void startPlaying(string filePath)
-        {
-            if (this.recorder != null)
-            {
-                this.handler.InvokeCustomScript(new ScriptCallback(CallbackFunction, this.id, MediaError, MediaErrorRecordModeSet));
-                return;
-            }
-
-
-            if (this.player == null) 
-            {
-                try
-                {
-                    if (this.player == null)
-                    {
-                        // this.player is a MediaElement, it must be added to the visual tree in order to play
-                        PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
-                        if (frame != null)
-                        {
-                            PhoneApplicationPage page = frame.Content as PhoneApplicationPage;
-                            if (page != null)
-                            {
-                                Grid grid = page.FindName("LayoutRoot") as Grid;
-                                if (grid != null)
-                                {
-                                    
-                                    this.player = new MediaElement();
-                                    this.player.Name = "playerMediaElement";
-                                    grid.Children.Add(this.player);
-                                    this.player.Visibility = Visibility.Collapsed;
-                                    this.player.MediaOpened += MediaOpened;
-                                    this.player.MediaEnded += MediaEnded;
-                                    this.player.MediaFailed += MediaFailed;
-                                }
-                            }
-                        }
-
-                    }
-                    this.audioFile = filePath;
-
-                    Uri uri = new Uri(filePath, UriKind.RelativeOrAbsolute);
-                    if (uri.IsAbsoluteUri)
-                    {
-                        this.player.Source = uri;
-                    }
-                    else
-                    {
-                        using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication())
-                        {
-                            if (isoFile.FileExists(filePath))
-                            {
-                                using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream(filePath, FileMode.Open, isoFile))
-                                {
-                                    this.player.SetSource(stream);
-                                }
-                            }
-                            else
-                            {
-                                Debug.WriteLine("Error: source doesn't exist :: " + filePath);
-                                throw new ArgumentException("Source doesn't exist");
-                            }
-                        }
-                    }
-                    this.SetState(MediaStarting);
-                }
-                catch (Exception e)
-                {
-                    Debug.WriteLine("Error: " + e.Message);
-                    this.handler.InvokeCustomScript(new ScriptCallback(CallbackFunction, this.id, MediaError, MediaErrorStartingPlayback));
-                }
-            }
-            else
-            {
-                if (this.state != MediaRunning)
-                {
-                    this.player.Play();
-                    this.SetState(MediaRunning);
-                }
-                else
-                {
-                    this.handler.InvokeCustomScript(new ScriptCallback(CallbackFunction, this.id, MediaError, MediaErrorResumeState));
-                }
-            }
-        }
-        
-        /// <summary>
-        /// Callback to be invoked when the media source is ready for playback
-        /// </summary>
-        private void MediaOpened(object sender, RoutedEventArgs arg)
-        {
-            if (!this.prepareOnly)
-            { 
-                this.player.Play();
-                this.SetState(MediaRunning);                       
-            }
-
-            this.duration = this.player.NaturalDuration.TimeSpan.TotalSeconds;
-            this.prepareOnly = false;
-            this.handler.InvokeCustomScript(new ScriptCallback(CallbackFunction, this.id, MediaDuration, this.duration));
-        }
-
-        /// <summary>
-        /// Callback to be invoked when playback of a media source has completed
-        /// </summary>
-        private void MediaEnded(object sender, RoutedEventArgs arg)
-        {
-            this.SetState(MediaStopped);
-        }
-
-        /// <summary>
-        /// Callback to be invoked when playback of a media source has failed
-        /// </summary>
-        private void MediaFailed(object sender, RoutedEventArgs arg)
-        {
-            player.Stop();
-            this.handler.InvokeCustomScript(new ScriptCallback(CallbackFunction, this.id, MediaError.ToString(), "Media failed"));
-        }
-
-        /// <summary>
-        /// Seek or jump to a new time in the track
-        /// </summary>
-        /// <param name="milliseconds">The new track position</param>
-        public void seekToPlaying(int milliseconds)
-        { 
-            if (this.player != null)
-            {
-                TimeSpan tsPos = new TimeSpan(0, 0, 0, 0, milliseconds);
-                this.player.Position = tsPos;
-                this.handler.InvokeCustomScript(new ScriptCallback(CallbackFunction, this.id, MediaPosition, milliseconds / 1000.0f));
-            }
-        }
-
-        /// <summary>
-        /// Pauses playing
-        /// </summary>
-        public void pausePlaying()
-        {
-            if (this.state == MediaRunning)
-            {
-                this.player.Pause();
-                this.SetState(MediaPaused);
-            } else
-            {
-                this.handler.InvokeCustomScript(new ScriptCallback(CallbackFunction, this.id, MediaError, MediaErrorPauseState));
-            }
-        }
-
-
-        /// <summary>
-        /// Stops playing the audio file
-        /// </summary>
-        public void stopPlaying()
-        {            
-            if ((this.state == MediaRunning) || (this.state == MediaPaused))
-            {
-                this.player.Stop();
-
-                this.player.Position = new TimeSpan(0L);
-                this.SetState(MediaStopped);
-            } else
-            {
-                this.handler.InvokeCustomScript(new ScriptCallback(CallbackFunction, this.id, MediaError, MediaErrorStopState));
-            }             
-        }
-
-        /// <summary>
-        /// Gets current position of playback
-        /// </summary>
-        /// <returns>current position</returns>
-        public double getCurrentPosition()
-        {
-            if ((this.state == MediaRunning) || (this.state == MediaPaused))
-            {
-                double currentPosition = this.player.Position.TotalSeconds;
-                this.handler.InvokeCustomScript(new ScriptCallback(CallbackFunction, this.id, MediaPosition, currentPosition));                
-                return currentPosition;
-            }
-            else
-            {
-                return -1;
-            }
-        }
-
-        /// <summary>
-        /// Gets the duration of the audio file
-        /// </summary>
-        /// <param name="filePath">The name of the audio file</param>
-        /// <returns>track duration</returns>
-        public double getDuration(string filePath)
-        {
-            if (this.recorder != null)
-            {
-                return (-2);
-            }
-
-            if (this.player != null)
-            {
-                return this.duration;
-
-            } else
-            { 
-                this.prepareOnly = true;
-                this.startPlaying(filePath);
-                return this.duration;
-            }
-        }                
-
-        /// <summary>
-        /// Sets the state and send it to JavaScript
-        /// </summary>
-        /// <param name="state">state</param>
-        private void SetState(int state)
-        {
-            if (this.state != state)
-            {
-                this.handler.InvokeCustomScript(new ScriptCallback(CallbackFunction, this.id, MediaState, state));
-            }
-
-            this.state = state;
-        }
-
-        #region record methods
-
-        /// <summary>
-        /// Copies data from recorder to memory storages and updates recording state
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void recorderBufferReady(object sender, EventArgs e)
-        {
-            this.recorder.GetData(this.buffer);
-            this.memoryStream.Write(this.buffer, 0, this.buffer.Length);         
-        }
-
-        /// <summary>
-        /// Writes audio data from memory to isolated storage
-        /// </summary>
-        /// <returns></returns>
-        private void SaveAudioClipToLocalStorage()
-        {
-            if (this.memoryStream == null || this.memoryStream.Length <= 0)
-            {
-                return;
-            }
-
-            this.UpdateWavHeader(this.memoryStream);
-
-            try
-            {
-                using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication())
-                {
-                    string directory = Path.GetDirectoryName(audioFile);
-
-                    if (!isoFile.DirectoryExists(directory))
-                    {
-                        isoFile.CreateDirectory(directory);
-                    }
-
-                    this.memoryStream.Seek(0, SeekOrigin.Begin);
-
-                    using (IsolatedStorageFileStream fileStream = isoFile.CreateFile(audioFile))
-                    {
-                        this.memoryStream.CopyTo(fileStream);
-                    }
-                }
-            }
-            catch (Exception)
-            {
-                //TODO: log or do something else
-                throw;
-            }
-        }
-
-        
-
-        #region Wav format
-        // Original source http://damianblog.com/2011/02/07/storing-wp7-recorded-audio-as-wav-format-streams/
-
-        /// <summary>
-        /// Adds wav file format header to the stream
-        /// https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
-        /// </summary>
-        /// <param name="stream">Wav stream</param>
-        /// <param name="sampleRate">Sample Rate</param>
-        private void WriteWavHeader(Stream stream, int sampleRate)
-        {
-            const int bitsPerSample = 16;
-            const int bytesPerSample = bitsPerSample / 8;
-            var encoding = System.Text.Encoding.UTF8;
-
-            // ChunkID Contains the letters "RIFF" in ASCII form (0x52494646 big-endian form).
-            stream.Write(encoding.GetBytes("RIFF"), 0, 4);
-
-            // NOTE this will be filled in later
-            stream.Write(BitConverter.GetBytes(0), 0, 4);
-
-            // Format Contains the letters "WAVE"(0x57415645 big-endian form).
-            stream.Write(encoding.GetBytes("WAVE"), 0, 4);
-
-            // Subchunk1ID Contains the letters "fmt " (0x666d7420 big-endian form).
-            stream.Write(encoding.GetBytes("fmt "), 0, 4);
-
-            // Subchunk1Size 16 for PCM.  This is the size of therest of the Subchunk which follows this number.
-            stream.Write(BitConverter.GetBytes(16), 0, 4);
-
-            // AudioFormat PCM = 1 (i.e. Linear quantization) Values other than 1 indicate some form of compression.
-            stream.Write(BitConverter.GetBytes((short)1), 0, 2);
-
-            // NumChannels Mono = 1, Stereo = 2, etc.
-            stream.Write(BitConverter.GetBytes((short)1), 0, 2);
-
-            // SampleRate 8000, 44100, etc.
-            stream.Write(BitConverter.GetBytes(sampleRate), 0, 4);
-
-            // ByteRate =  SampleRate * NumChannels * BitsPerSample/8
-            stream.Write(BitConverter.GetBytes(sampleRate * bytesPerSample), 0, 4);
-
-            // BlockAlign NumChannels * BitsPerSample/8 The number of bytes for one sample including all channels.
-            stream.Write(BitConverter.GetBytes((short)(bytesPerSample)), 0, 2);
-
-            // BitsPerSample    8 bits = 8, 16 bits = 16, etc.
-            stream.Write(BitConverter.GetBytes((short)(bitsPerSample)), 0, 2);
-
-            // Subchunk2ID Contains the letters "data" (0x64617461 big-endian form).
-            stream.Write(encoding.GetBytes("data"), 0, 4);
-
-            // NOTE to be filled in later
-            stream.Write(BitConverter.GetBytes(0), 0, 4);
-        }
-
-        /// <summary>
-        /// Updates wav file format header
-        /// https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
-        /// </summary>
-        /// <param name="stream">Wav stream</param>
-        private void UpdateWavHeader(Stream stream)
-        {
-            if (!stream.CanSeek) throw new Exception("Can't seek stream to update wav header");
-
-            var oldPos = stream.Position;
-
-            // ChunkSize  36 + SubChunk2Size
-            stream.Seek(4, SeekOrigin.Begin);
-            stream.Write(BitConverter.GetBytes((int)stream.Length - 8), 0, 4);
-
-            // Subchunk2Size == NumSamples * NumChannels * BitsPerSample/8 This is the number of bytes in the data.
-            stream.Seek(40, SeekOrigin.Begin);
-            stream.Write(BitConverter.GetBytes((int)stream.Length - 44), 0, 4);
-
-            stream.Seek(oldPos, SeekOrigin.Begin);
-        }
-
-        #endregion
-
-        #region Xna loop
-        /// <summary>
-        /// Special initialization required for the microphone: XNA game loop
-        /// </summary>
-        private void InitializeXnaGameLoop()
-        {
-            // Timer to simulate the XNA game loop (Microphone is from XNA)
-            this.dtXna = new DispatcherTimer();
-            this.dtXna.Interval = TimeSpan.FromMilliseconds(33);
-            this.dtXna.Tick += delegate { try { FrameworkDispatcher.Update(); } catch { } };
-            this.dtXna.Start();
-        }
-        /// <summary>
-        /// Finalizes XNA game loop for microphone
-        /// </summary>
-        private void FinalizeXnaGameLoop()
-        {
-            // Timer to simulate the XNA game loop (Microphone is from XNA)
-            this.dtXna.Stop();
-            this.dtXna = null;
-        }
-
-        #endregion
-
-        #endregion
-    }
-}


Mime
View raw message