<commit_before>var djConfig = {
    usePlainJson: true,
    parseOnLoad: true
};

var Browser = function(containerID, trackData) {
    dojo.require("dojo.dnd.Source");
    dojo.require("dojo.dnd.Moveable");
    dojo.require("dojo.dnd.Mover");
    dojo.require("dojo.dnd.move");
    dojo.require("dijit.layout.ContentPane");
    dojo.require("dijit.layout.BorderContainer");

    this.deferredFunctions = [];
    var brwsr = this;
    brwsr.isInitialized = false;
    dojo.addOnLoad(function() {
            dojo.addClass(document.body, "tundra");
            brwsr.container = dojo.byId(containerID);
            brwsr.container.genomeBrowser = brwsr;
            var containerWidget = new dijit.layout.BorderContainer({
                    liveSplitters: false,
                    design: "sidebar"
                }, brwsr.container);
            var topPane = document.createElement("div");
            brwsr.container.appendChild(topPane);
            var contentWidget = new dijit.layout.ContentPane({region: "top"}, topPane);
            var overview = document.createElement("div");
            overview.className = "overview";
            overview.id = "overview";
            topPane.appendChild(overview);
            var navbox = brwsr.createNavBox(topPane);

            var viewElem = document.createElement("div");
            brwsr.container.appendChild(viewElem);
            var browserWidget = new dijit.layout.ContentPane({region: "center"}, viewElem);
            viewElem.className = "dragWindow";

            var location;
            var locCookie = dojo.cookie(containerID + "-location");
            if (locCookie)
                location = parseInt(locCookie);
            if (isNaN(location))
                location = ((brwsr.refSeq.end + brwsr.refSeq.start) / 2) | 0;

            brwsr.locationTrap = document.createElement("div");
            brwsr.locationTrap.className = "locationTrap";
            topPane.appendChild(brwsr.locationTrap);
            topPane.style.overflow="hidden";

            brwsr.refSeq = trackData["3R"];
            var trackList = brwsr.refSeq["trackList"];
            var zoomLevel = 1/200;
            var zoomCookie = dojo.cookie(containerID + "-zoom");
            if (zoomCookie) 
                zoomLevel = parseFloat(zoomCookie);
            if (isNaN(zoomLevel))
                zoomLevel = 1/200;

            var refCookie = dojo.cookie(containerID + "-refseq");
            refs = [];
            //sort ref sequences more or less how people expect
            for (var refname in trackData) refs.push(refname);
            refs.sort(function(a, b) {
                    aNum=String(a).match(/^[0-9]+/);
                    bNum=String(b).match(/^[0-9]+/);
                    if (aNum && !bNum) return -1;
                    if (!aNum && bNum) return 1;
                    if (aNum && bNum && (aNum[0] != bNum[0]))
                        return aNum[0] - bNum[0];
                    if (a < b)
                        return -1;
                    else if (a == b)
                        return 0;
                    else
                        return 1;
                });

            // for (var i = 0; i < refs.length; i++)
            //     brwsr.chromList.add(new Option(refs[i], refs[i], false, 
            //                                   String(refs[i]) == refCookie), 
            //                        null);

            // dojo.connect(brwsr.chromList, "onchange", function(event) {
            //         dojo.forEach(brwsr.viewElem.childNodes, fuction(node) {
            //                 node.parentNode.removeChild(node);
            //             });
            //         brwsr.view

            var gv = new GenomeView(viewElem, 250, 
                                    brwsr.refSeq.start, brwsr.refSeq.end,
                                    zoomLevel);
            brwsr.view = gv;<commit_msg>fix location cookie usage, IE refseq select populating<commit_after>var djConfig = {
    usePlainJson: true
};

var Browser = function(containerID, trackData) {
    dojo.require("dojo.dnd.Source");
    dojo.require("dojo.dnd.Moveable");
    dojo.require("dojo.dnd.Mover");
    dojo.require("dojo.dnd.move");
    dojo.require("dijit.layout.ContentPane");
    dojo.require("dijit.layout.BorderContainer");

    this.deferredFunctions = [];
    var brwsr = this;
    brwsr.isInitialized = false;
    dojo.addOnLoad(function() {
            dojo.addClass(document.body, "tundra");
            brwsr.container = dojo.byId(containerID);
            brwsr.container.genomeBrowser = brwsr;
            var containerWidget = new dijit.layout.BorderContainer({
                    liveSplitters: false,
                    design: "sidebar"
                }, brwsr.container);
            var topPane = document.createElement("div");
            brwsr.container.appendChild(topPane);
            var contentWidget = new dijit.layout.ContentPane({region: "top"}, topPane);
            var overview = document.createElement("div");
            overview.className = "overview";
            overview.id = "overview";
            topPane.appendChild(overview);
            var navbox = brwsr.createNavBox(topPane);

            var viewElem = document.createElement("div");
            brwsr.container.appendChild(viewElem);
            var browserWidget = new dijit.layout.ContentPane({region: "center"}, viewElem);
            viewElem.className = "dragWindow";

            brwsr.locationTrap = document.createElement("div");
            brwsr.locationTrap.className = "locationTrap";
            topPane.appendChild(brwsr.locationTrap);
            topPane.style.overflow="hidden";

            brwsr.refSeq = trackData["3R"];
            var trackList = brwsr.refSeq["trackList"];
            var zoomLevel = 1/200;
            var zoomCookie = dojo.cookie(containerID + "-zoom");
            if (zoomCookie) 
                zoomLevel = parseFloat(zoomCookie);
            if (isNaN(zoomLevel))
                zoomLevel = 1/200;

            var refCookie = dojo.cookie(containerID + "-refseq");
            refs = [];
            //sort ref sequences more or less how people expect
            for (var refname in trackData) refs.push(refname);
            refs.sort(function(a, b) {
                    aNum=String(a).match(/^[0-9]+/);
                    bNum=String(b).match(/^[0-9]+/);
                    if (aNum && !bNum) return -1;
                    if (!aNum && bNum) return 1;
                    if (aNum && bNum && (aNum[0] != bNum[0]))
                        return aNum[0] - bNum[0];
                    if (a < b)
                        return -1;
                    else if (a == b)
                        return 0;
                    else
                        return 1;
                });

            for (var i = 0; i < refs.length; i++)
                brwsr.chromList.options[i] = new Option(refs[i], refs[i]);

            // dojo.connect(brwsr.chromList, "onchange", function(event) {
            //         dojo.forEach(brwsr.viewElem.childNodes, fuction(node) {
            //                 node.parentNode.removeChild(node);
            //             });
            //         brwsr.view

            var location;
            var locCookie = dojo.cookie(containerID + "-location");
            if (locCookie)
                location = parseInt(locCookie);
            if (isNaN(location))
                location = ((brwsr.refSeq.end + brwsr.refSeq.start) / 2) | 0;

            var gv = new GenomeView(viewElem, 250, 
                                    brwsr.refSeq.start, brwsr.refSeq.end,
                                    zoomLevel);
            brwsr.view = gv;
{'fraction_non_alphanumeric': 0.12179653119337303, 'fraction_numerical': 0.007248252653378203, 'mean_word_length': 1.536769533814839, 'pattern_counts': {'":': 0, '<': 7, '<?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': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '161230', 'n_tokens_mistral': 2238, 'n_tokens_neox': 2114, 'n_words': 403}