Skip to content

Instantly share code, notes, and snippets.

Proposed View-layer changes

Friday, Juan, Tom, Yehuda and I had a meeting where we discussed the renderer APIs and some ideas we had for the view layer. Here is what we came up with:

Overview

The purpose of these proposed changes is to lower the learning curve for users entering the SproutCore world and who are looking for quick feedback and an easy way to create custom views

config :all,
:combine_javascript =>false,
:combine_stylesheets =>true,
:minify_javascript =>false,
:minify_css =>false,
:required => [:sproutcore, 'flot']
proxy '/blah.php', :to => 'subdomain.domain.com', :url => '/path/to/phpfile'
# ===========================================================================
# Project: RaphaelPlay
# Copyright: ©2010 My Company, Inc.
# ===========================================================================
config :raphaelplay, :required => [:sproutcore, :raphael]
config :test_controls, :required => [:sproutcore, "sproutcore/forms", "sproutcore/animation"], :theme => "sproutcore/ace"
config :phone_controls, :required => [:sproutcore, "sproutcore/forms", "sproutcore/animation"], :theme => "sproutcore/ace"
MyApp.graphController = SC.ArrayController.create(
/** @scope MyApp.graphController.prototype */ {
content: [
SC.Object.create({label: 'set1', data:[[0,0]]}) ,
SC.Object.create({label: 'set2', data:[[0,0]]})
] ,
options: SC.Object.create({}) ,
checkArrangedObjects: function(){
MyApp.graphController = SC.ArrayController.create(
/** @scope MyApp.graphController.prototype */ {
content: [
SC.Object.create({label: 'set1', data:[[0,0]]}) ,
SC.Object.create({label: 'set2', data:[[0,0]]})
] ,
options: SC.Object.create({}) ,
// ==========================================================================
// Project: Dialog.SplitView
// Copyright: ©2010 My Company, Inc.
// ==========================================================================
/*globals Dialog */
/** @class
(Document Your View Here)
@ialexi
ialexi / view.js
Created March 29, 2010 16:48 — forked from rebo/gist:348079
nameValue: SC.LabelView.design({
layout: {
top: 30,
left: 125,
height: 24,
width: 200
},
valueBinding: "Training.operativesController.selection",
valueBindingDefault: SC.Binding.single() // when bindings are formed, it will use single() binding, which gets first object
@ialexi
ialexi / gist:302159
Created February 12, 2010 00:31 — forked from ncrohn/gist:302158
SC.View.design(SC.Animatable, {
layout: { top: 20+(25*i), right: 0, left: 20, height: 25 },
transitions: {
height: { duration: .25, timing: SC.Animatable.TRANSITION_EASE_IN_OUT }
}
//--- more code ---
//--- in render method ---
@ialexi
ialexi / foo.css
Created January 6, 2010 03:53 — forked from sproutit/foo.css
// theme specified in an argument to builder
// becomes .sc-view.sc-button-view.ace.light
@view(sc-button-view) {
border: none;
padding: none;
}
// becomes .sc-view.sc-button-view.ace.light .left
@view(sc-button-view) .left {
// ==========================================================================
// Project: Dictionary.Word Fixtures
// Copyright: ©2009 My Company, Inc.
// ==========================================================================
/*globals Dictionary */
sc_require('models/word');
Dictionary.Word.FIXTURES = [
{ guid: 1,