<commit_before>/* Extend jQuery Shake */
jQuery.fn.shake = function(intShakes, intDistance, intDuration) {
    this.each(function() {
        $(this).css("position","relative"); 
        for (var x=1; x<=intShakes; x++) {
        $(this).animate({left:(intDistance*-1)}, (((intDuration/intShakes)/3)))
    .animate({left:intDistance}, ((intDuration/intShakes)/2))
    .animate({left:0}, (((intDuration/intShakes)/3)));
    }
  });
    return this;
};
/* End extend */

var SESSION_KEY = 'browser-property';
function toggleLock() {
	if (window.parent && window.parent != window.self && window.parent.document) {
		$( window.parent.document).find('body').toggleClass('lock');
	}
	$('body').toggleClass('lock');
}

function removePropertyHandler(e) {
	e.preventDefault();
	e.stopPropagation();
	var _tr = $(this).closest('tr');
	var propStr = encodeURIComponent(_tr.data('name'))+'@Delete=';
	
	$.post(resourcePath+"?"+propStr).done(function(data){
		_tr.fadeOut(800, function() { _tr.remove(); })
	}).fail(function() {
		_tr.shake(5,5,800);
	});
}

$('.glyphicon-trash').one('click dblclick', removePropertyHandler);

var propertyFormTmpl = $('#propertyFormTmpl').clone().removeAttr('id');<commit_msg>moved code to common.js<commit_after>

var SESSION_KEY = 'browser-property';
function toggleLock() {
	if (window.parent && window.parent != window.self && window.parent.document) {
		$( window.parent.document).find('body').toggleClass('lock');
	}
	$('body').toggleClass('lock');
}

function removePropertyHandler(e) {
	e.preventDefault();
	e.stopPropagation();
	var _tr = $(this).closest('tr');
	var propStr = encodeURIComponent(_tr.data('name'))+'@Delete=';
	
	$.post(resourcePath+"?"+propStr).done(function(data){
		_tr.fadeOut(800, function() { _tr.remove(); })
	}).fail(function() {
		_tr.shake(5,5,800);
	});
}

$('.glyphicon-trash').one('click dblclick', removePropertyHandler);

var propertyFormTmpl = $('#propertyFormTmpl').clone().removeAttr('id');
{'fraction_non_alphanumeric': 0.21779141104294478, 'fraction_numerical': 0.011247443762781187, 'mean_word_length': 5.4375, 'pattern_counts': {'":': 0, '<': 4, '<?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': '6817859', 'n_tokens_mistral': 682, 'n_tokens_neox': 660, 'n_words': 96}