Skip to content

Commit

Permalink
Country cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Dremora committed Jun 20, 2013
1 parent d0cf1f9 commit f273d10
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 35 deletions.
2 changes: 1 addition & 1 deletion barcode-min.js

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

5 changes: 2 additions & 3 deletions barcode.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class Barcode
else if 30 <= code <= 39 then 'U.S. drugs (see U.S. National Drug Code)'
else if 40 <= code <= 49 then 'Restricted distribution (MO defined)'
else if 50 <= code <= 59 then 'Coupons'
else if 60 <= code <= 99 then 'U.S. and Canada'
else if 100 <= code <= 139 then 'U.S. (reserved for later use)'
else if 60 <= code <= 139 then 'U.S. and Canada'
else if 200 <= code <= 299 then 'Restricted distribution (MO defined)'
else if 300 <= code <= 379 then 'France and Monaco'
else if code == 380 then 'Bulgaria'
Expand Down Expand Up @@ -143,7 +142,7 @@ class Barcode
else if code == 958 then 'Macau'
else if 960 <= code <= 969 then 'GS1 Global Office: GTIN-8 allocations'
else if code == 977 then 'Serial publications (ISSN)'
else if 978 <= code <= 979 then 'Bookland (ISBN) - 979-0 used for sheet music'
else if 978 <= code <= 979 then 'Bookland (ISBN)' # TODO - 979-0 used for sheet music
else if code == 980 then 'Refund receipts'
else if 981 <= code <= 983 then 'Common Currency Coupons'
else if 990 <= code <= 999 then 'Coupons'
Expand Down
32 changes: 5 additions & 27 deletions barcode.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,33 +87,6 @@ h1 {
display: none;
}

#results dl
{
overflow: auto;
}

#results dl dt,
#results dl dd
{
float: left;
margin: 5px 0;
}

#results dl dt
{
clear: left;
width: 250px;
color: #555;
text-align: right;
display: block;
}

#results dl dd
{
padding-left: 10px;
width: 240px;
}

#links
{
text-align: center;
Expand Down Expand Up @@ -152,6 +125,11 @@ h1 {
display: none;
}

#country {
font-size: 2.4rem;
text-align: center;
}

img {
display: block;
margin-left: auto;
Expand Down
3 changes: 2 additions & 1 deletion barcode.js

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

1 change: 1 addition & 0 deletions controller.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ barcode.onChange (value) ->
$checksum.textContent = 'fix checksum'
$checksum.href = '#' + barcode.withValidChecksum()
$checksum.style.display = ''

document.getElementById('country').textContent = barcode.country()

if value == barcode.canonical
Expand Down
4 changes: 1 addition & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ <h1>Barcode lookup</h1>
<a id="checksum"></a>
</p>
<img src="" alt="" id="image"/>
<dl>
<dt>Country: </dt> <dd id="country"></dd>
</dl>
<p id="country"></p>
<canvas id="canvas" width="360" height="250"></canvas>
</div>

Expand Down

0 comments on commit f273d10

Please sign in to comment.