cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [25/51] [abbrv] cleanup old cruft
Date Thu, 01 Nov 2012 10:53:30 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cordova-windows/blob/5c25a9e0/windows8/samples/Media_Test/Media_Test/cordova.js
----------------------------------------------------------------------
diff --git a/windows8/samples/Media_Test/Media_Test/cordova.js b/windows8/samples/Media_Test/Media_Test/cordova.js
new file mode 100644
index 0000000..1f2c353
--- /dev/null
+++ b/windows8/samples/Media_Test/Media_Test/cordova.js
@@ -0,0 +1,27 @@
+(function () {
+
+    var VERSION = '2.2.0',
+        currentScript = 'cordova-' + VERSION + '.js',
+        scripts = document.getElementsByTagName('script');
+
+    for (var n = 0; n < scripts.length; n++) {
+        if (scripts[n].src.indexOf('cordova.js') > -1) {
+            var cordovaPath = scripts[n].src.replace('cordova.js', currentScript);
+            var scriptElem = document.createElement("script");
+            scriptElem.src = cordovaPath;
+            document.head.appendChild(scriptElem);
+        }
+    }
+
+})();
+
+function backHome() {
+	if (window.device && device.platform && device.platform.toLowerCase() ==
'android') {
+            navigator.app.backHistory();
+	}
+	else {
+	    window.history.go(-1);
+	}
+}
+
+window.alert = window.alert || function (msg, title, btn) { console.log("Alert::" + msg);
};

http://git-wip-us.apache.org/repos/asf/incubator-cordova-windows/blob/5c25a9e0/windows8/samples/Media_Test/Media_Test/default.html
----------------------------------------------------------------------
diff --git a/windows8/samples/Media_Test/Media_Test/default.html b/windows8/samples/Media_Test/Media_Test/default.html
deleted file mode 100644
index dd38b2b..0000000
--- a/windows8/samples/Media_Test/Media_Test/default.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="utf-8" />
-    <title>Cordova_Metro</title>
-
-    <!-- WinJS references -->
-    <link href="//Microsoft.WinJS.1.0/css/ui-dark.css" rel="stylesheet" />
-    <script src="//Microsoft.WinJS.1.0/js/base.js"></script>
-    <script src="//Microsoft.WinJS.1.0/js/ui.js"></script>
-
-	
-    
-    <!-- Cordova win8 references -->
-    <link href="/css/default.css" rel="stylesheet" />
-    <script src="/js/cordova.windows8.js"></script>
-</head>
-<body>
-    <button id="btnStart" onclick="start()">Start</button>
-    <button id="btnPlay" onclick="play()" disabled="disabled">Play</button>
-    <button id="btnPause" onclick="pause()" disabled="disabled">Pause</button>
-    <button id="btnStop" onclick="stop()" disabled="disabled">Stop</button>
-    <button id="btnPosition" onclick="position()" disabled="disabled">Position</button>
-    <div id="statusDiv">[Status]</div>
-    <div id="durationDiv">[Duration]</div>
-    <div id="positionDiv">[Position]</div>
-
-    <script type="text/javascript">
-
-        var $ = function (sel) {
-            return document.querySelector(sel);
-        };
-
-        var updateStatus = function (msg) {
-            console.log("Status::" + msg);
-            $("#statusDiv").innerHTML = msg;
-        };
-
-
-        var media = null;
-        var src = "/music/BlueZedEx.mp3";
-        function start() {
-            media = new Media(src,
-                function () {
-                    updateStatus("Success creating media");
-                },
-                function () {
-                    updateStatus("Error loading media.");
-                },
-                function (res) {
-                    updateStatus("Media status callback :: " + res);
-                }
-            );
-            $("#durationDiv").innerHTML = 'Duration: ' + media.getDuration();
-            updateStatus("Media starting");
-
-            btnStart.disabled = 'disabled';
-            btnPlay.disabled = false;
-            btnStop.disabled = false;
-            btnPosition.disabled = false;
-        }
-        function play() {
-            media.play();
-            btnPlay.disabled = 'disabled';
-            btnPause.disabled = false;
-            updateStatus("Media playing.");
-        }
-        function pause() {
-            media.pause();
-            btnPlay.disabled = false;
-            btnPause.disabled = 'disabled';
-            updateStatus("Media paused.");
-        }
-        function stop() {
-            media.stop();
-            btnPlay.disabled = 'disabled';
-            btnPause.disabled = 'disabled';
-            btnStart.disabled = false;
-            btnStop.disabled = 'disabled';
-            btnPosition.disabled = 'disabled';
-            updateStatus( "Media stopped.");
-        }
-
-        function position() {
-            media.getCurrentPosition(
-                function (p) {
-                    $("#positionDiv").innerHTML = "Position: " + p;
-                    
-                },
-                function(e) {
-                    updateStatus("Error getting position: " + e);
-                }
-            )
-        }
-    </script>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-windows/blob/5c25a9e0/windows8/samples/Media_Test/Media_Test/images/logo.png
----------------------------------------------------------------------
diff --git a/windows8/samples/Media_Test/Media_Test/images/logo.png b/windows8/samples/Media_Test/Media_Test/images/logo.png
index e26771c..86a48a8 100644
Binary files a/windows8/samples/Media_Test/Media_Test/images/logo.png and b/windows8/samples/Media_Test/Media_Test/images/logo.png
differ

http://git-wip-us.apache.org/repos/asf/incubator-cordova-windows/blob/5c25a9e0/windows8/samples/Media_Test/Media_Test/images/smalllogo.png
----------------------------------------------------------------------
diff --git a/windows8/samples/Media_Test/Media_Test/images/smalllogo.png b/windows8/samples/Media_Test/Media_Test/images/smalllogo.png
index 1eb0d9d..0e648ef 100644
Binary files a/windows8/samples/Media_Test/Media_Test/images/smalllogo.png and b/windows8/samples/Media_Test/Media_Test/images/smalllogo.png
differ

http://git-wip-us.apache.org/repos/asf/incubator-cordova-windows/blob/5c25a9e0/windows8/samples/Media_Test/Media_Test/images/splashscreen.png
----------------------------------------------------------------------
diff --git a/windows8/samples/Media_Test/Media_Test/images/splashscreen.png b/windows8/samples/Media_Test/Media_Test/images/splashscreen.png
index c951e03..d1e6c98 100644
Binary files a/windows8/samples/Media_Test/Media_Test/images/splashscreen.png and b/windows8/samples/Media_Test/Media_Test/images/splashscreen.png
differ

http://git-wip-us.apache.org/repos/asf/incubator-cordova-windows/blob/5c25a9e0/windows8/samples/Media_Test/Media_Test/images/storelogo.png
----------------------------------------------------------------------
diff --git a/windows8/samples/Media_Test/Media_Test/images/storelogo.png b/windows8/samples/Media_Test/Media_Test/images/storelogo.png
index dcb6727..dd00478 100644
Binary files a/windows8/samples/Media_Test/Media_Test/images/storelogo.png and b/windows8/samples/Media_Test/Media_Test/images/storelogo.png
differ

http://git-wip-us.apache.org/repos/asf/incubator-cordova-windows/blob/5c25a9e0/windows8/samples/Media_Test/Media_Test/index.html
----------------------------------------------------------------------
diff --git a/windows8/samples/Media_Test/Media_Test/index.html b/windows8/samples/Media_Test/Media_Test/index.html
new file mode 100644
index 0000000..b5c35cd
--- /dev/null
+++ b/windows8/samples/Media_Test/Media_Test/index.html
@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8" />
+    <title>Cordova_Media</title>
+
+    <!-- WinJS references -->
+    <link href="//Microsoft.WinJS.1.0/css/ui-dark.css" rel="stylesheet" />
+
+	
+    
+    <!-- Cordova win8 references -->
+    <link href="/css/default.css" rel="stylesheet" />
+    <script src="/jcordova.js"></script>
+</head>
+<body>
+    <button id="btnStart" onclick="start()">Start</button>
+    <button id="btnPlay" onclick="play()" disabled="disabled">Play</button>
+    <button id="btnPause" onclick="pause()" disabled="disabled">Pause</button>
+    <button id="btnStop" onclick="stop()" disabled="disabled">Stop</button>
+    <button id="btnPosition" onclick="position()" disabled="disabled">Position</button>
+    <div id="statusDiv">[Status]</div>
+    <div id="durationDiv">[Duration]</div>
+    <div id="positionDiv">[Position]</div>
+
+    <script type="text/javascript">
+
+        var $ = function (sel) {
+            return document.querySelector(sel);
+        };
+
+        var updateStatus = function (msg) {
+            console.log("Status::" + msg);
+            $("#statusDiv").innerHTML = msg;
+        };
+
+
+        var media = null;
+        var src = "/music/BlueZedEx.mp3";
+        function start() {
+            media = new Media(src,
+                function () {
+                    updateStatus("Success creating media");
+                },
+                function () {
+                    updateStatus("Error loading media.");
+                },
+                function (res) {
+                    updateStatus("Media status callback :: " + res);
+                }
+            );
+            $("#durationDiv").innerHTML = 'Duration: ' + media.getDuration();
+            updateStatus("Media starting");
+
+            btnStart.disabled = 'disabled';
+            btnPlay.disabled = false;
+            btnStop.disabled = false;
+            btnPosition.disabled = false;
+        }
+        function play() {
+            media.play();
+            btnPlay.disabled = 'disabled';
+            btnPause.disabled = false;
+            updateStatus("Media playing.");
+        }
+        function pause() {
+            media.pause();
+            btnPlay.disabled = false;
+            btnPause.disabled = 'disabled';
+            updateStatus("Media paused.");
+        }
+        function stop() {
+            media.stop();
+            btnPlay.disabled = 'disabled';
+            btnPause.disabled = 'disabled';
+            btnStart.disabled = false;
+            btnStop.disabled = 'disabled';
+            btnPosition.disabled = 'disabled';
+            updateStatus( "Media stopped.");
+        }
+
+        function position() {
+            media.getCurrentPosition(
+                function (p) {
+                    $("#positionDiv").innerHTML = "Position: " + p;
+                    
+                },
+                function(e) {
+                    updateStatus("Error getting position: " + e);
+                }
+            )
+        }
+    </script>
+
+</body>
+</html>
\ No newline at end of file


Mime
View raw message