<commit_before><!DOCTYPE html>
<html>
<head>
</head>
<body>
	<script type="text/x-handlebars">
		Hello, world!
		{{ input autofocus="true"}}
		{{ autofocus }}
	</script>
	<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
	<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.min.js"></script>
	<script src="http://cdnjs.cloudflare.com/ajax/libs/ember.js/1.2.0/ember.min.js"></script>
	<script>
;(function(){
    // my own namespace = my own clutter
    window.AndreasPizsa = window.AndreasPizsa || {};
    AndreasPizsa.Ember = AndreasPizsa.Ember || {};

    AndreasPizsa.Ember.ViewAutofocus = Ember.View.extend({
      attributeBindings : ['on','scrolling'],
      useScheduling     : true,
      on                : null,
      scrolling         : false,
      hasNativeAutofocus: ('autofocus' in document.createElement('input')),
      useNativeAutofocus: false,

      scheduleAutofocus: function() {
        if(this.hasNativeAutofocus
        && (this.useNativeAutofocus=Em.$('[autofocus]').length>0))
        {
            return;
        }

        if (this.useScheduling) {
          Ember.run.scheduleOnce('afterRender', this, this.autofocus);
        } else {
          this.autofocus();
        }
      }.on('didInsertElement'),

      preventScrolling : function() {
        if(!this.scrolling) {
            window.scrollTo(0,0);
            window.setTimeout(function(){window.scrollTo(0,0);},100);
        }
      }.on('didInsertElement'),

      autofocus: (function() {
        var selector = this.on;
        if (selector === null) {
          selector = 'input[autofocus],textarea[autofocus],button[autofocus]';
          if (Em.$(selector).length === 0) {
            selector = 'input';
          }
        }
        var scrollX = window.scrollX, scrollY = window.scrollY;
        Em.$(selector).first().select().focus();
        window.scrollTo(scrollX, scrollY);
      })
    });

    Ember.Handlebars.helper('autofocus', AndreasPizsa.Ember.ViewAutofocus);
    Ember.TextField.reopen({
      attributeBindings: ['autofocus']
    });
}());

	</script>
	<script>
		Ember.Application.create();
	</script>
</body>
</html><commit_msg>Updated example.html<commit_after><!DOCTYPE html>
<html>
<head>
</head>
<body>
	<!-- all the libraries -->
	<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
	<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.min.js"></script>
	<script src="http://cdnjs.cloudflare.com/ajax/libs/ember.js/1.2.0/ember.min.js"></script>
	<script src="http://rawgithub.com/AndreasPizsa/ember-autofocus/master/dist/ember-autofocus.min.js"></script>
	<!-- your template -->
	<script type="text/x-handlebars">
		Hello, world!
		{{ input autofocus="true"}}
		{{ autofocus }}
	</script>
	<!-- your app -->
	<script>
		Ember.Application.create();
	</script>
</body>
</html>
{'fraction_non_alphanumeric': 0.18420156622403813, 'fraction_numerical': 0.009193054136874362, 'mean_word_length': 2.8607095926412613, 'pattern_counts': {'":': 0, '<': 44, '<?xml version=': 0, '>': 45, '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': '461437', 'n_tokens_mistral': 1051, 'n_tokens_neox': 1004, 'n_words': 135}