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.8.2 RufusApp/Frank/frankified_build/Frankified.app/frank_static_resources.bundle/js/details_view.js
rufus-0.8.2 RufusApp/Frank/frank_static_resources.bundle/js/details_view.js
rufus-0.8.1 RufusApp/Frank/frank_static_resources.bundle/js/details_view.js
rufus-0.8.1 RufusApp/Frank/frankified_build/Frankified.app/frank_static_resources.bundle/js/details_view.js
rufus-0.8 RufusApp/Frank/frankified_build/Frankified.app/frank_static_resources.bundle/js/details_view.js
rufus-0.8 RufusApp/Frank/frank_static_resources.bundle/js/details_view.js
sc-frank-cucumber-1.2.1.1dcc760.debug frank-skeleton/frank_static_resources.bundle/js/details_view.js
frank-cucumber-1.2.2 frank-skeleton/frank_static_resources.bundle/js/details_view.js
sc-frank-cucumber-1.2.1.1dcc760 frank-skeleton/frank_static_resources.bundle/js/details_view.js
sc-frank-cucumber-1.2.1.1dcc760 frank-skeleton/frank_static_resources.bundle/bundle/js/details_view.js
sc-frank-cucumber-1.2.1.1dcc760 frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/details_view.js
frank-cucumber-1.2.1 frank-skeleton/frank_static_resources.bundle/js/details_view.js
sc-frank-cucumber-1.2.1.902fa34 frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/details_view.js
sc-frank-cucumber-1.2.1.902fa34 frank-skeleton/frank_static_resources.bundle/js/details_view.js
sc-frank-cucumber-1.2.1.902fa34 frank-skeleton/frank_static_resources.bundle/bundle/js/details_view.js
sc-frank-cucumber-1.2.1.d2d00d2 frank-skeleton/frank_static_resources.bundle/js/details_view.js
sc-frank-cucumber-1.2.1.c13cb90 frank-skeleton/frank_static_resources.bundle/js/details_view.js
sc-frank-cucumber-1.2.1.00af28c frank-skeleton/frank_static_resources.bundle/js/details_view.js
rufus-0.7 RufusApp/Frank/frankified_build/Frankified.app/frank_static_resources.bundle/js/details_view.js
rufus-0.7 RufusApp/Frank/frank_static_resources.bundle/js/details_view.js