<commit_before>/*global privlyUrlReceiptNode:false, pendingPost:false, chrome:false, ls:true,  */

/**
 * This content-script provides Privly Posting Button feature.
 * It listens events of editable elements (textarea / contentEditable elements)
 * and create or show the posting button.
 *
 * The button is created as a sibling of the editable element, which enables
 * it to share the same parent with the editable element. This gives it better
 * positioning in most of situations. It works well even when the parent has
 * `position:fixed` style.
 */

(function() {

var BUTTON_WIDTH = 16;
var BUTTON_HEIGHT = 16;
var BUTTON_MARGIN = 5;
var INTERVAL_UPDATE_POSITION = 500;
var HIDE_DELAY = 5000; // fade out after 5000 ms
var HIDE_DELAY_SHORT = 500; // fade out after 500 ms when lose focus

// create a unique className for privly button
// will be used to easily find the button from target container
var privlyButtonClassName = "privlyButton-" + Math.floor(Math.random() * 0xFFFFFFFF).toString(16);

/**
 * Helper methods to calculate correct position of an element.
 * Mainly ported from jQuery.fn.position()
 */
var PositionHelper = {
  /**
   * Get computed style of an element
   * <commit_msg>updated posting button comment<commit_after>/*global privlyUrlReceiptNode:false, pendingPost:false, chrome:false, ls:true,  */

/**
 * This content-script provides a button on HTML input elements for posting content.
 * It listens for events of editable elements, which can include textareas, text inputs,
 * or contentEditable elements and creates the posting button if it doesn't
 * exist or shows the posting button if it was previously created.
 *
 * The button is created as a sibling of the editable element, which enables
 * it to share the same parent with the editable element. This gives it better
 * positioning in most situations. It works well even when the parent has
 * `position:fixed` style.
 */

(function() {

var BUTTON_WIDTH = 16;
var BUTTON_HEIGHT = 16;
var BUTTON_MARGIN = 5;
var INTERVAL_UPDATE_POSITION = 500;
var HIDE_DELAY = 5000; // fade out after 5000 ms
var HIDE_DELAY_SHORT = 500; // fade out after 500 ms when lose focus

// create a unique className for privly button
// will be used to easily find the button from target container
var privlyButtonClassName = "privlyButton-" + Math.floor(Math.random() * 0xFFFFFFFF).toString(16);

/**
 * Helper methods to calculate correct position of an element.
 * Mainly ported from jQuery.fn.position()
 */
var PositionHelper = {
  /**
   * Get computed style of an element
   * 
{'fraction_non_alphanumeric': 0.07902973395931143, 'fraction_numerical': 0.019561815336463225, 'mean_word_length': 4.124248496993988, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '6604600', 'n_tokens_mistral': 769, 'n_tokens_neox': 698, 'n_words': 318}