This file contains 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
myForm: SC.View.extend({ | |
childViews: ['nameLabel', 'givenNameField', 'familyNameField', 'imageField', 'phoneLabel', 'phoneField', // ... etc. ], | |
// To save us the trouble of offsetting each view independently, we use a child layout plugin that stacks them vertically. | |
childViewLayout: SC.View.VERTICAL_STACK, | |
childViewLayoutOptions: { paddingBefore: 35, paddingAfter: 35, spacing: 14 }, | |
nameLabel: SC.LabelView.extend({ | |
classNames: ['form-label'], | |
layout: { left: 20, height: 20 }, |
This file contains 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
// Note: by mixing in SC.ContentDisplay, we get `content` added as a displayProperty | |
MyApp.CustomItemView = SC.View.extend(SC.ContentDisplay, { | |
// --------------------------------------------------------------------------- | |
// Properties | |
// | |
classNames: ['custom-item-view'], | |
content: null, |
This file contains 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
SC.ArrayController.reopen({ | |
proxyItem: null, | |
indexOf: function (object, startAt) { | |
var content = this._scac_observableContent(); | |
if (this.proxyItem) { | |
object = object.get('content'); | |
} |
This file contains 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 phonegap-sc.rb -a alfresco -o ../output/path | |
require 'fileutils' | |
require 'pathname' | |
require 'optparse' | |
config = {} | |
argparser = OptionParser.new {|opts| | |
opts.on('-a', '--application-name [name]', "The application name (required)"){|name| | |
config[:app_name] = name | |
} |
This file contains 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
// ========================================================================== | |
// Project: SproutCore | |
// Copyright: ©2013 7x7 Software, Inc. | |
// License: Licensed under MIT license | |
// ========================================================================== | |
/*global SC */ | |
/** @class | |
*/ |
This file contains 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
MyApp.SectionState = SC.State.extend({ | |
initialSubstate: 'noCategory', | |
noCategory: SC.State.extend({ | |
representRoute: 'sections/:section_id', | |
enterState: function (context) { | |
var section = context.section; |
This file contains 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
MyApp.Group = SC.Record.extend({ | |
name: SC.Record.attr(String), | |
people: function () { | |
var query, | |
ret; | |
query = SC.Query.local(MyApp.Person, { | |
conditions: 'group = {self}', |
This file contains 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
// ========================================================================== | |
// Project: SproutCore | |
// Copyright: ©2012 7x7 Software, Inc. | |
// License: Licensed under MIT license | |
// ========================================================================== | |
/** | |
@class |
This file contains 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
MyApp.statechart = SC.Statechart.create({ | |
// Root state | |
rootState: SC.State.design({ | |
// Properties | |
initialSubstate: 'loggedOutState', | |
// Actions & Events |
This file contains 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
// ... | |
/** | |
A list of any attributes that are expected to be empty when the record | |
is initially loaded. | |
This property is very useful for working with partially loaded records in | |
order to efficiently bring in the full data only when necessary. | |
# What is a partially loaded record? |
NewerOlder