Changeset 18777 for lang/ruby

Show
Ignore:
Timestamp:
09/04/08 01:33:32 (3 months ago)
Author:
hajimehoshi
Message:

Updated js

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/bokeshi/trunk/website/public/javascripts/bokeshi.js

    r18776 r18777  
    7070                this[row][col2] = by; 
    7171                var id = "stick_" + row + "_" + col2; 
    72                 var stick = $("#" + id); 
    73                 stick.addClass("removed").addClass({ 
     72                $("#" + id).addClass("removed").addClass({ 
    7473                    "player": "byPlayer", 
    7574                    "cpu": "byCPU" 
     
    7776            } 
    7877            if (this.isTerminated()) { 
    79                 switch (by) { 
    80                 case "player": 
    81                     $("#message").text("You Lose!"); 
    82                     break; 
    83                 case "cpu": 
    84                     $("#message").text("You Win!"); 
    85                     break; 
    86                 } 
     78                $("message").text({ 
     79                    "player": "You Lose!", 
     80                    "cpu": "You Win!" 
     81                }[by]); 
    8782                $("#message").show(); 
    8883                return;