<commit_before>jQuery(function($) {

    $('a[onclick*=dismissRelatedLookupPopup]').each(function() {
        var _onclick = this.onclick,
            $trigger = $(this);
        this.onclick = null;
        $trigger.click(function(evt) {
            evt.preventDefault();
            var d = opener.document,
                fieldName = window.name.substring('id_'.length),
                $input = $('#' + window.name, d),
                $widgetContainer = $('.field-' + fieldName, d);
            if ($input.closest('.FileNodeForeignKeyRawIdWidget').length) {
                var $preview = $trigger.find('.preview:visible').clone(),
                    $name = $trigger.find('.name').clone(),
                    $targetPreview = $widgetContainer.find('.preview'),
                    $targetName = $widgetContainer.find('.name');
                $targetPreview.replaceWith($preview);
                $targetName.replaceWith($name);
            }

            window.selectedMeta = $trigger.find('link.meta')[0];
            _onclick();
        });
    });

    return;
<commit_msg>Fixed ForeignKeyRawIdWidget to work with the markup in inlines<commit_after>jQuery(function($) {

    $('a[onclick*=dismissRelatedLookupPopup]').each(function() {
        var _onclick = this.onclick,
            $trigger = $(this);
        this.onclick = null;
        $trigger.click(function(evt) {
            evt.preventDefault();
            var d = opener.document,
                fieldName = windowname_to_id(window.name).substring('id_'.length),
                $input = $('#' + windowname_to_id(window.name), d),
                $widgetContainer = $input.closest('.FileNodeForeignKeyRawIdWidget');
            if ($widgetContainer.length) {
                var $preview = $trigger.find('.preview:visible').clone(),
                    $name = $trigger.find('.name').clone(),
                    $targetPreview = $widgetContainer.find('.preview'),
                    $targetName = $widgetContainer.find('.name');
                $targetPreview.replaceWith($preview);
                $targetName.replaceWith($name);
            }

            window.selectedMeta = $trigger.find('link.meta')[0];
            _onclick();
        });
    });

    return;

{'fraction_non_alphanumeric': 0.152135231316726, 'fraction_numerical': 0.0008896797153024911, 'mean_word_length': 1.9514435695538057, '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': '3135002', 'n_tokens_mistral': 610, 'n_tokens_neox': 582, 'n_words': 86}