<commit_before>/*!
 * Protected Field
 *
 * Copyright (c) <NAME>
 */

/*
 * Protected Field is a jQuery plugin that attaches a lock
 * to fields that you want protected
 *
 * Authors        <NAME>
 */

 /*
  * TODO:
  * #
*/

(function($) {
  'use strict';
  $.fn.protectedfield = function(o){

    return this.each(function(i, el){
      var $el = $(el),
          $icon = $('<i class="icon-lock pf-trigger" title="unlock field"></i>'),
          confirmation = 'Are you sure you want to edit this field?',
          $trigger;

      if (!$el.next().is('.pf-trigger')) {
        // STEP 1: set protected field to disabled
        $el.attr('disabled','disabled');
        // STEP 2: draw lock icon
        $el.after($icon);
        $trigger = $el.next();
        // STEP 3: attach click events

        $trigger.on('click',function(e) {
          if (confirm(confirmation)) {
            $el.removeAttr('disabled');
          }
        });
      }
    });
  }
}(jQuery));<commit_msg>[#57457068] remove lock icon after unlock<commit_after>/*!
 * Protected Field
 *
 * Copyright (c) <NAME>
 */

/*
 * Protected Field is a jQuery plugin that attaches a lock
 * to fields that you want protected
 *
 * Authors        <NAME>
 */

 /*
  * TODO:
  * #
*/

(function($) {
  'use strict';
  $.fn.protectedfield = function(o){

    return this.each(function(i, el){
      var $el = $(el),
          $icon = $('<i class="icon-lock pf-trigger" title="unlock field"></i>'),
          confirmation = 'Are you sure you want to edit this field?',
          $trigger;

      if (!$el.next().is('.pf-trigger')) {
        // STEP 1: set protected field to disabled
        $el.attr('disabled','disabled');
        // STEP 2: draw lock icon
        $el.after($icon);
        $trigger = $el.next();
        // STEP 3: attach click events

        $trigger.on('click',function(e) {
          if (confirm(confirmation)) {
            $el.removeAttr('disabled');
            $trigger.remove();
          }
        });
      }
    });
  }
}(jQuery));
{'fraction_non_alphanumeric': 0.17185185185185184, 'fraction_numerical': 0.006913580246913581, 'mean_word_length': 2.032934131736527, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1781942', 'n_tokens_mistral': 637, 'n_tokens_neox': 621, 'n_words': 167}