Skip to content

Instantly share code, notes, and snippets.

View charlesjolley's full-sized avatar

Charles Jolley charlesjolley

View GitHub Profile
myview = SC.SlideshowView.extend({
content: 'url1 url2 url3'.w(),
exampelView: SC.ImageView,
transition: SC.KenBurnsTransition
});
var query = SC.Query.local(MyApp.Record);
var data = MyApp.store.find(query);
// old way
var f = function() {
if (data.get('status') & SC.Record.READY) {
data.removeObserver('status', this, f);
// ...
}
};
var myContact = SC.Object.create({
firstName: 'John',
lastName: 'Doe',
fullName: function() {
return this.getEach('firstName', 'lastName').join(' ');
}.property('firstName', 'lastName').cacheable(),
fullNameDidChange: function() {
/**
An Accessory is an embeddable mini-application. It can have its own set of controllers,
states, and views. Accessories are useful pattern for building independent, reusable plugins
inside of your application.
*/
SC.Accessory = SC.Object.extend({
/**
This should point to the main application object to give the accessory some context.
contact = HandlebarsView.create({
template: "<h1>{firstName} {lastName}</h1><br><h2>{emailAddress}</h2>"
});
--
// AUTOMATICALLY observes properties referenced in the template
contact.set('firstName', 'John');
var queue = [];
var scripts ={};
function loadIt(scriptname) {
queue.push(scriptname);
if (!scripts[scriptname]) {
var el = document.createElement('script');
el.src = scriptname;
document.head.appendElement(el);
PATH
remote: .
specs:
sproutcore (1.4.0.rc)
erubis (>= 2.6.2)
extlib (>= 0.9.9)
json_pure (>= 1.1.0)
rack (>= 0.9.1)
thin (~> 1.2.7)
thor (>= 0.11.7)
childViews: ['labelView', 'hintView'],
labelView: SC.LabelView.design({
valueBinding: '.parentView*content.value',
isEditable: '.parentView*content.given',
// NOTE: all methods should normally be in a subclass, not in the design
click: function(evt) {
return this.touchStart(evt);
@charlesjolley
charlesjolley / tryme.js
Created October 26, 2010 19:39
Renderers Middle Ground?
// RenderDelegates are a part of jQuery so they are reusable.
var del = SC.RenderDelegate.extend({
enable: function(flag) {
this.setClass('enabled', YES); // used buffered jQuery to build up changes
},
active: function(flag) {
this.setClass('active', YES);
}
@charlesjolley
charlesjolley / foo.md
Created November 4, 2010 23:22
Simple App for Strobe

Big Idea

Pushing an app to strobe requires you meet just a few basic requirements:

  1. You must have an index.html file at the root directory and a 'static' directory with static assets you want hosted on the CDN
  2. For an app manifest, the file should be called *.manifest and should live next to the index.html file.
  3. For localizations, add a language folder with an index.html inside it at the root level. If you use an app manifest, place it in the language folder next to the index.html. Localized static assets should appear in the static directory inside a language folder
  4. You should also have a deploy.json at the root level where you can state deployment options.

Note that when we deploy, we will look for a tag in your index.html and rewrite it to put the static assets on theCDN. If you do not include a base tag one will be added for you just inside the