Sha256: 2e34cd7227b019af1faeeaa2da5959b0c2d6ae3ad2c05042146b91d1481834f4

Contents?: true

Size: 1.24 KB

Versions: 17

Compression:

Stored size: 1.24 KB

Contents

// ========================================================================
// SproutCore -- JavaScript Application Framework
// Copyright ©2006-2008, Sprout Systems, Inc. and contributors.
// Portions copyright ©2008 Apple Inc.  All rights reserved.
// ========================================================================

/*jslint evil:true */

/** 
  Extend SC.View with emitDesign() which will encode the view and all of its
  subviews then computes an empty element to attach to the design.
*/
SC.View.prototype.emitDesign = function() {
  
  // get design...
  var ret = SC.DesignCoder.encode(this);
  
  return ret ;
};

/**
  Extend SC.View to emit the localization for the current configuration of the
  view and all of its subviews.
*/
SC.View.prototype.emitLocalization = function(design) {
  var ret = SC.LocalizationCoder.encode(this);
  
  // prepare rootElement HTML.  Get the design, apply loc and generate the
  // emptyElement HTML...
  if (!design) design = this.emitDesign();
  var views = eval(design).loc(eval(ret)).create() ;
  var emptyElement = views.computeEmptyElement().replace(/\'/g,"\'");
  views.destroy();
  
  // now insert as extra param at end...
  ret = ret.replace(/\)$/, ", '%@')".fmt(emptyElement)) ;
  return ret ;
} ;

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
sproutit-sproutcore-1.0.20090721145285 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1046 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1043 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1042 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1037 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1035 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1031 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1030 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1029 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1027 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1028 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1026 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1025 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1024 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1009 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1008 frameworks/sproutcore/frameworks/designer/ext/view.js
sproutcore-1.0.1003 frameworks/sproutcore/frameworks/designer/ext/view.js