Skip to content

Instantly share code, notes, and snippets.

/* private methods */
_addConcept: function() {
var concept, description;
concept = this.store.createRecord(BB.Concept,
{_id: "@id%@".fmt(SC.Store.generateStoreKey())}
);
concept.set('user', BB.userController);
concept.set('date', new Date());
store.commitRecord(BB.Concept, concept.get('_id'));
BB.main = function main() {
var usersQuery = SC.Query.create({recordType: BB.User});
BB.set('usersQuery', usersQuery);
var users = BB.store.findAll(BB.get('usersQuery'));
BB.set('users', users);
var conceptsQuery = SC.Query.create({
recordType: BB.Concept,
conditions: "type = 'BB.Concept'"});
// ==========================================================================
// Project: SproutCore - JavaScript Application Framework
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
// Portions ©2008-2009 Apple, Inc. All rights reserved.
// License: Licened under MIT license (see license.js)
// ==========================================================================
//Set these require statements if put into frameworks/datastore/models:
//sc_require('models/record');
//sc_require('models/record_attribute');
contentView: SC.ListView.design({
listItemActionProperty: 'action',
contentValueKey: "title",
contentBinding: "BB.associationListController.arrangedObjects",
exampleView: SC.ListItemView.extend({
renderAction: function(context, actionClassName){
context.push('<img src="',
SC.BLANK_IMAGE_URL,
'" class="action sc-mini-icon plus" />');
},
contentView: SC.ListView.design({
listItemActionProperty: 'actionClassName',
contentValueKey: "title",
contentBinding: "BB.associationListController.arrangedObjects",
//isEditable: YES,
//canReorderContent: YES,
exampleView: SC.ListItemView.extend({
renderAction: function(context, actionClassName){
context.push('<img src="',
SC.BLANK_IMAGE_URL,
// ==========================================================================
// Project: BB.Concept
// Copyright: ©2009 My Company, Inc.
// ==========================================================================
/*globals BB */
/** @class
(Document your Model here)
activeUnits: function(){
console.log('activeUnits');
var us = this.get('units');
if (us == this.previousUnits) return this.previousActiveUnits;
this.previousUnits = us;
var l = us.get('length');
var list = [];
// ==========================================================================
// Project: BB.listSelectionController
// Copyright: ©2009 My Company, Inc.
// ==========================================================================
/*globals BB */
/** @class
(Document Your Controller Here)
/////////////////////////////////////////////////////
// state transformers
//
goStateVdatabase: function(){
if (this.activeB) this.activeB.disconnect();
this.databaseB.connect().sync();
this.activeB = this.databaseB;
this.viewController.set('tabSelection', 'database');
},
/**
* Global formatters
* from display to internal representation and back
*
* @author Thomas Langemann
*/
sc_require('core');
BB.mixin({