Skip to content

Instantly share code, notes, and snippets.

View endash's full-sized avatar

Christopher Swasey endash

View GitHub Profile
sessionLength: function(key, value) {
if(value !== undefined) {
this.writeAttribute('sessionLength', value)
} else {
var sl = this.readAttribute('sessionLength') ;
if(sl > 0)
return sl;
return '0';
}
@endash
endash / gist:6845
Created August 22, 2008 19:48 — forked from anonymous/gist:6844
require('core');
// objects are created by passing an object literal to the create() method
//
// Ofapisurfer.mainController = SC.Object.create({}) ;
// is the same as
// var obj = {}
// Ofapisurfer.mainController = SC.object.create(obj);
//
>>> Editor.Page.find(1)['_page@102']
SC.Collection:@127 conditions=Object _bindings=[0] _observers=[0]
>>> Editor.Page.find(2)['_page@102']
SC.Collection:@128 conditions=Object _bindings=[0] _observers=[0]
>>> $I(Editor.Page.find(1)['_page@102'].conditions)
"#<Hash:{'page': Editor.Page({ guid=2 })}>"
>>> $I(Editor.Page.find(2)['_page@102'].conditions)
@implementation MyCustomView : SCView
{
}
- (void)createChildViews
{
[self createChildViewWithClass: [self classFor: 'Label']]
[[self operatingView] addBinding: [[self content] pathFor: 'Subject'] forKey: 'title']
[[self operatingView] setLayout: [self translateFromFrame: [self Frame] byX: 5 andByY: 10]]
[self appendView: [self operatingView]]
selectionDidChange: function()
{
if (this.changeTimer)
this.changeTimer.destroy();
this.changeTimer = SC.Timer.schedule({
target: 'this',
action: 'getSelectionData',
interval: 500,
until: Time.now() + 500
.
./.DS_Store
./.git
./.git/branches
./.git/COMMIT_EDITMSG
./.git/config
./.git/description
./.git/HEAD
./.git/hooks
./.git/hooks/applypatch-msg.sample
Rapid.itemController = SC.ObjectController.create({
//set your item .set('content', item)
});
------------------------------------------------------------------------------------
progressView: Rapid.ProgressView.design({
layout: {centerX:0, centerY:0, height:150, width:150, border:0},
isVisibleBinding: SC.Binding.from('Rapid.itemController*status').transform(function(value) {
return !!(value & SC.Record.BUSY);
})
})
{
"name": "bpmtest",
"bpm": "1.0.0",
"bpm:build": {
"bpm_libs.js": {
"directories": [
"lib"
]
},
"bpm_styles.css": {
spade.register("sproutcore", {"name":"sproutcore","description":"SproutCore - JavaScript Application Framework","summary":"SproutCore - JavaScript Application Framework","homepage":"http://github.com/sproutcore/sproutcore20","author":"Charles Jolley","version":"2.0.beta.2","dependencies":{"spade":"~> 1.0.0","sproutcore-runtime":"2.0.beta.2","sproutcore-views":"2.0.beta.2","sproutcore-datastore":"2.0.beta.2","sproutcore-handlebars":"2.0.beta.2"},"directories":{"lib":"lib"},"bpm:build":{"bpm_libs.js":{"directories":["lib"],"modes":"*"}},"bpm:formats":{"handlebars":"sproutcore-handlebars/handlebars-format"}});
spade.register("sproutcore/main", function(require, exports, __module, ARGV, ENV, __filename){
// ==========================================================================
// Project: bpmtest
// Copyright: ©2011 My Company Inc. All rights reserved.
// ==========================================================================
// TODO: Your app code goes here
spade.require('sproutcore');
var Lists = SC.Application.create({