harin
6/28/2013 - 7:31 AM

hey.coffee

# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/

# Pusher.log = (message) ->
#   if window.console and window.console.log
#     window.console.log(message);
`
Pusher.log = function(message) {
  if (window.console && window.console.log) {
    window.console.log(message);
  }
};
`
pusher = new Pusher('87ff267180379d184dd2');
channel = pusher.subscribe('test_channel');
channel.bind 'my_event', (data) ->
  alert(data.date);
  $.ajax
    url: "/calendar/#{code_branch}"
    success: (pushdata) ->

      $("#row-#{data.date}").load "/calendar/#{code_branch} #row-#{data.date}"
      console.log("row-#{data.date}")
  return