{:uriI"file:///Users/marten/rgoc/quby/app/assets/javascripts/quby/backbone/logic/init_questions.js.coffee?type=application/javascript&pipeline=self&id=273ff951f7ee2eaac5777c438a7742fbece0d221650b97bad74113969f57f32a:ET:load_pathI"3/Users/marten/rgoc/quby/app/assets/javascripts;T: filenameI"`/Users/marten/rgoc/quby/app/assets/javascripts/quby/backbone/logic/init_questions.js.coffee;T: nameI"'quby/backbone/logic/init_questions;T:logical_pathI"/quby/backbone/logic/init_questions.self.js;T:content_typeI"application/javascript;T: sourceI"4 (function() { Quby.Logic.InitQuestions = (function() { function InitQuestions(questionAttributes) { this.questions = new Quby.Collections.Questions; this.questionAttributes = questionAttributes; } InitQuestions.prototype.initializeQuestions = function() { _.each(this.questionAttributes, (function(_this) { return function(questionAttribute) { var options, question; options = _this.initializeOptions(questionAttribute.options); question = _this.initializeQuestion(questionAttribute, options); return _this.questions.add(question); }; })(this)); return this.questions; }; InitQuestions.prototype.initializeOptions = function(optionAttributes) { var options; options = new Quby.Collections.QuestionOptions; _.each(optionAttributes, (function(_this) { return function(attrs) { var element, option; option = new Quby.Models.QuestionOption({ key: attrs.key, showsQuestionsKeys: attrs.showsQuestions, hidesQuestionsKeys: attrs.hidesQuestions, startChosen: attrs.startChosen }); element = _this.initializeOptionViewElement(attrs.viewId); new Quby.Views.QuestionOptionView({ model: option, el: element }); return options.add(option); }; })(this)); return options; }; InitQuestions.prototype.initializeOptionViewElement = function(view_id) { return $("#" + view_id)[0]; }; InitQuestions.prototype.initializeQuestion = function(question, options) { var parentOption, parentQuestion; parentQuestion = this.questions.findWhere({ key: question.parentKey }); if (parentQuestion) { parentOption = parentQuestion.get("options").findWhere({ key: question.parentOptionKey }); } return new Quby.Models.Question({ key: question.key, viewSelector: question.viewSelector, options: options, type: question.type, defaultInvisible: question.defaultInvisible, parentQuestion: parentQuestion, parentOption: parentOption, deselectable: question.deselectable }); }; return InitQuestions; })(); }).call(this); ;T: metadata{ :dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"jprocessors:type=application/javascript&file_type=application/javascript&engines=.coffee&pipeline=self;TTI"nfile-digest:///Users/marten/rgoc/quby/app/assets/javascripts/quby/backbone/logic/init_questions.js.coffee;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%4Sfte 6Z3OM: lengthi4 :dependencies_digest"%S7FNŮ_uJMO|ȍ:idI"E273ff951f7ee2eaac5777c438a7742fbece0d221650b97bad74113969f57f32a;F: mtimel+:^