/* global require */

// FIXME: Use minified versions when not in development mode?
require.config({
    baseUrl: "scripts",
    paths: {
        backbone: "lib/backbone",
        "dom-ready": "lib/require/dom-ready",
        jquery: "lib/jquery",
        text: "lib/require/text",
        "underscore-base": "lib/underscore",
        underscore: "lib/underscore-wrapper"
    },
    shim: {
        backbone: {
            deps: ["underscore", "jquery"],
            exports: "Backbone"
        },
        "underscore-base": {
            exports: "_"
        }
    }
});

require([
        "dom-ready!",
        "jquery",
        "underscore",
        "player-controls",
        "track-list"
    ],
    function(
        doc,
        $,
        _,
        PlayerControls,
        TrackList) {

    "use strict";

    $("body").html(new PlayerControls().render().el);
    $("body").append(new TrackList().render().el);

    // setInterval(function() {
    //     $.getJSON("trackInfo", function(track) {
    //         // FIXME: display duplicate tracks
    //         if ($("#" + track.trackID).length == 0) {
    //             buildQueueEntry("#queueHead", track.trackID, track)
    //         }
    //     });
    // }, 1000);
});

@@ -915,320 +915,8 @@
 el);
-%0A%0A    // setInterval(function() %7B%0A    //     $.getJSON(%22trackInfo%22, function(track) %7B%0A    //         // FIXME: display duplicate tracks%0A    //         if ($(%22#%22 + track.trackID).length == 0) %7B%0A    //             buildQueueEntry(%22#queueHead%22, track.trackID, track)%0A    //         %7D%0A    //     %7D);%0A    // %7D, 1000);
 %0A%7D);

Remove commented code.