<commit_before>Template.insertPlaylistForm.rendered = function() {
  Session.setDefault('playlistPrivacy','public');
  this.find('[data-schema-key=privacy]').value = 'public';
  $("button").tooltip();
  AutoForm.hooks({
    insertPlaylistForm: {
      onSuccess: function(operation, result, template) {
        Router.go('/playlist/'+result);
      }
    }
  });
};

Template.insertPlaylistForm.events = {
  'click #privacyToggle button' : function(e,template) {
    var btn = e.currentTarget;
    Session.set('playlistPrivacy',btn.getAttribute("data-action"));
    template.find('[data-schema-key=privacy]').value = btn.getAttribute("data-action");
  }
};

Template.playlistsEntry.events = {
  'click .playlist-container' : function(e,template) {
    Router.go('/playlist/'+this._id);
  }
};


Template.playlist.rendered = function() {
  AutoForm.hooks({
    removeButton: { //on successful remove, go back to playlist page
      onSuccess: function(operation, result, template) {
        Router.go('playlists');
      }
    },
    updatePlaylistForm: { //on successful edit, collapse back out
      onSuccess: function(operation, result, template) {
        $('#playlistInfo').collapse('show');
        $('#updatePlaylistForm').collapse('hide');<commit_msg>remove unnecessary code<commit_after>Template.insertPlaylistForm.rendered = function() {
  Session.setDefault('playlistPrivacy','public');
  this.find('[data-schema-key=privacy]').value = 'public';
  $("button").tooltip();
  AutoForm.hooks({
    insertPlaylistForm: {
      onSuccess: function(operation, result, template) {
        Router.go('/playlist/'+result);
      }
    }
  });
};

Template.insertPlaylistForm.events = {
  'click #privacyToggle button' : function(e,template) {
    var btn = e.currentTarget;
    Session.set('playlistPrivacy',btn.getAttribute("data-action"));
    template.find('[data-schema-key=privacy]').value = btn.getAttribute("data-action");
  }
};

Template.playlist.rendered = function() {
  AutoForm.hooks({
    removeButton: { //on successful remove, go back to playlist page
      onSuccess: function(operation, result, template) {
        Router.go('playlists');
      }
    },
    updatePlaylistForm: { //on successful edit, collapse back out
      onSuccess: function(operation, result, template) {
        $('#playlistInfo').collapse('show');
        $('#updatePlaylistForm').collapse('hide');
{'fraction_non_alphanumeric': 0.16394813885403597, 'fraction_numerical': 0.0, 'mean_word_length': 3.9833333333333334, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3500126', 'n_tokens_mistral': 711, 'n_tokens_neox': 712, 'n_words': 114}