jQuery = $ = require('jquery');
Backbone = require('backbone');
Backbone.$ = jQuery;

Handlebars = require('handlebars');
_ = require('underscore');

require('./js/helpers.js'); // Handelbars helpers
require('bootstrap/dist/js/bootstrap.min.js'); // bootstrap
require('./js/lib/jquery.minicolors.min.js'); // minicolors

App = {};

App.init = function(options){
    
    //Model
    var Model = require('./js/models/main.js');
    App.model = new Model(options);
    
    //Server collection
    var Servers = require('./js/collections/psicquicServers.js');
    App.model.servers = new Servers();
    
    App.model.servers.fetch();
    
    //Views
    var Main = require('./js/views/main');
    var Navbar = require('./js/views/navbar');
    var SideMenu = require('./js/views/sidemenu');
    var Logger = require('./js/views/logger');
    var Graph = require('./js/views/graph');
    var UPDialog = require('./js/views/UPdialog');
    var Pathway = require('./js/views/pathway');
    var Import = require('./js/views/import');
    var Layout = require('./js/views/layout');

    App.views = {};

    //Main
    App.views.main = new Main({el:'body'});
    App.views.main.render();

    //Nav bar
    App.views.navbar = new Navbar({el:'#navbar'});
    App.views.navbar.render();

    App.views.side = new SideMenu({el:'#sidemenu'});
    App.views.side.render();

    //Dialogs
    App.views.UPDialog = new UPDialog({el:'#dialog'});
    App.views.import = new Import({el:'#dialog'});
    App.views.layout = new Layout({el:'#dialog'});
    App.views.pathway = new Pathway({el:'#dialog'});

    //Logger
    App.views.logger = new Logger({el:'#logger'});

    //Graph
    App.views.graph = new Graph({el:'network'});

    //Import additional layout libraries
    Springy = require('springy');
    
    //Init minicolors
    $('.minicolors-input').minicolors({ theme:'bootstrap'});
};

App.init();
@@ -1872,16 +1872,85 @@
 rap'%7D);%0A
+    %0A    //Init tooltips%0A    $('%5Bdata-toggle=%22tooltip%22%5D').tooltip();%0A
 %7D;%0A%0AApp.

update tooltips