Skip to content
This repository has been archived by the owner on Mar 28, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
basvanbeek committed Feb 13, 2015
2 parents b571e2b + fb600c1 commit 28f393e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
16 changes: 15 additions & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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="2.0.0">
version="2.0.1">

<name>BarcodeScanner</name>
<description>You can use the BarcodeScanner plugin to scan different types of barcodes (using the device's camera) and get the metadata encoded in them for processing within your application.</description>
Expand Down Expand Up @@ -318,4 +318,18 @@
<source-file src="src/wp8/BarcodeScannerUI.xaml.cs" />

</platform>

<!-- browser -->
<platform name="browser">
<config-file target="config.xml" parent="/*">
<feature name="BarcodeScanner">
<param name="browser-package" value="BarcodeScanner" />
</feature>
</config-file>

<js-module src="src/browser/BarcodeScannerProxy.js" name="BarcodeScannerProxy">
<runs />
</js-module>
</platform>

</plugin>
24 changes: 24 additions & 0 deletions src/browser/BarcodeScannerProxy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
function scan(success, error) {
var code = window.prompt("Enter barcode value (empty value will fire the error handler):");
if(code) {
var result = {
text:code,
format:"Fake",
cancelled:false
};
success(result);
} else {
error("No barcode");
}
}

function encode(type, data, success, errorCallback) {
success();
}

module.exports = {
scan: scan,
encode: encode
};

require("cordova/exec/proxy").add("BarcodeScanner",module.exports);

0 comments on commit 28f393e

Please sign in to comment.