Skip to content

Commit

Permalink
Merge pull request #7 from janantala/canary
Browse files Browse the repository at this point in the history
v0.1.1
  • Loading branch information
janantala committed Nov 6, 2013
2 parents 4fe3b51 + d728b23 commit c10e04d
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = function (grunt) {
uglify: {
options: {
preserveComments: 'some'
},
},
dist: {
src: '<%= pkg.name %>.js',
dest: '<%= pkg.name %>.min.js'
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# angular-qr v0.1.0 [![Build Status](https://travis-ci.org/janantala/angular-qr.png?branch=master)](https://travis-ci.org/janantala/angular-qr)
# angular-qr v0.1.1 [![Build Status](https://travis-ci.org/janantala/angular-qr.png?branch=master)](https://travis-ci.org/janantala/angular-qr)

QR code generator for AngularJS

Expand Down Expand Up @@ -52,13 +52,13 @@ Your text to encode

#### type-number
- 1-40
- default value: minimal required version
- default value: `0` = minimal required version

#### correction-level
- L
- M (default)
- Q
- H
- `L` - Low
- `M` - Medium (default)
- `Q` - Quartile
- `H` - High

#### size
Size in pixels
Expand Down
10 changes: 8 additions & 2 deletions angular-qr.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*!
* angular-qr v0.1.1
* (c) 2013 Jan Antala http://janantala.com
* License: MIT
*/

(function (QRCode) {
'use strict';
angular.module('ja.qr', []).controller('QrCtrl', [
Expand All @@ -23,11 +29,11 @@
return $scope.size || 250;
};
$scope.isNUMBER = function (text) {
var ALLOWEDCHARS = /^[0123456789]*$/;
var ALLOWEDCHARS = /^[0-9]*$/;
return ALLOWEDCHARS.test(text);
};
$scope.isALPHA_NUM = function (text) {
var ALLOWEDCHARS = /^[0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:]*$/;
var ALLOWEDCHARS = /^[0-9A-Z $%*+\-./:]*$/;
return ALLOWEDCHARS.test(text);
};
$scope.is8bit = function (text) {
Expand Down
8 changes: 7 additions & 1 deletion angular-qr.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-qr",
"version": "0.1.0",
"version": "0.1.1",
"description": "QR code generator for AngularJS",
"author": "https://github.com/janantala/angular-qr/graphs/contributors",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-qr",
"version": "0.1.0",
"version": "0.1.1",
"description": "QR code generator for AngularJS",
"author": "https://github.com/janantala/angular-qr/graphs/contributors",
"license": "MIT",
Expand Down
8 changes: 4 additions & 4 deletions src/angular-qr.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* angular-qr v0.1.0
/*!
* angular-qr v0.1.1
* (c) 2013 Jan Antala http://janantala.com
* License: MIT
*/
Expand Down Expand Up @@ -34,12 +34,12 @@
};

$scope.isNUMBER = function(text){
var ALLOWEDCHARS = /^[0123456789]*$/;
var ALLOWEDCHARS = /^[0-9]*$/;
return ALLOWEDCHARS.test(text);
};

$scope.isALPHA_NUM = function(text){
var ALLOWEDCHARS = /^[0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:]*$/;
var ALLOWEDCHARS = /^[0-9A-Z $%*+\-./:]*$/;
return ALLOWEDCHARS.test(text);
};

Expand Down
4 changes: 4 additions & 0 deletions test/unit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ describe('ja.qr', function() {
expect(scope.getInputMode('aA123')).not.toBe('NUMBER');
expect(scope.getInputMode('aA123')).not.toBe('ALPHA_NUM');
expect(scope.getInputMode('aA123')).toBe('8bit');

expect(scope.getInputMode('A,123')).not.toBe('NUMBER');
expect(scope.getInputMode('A,123')).not.toBe('ALPHA_NUM');
expect(scope.getInputMode('A,123')).toBe('8bit');
});

});
Expand Down

0 comments on commit c10e04d

Please sign in to comment.