Permalink
Browse files

refactored into a jquery lib

  • Loading branch information...
Rob Hurring
Rob Hurring committed Mar 23, 2011
1 parent db6f5d5 commit c990874f71f878931c11f6b8f652cb7ee4f3231b
Showing with 3 additions and 101 deletions.
  1. +0 −98 public/js/application.js
  2. +3 −3 public/js/jquery.bingo.js
View
@@ -2,102 +2,4 @@ $(document).ready(function()
{
$.metadata.setType('attr', 'data');
$.bingo.init();
-
-// // Pusher
-//
-// if(Application.card)
-// {
-// WEB_SOCKET_DEBUG = true;
-// Pusher.log = function()
-// {
-// if (window.console) window.console.log.apply(window.console, arguments);
-// };
-//
-// var pusher = new Pusher(Application.pusher_key, 'game_'+Application.token);
-// pusher.bind('log', function(data)
-// {
-// var message = '<strong>' + data.name + ':</strong> ' + data.message;
-// if(parseInt(data.player) == 0)
-// message = '<small>' + message + '</small>';
-//
-// $('#messages').prepend(message + '<br/>');
-// });
-//
-// pusher.bind('game_over', function(data)
-// {
-// Application.game_over = true;
-// });
-// }
-//
-// // Chat
-//
-// $('#send_message').keypress(function(e)
-// {
-// var url = Application.web_root + '/play/' + Application.token + '/' + Application.card + '/message';
-// if(e.keyCode == 13)
-// {
-// $.post(url, {message: $(this).val()});
-// $(this).val('');
-// }
-// });
-//
-// // Selecting Words
-//
-// $('.square').click(function()
-// {
-// if(Application.game_over)
-// return;
-//
-// var self = $(this);
-// var data = self.metadata();
-//
-// var url = Application.web_root + '/play/' + Application.token + '/' + Application.card + '/' + data.row + '/' + data.column;
-// var add = !self.hasClass('found');
-//
-// self.find('.indicator').show();
-//
-// $.post(url, {"add": (add ? 1 : 0)}, function(data, status)
-// {
-// self.find('.indicator').hide();
-// if(add)
-// self.addClass('found');
-// else
-// self.removeClass('found');
-// });
-// });
-//
-// // Hovers
-//
-// $('.square').mouseover(function(){ $(this).addClass('hover') });
-// $('.square').mouseout(function(){ $(this).removeClass('hover') });
-//
-// // Name Changes
-//
-// $('.card_name_toggle').live('click', function()
-// {
-// if(Application.game_over)
-// return;
-//
-// $('#name_input').toggle();
-// $('#name_text').toggle();
-// return false;
-// });
-//
-// $('#submit_name_change').live('click', function()
-// {
-// if(Application.game_over)
-// return;
-//
-// var url = Application.web_root + '/play/' + Application.token + '/' + Application.card + '/change_name';
-// var name = $('#card_name').val();
-// var indicator = $(this).parent().parent().parent().find('.indicator');
-//
-// indicator.show();
-// $.post(url, {"card[name]": name}, function(data)
-// {
-// indicator.hide();
-// $('#card_name_form').replaceWith(data);
-// });
-// });
-
});
@@ -80,7 +80,7 @@ $.extend(
if(this.settings.game_over)
return false;
- console.log(this.settings);
+ //console.log(this.settings);
var url = this.game_url(true) + '/change_name';
var input = $(this.settings.inputs.name);
@@ -130,10 +130,10 @@ $.extend(
user_joined_event: function(data)
{
- console.log(data);
+ // console.log(data);
var already_in_list = $('#whos_playing li#player-' + data.id).length > 0
- console.log("In? " + already_in_list + "\n" + data.name);
+ // console.log("In? " + already_in_list + "\n" + data.name);
if(!already_in_list)
{

0 comments on commit c990874

Please sign in to comment.