<commit_before>goog.provide('annotorious.events');

goog.require('goog.array');
goog.require('goog.events');

/**
 * A central 'event bus' to distribute the annotation lifecycle events.
 * @constructor
 */
annotorious.events.EventBroker = function() {
  /** @private **/
  this._handlers = [];
}
/**
  *
  * To get screen coordinates while taking into consideration mobile and the offset of the screen
  * @param event, the DOM Event object
  * @param the parent element that triggers the event
  */
annotorious.events.sanitizeCoordinates = function(event, parent) {
  var points = false;
  var offset = annotorious.dom.getOffset;
  
  if (!event.offsetX || !event.offsetY && event.event_.changedTouches) {
    points = {
      x: event.event_.changedTouches[0].pageX - offset(parent).left,
      y: event.event_.changedTouches[0].pageY - offset(parent).top
    };
  } else {
    points = {
      x: event.offsetX,
      y: event.offsetY
    };<commit_msg>Minor bugfix: touch on scrolled pages<commit_after>goog.provide('annotorious.events');

goog.require('goog.array');
goog.require('goog.events');

/**
 * A central 'event bus' to distribute the annotation lifecycle events.
 * @constructor
 */
annotorious.events.EventBroker = function() {
  /** @private **/
  this._handlers = [];
}
/**
  *
  * To get screen coordinates while taking into consideration mobile and the offset of the screen
  * @param event, the DOM Event object
  * @param the parent element that triggers the event
  */
annotorious.events.sanitizeCoordinates = function(event, parent) {
  var points = false;
  var offset = annotorious.dom.getOffset;
  
  if (!event.offsetX || !event.offsetY && event.event_.changedTouches) {
    points = {
      x: event.event_.changedTouches[0].clientX - offset(parent).left,
      y: event.event_.changedTouches[0].clientY - offset(parent).top
    };
  } else {
    points = {
      x: event.offsetX,
      y: event.offsetY
    };
{'fraction_non_alphanumeric': 0.1324742268041237, 'fraction_numerical': 0.002061855670103093, 'mean_word_length': 3.513953488372093, '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': '4350547', 'n_tokens_mistral': 608, 'n_tokens_neox': 591, 'n_words': 151}