Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
Use <js-module> in favour of <asset> for the JS.
Browse files Browse the repository at this point in the history
This bumps the version to 1.0 since it's a non-backwards compatible
change.
  • Loading branch information
agrieve committed Sep 5, 2013
1 parent 7094cc6 commit 6ad6daf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ Cross-platform BarcodeScanner for Cordova / PhoneGap.

Follows the [Cordova Plugin spec](https://github.com/apache/cordova-plugman/blob/master/plugin_spec.md), so that it works with [Plugman](https://github.com/apache/cordova-plugman).

This plugin leverages Cordova/PhoneGap's [require/define functionality used for plugins](http://simonmacdonald.blogspot.ca/2012/08/so-you-wanna-write-phonegap-200-android.html).

Note: the Android source for this project includes an Android Library Project.
plugman currently doesn't support Library Project refs, so its been
prebuilt as a jar library. Any updates to the Library Project should be
Expand Down Expand Up @@ -49,9 +47,7 @@ The following barcode types are currently supported:

A full example could be:
```
var scanner = cordova.require("cordova/plugin/BarcodeScanner");
scanner.scan(
cordova.plugins.barcodeScanner.scan(
function (result) {
alert("We got a barcode\n" +
"Result: " + result.text + "\n" +
Expand All @@ -76,9 +72,7 @@ Supported encoding types:
```
A full example could be:
var scanner = cordova.require("cordova/plugin/BarcodeScanner");
scanner.encode(BarcodeScanner.Encode.TEXT_TYPE, "http://www.nytimes.com", function(success) {
cordova.plugins.barcodeScanner.encode(BarcodeScanner.Encode.TEXT_TYPE, "http://www.nytimes.com", function(success) {
alert("encode success: " + success);
}, function(fail) {
alert("encoding failed: " + fail);
Expand Down
12 changes: 6 additions & 6 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?><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.7.0">
version="1.0.0">

<name>BarcodeScanner</name>

<description>Scans Barcodes.</description>
<license>MIT</license>

<engines>
<engine name="cordova" version=">=2.8.0" />
<engine name="cordova" version=">=2.9.0" />
</engines>

<asset src="www/barcodescanner.js" target="barcodescanner.js" />

<license>MIT</license>
<js-module src="www/barcodescanner.js" name="BarcodeScanner">
<clobbers target="cordova.plugins.barcodeScanner" />
</js-module>

<!-- ios -->
<platform name="ios">
Expand Down
6 changes: 1 addition & 5 deletions www/barcodescanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
*/


cordova.define("cordova/plugin/BarcodeScanner",

function (require, exports, module) {

var exec = require("cordova/exec");

/**
Expand Down Expand Up @@ -88,4 +84,4 @@ cordova.define("cordova/plugin/BarcodeScanner",

var barcodeScanner = new BarcodeScanner();
module.exports = barcodeScanner;
});

0 comments on commit 6ad6daf

Please sign in to comment.