<commit_before>/**
 * jQuery placeholder attribute plugin.
 * 
 * Adds support via jQuery for the placeholder attribute in text inputs
 * and text areas for browsers which do not support the feature.
 * 
 * Copyright (c) 2011 <NAME>, http://blakerg.wordpress.com/
 * Release under the MIT License. See License.txt
 * 
 */

(function( $ ) {
    $.fn.Placeholder = function(options) {
        
        // detect if we are running IE9 or greater
        if($.browser.msie && parseInt($.browser.version, 10) >= 9) {
            detect_pass = true;
        } else {
            detect_pass = false;
        }
        
        var selector = 'input[type="text"][placeholder!=""], input[type="password"][placeholder!=""], textarea[placeholder!=""]';
        
        // bind the form to clear form fields
        $("form", this).bind('submit', function() {
            $(selector, this).each(function() {
                if($(this).val() == $(this).attr('placeholder')) {
                    $(this).val("");
                }
            });
        });


        // loop over all inputs
        $(selector, this).each(function() {
            
            if($(this).val() == "" || $(this).val() == $(this).attr('placeholder')) {
                // set the placeholder values
                $(this).val($(this).attr('placeholder'));
                $(this).addClass(options.defaultClass);
                // convert a password input to a text input
                if(detect_pass && $(this).attr('type') == 'password') {
                    $(this).addClass('was_pw');
                    this.type = "text";
                }
            }


            $(this).bind({
                focus: function() {
                    if($(this).val() == $(this).attr('placeholder')) {
                        $(this).val("");
                        $(this).removeClass(options.defaultClass);
                    }
                    if(detect_pass && $(this).hasClass('was_pw')) {
                        this.type = "password";
                    }
                },
                blur: function() {
                    if($(this).val() == "") {
                        $(this).addClass(options.defaultClass);
                        $(this).val($(this).attr('placeholder'));
                        if(detect_pass && $(this).hasClass('was_pw')) {
                            this.type = "text";
                        }
                    }
                }
            }); // bind
                

        }); // end each loop


    };
})(jQuery);<commit_msg>Fix for missing blinking cursor in input fields when using using TAB to give the field focus.<commit_after>/**
 * jQuery placeholder attribute plugin.
 * 
 * Adds support via jQuery for the placeholder attribute in text inputs
 * and text areas for browsers which do not support the feature.
 * 
 * Copyright (c) 2011 <NAME>, http://blakerg.wordpress.com/
 * Release under the MIT License. See License.txt
 * 
 */

(function( $ ) {
    $.fn.Placeholder = function(options) {
        
        // detect if we are running IE9 or greater
        if($.browser.msie && parseInt($.browser.version, 10) >= 9) {
            detect_pass = true;
        } else {
            detect_pass = false;
        }
        
        var selector = 'input[type="text"][placeholder!=""], input[type="password"][placeholder!=""], textarea[placeholder!=""]';
        
        // bind the form to clear form fields
        $("form", this).bind('submit', function() {
            $(selector, this).each(function() {
                if($(this).val() == $(this).attr('placeholder')) {
                    $(this).val("");
                }
            });
        });


        // loop over all inputs
        $(selector, this).each(function() {
            
            if($(this).val() == "" || $(this).val() == $(this).attr('placeholder')) {
                // set the placeholder values
                $(this).val($(this).attr('placeholder'));
                $(this).addClass(options.defaultClass);
                // convert a password input to a text input
                if(detect_pass && $(this).attr('type') == 'password') {
                    $(this).addClass('was_pw');
                    this.type = "text";
                }
            }


            $(this).bind({
                focus: function() {
                    if($(this).val() == $(this).attr('placeholder')) {
                        $(this).val("");
                        $(this).removeClass(options.defaultClass);
                    }
                    if(detect_pass && $(this).hasClass('was_pw')) {
                        this.type = "password";
                    }
                    $(this).select();
                },
                blur: function() {
                    if($(this).val() == "") {
                        $(this).addClass(options.defaultClass);
                        $(this).val($(this).attr('placeholder'));
                        if(detect_pass && $(this).hasClass('was_pw')) {
                            this.type = "text";
                        }
                    }
                }
            }); // bind
                

        }); // end each loop


    };
})(jQuery);
{'fraction_non_alphanumeric': 0.15807560137457044, 'fraction_numerical': 0.0030546009927453228, 'mean_word_length': 1.3346702317290553, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3547294', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1244, 'n_words': 282}