<commit_before>DP.screens = (function() {
    //get the data from the specific vimeo id
    var _setVimeoForm = function() {
        var client = new DP.helper.getData(),
            fieldVimeoId = DP.helper.selectId('field-vimeo-id'),
            vimeoIdError = DP.helper.selectId('vimeo-id-error'),
            fieldname = DP.helper.selectId('field-name'),
            fieldDiscription = DP.helper.selectId('field-discription'),
            fieldDuration = DP.helper.selectId('field-duration');

console.log(vimeoIdError);
        fieldVimeoId.addEventListener('blur', function(e) {
            client.get('http://vimeo.com/api/v2/video/' + e.target.value + '.json', function(response) {
                if (response !== 'error') {
                    fieldVimeoId.classList.remove('error');
                    var data = JSON.parse(response)[0];
                      vimeoIdError.innerHTML = '';
                    fieldDiscription.value = data.description;
                    fieldname.value = data.title;
                    fieldDuration.value = data.duration;
                    console.log(data);
                } else {
                    fieldVimeoId.classList.add('error');
                    vimeoIdError.innerHTML = 'Fill only the id, not the whole url';
                    console.log('there was a error');
                }
            });
        });
    };



    //if a file select ad the selected image to the html
    var uploadPreview = function() {
        var fieldFile = DP.helper.selectId('field-file'),
            filename = DP.helper.selectId('filename'),
            inputPreview = DP.helper.selectId('input-preview');

        function readURL(input) {
            var files = input.target.files;
            filename.innerHTML = files[0].name;
            if (files && files[0]) {
                var reader = new FileReader();

                reader.onload = function(event) {
                    inputPreview.src = event.target.result;
                };
                reader.readAsDataURL(files[0]);
            }
        }
        fieldFile.addEventListener('click', function(e) {
            readURL(e);
        });
    };
    var watchOptions = function() {
        var radioOptionField = DP.helper.selectId('radio-option-field'),
            fileInput = DP.helper.select('.file-input'),<commit_msg>fix an error with selecting photo and use createObjectURL instead of readfile for beter broser suport<commit_after>DP.screens = (function() {
    //get the data from the specific vimeo id
    var _setVimeoForm = function() {
        var client = new DP.helper.getData(),
            fieldVimeoId = DP.helper.selectId('field-vimeo-id'),
            vimeoIdError = DP.helper.selectId('vimeo-id-error'),
            fieldname = DP.helper.selectId('field-name'),
            fieldDiscription = DP.helper.selectId('field-discription'),
            fieldDuration = DP.helper.selectId('field-duration');

        fieldVimeoId.addEventListener('blur', function(e) {
            client.get('http://vimeo.com/api/v2/video/' + e.target.value + '.json', function(response) {
                if (response !== 'error') {
                    fieldVimeoId.classList.remove('error');
                    var data = JSON.parse(response)[0];
                    vimeoIdError.innerHTML = '';
                    fieldDiscription.value = data.description;
                    fieldname.value = data.title;
                    fieldDuration.value = data.duration;
                    console.log(data);
                } else {
                    fieldVimeoId.classList.add('error');
                    vimeoIdError.innerHTML = 'Fill only the id, not the whole url';
                    console.log('there was a error');
                }
            });
        });
    };

    //if a file select ad the selected image to the html
    var uploadPreview = function() {
        var fieldFile = DP.helper.selectId('field-file'),
            filename = DP.helper.selectId('filename'),
            inputPreview = DP.helper.selectId('input-preview');

            }
        function readURL(event) {
            console.log(event.target.files);
            inputPreview.src = URL.createObjectURL(event.target.files[0]);
            filename.innerHTML = event.target.files[0].name;
        }
        fieldFile.addEventListener('change', function(e) {
            readURL(e);
        });
    };
    var watchOptions = function() {
        var radioOptionField = DP.helper.selectId('radio-option-field'),
            fileInput = DP.helper.select('.file-input'),
{'fraction_non_alphanumeric': 0.12333551626282471, 'fraction_numerical': 0.0019646365422396855, 'mean_word_length': 1.7973137973137974, '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': '7032650', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1196, 'n_words': 231}