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 // SproutCore -- JavaScript Application Framework 9 // ======================================================================== 10 11 /** 12 Extend SC.Binding with properites that make it easier to detect bindings 13 in the inspector 14 */ 15 SC.Binding.isBinding = true; 16 17 18 SC.Binding.displayValue = function(){ 19 var from = this._fromRoot ? "<%@>:%@".fmt(this._fromRoot,this._fromPropertyPath) : this._fromPropertyPath; 20 21 var to = this._toPropertyPath; 22 23 var oneWay = this._oneWay ? '[oneWay]' : ''; 24 return "%@ -> %@ %@".fmt(from, to, oneWay); 25 26 }; 27 28 29 SC.Binding.encodeDesign = function(coder){ 30 var ret = "SC.Binding"; 31 32 if(this._fromPropertyPath){ 33 ret= ret+".from('"+this._fromPropertyPath+"')"; 34 } 35 if(this._oneWay){ 36 ret = ret+".oneWay()"; 37 } 38 return ret;//coder.js(key,ret); 39 }; 40