43 Commits
Author SHA1 Message Date
Ryan Willoughby c24882311f [plugin.xml] license tag 2013-07-08 16:34:44 -07:00
Ryan Willoughby 18f2f7a9fe [0.5.4] upped version 2013-07-04 14:18:37 -07:00
Ryan Willoughby 10d66a4e67 Merge branch 'master' of github.com:wildabeast/BarcodeScanner 2013-06-24 12:29:40 -07:00
Ryan Willoughby 27d6d653fc [readme] reference plugman not pluginstall 2013-06-24 12:28:13 -07:00
Ryan Willoughby 4efcc86a24 [plugin-xml] added engines 2013-06-24 12:28:13 -07:00
Ryan WilloughbyandRyan Willoughby 4d38047b41 [plugin-xml] Add description 2013-06-24 12:28:13 -07:00
Ryan Willoughby af21cd20f6 [readme] reference plugman not pluginstall 2013-06-24 12:09:49 -07:00
Ryan Willoughby e38147f27f [plugin-xml] added engines 2013-06-24 11:26:05 -07:00
Ryan Willoughby b45ce29fec [0.5.3] upped version 2013-06-18 17:38:27 -07:00
Ryan Willoughby 77d4a3dda2 [spec] update specs to cordova.require/define 2013-06-18 17:38:27 -07:00
Ryan Willoughby 6f4e09be4f [plugman] plugman don't like spec/config.xml
+ upped version to 0.5.2
2013-06-18 17:38:27 -07:00
Ryan Willoughby b0747cadce [plugin-xml] Add description 2013-06-18 16:59:28 -06:00
Ryan Willoughby 3332885acd [0.5.3] upped version 2013-06-14 17:32:20 -07:00
Ryan Willoughby 2331218b5a [spec] update specs to cordova.require/define 2013-06-10 16:36:11 -07:00
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 3ab188539c [js] cordova.require instead of PhoneGap.require 2013-06-07 16:37:48 -07:00
Ryan WilloughbyandRyan Willoughby d9f9f2dc9b [readme] formatting 2013-06-07 16:37:48 -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
Ryan Willoughby 6cf71f0a3e [spec] FIXED IT 2013-05-29 17:08:48 -07:00
Ryan Willoughby 6d95b33987 [spec] 2.5.0 2013-05-29 17:08:48 -07:00
Ryan Willoughby ec5e1dc843 [spec] removing a maybe bunk spec 2013-05-29 17:08:48 -07:00
Ryan Willoughby 507c726215 [spec] removing filsystem init 2013-05-29 17:08:48 -07:00
Ryan Willoughby fceafa235a [spec] more specs 2013-05-29 17:08:48 -07:00
Ryan Willoughby 666387e132 [spec] formatting for medic 2013-05-29 17:08:48 -07:00
Ryan Willoughby eb557c4827 [spec] app id 2013-05-29 17:08:48 -07:00
Ryan Willoughby 33b2e914a4 [spec] Fixed spec 2013-05-29 17:08:48 -07:00
Ryan Willoughby 657ec45122 [spec] app id, title 2013-05-29 17:08:48 -07:00
Ryan Willoughby 52ce70de60 [spec] fixing spec app 2013-05-29 17:08:47 -07:00
Ryan Willoughby ab95b1342d [spec] add barcodescanner.js 2013-05-29 17:08:47 -07:00
Ryan Willoughby 7e7c39dda6 [spec] Initial version of spec 2013-05-29 17:08:47 -07:00
Justin WarkandRyan Willoughby 5c46e8d93f Do not copy the scanned barcode to the clipboard. 2013-05-29 17:08:47 -07:00
Jayson RaymondandRyan Willoughby 3bc65ebbaa readme fix 2013-05-29 17:08:47 -07:00
Jayson RaymondandRyan Willoughby 5d6f0d52f9 Update for Cordova/PhoneGap 2.0 plugins (http://simonmacdonald.blogspot.ca/2012/08/so-you-wanna-write-phonegap-200-android.html) 2013-05-29 17:08:47 -07:00
Fil MajandRyan Willoughby f26cde76f5 fix for a java ref 2013-05-29 17:05:16 -07:00
Fil MajandRyan Willoughby 5d452348da full paths for android 2013-05-29 17:05:16 -07:00
Fil MajandRyan Willoughby 4d8646e26d fully qualified paths 2013-05-29 17:05:16 -07:00
Ryan Willoughby b1f643f6f4 Merge pull request #3 from filmaj/master
cordova-plugman support
2013-05-29 15:35:22 -07:00
Fil Maj 9c533da17e fix for a java ref 2013-05-16 09:09:55 -07:00
Fil Maj f568cc6d3e full paths for android 2013-05-15 19:27:10 -07:00
Fil Maj 215e077510 fully qualified paths 2013-05-14 17:38:30 -07:00
Ryan Willoughby cc0f7d82a1 [spec] FIXED IT 2013-05-10 14:04:27 -07:00
Bob Easterday 58e773af70 update BarcodeScanner plugin for 2.5.0+ 2013-03-28 16:20:14 -07:00
6 changed files with 110 additions and 96 deletions
+8 -6
View File
@@ -3,7 +3,7 @@ BarcodeScanner
Cross-platform BarcodeScanner for Cordova / PhoneGap.
Follows the [Cordova Plugin spec](https://github.com/alunny/cordova-plugin-spec), so that it works with [Pluginstall](https://github.com/alunny/pluginstall).
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).
@@ -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.
+80 -52
View File
@@ -2,9 +2,15 @@
<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.5">
<name>BarcodeScanner</name>
<description>Scans Barcodes.</description>
<engines>
<engine name="cordova" version=">=2.0.0" />
</engines>
<asset src="www/barcodescanner.js" target="barcodescanner.js" />
@@ -17,12 +23,12 @@
<plugin name="BarcodeScanner" value="CDVBarcodeScanner"/>
</config-file>
<resource-file src="scannerOverlay.xib" />
<resource-file src="src/ios/scannerOverlay.xib" />
<header-file src="zxing-all-in-one.h" />
<header-file src="src/ios/zxing-all-in-one.h" />
<source-file src="CDVBarcodeScanner.mm" />
<source-file src="zxing-all-in-one.cpp" />
<source-file src="src/ios/CDVBarcodeScanner.mm" />
<source-file src="src/ios/zxing-all-in-one.cpp" />
<framework src="libiconv.dylib" />
<framework src="AVFoundation.framework" />
@@ -33,7 +39,7 @@
<!-- android -->
<platform name="android">
<source-file src="com/phonegap/plugins/barcodescanner/BarcodeScanner.java" target-dir="src/com/phonegap/plugins/barcodescanner" />
<source-file src="src/android/com/phonegap/plugins/barcodescanner/BarcodeScanner.java" target-dir="src/com/phonegap/plugins/barcodescanner" />
<!--
<source-file src="R.java" target-dir="src/com/google/zxing/client/android" />
-->
@@ -76,39 +82,39 @@
<uses-feature android:name="android.hardware.camera" />
</config-file>
<source-file src="com.google.zxing.client.android.captureactivity.jar" target-dir="libs"/>
<source-file src="src/android/com.google.zxing.client.android.captureactivity.jar" target-dir="libs"/>
<source-file src="LibraryProject/res/drawable/launcher_icon.png" target-dir="res/drawable"/>
<source-file src="LibraryProject/res/drawable/share_via_barcode.png" target-dir="res/drawable"/>
<source-file src="LibraryProject/res/drawable/shopper_icon.png" target-dir="res/drawable"/>
<source-file src="src/android/LibraryProject/res/drawable/launcher_icon.png" target-dir="res/drawable"/>
<source-file src="src/android/LibraryProject/res/drawable/share_via_barcode.png" target-dir="res/drawable"/>
<source-file src="src/android/LibraryProject/res/drawable/shopper_icon.png" target-dir="res/drawable"/>
<source-file src="LibraryProject/res/drawable-hdpi/launcher_icon.png" target-dir="res/drawable-hdpi"/>
<source-file src="LibraryProject/res/drawable-hdpi/shopper_icon.png" target-dir="res/drawable-hdpi"/>
<source-file src="src/android/LibraryProject/res/drawable-hdpi/launcher_icon.png" target-dir="res/drawable-hdpi"/>
<source-file src="src/android/LibraryProject/res/drawable-hdpi/shopper_icon.png" target-dir="res/drawable-hdpi"/>
<source-file src="LibraryProject/res/raw/beep.ogg" target-dir="res/raw"/>
<source-file src="src/android/LibraryProject/res/raw/beep.ogg" target-dir="res/raw"/>
<source-file src="LibraryProject/res/layout/bookmark_picker_list_item.xml" target-dir="res/layout"/>
<source-file src="LibraryProject/res/layout/capture.xml" target-dir="res/layout"/>
<source-file src="LibraryProject/res/layout/encode.xml" target-dir="res/layout"/>
<source-file src="LibraryProject/res/layout/help.xml" target-dir="res/layout"/>
<source-file src="LibraryProject/res/layout/network.xml" target-dir="res/layout"/>
<source-file src="LibraryProject/res/layout/search_book_contents.xml" target-dir="res/layout"/>
<source-file src="LibraryProject/res/layout/search_book_contents_header.xml" target-dir="res/layout"/>
<source-file src="LibraryProject/res/layout/search_book_contents_list_item.xml" target-dir="res/layout"/>
<source-file src="LibraryProject/res/layout/share.xml" target-dir="res/layout"/>
<source-file src="src/android/LibraryProject/res/layout/bookmark_picker_list_item.xml" target-dir="res/layout"/>
<source-file src="src/android/LibraryProject/res/layout/capture.xml" target-dir="res/layout"/>
<source-file src="src/android/LibraryProject/res/layout/encode.xml" target-dir="res/layout"/>
<source-file src="src/android/LibraryProject/res/layout/help.xml" target-dir="res/layout"/>
<source-file src="src/android/LibraryProject/res/layout/network.xml" target-dir="res/layout"/>
<source-file src="src/android/LibraryProject/res/layout/search_book_contents.xml" target-dir="res/layout"/>
<source-file src="src/android/LibraryProject/res/layout/search_book_contents_header.xml" target-dir="res/layout"/>
<source-file src="src/android/LibraryProject/res/layout/search_book_contents_list_item.xml" target-dir="res/layout"/>
<source-file src="src/android/LibraryProject/res/layout/share.xml" target-dir="res/layout"/>
<source-file src="LibraryProject/res/layout-land/encode.xml" target-dir="res/layout-land"/>
<source-file src="LibraryProject/res/layout-land/share.xml" target-dir="res/layout-land"/>
<source-file src="src/android/LibraryProject/res/layout-land/encode.xml" target-dir="res/layout-land"/>
<source-file src="src/android/LibraryProject/res/layout-land/share.xml" target-dir="res/layout-land"/>
<source-file src="LibraryProject/res/layout-ldpi/capture.xml" target-dir="res/layout-ldpi"/>
<source-file src="src/android/LibraryProject/res/layout-ldpi/capture.xml" target-dir="res/layout-ldpi"/>
<source-file src="LibraryProject/res/xml/preferences.xml" target-dir="res/xml"/>
<source-file src="src/android/LibraryProject/res/xml/preferences.xml" target-dir="res/xml"/>
<source-file src="LibraryProject/res/values/attrs.xml" target-dir="res/values"/>
<source-file src="LibraryProject/res/values/colors.xml" target-dir="res/values"/>
<source-file src="LibraryProject/res/values/ids.xml" target-dir="res/values"/>
<source-file src="src/android/LibraryProject/res/values/attrs.xml" target-dir="res/values"/>
<source-file src="src/android/LibraryProject/res/values/colors.xml" target-dir="res/values"/>
<source-file src="src/android/LibraryProject/res/values/ids.xml" target-dir="res/values"/>
<config-file target="res/values/strings.xml" parent="/resources">
<!-- string name="app_name">Barcode Scanner</string -->
@@ -238,28 +244,50 @@
</config-file>
<source-file src="LibraryProject/res/values-ar/strings.xml" target-dir="res/values-ar"/>
<source-file src="LibraryProject/res/values-bg/strings.xml" target-dir="res/values-bg"/>
<source-file src="LibraryProject/res/values-cs/strings.xml" target-dir="res/values-cs"/>
<source-file src="LibraryProject/res/values-da/strings.xml" target-dir="res/values-da"/>
<source-file src="LibraryProject/res/values-de/strings.xml" target-dir="res/values-de"/>
<source-file src="LibraryProject/res/values-es/strings.xml" target-dir="res/values-es"/>
<source-file src="LibraryProject/res/values-fi/strings.xml" target-dir="res/values-fi"/>
<source-file src="LibraryProject/res/values-fr/strings.xml" target-dir="res/values-fr"/>
<source-file src="LibraryProject/res/values-he/strings.xml" target-dir="res/values-he"/>
<source-file src="LibraryProject/res/values-hu/strings.xml" target-dir="res/values-hu"/>
<source-file src="LibraryProject/res/values-it/strings.xml" target-dir="res/values-it"/>
<source-file src="LibraryProject/res/values-ja-rJP/strings.xml" target-dir="res/values-ja-rJP"/>
<source-file src="LibraryProject/res/values-nl/strings.xml" target-dir="res/values-nl"/>
<source-file src="LibraryProject/res/values-pl/strings.xml" target-dir="res/values-pl"/>
<source-file src="LibraryProject/res/values-pt/strings.xml" target-dir="res/values-pt"/>
<source-file src="LibraryProject/res/values-ru/strings.xml" target-dir="res/values-ru"/>
<source-file src="LibraryProject/res/values-sk/strings.xml" target-dir="res/values-sk"/>
<source-file src="LibraryProject/res/values-sl/strings.xml" target-dir="res/values-sl"/>
<source-file src="LibraryProject/res/values-sv/strings.xml" target-dir="res/values-sv"/>
<source-file src="LibraryProject/res/values-tr/strings.xml" target-dir="res/values-tr"/>
<source-file src="LibraryProject/res/values-zh-rCN/strings.xml" target-dir="res/values-zh-rCN"/>
<source-file src="LibraryProject/res/values-zh-rTW/strings.xml" target-dir="res/values-zh-rTW"/>
<source-file src="src/android/LibraryProject/res/values-ar/strings.xml" target-dir="res/values-ar"/>
<source-file src="src/android/LibraryProject/res/values-bg/strings.xml" target-dir="res/values-bg"/>
<source-file src="src/android/LibraryProject/res/values-cs/strings.xml" target-dir="res/values-cs"/>
<source-file src="src/android/LibraryProject/res/values-da/strings.xml" target-dir="res/values-da"/>
<source-file src="src/android/LibraryProject/res/values-de/strings.xml" target-dir="res/values-de"/>
<source-file src="src/android/LibraryProject/res/values-es/strings.xml" target-dir="res/values-es"/>
<source-file src="src/android/LibraryProject/res/values-fi/strings.xml" target-dir="res/values-fi"/>
<source-file src="src/android/LibraryProject/res/values-fr/strings.xml" target-dir="res/values-fr"/>
<source-file src="src/android/LibraryProject/res/values-he/strings.xml" target-dir="res/values-he"/>
<source-file src="src/android/LibraryProject/res/values-hu/strings.xml" target-dir="res/values-hu"/>
<source-file src="src/android/LibraryProject/res/values-it/strings.xml" target-dir="res/values-it"/>
<source-file src="src/android/LibraryProject/res/values-ja-rJP/strings.xml" target-dir="res/values-ja-rJP"/>
<source-file src="src/android/LibraryProject/res/values-nl/strings.xml" target-dir="res/values-nl"/>
<source-file src="src/android/LibraryProject/res/values-pl/strings.xml" target-dir="res/values-pl"/>
<source-file src="src/android/LibraryProject/res/values-pt/strings.xml" target-dir="res/values-pt"/>
<source-file src="src/android/LibraryProject/res/values-ru/strings.xml" target-dir="res/values-ru"/>
<source-file src="src/android/LibraryProject/res/values-sk/strings.xml" target-dir="res/values-sk"/>
<source-file src="src/android/LibraryProject/res/values-sl/strings.xml" target-dir="res/values-sl"/>
<source-file src="src/android/LibraryProject/res/values-sv/strings.xml" target-dir="res/values-sv"/>
<source-file src="src/android/LibraryProject/res/values-tr/strings.xml" target-dir="res/values-tr"/>
<source-file src="src/android/LibraryProject/res/values-zh-rCN/strings.xml" target-dir="res/values-zh-rCN"/>
<source-file src="src/android/LibraryProject/res/values-zh-rTW/strings.xml" target-dir="res/values-zh-rTW"/>
</platform>
</plugin>
<license>
Copyright (c) 2012 Adobe Software Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
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.
</license>
</plugin>
+18 -14
View File
@@ -19,35 +19,39 @@
*
*/
describe('Plugin object (window.plugins)', function () {
var scanner;
describe('cordova.require object should exist', function () {
it("should exist", function() {
expect(window.plugins).toBeDefined();
expect(window.cordova).toBeDefined();
expect(typeof cordova.require == 'function').toBe(true);
});
it("should contain a barcodeScanner object", function() {
expect(window.plugins.barcodeScanner).toBeDefined();
expect(typeof window.plugins.barcodeScanner == 'object').toBe(true);
it("BarcodeScanner plugin should exist", function() {
scanner = cordova.require("cordova/plugin/BarcodeScanner")
expect(scanner).toBeDefined();
expect(typeof scanner == 'object').toBe(true);
});
it("should contain a scan function", function() {
expect(window.plugins.barcodeScanner.scan).toBeDefined();
expect(typeof window.plugins.barcodeScanner.scan == 'function').toBe(true);
expect(scanner.scan).toBeDefined();
expect(typeof scanner.scan == 'function').toBe(true);
});
it("should contain an encode function", function() {
expect(window.plugins.barcodeScanner.encode).toBeDefined();
expect(typeof window.plugins.barcodeScanner.encode == 'function').toBe(true);
expect(scanner.encode).toBeDefined();
expect(typeof scanner.encode == 'function').toBe(true);
});
it("should contain three DestinationType constants", function() {
expect(BarcodeScanner.Encode.TEXT_TYPE).toBe("TEXT_TYPE");
expect(BarcodeScanner.Encode.EMAIL_TYPE).toBe("EMAIL_TYPE");
expect(BarcodeScanner.Encode.PHONE_TYPE).toBe("PHONE_TYPE");
expect(BarcodeScanner.Encode.SMS_TYPE).toBe("SMS_TYPE");
expect(scanner.Encode.TEXT_TYPE).toBe("TEXT_TYPE");
expect(scanner.Encode.EMAIL_TYPE).toBe("EMAIL_TYPE");
expect(scanner.Encode.PHONE_TYPE).toBe("PHONE_TYPE");
expect(scanner.Encode.SMS_TYPE).toBe("SMS_TYPE");
});
/*
it("should call scan successfully", function() {
window.plugins.barcodeScanner.scan(function() {}, function() {});
scanner.scan(function() {}, function() {});
});
*/
});
-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 = "com.phonegap.hydratest"
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
@@ -58,7 +58,7 @@
var htmlReporter = new jasmine.HtmlReporter();
jasmineEnv.addReporter(htmlReporter);jasmineEnv.addReporter(jr);
jasmineEnv.addReporter(htmlReporter);
jasmineEnv.specFilter = function(spec) {
return htmlReporter.specFilter(spec);
+3 -3
View File
@@ -7,7 +7,7 @@
*/
PhoneGap.define("cordova/plugin/BarcodeScanner",
cordova.define("cordova/plugin/BarcodeScanner",
function (require, exports, module) {
@@ -54,12 +54,12 @@ PhoneGap.define("cordova/plugin/BarcodeScanner",
}
if (typeof errorCallback != "function") {
console.log("BarcodeScanner.scan failure: failure parameter not a function");
console.log("BarcodeScanner.encode failure: failure parameter not a function");
return
}
if (typeof successCallback != "function") {
console.log("BarcodeScanner.scan failure: success callback parameter must be a function");
console.log("BarcodeScanner.encode failure: success callback parameter must be a function");
return
}