// Generated by CoffeeScript 1.6.1
(function(){var e={}.hasOwnProperty,t=function(t,n){function r(){this.constructor=t}for(var i in n)e.call(n,i)&&(t[i]=n[i]);r.prototype=n.prototype;t.prototype=new r;t.__super__=n.prototype;return t};define(["backbone","text!templates/aws-info.html","text!templates/hit-config.html","text!templates/database.html","text!templates/server-params.html","text!templates/expt-info.html","views/validators","views/RunExptView"],function(e,n,r,i,s,o,u,a){var f,l=this;return f=function(e){function a(){var e=this;this.render=function(){return a.prototype.render.apply(e,arguments)};return a.__super__.constructor.apply(this,arguments)}t(a,e);a.prototype.initialize=function(){return this.render()};a.prototype.render=function(){var e=this;$("li").on("click",function(){$("li").removeClass("selected");return $(this).addClass("selected")});return $.when(this.options.config.fetch(),this.options.ataglance.fetch().done(function(){var t,a,f,l,c,h,p;t=_.template(n,{input:{aws_access_key_id:e.options.config.get("AWS Access").aws_access_key_id,aws_secret_access_key:e.options.config.get("AWS Access").aws_secret_access_key}});l=_.template(r,{input:{title:e.options.config.get("HIT Configuration").title,description:e.options.config.get("HIT Configuration").description,keywords:e.options.config.get("HIT Configuration").keywords,question_url:e.options.config.get("HIT Configuration").question_url,max_assignments:e.options.config.get("HIT Configuration").max_assignments,hit_lifetime:e.options.config.get("HIT Configuration").hit_lifetime,reward:e.options.config.get("HIT Configuration").reward,duration:e.options.config.get("HIT Configuration").duration,us_only:e.options.config.get("HIT Configuration").us_only,approve_requirement:e.options.config.get("HIT Configuration").approve_requirement,using_sandbox:e.options.config.get("HIT Configuration").using_sandbox}});a=_.template(i,{input:{database_url:e.options.config.get("Database Parameters").database_url,table_name:e.options.config.get("Database Parameters").table_name}});h=_.template(s,{input:{host:e.options.config.get("Server Parameters").host,port:e.options.config.get("Server Parameters").port,cutoff_time:e.options.config.get("Server Parameters").cutoff_time,support_ie:e.options.config.get("Server Parameters").support_ie}});f=_.template(o,{input:{code_version:e.options.config.get("Task Parameters").code_version,num_conds:e.options.config.get("Task Parameters").num_conds,num_counters:e.options.config.get("Task Parameters").num_counters}});p=new u;c=function(t){return e.options.pubsub.trigger("save",t)};$("#overview").off("click").on("click",function(){$("li").removeClass("selected");$("#overview").addClass("selected");return e.options.pubsub.trigger("loadOverview")});$("#aws-info").on("click",function(){var e=this;$("#content").html(t);p.loadValidators();$("#myform").submit(!1);return $(".save").on("click",function(e){return c(e)})});$("#hit-config").on("click",function(){var e=this;$("#content").html(l);p.loadValidators();$("#myform").submit(!1);return $(".save").on("click",function(e){return c(e)})});$("#database").on("click",function(){var e=this;$("#content").html(a);p.loadValidators();$("#myform").submit(!1);return $(".save").on("click",function(e){e.preventDefault();return c(e)})});$("#server-params").on("click",function(){$("#content").html(h);p.loadValidators();$("#myform").submit(!1);return $(".save").on("click",function(e){e.preventDefault();return c(e)})});$("#expt-info").on("click",function(){$("#content").html(f);p.loadValidators();$("#myform").submit(!1);return $(".save").on("click",function(e){e.preventDefault();return c(e)})});$("#documentation").on("click",function(){return window.open("https://github.com/NYUCCL/psiTurk/wiki")});return $("#contribute").on("click",function(){window.open("https://github.com/NYUCCL/psiTurk");return this.options.pubsub.trigger("loadOverview")})}))};return a}(e.View)})}).call(this);