You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2013/06/07 00:06:11 UTC
[03/13] remove cruft
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/bf4b3ce3/tests/MobileSpecUnitTests/www/camera/index.html
----------------------------------------------------------------------
diff --git a/tests/MobileSpecUnitTests/www/camera/index.html b/tests/MobileSpecUnitTests/www/camera/index.html
deleted file mode 100644
index bc3b554..0000000
--- a/tests/MobileSpecUnitTests/www/camera/index.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,maximum-scale=1.0,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;
-
- //-------------------------------------------------------------------------
- // Camera
- //-------------------------------------------------------------------------
-
- /**
- * Capture picture
- */
- function getPicture() {
-
- //navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50,
- // destinationType: Camera.DestinationType.FILE_URI, sourceType : Camera.PictureSourceType.CAMERA });
-
- navigator.camera.getPicture(
- function(data) {
- var img = document.getElementById('camera_image');
- img.style.visibility = "visible";
- img.style.display = "block";
- //img.src = "data:image/jpeg;base64," + data;
- img.src = data;
- document.getElementById('camera_status').innerHTML = "Success";
- },
- function(e) {
- console.log("Error getting picture: " + e);
- document.getElementById('camera_status').innerHTML = "Error getting picture.";
- },
- { quality: 50, destinationType:
- Camera.DestinationType.FILE_URI, sourceType : Camera.PictureSourceType.CAMERA});
- };
-
- /**
- * Select image from library
- */
- function getImage() {
- navigator.camera.getPicture(
- function(data) {
- var img = document.getElementById('camera_image');
- img.style.visibility = "visible";
- img.style.display = "block";
- //img.src = "data:image/jpeg;base64," + data;
- img.src = data;
- document.getElementById('camera_status').innerHTML = "Success";
- },
- function(e) {
- console.log("Error getting picture: " + e);
- document.getElementById('camera_status').innerHTML = "Error getting picture.";
- },
- { quality: 50, destinationType:
- Camera.DestinationType.FILE_URI, sourceType: Camera.PictureSourceType.PHOTOLIBRARY});
- };
-
-
- /**
- * 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: PhoneGap did not initialize. Demo will not run correctly.");
- }
- },1000);
- }
-
-</script>
-
- </head>
- <body onload="init();" id="stage" class="theme">
-
- <h1>Camera</h1>
- <div id="info">
- <b>Status:</b> <span id="camera_status"></span><br>
- <img style="width:120px;height:120px;visibility:hidden;display:none;" id="camera_image" src="" />
- </div>
- <h2>Action</h2>
- <div class="btn large" onclick="getPicture();">Take Picture</div>
- <div class="btn large" onclick="getImage();">Select Image from Library</div>
- <h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/bf4b3ce3/tests/MobileSpecUnitTests/www/compass/index.html
----------------------------------------------------------------------
diff --git a/tests/MobileSpecUnitTests/www/compass/index.html b/tests/MobileSpecUnitTests/www/compass/index.html
deleted file mode 100644
index 8dbf99a..0000000
--- a/tests/MobileSpecUnitTests/www/compass/index.html
+++ /dev/null
@@ -1,128 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,maximum-scale=1.0,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;
- }
-
- //-------------------------------------------------------------------------
- // Compass
- //-------------------------------------------------------------------------
- var watchCompassId = null;
-
- /**
- * Start watching compass
- */
- var watchCompass = function() {
- console.log("watchCompass()");
-
- // Success callback
- var success = function(a){
- document.getElementById('compassHeading').innerHTML = roundNumber(a.magneticHeading);
- };
-
- // Fail callback
- var fail = function(e){
- console.log("watchCompass fail callback with error code "+e);
- stopCompass();
- setCompassStatus(e);
- };
-
- // Update heading every 1 sec
- var opt = {};
- opt.frequency = 1000;
- watchCompassId = navigator.compass.watchHeading(success, fail, opt);
-
- setCompassStatus("Running");
- };
-
- /**
- * Stop watching the acceleration
- */
- var stopCompass = function() {
- setCompassStatus("Stopped");
- if (watchCompassId) {
- navigator.compass.clearWatch(watchCompassId);
- watchCompassId = null;
- }
- };
-
- /**
- * Get current compass
- */
- var getCompass = function() {
- console.log("getCompass()");
-
- // Stop compass if running
- stopCompass();
-
- // Success callback
- var success = function(a){
- document.getElementById('compassHeading').innerHTML = roundNumber(a.magneticHeading);
- };
-
- // Fail callback
- var fail = function(e){
- console.log("getCompass fail callback with error code "+e);
- setCompassStatus(e);
- };
-
- // Make call
- var opt = {};
- navigator.compass.getCurrentHeading(success, fail, opt);
- };
-
- /**
- * Set compass status
- */
- var setCompassStatus = function(status) {
- document.getElementById('compass_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: PhoneGap did not initialize. Demo will not run correctly.");
- }
- },1000);
- }
-
-</script>
-
- </head>
- <body onload="init();" id="stage" class="theme">
-
- <h1>Compass</h1>
- <div id="info">
- <b>Status:</b> <span id="compass_status">Stopped</span>
- <table width="100%"><tr>
- <td width="33%">Heading: <span id="compassHeading"> </span></td>
- </tr></table>
- </div>
- <h2>Action</h2>
- <div class="btn large" onclick="getCompass();">Get Compass</div>
- <div class="btn large" onclick="watchCompass();">Start Watching Compass</div>
- <div class="btn large" onclick="stopCompass();">Stop Watching Compass</div>
- <h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/bf4b3ce3/tests/MobileSpecUnitTests/www/contacts/index.html
----------------------------------------------------------------------
diff --git a/tests/MobileSpecUnitTests/www/contacts/index.html b/tests/MobileSpecUnitTests/www/contacts/index.html
deleted file mode 100644
index 950e1cc..0000000
--- a/tests/MobileSpecUnitTests/www/contacts/index.html
+++ /dev/null
@@ -1,112 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,maximum-scale=1.0,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;
-
- //-------------------------------------------------------------------------
- // Contacts
- //-------------------------------------------------------------------------
- function getContacts() {
- obj = new ContactFindOptions();
- obj.filter = "D"; //Brooks";
- obj.multiple = true;
- navigator.contacts.find(
- ["displayName", "name", "phoneNumbers", "emails", "urls", "note"],
- function(contacts) {
- var s = "";
- if (contacts.length == 0) {
- s = "No contacts found";
- }
- else {
- s = "Number of contacts: "+contacts.length+"<br><table width='100%'><tr><th>Name</th><td>Phone</td><td>Email</td></tr>";
- for (var i=0; i<contacts.length; i++) {
- var contact = contacts[i];
- s = s + "<tr><td>" + contact.name.formatted + "</td><td>";
- if (contact.phoneNumbers && contact.phoneNumbers.length > 0) {
- s = s + contact.phoneNumbers[0].value;
- }
- s = s + "</td><td>"
- if (contact.emails && contact.emails.length > 0) {
- s = s + contact.emails[0].value;
- }
- s = s + "</td></tr>";
- }
- s = s + "</table>";
- }
- document.getElementById('contacts_results').innerHTML = s;
- },
- function(e) {
- document.getElementById('contacts_results').innerHTML = "Error: "+e.code;
- },
- obj);
- };
-
- function addContact(){
- console.log("addContact()");
- try{
- var contact = navigator.contacts.create({"displayName": "Dooney Evans"});
- var contactName = {
- formatted: "Dooney Evans",
- familyName: "Evans",
- givenName: "Dooney",
- middleName: ""
- };
-
- contact.name = contactName;
-
- var phoneNumbers = [1];
- phoneNumbers[0] = new ContactField('work', '512-555-1234', true);
- contact.phoneNumbers = phoneNumbers;
-
- contact.save(
- function() { alert("Contact saved.");},
- function(e) { alert("Contact save failed: " + e.code); }
- );
- console.log("you have saved the contact");
- }
- catch (e){
- alert(e);
- }
-
- };
-
- /**
- * 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: PhoneGap did not initialize. Demo will not run correctly.");
- }
- },1000);
- }
-
-</script>
-
- </head>
- <body onload="init();" id="stage" class="theme">
-
- <h1>Contacts</h1>
- <div id="info">
- <b>Results:</b><br>
- <span id="contacts_results"> </span>
- </div>
- <h2>Action</h2>
- <div class="btn large" onclick="getContacts();">Get phone's contacts</div>
- <div class="btn large" onclick="addContact();">Add a new contact 'Dooney Evans'</div>
- <h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
- </body>
-</html>