Sha256: 253b0981ec889c79a5d2526bf220276fd7d53ac5a7aea45a9cf0f1129495497e

Contents?: true

Size: 1.66 KB

Versions: 71

Compression:

Stored size: 1.66 KB

Contents

(function() {
  var INTERESTING_PROPERTIES, IRREGULAR_PROPERTIES, renderListItem;

  INTERESTING_PROPERTIES = ['class', 'accessibilityLabel', 'tag', 'alpha', 'isHidden'];

  IRREGULAR_PROPERTIES = INTERESTING_PROPERTIES.concat('parent', 'subviews', 'children');

  renderListItem = function(propertyName, propertyValue, cssClass) {
    if (propertyValue == null) {
      propertyValue = 'null';
    }
    if (_.isObject(propertyValue)) {
      propertyValue = JSON.stringify(propertyValue);
    }
    return $("<li>").addClass(cssClass).append($('<div/>').addClass('key').text(propertyName), $('<div/>').addClass('value').text(propertyValue));
  };

  define(function() {
    var DetailsView;
    DetailsView = Backbone.View.extend({
      el: $('#dom-detail'),
      updateModel: function(model) {
        this.model = model;
        return this.refresh();
      },
      refresh: function() {
        var $ul, prop, val, _i, _j, _len, _len1, _ref;
        $ul = $('<ul>');
        for (_i = 0, _len = INTERESTING_PROPERTIES.length; _i < _len; _i++) {
          prop = INTERESTING_PROPERTIES[_i];
          if (this.model.has(prop)) {
            val = this.model.get(prop);
            $ul.append(renderListItem(prop, val, 'interesting'));
          }
        }
        _ref = _.keys(this.model.attributes).sort();
        for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
          prop = _ref[_j];
          if (_.contains(IRREGULAR_PROPERTIES, prop)) {
            continue;
          }
          val = this.model.get(prop);
          $ul.append(renderListItem(prop, val));
        }
        return this.$el.empty().append($ul);
      }
    });
    return DetailsView;
  });

}).call(this);

Version data entries

71 entries across 54 versions & 5 rubygems

Version Path
rufus-0.6 RufusApp/Frank/frankified_build/Frankified.app/frank_static_resources.bundle/js/details_view.js
rufus-0.6 RufusApp/Frank/frank_static_resources.bundle/js/details_view.js
rufus-0.5 RufusApp/Frank/frankified_build/Frankified.app/frank_static_resources.bundle/js/details_view.js
rufus-0.5 RufusApp/Frank/frank_static_resources.bundle/js/details_view.js
rufus-0.4 RufusApp/Frank/frankified_build/Frankified.app/frank_static_resources.bundle/js/details_view.js
rufus-0.4 RufusApp/Frank/frank_static_resources.bundle/js/details_view.js
rufus-0.3 RufusApp/Frank/frank_static_resources.bundle/js/details_view.js
rufus-0.3 RufusApp/Frank/frankified_build/Frankified.app/frank_static_resources.bundle/js/details_view.js
rufus-0.1 RufusApp/Frank/frankified_build/Frankified.app/frank_static_resources.bundle/js/details_view.js
rufus-0.1 RufusApp/Frank/frank_static_resources.bundle/js/details_view.js
frank-cucumber-1.2.0 frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-cucumber-1.2.0.pre1 frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-cucumber-1.1.13.pre1 frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-cucumber-1.1.12 frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-cucumber-1.1.11.pre1 frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-cucumber-1.1.10 frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-cucumber-1.1.9.pre1 frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-cucumber-1.1.8 frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-cucumber-1.1.7 frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-cucumber-1.1.6 frank-skeleton/frank_static_resources.bundle/js/details_view.js