Permalink
Browse files

Braille fun.

  • Loading branch information...
1 parent a546702 commit e5d3f9d9dc385133b7df436d2b34ea2678e9d4b3 @amster committed Apr 22, 2012
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -245,7 +245,7 @@ $(function () {
$tgt = $(ev.target),
$tgtrow = $tgt.parents('tr'),
val = $tgt.val(),
- items, sums, indexed, allsum, sum26, morsec, sema, brailles,
+ items, sums, indexed, allsum, sum26, morsec, sema, brailles, $brailletd,
i, curclass;
// Select next row?
@@ -301,8 +301,13 @@ $(function () {
// Braille
brailles = itemsToBraille(items);
+ $brailletd = $('.braille', $tgtrow);
if (brailles) {
- $('.braille', $tgtrow).text(brailles);
+ $brailletd.text(brailles);
+ $brailletd.addClass( 'braille-'+(brailles.replace(/\W/,'')) );
+ } else {
+ // Wipe out all classes.s
+ $brailletd[0].className = 'braille';
}
} catch (e) {
window.console.log(e);
@@ -70,3 +70,33 @@ footer {
font-size: 0.7em;
color: #777;
}
+.braille {
+ background: url("../../resources/images/psolve_braillemap.png") 0px 100px no-repeat;
+}
+
+.braille-A { background-position: -10px 0px; }
+.braille-B { background-position: -10px -100px; }
+.braille-C { background-position: -10px -200px; }
+.braille-D { background-position: -10px -300px; }
+.braille-E { background-position: -10px -400px; }
+.braille-F { background-position: -10px -500px; }
+.braille-G { background-position: -10px -600px; }
+.braille-H { background-position: -10px -700px; }
+.braille-I { background-position: -10px -800px; }
+.braille-J { background-position: -10px -900px; }
+.braille-K { background-position: -10px -1000px; }
+.braille-L { background-position: -10px -1100px; }
+.braille-M { background-position: -10px -1200px; }
+.braille-N { background-position: -10px -1300px; }
+.braille-O { background-position: -10px -1400px; }
+.braille-P { background-position: -10px -1500px; }
+.braille-Q { background-position: -10px -1600px; }
+.braille-R { background-position: -10px -1700px; }
+.braille-S { background-position: -10px -1800px; }
+.braille-T { background-position: -10px -1900px; }
+.braille-U { background-position: -10px -2000px; }
+.braille-v { background-position: -10px -2100px; }
+.braille-W { background-position: -10px -2200px; }
+.braille-X { background-position: -10px -2300px; }
+.braille-Y { background-position: -10px -2400px; }
+.braille-Z { background-position: -10px -2500px; }

0 comments on commit e5d3f9d

Please sign in to comment.