- From: Dominique Hazael-Massieux via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 02 Dec 2009 14:41:00 +0000
- To: public-dap-commits@w3.org
Update of /sources/public/2009/dap/camera
In directory hutz:/tmp/cvs-serv8093
Modified Files:
Overview.html
Log Message:
removing unneeded space in example, per http://www.w3.org/mid/8BDB1F52-D640-4CAB-9E27-C30E9D54984C@robineko.com
Index: Overview.html
===================================================================
RCS file: /sources/public/2009/dap/camera/Overview.html,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- Overview.html 2 Dec 2009 14:35:51 -0000 1.31
+++ Overview.html 2 Dec 2009 14:40:58 -0000 1.32
@@ -34,47 +34,45 @@
</p>
<div>
<p>Launching a device camera application and retrieving the pictures taken. </p>
-<pre class="example sh_javascript_dom">
- // Create a container div element and append it to the document body.
- var container = document.createElement("div");
- document.body.appendChild(container);
+<pre class="example sh_javascript_dom">// Create a container div element and append it to the document body.
+var container = document.createElement("div");
+document.body.appendChild(container);
- // The browser viewport width in pixels.
- var screenWidth = window.innerWidth;
-
- function successCallback(data) {
- for (var i in data) {
- var img = document.createElement("img");
- img.src = data[i].uri;
- // If the image width exceeds that of the browser viewport, the image
- // is scaled to fit the screen keeping the aspect ratio intact.
- if (data[i].format.width > screenWidth) {
- img.style.width = screenWidth + "px";
- img.style.height = (data[i].format.height/data[i].format.width)*screenWidth + "px";
- }
- container.appendChild(img);
- }
- }
+// The browser viewport width in pixels.
+var screenWidth = window.innerWidth;
+
+function successCallback(data) {
+for (var i in data) {
+var img = document.createElement("img");
+img.src = data[i].uri;
+// If the image width exceeds that of the browser viewport, the image
+// is scaled to fit the screen keeping the aspect ratio intact.
+if (data[i].format.width > screenWidth) {
+img.style.width = screenWidth + "px";
+img.style.height = (data[i].format.height/data[i].format.width)*screenWidth + "px";
+}
+container.appendChild(img);
+}
+}
- function errorCallback(err) {
- alert(err.message + " (" + err.code + ")");
- }
+function errorCallback(err) {
+alert(err.message + " (" + err.code + ")");
+}
- // Launch the device camera application and invoke the callback once
- // the user exits the camera application.
- transactionId = navigator.device.captureImage(successCallback, 1, errorCallback);
- </pre>
+// Launch the device camera application and invoke the callback once
+// the user exits the camera application.
+transactionId = navigator.device.captureImage(successCallback, 1, errorCallback);</pre>
</div>
<div>
<p>Example of retrieving image sizes and formats supported by hosting device camera.</p>
<pre class="example sh_javascript_dom">var summary;
- var formats = navigator.device.supportedImageFormats;
-
- for (var key in formats) {
- summary += key + ": " + formats[key] + "\n";
- }
-
- alert(summary);</pre>
+var formats = navigator.device.supportedImageFormats;
+
+for (var key in formats) {
+summary += key + ": " + formats[key] + "\n";
+}
+
+alert(summary);</pre>
</div>
</section>
</section>
Received on Wednesday, 2 December 2009 14:41:12 UTC