Sha256: dcd6fada4acb5fc558af03e8752e7c73c2c435d20aea8c0fe414b834fa599797

Contents?: true

Size: 1.76 KB

Versions: 2

Compression:

Stored size: 1.76 KB

Contents

I"ú(function() {
  this.Quby = {};

  Quby.Models = {};

  Quby.Collections = {};

  Quby.Views = {};

  Quby.Logic = {};

  Quby.Components = {};

  $(function() {
    Quby.questions = new Quby.Collections.Questions;
    Quby.panels = new Quby.Collections.Panels;
    return Quby.flags = new Quby.Collections.Flags;
  });

  Quby.init = function(options) {
    Quby.questionnaire_key = options.questionnaire_key;
    Quby.flags.addFlags(options.flag_definitions, options.flag_values);
    Quby.answer = new Quby.Models.Answer(options.answer_value);
    Quby.initTextvars(options.textvars);
    Quby.initShowsHides();
    return Quby.initFieldListeners();
  };

  Quby.initTextvars = function(textvars) {
    console.log("WAAAA");
    Quby.textvars = new Quby.Collections.Textvars(textvars);
    $("span[textvar]").each(function(idx, elm) {
      var textvar;
      textvar = elm.getAttribute('textvar');
      return React.renderComponent(Quby.Components.Textvar({
        textvar: textvar
      }), elm);
    });
    $(document).on("change", "input[sets_textvar]", function() {
      console.log("OOAOAO");
      return Quby.textvars.set(this.getAttribute("sets_textvar"), this.value);
    });
    return $("input[sets_textvar][value][value!=\"\"]").trigger("change");
  };

  Quby.initShowsHides = function() {
    Quby.questions.trigger("initShowsHides");
    return Quby.flags.initShowsHides(Quby.questions);
  };

  Quby.initFieldListeners = function() {
    return $("select[data-field-key], input[data-field-key], textarea[data-field-key]").on("change", function(event) {
      var fieldKey, fieldValue;
      fieldKey = $(event.target).data("field-key");
      fieldValue = event.target.value;
      return Quby.answer.setField(fieldKey, fieldValue);
    });
  };

}).call(this);
:ET

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
quby-5.0.4 spec/internal/tmp/cache/assets/test/sprockets/v3.0/k9/k9H_Gux0dH0NE2Th908VKpWWsUCtFRgw0e5ASs_pgjc.cache
quby-4.0.0 spec/internal/tmp/cache/assets/test/sprockets/v3.0/k9/k9H_Gux0dH0NE2Th908VKpWWsUCtFRgw0e5ASs_pgjc.cache