This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App = SC.Application.create( | |
/** @scope Chase.prototype */ { | |
NAMESPACE: 'App', | |
VERSION: '0.1.0', | |
// This is your application store. You will use this store to access all | |
// of your model data. You can also set a data source on this store to | |
// connect to a backend server. The default setup below connects the store | |
// to any fixtures you define. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App = SC.Application.create( | |
/** @scope Chase.prototype */ { | |
NAMESPACE: 'App', | |
VERSION: '0.1.0', | |
// This is your application store. You will use this store to access all | |
// of your model data. You can also set a data source on this store to | |
// connect to a backend server. The default setup below connects the store | |
// to any fixtures you define. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Is this correct? | |
SC.ImageView.design({ | |
// You don't need to have both a 'right' and a 'width', just one or the other | |
layout: { top: 100, left: 840, rotate: 90, height: 150, width: 130 }, | |
value: static_url('resources/aly.JPG'), | |
localize: NO, | |
mouseDown: function(evt) { | |
// This will hide the current image when clicked | |
this.set('isVisible', YES) ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
firstName: SC.Record.attr(String), | |
lastName: SC.Record.attr(String), | |
fullName: function(key, newValue) | |
{ | |
if(newValue) { | |
var names = newValue.split(" "); | |
this.set('firstName', names[0]); | |
this.set('lastName', names[1]); | |
return this; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
layoutView : SC.SplitView.design({ | |
layoutDirection: SC.LAYOUT_HORIZONTAL, | |
defaultThickness: 200, | |
layout: {bottom:0, top:0, left:0, right:0}, | |
canCollapseViews: NO, | |
// the left view... | |
topLeftView: SC.SplitView.design({ | |
layoutDirection : SC.LAYOUT_VERTICAL, | |
defaultThickness: 200, | |
layout: {bottom:0, top:0, left:0, right:0}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frameworks/sproutcore/frameworks/foundation/views/view.js: line 1371 | |
/** | |
The layout describes how you want your view to be positions on the | |
screen. You can define the following properties: | |
- left: the left edge | |
- top: the top edge | |
- right: the right edge | |
- bottom: the bottom edge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveRecord | |
module NamedScope | |
class Scope | |
def conditions | |
@conditions ||= begin | |
all_conditions = [] | |
scope = self | |
while scope.class == self.class | |
all_conditions << scope.proxy_options[:conditions] | |
scope = scope.proxy_scope |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sprout Casts: | |
All of these are focused on 1.0 | |
- Make a blank app. | |
- setting up a model | |
- with some fixtures. | |
- Setup some views (a list, with a form) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compareObjects: function (v1, v2) { | |
var orderDefinition = [SC.T_ERROR, SC.T_UNDEFINED, SC.T_NULL, SC.T_BOOL, SC.T_NUMBER, SC.T_STRING, SC.T_ARRAY, SC.T_HASH, SC.T_OBJECT, SC.T_FUNCTION, SC.T_CLASS]; | |
//function getType (v) { | |
// var t = typeof v; | |
// if (t == 'object') { | |
// if (t == null) return 'null'; | |
// if (t instanceof Array) return 'array'; | |
// } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Ruby assignment option to assign unless nil | |
replacement_content = page_contents.content_label_find(item) | |
element.inner_html = replacement_content if replacement_content | |
# Should be able to do something like... not sure if the "=||" is the best suggestion for the assignment symbols | |
element.inner_html =|| page_contents.content_label_find(item) | |