<commit_before><%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<script type="text/javascript">
jQuery(document).ready(function() {
    var opts = {
        matchCb: function(id, type) {
            window.open(window.service.replace('/service/', '/portal.do?class=' + type + "&externalids=" + id));
        },
        listCb: function(pq) {
            var service = new intermine.Service({'root': window.service, 'token': "<tiles:getAsString name="token"/>"});
            service.query(pq, function(query) {
                var dialogue = new intermine.query.actions.ListCreator(query);
                dialogue.render().$el.appendTo('#<tiles:getAsString name="widgetId"/>-widget');
                dialogue.openDialogue();

                var notify = {
                    'success': function(list, change) {
                        window.LIST_EVENTS['list-creation:success'](list, change);
                        window.scrollTo(0, 0);
                    },
                    'failure': function(list, change) {
                        window.LIST_EVENTS['list-creation:failure'](list, change);
                        window.scrollTo(0, 0);
                    }
                };

                query.on('list-creation:success', notify.success);
                query.on('list-creation:failure', notify.failure);
            });
        },
        resultsCb: function(pq) {
            (new intermine.Service({'root': service})).query(pq, function(query) {
                var target, uri, form, w;

                // Generate the target name.
                target = 'tmp' + +new Date();

                // Open the window.
                w = window.open('', target);<commit_msg>Callback for viewing list-widgets results now uses promises.<commit_after><%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<script type="text/javascript">
jQuery(document).ready(function() {
    var opts = {
        matchCb: function(id, type) {
            window.open(window.service.replace('/service/', '/portal.do?class=' + type + "&externalids=" + id));
        },
        listCb: function(pq) {
            var service = new intermine.Service({'root': window.service, 'token': "<tiles:getAsString name="token"/>"});
            service.query(pq).then(function(query) {
                var dialogue = new intermine.query.actions.ListCreator(query);
                dialogue.render().$el.appendTo('#<tiles:getAsString name="widgetId"/>-widget');
                dialogue.openDialogue();

                var notify = {
                    'success': function(list, change) {
                        window.LIST_EVENTS['list-creation:success'](list, change);
                        window.scrollTo(0, 0);
                    },
                    'failure': function(list, change) {
                        window.LIST_EVENTS['list-creation:failure'](list, change);
                        window.scrollTo(0, 0);
                    }
                };

                query.on('list-creation:success', notify.success);
                query.on('list-creation:failure', notify.failure);
            });
        },
        resultsCb: function(pq) {
            (new intermine.Service({'root': service})).query(pq).then(function(query) {
                var target, uri, form, w;

                // Generate the target name.
                target = 'tmp' + +new Date();

                // Open the window.
                w = window.open('', target);
{'fraction_non_alphanumeric': 0.14901512988866686, 'fraction_numerical': 0.0022837567799029405, 'mean_word_length': 1.7417840375586855, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1458342', 'n_tokens_mistral': 971, 'n_tokens_neox': 903, 'n_words': 166}