incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [19/50] [abbrv] Merging+Moving Windows7 specifics
Date Wed, 17 Oct 2012 23:27:01 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cordova-windows/blob/3711f4bc/windows7/Cordova/www/device.html
----------------------------------------------------------------------
diff --git a/windows7/Cordova/www/device.html b/windows7/Cordova/www/device.html
new file mode 100644
index 0000000..42a4774
--- /dev/null
+++ b/windows7/Cordova/www/device.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html lang='en'>
+	<head>
+		<title>Device Info</title>
+        <script src='cordova.win7.js'></script>
+	</head>
+	<body>
+        <div id='state'></div>
+        <script>
+		    document.addEventListener('deviceready', function () {
+		        document.getElementById('state').innerHTML = 'Platform: ' + device.platform + '
v' + device.version + '<br>Name: ' + device.name + '<br>UUID: ' + device.uuid;
+		    }, false);
+		</script>
+	</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-windows/blob/3711f4bc/windows7/Cordova/www/events.html
----------------------------------------------------------------------
diff --git a/windows7/Cordova/www/events.html b/windows7/Cordova/www/events.html
new file mode 100644
index 0000000..5d9c5e3
--- /dev/null
+++ b/windows7/Cordova/www/events.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang='en'>
+	<head>
+        <title>Events Test</title>
+        <script src='cordova.win7.js'></script>
+	</head>
+	<body>
+        <div id='state'></div>
+        <script>
+          document.addEventListener('deviceready', function () { document.getElementById('state').innerHTML
= 'Ready!'; }, false);
+          document.addEventListener('pause', function () { document.getElementById('state').innerHTML
= 'Paused!'; }, false);
+          document.addEventListener('resume', function () { document.getElementById('state').innerHTML
= 'Resumed!'; }, false);
+          document.addEventListener('backbutton', function () { document.getElementById('state').innerHTML
= 'Back!'; }, false);
+        </script>
+	</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-windows/blob/3711f4bc/windows7/Cordova/www/file.html
----------------------------------------------------------------------
diff --git a/windows7/Cordova/www/file.html b/windows7/Cordova/www/file.html
new file mode 100644
index 0000000..4419ed5
--- /dev/null
+++ b/windows7/Cordova/www/file.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang='en'>
+    <head>
+        <title>Device Info</title>
+        <script type="text/javascript" src='cordova.win7.js'></script>
+    </head>
+    <body>
+        <div id='state'></div>
+        <div id='filesystem'></div>
+        <br/>
+        <div id='entry'></div>
+        <script type="text/javascript">
+             function onFileSystemSuccess(fileSystem) {
+                 document.getElementById('filesystem').innerHTML = 'File system name: ' +
fileSystem.name
+                         + '<br>Root name: ' + fileSystem.root.name
+                          + '<br>Root path: ' + fileSystem.root.fullPath;
+            }
+
+            function fail(error) {
+                document.getElementById('state').innerHTML = 'Error, code: ' + error.code;
+            }
+
+            document.addEventListener('deviceready', function () {
+                window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess,
fail);
+            }, false);
+        </script>
+    </body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-windows/blob/3711f4bc/windows7/Cordova/www/index.html
----------------------------------------------------------------------
diff --git a/windows7/Cordova/www/index.html b/windows7/Cordova/www/index.html
new file mode 100644
index 0000000..2b509c1
--- /dev/null
+++ b/windows7/Cordova/www/index.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang='en'>
+	<head>
+		<title>Welcome to Cordova</title>
+        <script src='cordova.win7.js'></script>
+	</head>
+
+	<body>
+        <a href='device.html'>Device</a><br>
+        <a href='network.html'>Network</a><br>
+        <a href='accel_game.html'>Accelerometer</a><br>
+        <a href='capture.html'>Capture</a><br>
+        <a href='events.html'>Events</a><br>
+        <a href='notification.html'>Notification</a><br>
+        <a href='storage.html'>Storage</a><br>
+        <a href='file.html'>File</a><br>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-windows/blob/3711f4bc/windows7/Cordova/www/network.html
----------------------------------------------------------------------
diff --git a/windows7/Cordova/www/network.html b/windows7/Cordova/www/network.html
new file mode 100644
index 0000000..fb0891c
--- /dev/null
+++ b/windows7/Cordova/www/network.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html lang='en'>
+	<head>
+        <title>Connectivity Info</title>
+        <script src='cordova.win7.js'></script>
+	</head>
+	<body>
+        <div id='state'></div>
+        <script>
+		    document.addEventListener('deviceready', function () {
+		        document.getElementById('state').innerHTML = 'Network connectivity type: ' + navigator.network.connection.type;
+		    }, false);
+		</script>
+	</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-windows/blob/3711f4bc/windows7/Cordova/www/notification.html
----------------------------------------------------------------------
diff --git a/windows7/Cordova/www/notification.html b/windows7/Cordova/www/notification.html
new file mode 100644
index 0000000..aaea533
--- /dev/null
+++ b/windows7/Cordova/www/notification.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html lang='en'>
+    <head>
+        <title>Notification</title>
+        <script src='cordova.win7.js'></script>
+    </head>
+    <body>
+        <p>Tap on the Launch PopUp button below to open the modal window.</p>
+        <br />
+        <input type="button" id="popUpBtn" value="Launch PopUp" />
+        <script  type="text/javascript">
+            document.addEventListener('deviceready', function () {
+                initApp();
+            }, false);
+
+            function initApp() {
+                setTimeout(function () { window.scrollTo(0, 1); }, 10);
+                document.getElementById("popUpBtn").addEventListener("click", function ()
{
+                    showPopUpMessage();
+                }, false);
+            }
+            
+            // Show the modal overlay and popup window
+            function showPopUpMessage() {
+                function alertDismissed(button) {
+                    console.log("Alert dismissed: " + button);
+                }
+
+                navigator.notification.beep(1);
+                navigator.notification.confirm(
+                    'Hello from JavaScript through Cordova!',
+                    alertDismissed,
+                    'Test Alert',
+                    'Done,Yes,No'
+                );
+            }
+        </script>
+    </body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-windows/blob/3711f4bc/windows7/Cordova/www/storage.html
----------------------------------------------------------------------
diff --git a/windows7/Cordova/www/storage.html b/windows7/Cordova/www/storage.html
new file mode 100644
index 0000000..8ebfdfb
--- /dev/null
+++ b/windows7/Cordova/www/storage.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html lang='en'>
+    <head>
+        <script src='cordova.win7.js'></script>
+    </head>
+    <body>
+        <script  type="text/javascript">
+            function QuerySuccessCB(Tx, results) {
+                alert("Results: " + results.rows.length);
+                alert("resultSet[0].data: " + results.rows.resultSet[0].data);
+            }
+
+            function populateDB(tx) {
+                tx.executeSql('DROP TABLE IF EXISTS DEMO');
+                tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
+                tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
+                tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
+                tx.executeSql('INSERT INTO DEMO (id, data) VALUES (3, "Third one")');
+                tx.executeSql('SELECT * FROM DEMO WHERE data LIKE "%row"', [], QuerySuccessCB);
+            }
+            function TxErrorCB() {
+                alert("Error processing SQL!");
+            }
+
+            document.addEventListener('deviceready', function () {
+                var db = window.openDatabase("test", "1.0", "Test DB", 1000000);
+                db.transaction(populateDB, TxErrorCB);
+            }, false);
+        </script>
+    </body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-windows/blob/3711f4bc/windows7/README
----------------------------------------------------------------------
diff --git a/windows7/README b/windows7/README
new file mode 100644
index 0000000..9b6ad62
--- /dev/null
+++ b/windows7/README
@@ -0,0 +1,44 @@
+This is a draft implementation of a Cordova layer for Windows 7.
+
+This project can be built using Visual Studio 2012. Doing so creates a Win32
+program that hosts a IE-based web view and loads www/index.html inside it. The
+supplied cordova.win7.js file has partial support for Cordova events and API
+sets, and is able to interact with the hosting program (native side).
+
+This is still very much work in progress, and further development, including
+bug fixing, will be required before this can be considered suitable for
+deployment.
+
+Internet Explorer 9 or newer is required.
+
+Major files are:
+
+shell.c: initialization, web view control and native <-> javascript interface
+accel.c: accelerometer sensing
+capture.c: video, audio and photo recording
+device.c: support routines for Cordova Device API
+network.c: network connectivity sensing
+notification.c: dialog boxes support
+
+There are some basic usage samples in www/
+
+-
+
+Copyright 2012 Intel Corporation
+
+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.
\ No newline at end of file


Mime
View raw message