1 // ==========================================================================
  2 // Project:   SproutCore - JavaScript Application Framework
  3 // Copyright: ©2006-2011 Strobe Inc. and contributors.
  4 //            Portions ©2008-2011 Apple Inc. All rights reserved.
  5 // License:   Licensed under MIT license (see license.js)
  6 // ==========================================================================
  7 
  8 
  9 /*jslint evil:true */
 10 
 11 /** 
 12   Extend `SC.View` with `emitDesign()` which will encode the view and all of its
 13   subviews then computes an empty element to attach to the design.
 14 */
 15 SC.View.prototype.emitDesign = function() {
 16   
 17   // get design...
 18   var ret = SC.DesignCoder.encode(this);
 19   
 20   return ret ;
 21 };
 22 
 23 /** 
 24   Patch `SC.View` to respond to `encodeDesign()`.  This will proxy to the
 25   paired designer, if there is one.  If there is no paired designer, returns
 26   `NO`.
 27 */
 28 SC.View.prototype.encodeDesign = function(coder) {
 29   return this.designer ? this.designer.encodeDesign(coder) : NO ;
 30 };
 31