Hack hack hack...

An open journal-- some of it written for you, but most of it is for me.

FIS Day30

  • state machine

  • gifsockets

    • real time communication
      • pushes text to client frame-by-frame
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<script type="text/javascript">

  var oldTime = new Date('<%= @issue.updated_at %>');

  setInterval(function() {
    var url = '<%= "/#{@issue.repo.owner_name}/#{@issue.repo.name}/issues/#{@issue.git_number}.json" %>'
    $.getJSON(url, {}, function(json){
      var newTime = new Date(Date.parse(json.updated_at));
      console.log(newTime)

      if (oldTime.valueOf() != newTime.valueOf()){
        console.log('diff')
        $('div#seal.seal.pull-right').fadeTo(3000, 1);
        $('div#seal.seal.pull-right').click(function(){
          location.reload();
        });
      }
    });
  }, 4000);

</script>

Comments