3 Commits
Author SHA1 Message Date
Ryan Willoughby 7ec3d477c2 [plugman] plugman don't like spec/config.xml
+ upped version to 0.5.2
2013-06-10 15:49:29 -07:00
Ryan Willoughby ea1586b0ff [js] cordova.require instead of PhoneGap.require 2013-06-05 12:38:57 -07:00
Ryan Willoughby 10f8e6b116 [readme] formatting 2013-05-29 18:13:03 -06:00
4 changed files with 9 additions and 27 deletions
+7 -5
View File
@@ -47,8 +47,8 @@ The following barcode types are currently supported:
`success` and `fail` are callback functions. Success is passed an object with data, type and cancelled properties. Data is the text representation of the barcode data, type is the type of barcode detected and cancelled is whether or not the user cancelled the scan.
A full example could be:
var scanner = window.PhoneGap.require("cordova/plugin/BarcodeScanner");
```
var scanner = cordova.require("cordova/plugin/BarcodeScanner");
scanner.scan(
function (result) {
@@ -61,7 +61,7 @@ A full example could be:
alert("Scanning failed: " + error);
}
);
```
## Encoding a Barcode ##
The plugin creates the object `window.plugins.barcodeScanner` with the method `encode(type, data, success, fail)`.
@@ -72,9 +72,10 @@ Supported encoding types:
* PHONE_TYPE
* SMS_TYPE
```
A full example could be:
var scanner = window.PhoneGap.require("cordova/plugin/BarcodeScanner");
var scanner = cordova.require("cordova/plugin/BarcodeScanner");
scanner.encode(BarcodeScanner.Encode.TEXT_TYPE, "http://www.nytimes.com", function(success) {
alert("encode success: " + success);
@@ -82,6 +83,7 @@ A full example could be:
alert("encoding failed: " + fail);
}
);
```
## Thanks on Github ##
@@ -110,4 +112,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
+1 -1
View File
@@ -2,7 +2,7 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="com.phonegap.plugins.barcodescanner"
version="0.3.1">
version="0.5.2">
<name>BarcodeScanner</name>
-20
View File
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "org.apache.cordova.example"
version = "2.0.0">
<name>cordovaExample</name>
<description>
Barcode Scanner Spec
</description>
<author href="http://phonegap.com" email="support@phonegap.com">
Ryan Willoughby - PhoneGap Team
</author>
<gap:preference name="phonegap-version" value="2.5.0" />
<gap:plugin name="BarcodeScanner"/>
</widget>
+1 -1
View File
@@ -7,7 +7,7 @@
*/
PhoneGap.define("cordova/plugin/BarcodeScanner",
cordova.define("cordova/plugin/BarcodeScanner",
function (require, exports, module) {