Sha256: 8cbee2c35903265c05129b991675a392a5cbfb4071db96e3d99eff007de3ebbb

Contents?: true

Size: 1.41 KB

Versions: 48

Compression:

Stored size: 1.41 KB

Contents

// ==========================================================================
// Project:   Greenhouse.ViewConfig
// Copyright: ©2010 Mike Ball
// ==========================================================================
/*globals Greenhouse js_beautify*/

/** @class

  (Document your Model here)

  @extends SC.Record
  @version 0.1
*/
Greenhouse.ViewConfig = SC.Record.extend(
/** @scope Greenhouse.ViewConfig.prototype */ {
  
  primaryKey: 'path',
  
  views: SC.Record.toMany('Greenhouse.Design', {nested: YES}),
  panes: SC.Record.toMany('Greenhouse.Design', {nested: YES}),
  controllers: SC.Record.toMany('Greenhouse.Design', {nested: YES}),
  canEdit: SC.Record.attr(Boolean),
  name: SC.Record.attr(String),
  path: SC.Record.attr(String),
  
  body: function(){
    var ret = {name: this.get('name'), path: this.get('path'), views: [], controllers: [], panes: []},
        views = this.get('views'),
        controllers = this.get('controllers'),
        panes = this.get('panes');
    
    
    views.forEach(function(i){
      ret.views.push(i.get('attributes'));
    });
    
    controllers.forEach(function(i){
      ret.controllers.push(i.get('attributes'));
    });
    
    panes.forEach(function(i){
      ret.panes.push(i.get('attributes'));
    });
    
    return js_beautify(SC.json.encode(ret));
  }.property('views', 'panes', 'controllers')
  
}) ;
Greenhouse.CONFIG_QUERY = SC.Query.remote(Greenhouse.ViewConfig);

Version data entries

48 entries across 48 versions & 2 rubygems

Version Path
sproutcore-1.6.0.beta.3-java lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/models/view_config.js
sproutcore-1.6.0.beta.3 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/models/view_config.js
sproutcore-1.6.0.beta.2-x86-mingw32 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/models/view_config.js
sproutcore-1.6.0.beta.2-java lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/models/view_config.js
sproutcore-1.6.0.beta.2 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/models/view_config.js
sproutcore-1.6.0.beta.1 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/models/view_config.js
sproutcore-1.5.0-java lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/models/view_config.js
sproutcore-1.5.0 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/models/view_config.js
sproutcore-1.5.0.rc.2 lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.5.0.rc.1 lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
spade-0.0.1 sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.5.0.pre.5 lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.5.0.pre.4.1 lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.5.0.pre.4 lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.5.0.pre.3 lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.4.5 lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.4.5-java lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.4.4-java lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.4.4 lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js
sproutcore-1.4.3.1 lib/frameworks/sproutcore/apps/greenhouse/models/view_config.js