From 4efb22b89050839d2504d25f2d10d88cf87d3c72 Mon Sep 17 00:00:00 2001 From: Andrea Rendine Date: Thu, 30 Apr 2015 17:11:24 +0200 Subject: [PATCH 1/2] Fixed variable name Actually in this case "name" is used in a function and is not necessary for lookups, but I think that if future changes to both room.js and outside.js occur, authors will appreciate consistency in scripts (also fixes indentation in comments). --- script/outside.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/script/outside.js b/script/outside.js index f734c85..97a23a5 100644 --- a/script/outside.js +++ b/script/outside.js @@ -364,11 +364,11 @@ var Outside = { updateVillageRow: function(name, num, village) { var id = 'building_row_' + name.replace(' ', '-'); - name = _(name); + lname = _(name); var row = $('div#' + id, village); if(row.length === 0 && num > 0) { row = $('
').attr('id', id).addClass('storeRow'); - $('
').addClass('row_key').text(name).appendTo(row); + $('
').addClass('row_key').text(lname).appendTo(row); $('
').addClass('row_val').text(num).appendTo(row); $('
').addClass('clear').appendTo(row); var curPrev = null; @@ -376,7 +376,7 @@ var Outside = { var child = $(this); if(child.attr('id') != 'population') { var cName = child.children('.row_key').text(); - if(cName < name) { + if(cName < lname) { curPrev = child.attr('id'); } } @@ -587,13 +587,13 @@ var Outside = { } } } - /// TRANSLATORS : Mind the whitespace at the end. + /// TRANSLATORS : Mind the whitespace at the end. var s = _('the traps contain '); for(var i = 0, len = msg.length; i < len; i++) { if(len > 1 && i > 0 && i < len - 1) { s += ", "; } else if(len > 1 && i == len - 1) { - /// TRANSLATORS : Mind the whitespaces at the beginning and end. + /// TRANSLATORS : Mind the whitespaces at the beginning and end. s += _(" and "); } s += msg[i]; From f0e05481160f9c5bc111bd6335894c76199a3015 Mon Sep 17 00:00:00 2001 From: Andrea Rendine Date: Thu, 30 Apr 2015 17:27:50 +0200 Subject: [PATCH 2/2] Var Working ina hurry is bad. --- script/outside.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/outside.js b/script/outside.js index 97a23a5..9372a31 100644 --- a/script/outside.js +++ b/script/outside.js @@ -364,7 +364,7 @@ var Outside = { updateVillageRow: function(name, num, village) { var id = 'building_row_' + name.replace(' ', '-'); - lname = _(name); + var lname = _(name); var row = $('div#' + id, village); if(row.length === 0 && num > 0) { row = $('
').attr('id', id).addClass('storeRow');