<commit_before>jQuery(document).ready(function(){  
  
  /*
   * Popup editing
   * This is done in a round-about fashion because there is a space in the
   * href attribute of the button. Firefox sees this as a %20, and all the
   * selectors break down
   */
  $('a.sympal_slot_button.popup').click(function(){
    slotForm = $($(this).attr('href'));
    
    $.fancybox(slotForm, {
      'zoomSpeedIn': 300,
      'zoomSpeedOut': 300,
      'overlayShow': true,
      'hideOnContentClick': false,
      'onStart': function(selectedArray, selectedIndex, selectedOpts) {
        $(slotForm).show();
        
        // enable edit mode
        sympal_toggle_edit_mode(true, $(slotForm));
      },
      'onCleanup': function(selectedArray, selectedIndex, selectedOpts) {
        $('#fancybox-inner .sympal_slot_form').hide();
        
        // potentially disable edit mode
        sympal_toggle_edit_mode(false, $('#fancybox-inner .sympal_slot_form'));
      }
    });
  });
  
  // inline editing
  $('a.sympal_slot_button.in-place').click(function(){
    sympal_toggle_inline_edit_slot($(this).parents('.sympal_slot_wrapper').eq(0), true);
    
    return false;
  });
  
  // the cancel button for inline and popup
  $('.sympal_slot_wrapper form input.cancel').click(function(){
    disable_edit_slot($(this).parents('.sympal_slot_form').eq(0));
  });
  
  // show the edit button when hovering over editable area
  $('.sympal_slot_wrapper').hover(function(){
    $(this).find('.sympal_slot_button:not(.no-hover)').show();
  }, function(){
    $(this).find('.sympal_slot_button:not(.no-hover)').hide();
  });
  
  // highlight editable area on edit button hover
  $('a.sympal_slot_button').hover(function(){
    $(this).next().css('opacity', .2)
    $(this).next().children().css('opacity', .2);
  },function(){
    $(this).next().css('opacity', 1)
    $(this).next().children().css('opacity', 1);
  });
  
  // globally save slots on the "save" edit button
  $('#inline-edit-bar-buttons-menu .sympal_save_content_slots').click(function(){
    $('.sympal_slot_form.edit_enabled form').submit();
  });
  
  // globally hide slot formss on the "cancel" edit button
  $('#inline-edit-bar-buttons-menu .sympal_disable_edit_mode').click(function(){
    $('.sympal_slot_form.edit_enabled form input.cancel').click();
  });<commit_msg>[1.4][sfSympalPlugin][1.0] Re-adding the ability to double-click a content slot to edit it.<commit_after>jQuery(document).ready(function(){  
  
  /*
   * Popup editing
   * This is done in a round-about fashion because there is a space in the
   * href attribute of the button. Firefox sees this as a %20, and all the
   * selectors break down
   */
  $('a.sympal_slot_button.popup').click(function(){
    slotForm = $($(this).attr('href'));
    
    $.fancybox(slotForm, {
      'zoomSpeedIn': 300,
      'zoomSpeedOut': 300,
      'overlayShow': true,
      'hideOnContentClick': false,
      'onStart': function(selectedArray, selectedIndex, selectedOpts) {
        $(slotForm).show();
        
        // enable edit mode
        sympal_toggle_edit_mode(true, $(slotForm));
      },
      'onCleanup': function(selectedArray, selectedIndex, selectedOpts) {
        $('#fancybox-inner .sympal_slot_form').hide();
        
        // potentially disable edit mode
        sympal_toggle_edit_mode(false, $('#fancybox-inner .sympal_slot_form'));
      }
    });
  });
  
  // inline editing
  $('a.sympal_slot_button.in-place').click(function(){
    sympal_toggle_inline_edit_slot($(this).parents('.sympal_slot_wrapper').eq(0), true);
    
    return false;
  });
  
  // the cancel button for inline and popup
  $('.sympal_slot_wrapper form input.cancel').click(function(){
    disable_edit_slot($(this).parents('.sympal_slot_form').eq(0));
  });
  
  // show the edit button when hovering over editable area
  $('.sympal_slot_wrapper').hover(function(){
    $(this).find('.sympal_slot_button:not(.no-hover)').show();
  }, function(){
    $(this).find('.sympal_slot_button:not(.no-hover)').hide();
  });
  
  $('.sympal_slot_content').bind('dblclick', function(){
    $(this).siblings('.sympal_slot_button').click();
  });
  
  // highlight editable area on edit button hover
  $('a.sympal_slot_button').hover(function(){
    $(this).next().css('opacity', .2)
    $(this).next().children().css('opacity', .2);
  },function(){
    $(this).next().css('opacity', 1)
    $(this).next().children().css('opacity', 1);
  });
  
  // globally save slots on the "save" edit button
  $('#inline-edit-bar-buttons-menu .sympal_save_content_slots').click(function(){
    $('.sympal_slot_form.edit_enabled form').submit();
  });
  
  // globally hide slot formss on the "cancel" edit button
  $('#inline-edit-bar-buttons-menu .sympal_disable_edit_mode').click(function(){
    $('.sympal_slot_form.edit_enabled form input.cancel').click();
  });
{'fraction_non_alphanumeric': 0.17567289911649886, 'fraction_numerical': 0.006574892130675981, 'mean_word_length': 3.4783808647654095, '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': '668424', 'n_tokens_mistral': 1567, 'n_tokens_neox': 1541, 'n_words': 300}