<commit_before>define(["dojo", "dijit"], function(dojo, dijit){
    return function(/*Array of widgets*/widgets, /*Object*/ models){
        dojo.forEach(widgets, function(item){
            //TODO need to find a better way to get all bindable widgets
            var bindWidgets = dojo.query("div[dojoType^=\"dojox.mvc\"]", item.domNode);
            //set ref for each dojox.mvc widgets.
            dojo.forEach(bindWidgets, function(widget){
                //TODO need to find a better way to know which model the widget is bound to
                //currently, the ref attribute in dojox.mvc.Group cannot be empty, leave
                //explicit string with single quote in ref attribute.
                var ref = widget.getAttribute("ref");
                if (ref) {
                    ref = ref.substring(1, ref.length-1);
                    var model = dojo.getObject(ref, false, models);
                    if (model){
                        dijit.byNode(widget).set("ref", model);
                    }                    
                }
            }, this);
        }, this);
        
    }
});
<commit_msg>add data-dojo-type support in bind.js<commit_after>define(["dojo", "dijit"], function(dojo, dijit){
    return function(/*Array of widgets*/widgets, /*Object*/ models){
        dojo.forEach(widgets, function(item){
            //TODO need to find a better way to get all bindable widgets
            var bindWidgets = dojo.query("div[dojoType^=\"dojox.mvc\"],div[data-dojo-type^=\"dojox.mvc\"]", item.domNode);
            //set ref for each dojox.mvc widgets.
            dojo.forEach(bindWidgets, function(widget){
                //TODO need to find a better way to know which model the widget is bound to
                //currently, the ref attribute in dojox.mvc.Group cannot be empty, leave
                //explicit string with single quote in ref attribute.
                var ref = widget.getAttribute("ref");
                
                if(ref === null){
                    var refProps = widget.getAttribute("data-dojo-props");
                    if(refProps){
                        ref = refProps.replace(/^\s*ref\s*:\s*/, "");
                    }
                }
                
                if (ref) {
                    ref = ref.substring(1, ref.length-1);
                    var model = dojo.getObject(ref, false, models);
                    if (model){
                        dijit.byNode(widget).set("ref", model);
                    }                    
                }
            }, this);
        }, this);
        
    }
});

{'fraction_non_alphanumeric': 0.11771472392638037, 'fraction_numerical': 0.0015337423312883436, 'mean_word_length': 1.4202226345083488, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4448455', 'n_tokens_mistral': 719, 'n_tokens_neox': 686, 'n_words': 192}