<commit_before>//= require_self
//= require ./common_validations
//= require_tree ./models
//= require ./controllers/apis/nested_form_controller
//= require ./controllers/apis/sortable_controller
//= require_tree ./components
//= require_tree ./controllers
//= require_tree ./views
//= require_tree ./helpers
//= require_tree ./templates
//= require ./router
//= require_tree ./routes

//Ember.LOG_BINDINGS = true

// Set Bootbox defaults.
bootbox.animate(false);

// PNotify Defaults.
_.merge(PNotify.prototype.options, {
  styling: 'bootstrap2',
  width: '400px',
  icon: false,
  animate_speed: 'fast',
  history: {
    history: false
  },
  buttons: {
    sticker: false
  }
});

(function() {
  var versionParts = Ember.VERSION.split('.');
  var major = parseInt(versionParts[0], 10);
  var minor = parseInt(versionParts[1], 10);
  var patch = parseInt(versionParts[2], 10);
  if(major > 1 || (major === 1 && (minor > 1 || patch > 2))) {
    Ember.Logger.warn('WARNING: New Ember version detected. URL hash monkey patch possibly no longer needed or broken. Check for compatibility.');
  }

  var get = Ember.get, set = Ember.set;

  // Fix URL hash parsing across browsers. Because we're putting query
  // parameters in the URL, we expect special characters which escape
  // differently across browsers with location.hash. So this is a monkey patch
  // to use location.href instead.
  // https://github.com/emberjs/ember.js/issues/3000
  // https://github.com/emberjs/ember.js/issues/3263
  //
  // All of this should be revisited once query-params lands, since this will
  // probably clean this up: https://github.com/emberjs/ember.js/pull/3182
  Ember.HashLocation.reopen({
    getURL: function() {
      var href = get(this, 'location').href;

      var hashIndex = href.indexOf('#');
      if (hashIndex === -1) {
        return '';
      } else {
        return href.substr(hashIndex + 1);
      }
    },

    onUpdateURL: function(callback) {
      var self = this;
      var guid = Ember.guidFor(this);

      Ember.$(window).on('hashchange.ember-location-'+guid, function() {
        Ember.run(function() {
          var path = self.getURL();
          if (get(self, 'lastSetURL') === path) { return; }

          set(self, 'lastSetURL', null);

          callback(path);
        });
      });
    },
  });
})();

window.Admin = Ember.Application.create({
  LOG_TRANSITIONS: true,
  LOG_TRANSITIONS_INTERNAL: true,

  rootElement: '#content'
});

function eachTranslatedAttribute(object, fn) {
  var isTranslatedAttribute = /(.+)Translation$/,
      isTranslatedAttributeMatch;

  for (var key in object) {
    isTranslatedAttributeMatch = key.match(isTranslatedAttribute);
    if (isTranslatedAttributeMatch) {
      var translation = object[key] == null ? null : polyglot.t(object[key]);
      fn.call(object, isTranslatedAttributeMatch[1], translation);
    }
  }
}

// Override existing Ember.EasyForm.processOptions to use our polyglot
// translations instead of Ember.i18n for the special *Translation fields.
//
// We could also potentially use subexpressions to call polyglot directly in
// the templates, but at least as of Ember 1.7, there are bugs with multiple
// subexpressions: https://github.com/wycats/handlebars.js/issues/748
// Perhaps revisit when we upgrade Ember.
Ember.EasyForm.processOptions = function(property, options) {
  if(options) {
    if(polyglot) {
      eachTranslatedAttribute(options.hash, function(attribute, translation) {
        options.hash[attribute] = translation;<commit_msg>Fix jshint warning.<commit_after>//= require_self
//= require ./common_validations
//= require_tree ./models
//= require ./controllers/apis/nested_form_controller
//= require ./controllers/apis/sortable_controller
//= require_tree ./components
//= require_tree ./controllers
//= require_tree ./views
//= require_tree ./helpers
//= require_tree ./templates
//= require ./router
//= require_tree ./routes

//Ember.LOG_BINDINGS = true

// Set Bootbox defaults.
bootbox.animate(false);

// PNotify Defaults.
_.merge(PNotify.prototype.options, {
  styling: 'bootstrap2',
  width: '400px',
  icon: false,
  animate_speed: 'fast',
  history: {
    history: false
  },
  buttons: {
    sticker: false
  }
});

(function() {
  var versionParts = Ember.VERSION.split('.');
  var major = parseInt(versionParts[0], 10);
  var minor = parseInt(versionParts[1], 10);
  var patch = parseInt(versionParts[2], 10);
  if(major > 1 || (major === 1 && (minor > 1 || patch > 2))) {
    Ember.Logger.warn('WARNING: New Ember version detected. URL hash monkey patch possibly no longer needed or broken. Check for compatibility.');
  }

  var get = Ember.get, set = Ember.set;

  // Fix URL hash parsing across browsers. Because we're putting query
  // parameters in the URL, we expect special characters which escape
  // differently across browsers with location.hash. So this is a monkey patch
  // to use location.href instead.
  // https://github.com/emberjs/ember.js/issues/3000
  // https://github.com/emberjs/ember.js/issues/3263
  //
  // All of this should be revisited once query-params lands, since this will
  // probably clean this up: https://github.com/emberjs/ember.js/pull/3182
  Ember.HashLocation.reopen({
    getURL: function() {
      var href = get(this, 'location').href;

      var hashIndex = href.indexOf('#');
      if (hashIndex === -1) {
        return '';
      } else {
        return href.substr(hashIndex + 1);
      }
    },

    onUpdateURL: function(callback) {
      var self = this;
      var guid = Ember.guidFor(this);

      Ember.$(window).on('hashchange.ember-location-'+guid, function() {
        Ember.run(function() {
          var path = self.getURL();
          if (get(self, 'lastSetURL') === path) { return; }

          set(self, 'lastSetURL', null);

          callback(path);
        });
      });
    },
  });
})();

window.Admin = Ember.Application.create({
  LOG_TRANSITIONS: true,
  LOG_TRANSITIONS_INTERNAL: true,

  rootElement: '#content'
});

function eachTranslatedAttribute(object, fn) {
  var isTranslatedAttribute = /(.+)Translation$/,
      isTranslatedAttributeMatch;

  for (var key in object) {
    isTranslatedAttributeMatch = key.match(isTranslatedAttribute);
    if (isTranslatedAttributeMatch) {
      var translation = (!object[key]) ? null : polyglot.t(object[key]);
      fn.call(object, isTranslatedAttributeMatch[1], translation);
    }
  }
}

// Override existing Ember.EasyForm.processOptions to use our polyglot
// translations instead of Ember.i18n for the special *Translation fields.
//
// We could also potentially use subexpressions to call polyglot directly in
// the templates, but at least as of Ember 1.7, there are bugs with multiple
// subexpressions: https://github.com/wycats/handlebars.js/issues/748
// Perhaps revisit when we upgrade Ember.
Ember.EasyForm.processOptions = function(property, options) {
  if(options) {
    if(polyglot) {
      eachTranslatedAttribute(options.hash, function(attribute, translation) {
        options.hash[attribute] = translation;
{'fraction_non_alphanumeric': 0.13629294500212075, 'fraction_numerical': 0.011027852396437155, 'mean_word_length': 3.220763723150358, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 8, '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': '6941306', 'n_tokens_mistral': 2230, 'n_tokens_neox': 2134, 'n_words': 562}