<commit_before>/**
 * FIXME: TODO: This file need heavy refactoring, as it's mixing props and state to
 *              a very entangle data thing, even tapping into getInitialState during
 *              render, which we should never be doing.
 */

var React = require('react');
var classes = require('classnames');
var Spec = require('../../lib/spec');
var touchhandler = require("../../lib/touchhandler");
var dispatcher = require('../../lib/dispatcher');

var PAGE_WIDTH = 320;
var PAGE_HEIGHT = 440;
var DRAG_BOUNDS_THRESHOLD = 40;

var BasicElement = React.createClass({
  statics: {
    types: {
      image: require('./types/image.jsx'),
      text: require('./types/text.jsx'),
      link: require('./types/link.jsx')
    },
    // the minimum size of the long-edge of an element, in pixels.
    minScaledEdgeLength: 100,
    maxScaledEdgeLength: window.innerWidth - 40,
    /**
     * A static function for determining whether a given scale will
     * be safe, or needs capping because it would lead to an element
     * that is visually too small to manipulate.
     */
    safifyScale: function(component, scale) {
      var node  = component.getDOMNode(),<commit_msg>increase drag threshold to 100px<commit_after>/**
 * FIXME: TODO: This file need heavy refactoring, as it's mixing props and state to
 *              a very entangle data thing, even tapping into getInitialState during
 *              render, which we should never be doing.
 */

var React = require('react');
var classes = require('classnames');
var Spec = require('../../lib/spec');
var touchhandler = require("../../lib/touchhandler");
var dispatcher = require('../../lib/dispatcher');

var PAGE_WIDTH = 320;
var PAGE_HEIGHT = 440;
var DRAG_BOUNDS_THRESHOLD = 100;

var BasicElement = React.createClass({
  statics: {
    types: {
      image: require('./types/image.jsx'),
      text: require('./types/text.jsx'),
      link: require('./types/link.jsx')
    },
    // the minimum size of the long-edge of an element, in pixels.
    minScaledEdgeLength: 100,
    maxScaledEdgeLength: window.innerWidth - 40,
    /**
     * A static function for determining whether a given scale will
     * be safe, or needs capping because it would lead to an element
     * that is visually too small to manipulate.
     */
    safifyScale: function(component, scale) {
      var node  = component.getDOMNode(),
{'fraction_non_alphanumeric': 0.12184873949579832, 'fraction_numerical': 0.012605042016806723, 'mean_word_length': 2.974958263772955, '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': '5208776', 'n_tokens_mistral': 706, 'n_tokens_neox': 670, 'n_words': 239}