<commit_before>= javascript_include_tag 'FABridge', 'swfobject', 'web_socket'
:javascript
  WebSocket.__swfLocation = "/javascripts/WebSocketMain.swf";
  $(document).ready(function(){
    function debug(str){ $("#debug").append("<p>" +  str); };

    ws = new WebSocket("ws://#{request.host}:8080/#{CGI::escape(current_user.id.to_s)}");

  //Attach onmessage to websocket
    ws.onmessage = function(evt) {
      var obj = jQuery.parseJSON(evt.data);
      console.log(obj)
      debug("got a " + obj['class'] + " for groups " + obj['group_ids']);

      if (obj['class']=="retractions"){
        processRetraction(obj['post_id']);
      
      }else if (obj['class']=="comments"){
        processComment(obj['post_id'], obj['html']) 
      
      }else if (obj['class']=='photos' && onPageForClass('albums')){
        processPhotoInAlbum(obj['photo_hash'])
      }else{
        alert("hey");
        processPost(obj['class'], obj['html'], obj['group_ids'])
      }

      
    }; 
    ws.onclose = function() { debug("socket closed"); };
    ws.onopen = function() {
      ws.send(location.pathname);
      debug("connected...");
    };


  });
  function processRetraction(post_id){
    $('#' + post_id ).fadeOut(500, function(){
      $(this).remove;
    });
  }

  function processComment(post_id, html){
    post = $('#' + post_id)[0]
    $(' .comment_set li:last', post ).before(
      $(html).fadeIn("fast", function(){})
    );
    toggler = $('.show_post_comments', post)
    toggler.html(
      toggler.html().replace(/\d/,$('.comment_set', post)[0].childElementCount -1));<commit_msg>Don't alert<commit_after>= javascript_include_tag 'FABridge', 'swfobject', 'web_socket'
:javascript
  WebSocket.__swfLocation = "/javascripts/WebSocketMain.swf";
  $(document).ready(function(){
    function debug(str){ $("#debug").append("<p>" +  str); };

    ws = new WebSocket("ws://#{request.host}:8080/#{CGI::escape(current_user.id.to_s)}");

  //Attach onmessage to websocket
    ws.onmessage = function(evt) {
      var obj = jQuery.parseJSON(evt.data);
      console.log(obj)
      debug("got a " + obj['class'] + " for groups " + obj['group_ids']);

      if (obj['class']=="retractions"){
        processRetraction(obj['post_id']);
      
      }else if (obj['class']=="comments"){
        processComment(obj['post_id'], obj['html']) 
      
      }else if (obj['class']=='photos' && onPageForClass('albums')){
        processPhotoInAlbum(obj['photo_hash'])
      }else{
        processPost(obj['class'], obj['html'], obj['group_ids'])
      }

      
    }; 
    ws.onclose = function() { debug("socket closed"); };
    ws.onopen = function() {
      ws.send(location.pathname);
      debug("connected...");
    };


  });
  function processRetraction(post_id){
    $('#' + post_id ).fadeOut(500, function(){
      $(this).remove;
    });
  }

  function processComment(post_id, html){
    post = $('#' + post_id)[0]
    $(' .comment_set li:last', post ).before(
      $(html).fadeIn("fast", function(){})
    );
    toggler = $('.show_post_comments', post)
    toggler.html(
      toggler.html().replace(/\d/,$('.comment_set', post)[0].childElementCount -1));
{'fraction_non_alphanumeric': 0.20720151610865445, 'fraction_numerical': 0.006317119393556538, 'mean_word_length': 3.2855209742895806, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2990150', 'n_tokens_mistral': 1077, 'n_tokens_neox': 1028, 'n_words': 163}