changelog shortlog tags manifest raw

changeset: add tournament state column to sitngo

changeset 737: 642321b1d840
parent 736:39120991a17b
child 738:4086ec59b02e
author: root@kun
date: Tue Aug 19 13:48:42 2008 +0000 (3 months ago)
files: jpoker/js/jquery.jpoker.js jpoker/js/test-jpoker.js
description: add tournament state column to sitngo
--- a/jpoker/js/jquery.jpoker.js	Tue Aug 19 13:43:28 2008 +0000
+++ b/jpoker/js/jquery.jpoker.js	Tue Aug 19 13:48:42 2008 +0000
@@ -1985,8 +1985,8 @@
     };
 
     jpoker.plugins.sitngoTourneyList.templates = {
-        header : '<thead><tr><th>{description_short}</th><th>{registered}</th><th>{players_quota}</th><th>{buy_in}</th></tr></thead><tbody>',
-        rows : '<tr id=\'{id}\' title=\'' + _("Click to show tourney details") + '\'><td>{description_short}</td><td>{registered}</td><td>{players_quota}</td><td>{buy_in}</td></tr>',
+        header : '<thead><tr><th>{description_short}</th><th>{registered}</th><th>{players_quota}</th><th>{buy_in}</th><th>{state}</th></tr></thead><tbody>',
+        rows : '<tr id=\'{id}\' title=\'' + _("Click to show tourney details") + '\'><td>{description_short}</td><td>{registered}</td><td>{players_quota}</td><td>{buy_in}</td><td>{state}</td></tr>',
         footer : '</tbody>'
     };
 
--- a/jpoker/js/test-jpoker.js	Tue Aug 19 13:43:28 2008 +0000
+++ b/jpoker/js/test-jpoker.js	Tue Aug 19 13:48:42 2008 +0000
@@ -2021,7 +2021,7 @@
 // sitngoTourneyList
 //
 test("jpoker.plugins.sitngoTourneyList", function(){
-        expect(12);
+        expect(13);
         stop();
 
         //
@@ -2032,6 +2032,7 @@
 
 	var TOURNEY_LIST_PACKET = {"players": 0, "packets": [{"players_quota": 2, "breaks_first": 7200, "name": "sitngo2", "description_short" : "Sit and Go 2 players, Holdem", "start_time": 0, "breaks_interval": 3600, "variant": "holdem", "currency_serial" : 1, "state": "registering", "buy_in": 300000, "type": "PacketPokerTourney", "breaks_duration": 300, "serial": 1, "sit_n_go": "y", "registered": 0}, {"players_quota": 1000, "breaks_first": 7200, "name": "regular1", "description_short": "Holdem No Limit Freeroll", "start_time": 1216201024, "breaks_interval" : 60, "variant": "holdem", "currency_serial": 1, "state": "canceled", "buy_in": 0, "type": "PacketPokerTourney", "breaks_duration": 300, "serial": 39, "sit_n_go": "n", "registered": 0}, {"players_quota": 1000, "breaks_first" : 7200, "name": "regular1", "description_short": "Holdem No Limit Freeroll", "start_time": 1216201024, "breaks_interval": 60, "variant": "holdem", "currency_serial": 1, "state": "canceled", "buy_in": 0, "type": "PacketPokerTourney", "breaks_duration": 300, "serial": 40, "sit_n_go": "n", "registered": 0}, {"players_quota": 1000, "breaks_first": 7200, "name": "regular1", "description_short": "Holdem No Limit Freeroll", "start_time": 1216201024, "breaks_interval": 60, "variant": "holdem", "currency_serial": 1, "state": "canceled", "buy_in": 0, "type": "PacketPokerTourney", "breaks_duration": 300, "serial" : 41, "sit_n_go": "n", "registered": 0}, {"players_quota": 1000, "breaks_first": 7200, "name": "regular1", "description_short": "Holdem No Limit Freeroll", "start_time": 1216201024, "breaks_interval": 60, "variant": "holdem", "currency_serial": 1, "state": "canceled", "buy_in": 0, "type": "PacketPokerTourney", "breaks_duration": 300, "serial": 42, "sit_n_go": "n", "registered": 0}], "tourneys": 5, "type": "PacketPokerTourneyList"};
 	var buy_in = TOURNEY_LIST_PACKET.packets[0].buy_in/100;
+	var state = TOURNEY_LIST_PACKET.packets[0].state;
 
         PokerServer.prototype = {
             outgoing: "[ " + JSON.stringify(TOURNEY_LIST_PACKET) + " ]",
@@ -2059,6 +2060,7 @@
                     var row = $("#" + row_id, place);
                     equals(tr.length, 1+1);
                     equals($('td:nth-child(4)', row).text(), buy_in, 'buy in');
+		    equals($('td:nth-child(5)', row).text(), state, 'state');
 		    equals($('.headerSortDown', tr[0]).text(), 'Buy In', "headerSortDown");
 		    server.tourneyRowClick = function(server, subpacket) {
 			equals(subpacket.serial, TOURNEY_LIST_PACKET.packets[0].serial, 'tourneyRowClick called');