<commit_before>/*
 * Copyright (c) 2012 by <NAME>. All rights reserved.  Use of this
 * source code is governed by a BSD-style license that can be found in the
 * LICENSE file.
 */

function bindTwitter() {
    $("a.js-action-reply").each(function(i,e){
      $(e).click(function(evt){
        var tweet = $(evt.target).parents(".tweet");
        var url = "https://twitter.com/" + $(tweet).data('screen-name') + "/status/" + $(tweet).attr('data-item-id');

        // TODO: THIS IS A HACK! see below.
        var postURL = "http://pk2.dev/admin/?reply_to=" + encodeURI(url);
        window.open(postURL);

        // TODO: Need to either get the page URL from the extension preferences, or send an event to the extension
        // where the extension can open the new window
        // chrome.extension.sendMessage({url: url}, function(response) {
        //   console.log(response);
        // });

        return false;
      });
    });
}

bindTwitter();
setTimeout(bindTwitter, 5000);

$("a[data-reply-to='']").each(function(i,e){
  $(e).click(function(evt){
    var post = $(evt.target).parents(".post-container");
    var url = "https://alpha.app.net/" + $(post).data('post-author-username') + "/post/" + $(post).attr('data-post-id');
    var postURL = "http://pk2.dev/admin/?reply_to=" + encodeURI(url);
    window.open(postURL);
    return false;
  });
});<commit_msg>Unbind so we don't double-fire the click event<commit_after>/*
 * Copyright (c) 2012 by <NAME>. All rights reserved.  Use of this
 * source code is governed by a BSD-style license that can be found in the
 * LICENSE file.
 */

function bindTwitter() {
    $("a.js-action-reply").each(function(i,e){
      $(e).unbind("click").click(function(evt){
        var tweet = $(evt.target).parents(".tweet");
        var url = "https://twitter.com/" + $(tweet).data('screen-name') + "/status/" + $(tweet).attr('data-item-id');

        // TODO: THIS IS A HACK! see below.
        var postURL = "http://pk.dev/admin/?reply_to=" + encodeURI(url);
        window.open(postURL);

        // TODO: Need to either get the page URL from the extension preferences, or send an event to the extension
        // where the extension can open the new window
        // chrome.extension.sendMessage({url: url}, function(response) {
        //   console.log(response);
        // });

        return false;
      });
    });
}

bindTwitter();
setTimeout(bindTwitter, 5000);

$("a[data-reply-to='']").each(function(i,e){
  $(e).click(function(evt){
    var post = $(evt.target).parents(".post-container");
    var url = "https://alpha.app.net/" + $(post).data('post-author-username') + "/post/" + $(post).attr('data-post-id');
    var postURL = "http://pk.dev/admin/?reply_to=" + encodeURI(url);
    window.open(postURL);
    return false;
  });
});
{'fraction_non_alphanumeric': 0.18801284338209062, 'fraction_numerical': 0.006421691045308598, 'mean_word_length': 2.8729281767955803, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '6239959', 'n_tokens_mistral': 904, 'n_tokens_neox': 874, 'n_words': 221}