diff options
Diffstat (limited to 'examples/6_Maths_matchingAnglesAndShapes/js/lesson.js')
-rwxr-xr-x | examples/6_Maths_matchingAnglesAndShapes/js/lesson.js | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/examples/6_Maths_matchingAnglesAndShapes/js/lesson.js b/examples/6_Maths_matchingAnglesAndShapes/js/lesson.js index 2aff46c..cd808a6 100755 --- a/examples/6_Maths_matchingAnglesAndShapes/js/lesson.js +++ b/examples/6_Maths_matchingAnglesAndShapes/js/lesson.js @@ -1,3 +1,47 @@ +/* +Bugs (firefox 3.5.7): +* sometimes mulitple cards are shown +* the image of one of the angles is not showing properly +* if you have a text without a hyphen it doesn't work (e.g. angulo +recto iso angulo-recto) +* the text for angulo-obtuso is not displaying properly +* title in english: 'matching angles with shapes' should maybe be +'matching angles and shapes' + +Questions: +* how do we set locale? cfr beginning of $(document).ready() + +Peeves: +* tabs for indenting +* trailing whitespace everywhere + +*/ + +// TBD: use jquery plugin instead, http://plugins.jquery.com/project/psprintf +function format(format_string /*, args*/) { + var args = [].slice.call(arguments); // arguments is not a real array + args.shift(); + var result = ''; + for (var i = 0; i < format_string.length; i += 1) { + var c = format_string.charAt(i); + if (c == '%') { + i += 1; // Breaks on format_string ending with % + var c2 = format_string.charAt(i); + if (c2 == '%') { + result += '%' + } else if (c2 == 'd') { + result += args.shift(); + } else { + alert('unsupported format character: ' + c2); + } + } else { + result += c; + } + } + return result; +} + + $(document).ready(function() { var i = 0, j = 0, flag = 0; @@ -52,7 +96,6 @@ $(document).ready(function() { }; - var check_game_over = function(){ if(numMatched === NUM_OBJECTS){ //show all play = 0; |