// Generated by CoffeeScript 1.3.3
var __hasProp = {}.hasOwnProperty,
  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

define(['underscore', 'serrano'], function(_, Serrano) {
  var DataViewHistory, DataViews, history, views;
  DataViews = (function(_super) {

    __extends(DataViews, _super);

    function DataViews() {
      return DataViews.__super__.constructor.apply(this, arguments);
    }

    DataViews.prototype.url = App.urls.dataviews;

    return DataViews;

  })(Serrano.DataViews);
  DataViewHistory = (function(_super) {

    __extends(DataViewHistory, _super);

    function DataViewHistory() {
      return DataViewHistory.__super__.constructor.apply(this, arguments);
    }

    DataViewHistory.prototype.url = App.urls.dataviewHistory;

    return DataViewHistory;

  })(Serrano.DataViews);
  views = new DataViews;
  views.on('reset', function() {
    var defaults;
    if (!views.hasSession()) {
      defaults = {
        session: true
      };
      defaults.json = App.defaults.dataview;
      return views.create(defaults);
    }
  });
  history = new DataViewHistory;
  views.fetch();
  return history.fetch();
});
