- Timestamp:
- 09/09/08 02:00:37 (2 months ago)
- Location:
- lang/ruby/bokeshi/trunk
- Files:
-
- 3 modified
-
bokeshi/stage.rb (modified) (1 diff)
-
website/public/javascripts/bokeshi.js (modified) (6 diffs)
-
website/public/stylesheets/style.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/bokeshi/trunk/bokeshi/stage.rb
r18746 r19023 102 102 return (0 <= row and row < size and 0 <= col and col < size(row)) 103 103 end 104 104 105 105 end 106 106 end -
lang/ruby/bokeshi/trunk/website/public/javascripts/bokeshi.js
r18798 r19023 2 2 3 3 function initStage() { 4 var stageUL = $("<ul ></ul>");5 for (var i = 0 ; i < stage.length; i++) {6 var rowUL = $("<ul ></ul>").addClass("row");7 for (var j = 0 ; j < stage[i].length; j++) {4 var stageUL = $("<ul/>"); 5 for (var i = 0, l = stage.length; i < l; i++) { 6 var rowUL = $("<ul/>").addClass("row"); 7 for (var j = 0, m = stage[i].length; j < m; j++) { 8 8 rowUL.append($("<li>|</li>").data("row", i).data("col", j)); 9 9 } … … 24 24 var firstRow = $(selected[0]).data("row"); 25 25 var firstCol = $(selected[0]).data("col"); 26 var isSuccessive = true 27 for (var i = 1 ; i < selected.length; i++) {26 var isSuccessive = true; 27 for (var i = 1, l = selected.length; i < l; i++) { 28 28 if ($(selected[i]).data("col") != firstCol + i) { 29 29 isSuccessive = false; … … 48 48 stage = data.stage; 49 49 stage.reset = function () { 50 for (var i = 0 ; i < this.length; i++) {51 for (var j = 0 ; j < this[i].length; j++) {50 for (var i = 0, l = this.length; i < l; i++) { 51 for (var j = 0, m = this[i].length; j < m; j++) { 52 52 this[i][j] = null; 53 53 } 54 54 } 55 55 $("#stage li").removeClass("removed").removeClass("byPlayer").removeClass("byCPU"); 56 $("#message").hide();56 $("#message").hide(); 57 57 }; 58 58 stage.remove = function (removing, by) { … … 84 84 $("#waitingMessage").show(); 85 85 $.post("./", { 86 "stage": this.toRequestStr(),87 "dummy": (new Date()).getTime()88 }, function (data) {86 "stage": this.toRequestStr(), 87 "dummy": (new Date()).getTime() 88 }, function (data) { 89 89 var nextRemoving = data.nextRemoving; 90 90 if (nextRemoving) { … … 104 104 }; 105 105 stage.isTerminated = function () { 106 for (var i = 0 ; i < this.length; i++) {107 for (var j = 0 ; j < this[i].length; j++) {106 for (var i = 0, l = this.length; i < l; i++) { 107 for (var j = 0, m = this[i].length; j < m; j++) { 108 108 if (!this[i][j]) { 109 109 return false; … … 112 112 } 113 113 return true; 114 } 114 }; 115 115 initStage(); 116 116 }, "json"); 117 $("#reset").click(function () { 118 stage.reset(); 119 }); 117 $("#reset").click(stage.reset); 120 118 $("#waitingMessage").hide(); 121 119 $("#message").hide(); -
lang/ruby/bokeshi/trunk/website/public/stylesheets/style.css
r18763 r19023 19 19 20 20 #stage .byPlayer { 21 color: #3333cc 21 color: #3333cc; 22 22 } 23 23
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)