Created
February 20, 2012 12:25
-
-
Save philhaeusler/1868997 to your computer and use it in GitHub Desktop.
Demo app that causes RTE on iOS when repeatedly taking pictures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title></title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" /> | |
| <meta charset="utf-8"> | |
| <script type="text/javascript" charset="utf-8" src="phonegap-1.4.1.js"></script> | |
| <script type="text/javascript" src="libs/jquery-1.6.2.min.js"></script> | |
| <script type="text/javascript"> | |
| function onBodyLoad() | |
| { | |
| document.addEventListener("deviceready", onDeviceReady, false); | |
| } | |
| function onDeviceReady() | |
| { | |
| $("#photoBtn").click(function(event) { | |
| takePhoto(); | |
| }); | |
| } | |
| function takePhoto() { | |
| navigator.camera.getPicture( | |
| takePhotoSuccess, | |
| takePhotoFailure, | |
| { | |
| quality:80, | |
| destinationType: navigator.camera.DestinationType.FILE_URI | |
| } | |
| ); | |
| } | |
| function takePhotoSuccess(fileUri) { | |
| $("#ad-thumb").attr("src", fileUri); | |
| $("#ad-thumbcontainer").show(); | |
| } | |
| function takePhotoFailure(message) { | |
| alert(message); | |
| } | |
| </script> | |
| </head> | |
| <body onload="onBodyLoad()"> | |
| <button id="photoBtn">Take Photo</button> | |
| <div id="ad-thumbcontainer" style="display:none;width:258px;text-align:center"> | |
| <img id="ad-thumb" style="display:inline"/></a> | |
| </div> | |
| </ol> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment