<commit_before>parent.$.fn.getIndex = function(){
    var $p=$(this).parent().children();
    return $p.index(this);
}
selectedPart = parent.$('#page_parts .ui-tabs-selected').getIndex();

wym = parent.$.wymeditors(selectedPart);
wym.html(wym.html() + '<%= escape_javascript(@html_for_wym) %>');
wym.update();
close_dialog();<commit_msg>Adding video on the selected block (previously was always at the end of html)<commit_after>parent.$.fn.getIndex = function(){
    var $p=$(this).parent().children();
    return $p.index(this);
}
selectedPart = parent.$('#page_parts .ui-tabs-selected').getIndex();
wym = parent.$.wymeditors(selectedPart);
selectedBlock = wym.selected();
if (selectedBlock !== null) {
   $(selectedBlock).append('<%= escape_javascript(@html_for_wym) %>');
} else {
   wym.html(wym.html() + '<%= escape_javascript(@html_for_wym) %>');
}
wym.update();
close_dialog();
{'fraction_non_alphanumeric': 0.20927601809954752, 'fraction_numerical': 0.0, 'mean_word_length': 5.9140625, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '7148384', 'n_tokens_mistral': 302, 'n_tokens_neox': 293, 'n_words': 50}