This file contains hidden or 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
| /* 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')); |
This file contains hidden or 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
| 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'"}); |
This file contains hidden or 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 - 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'); |
This file contains hidden or 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
| 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" />'); | |
| }, |
This file contains hidden or 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
| 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, |
This file contains hidden or 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: BB.Concept | |
| // Copyright: ©2009 My Company, Inc. | |
| // ========================================================================== | |
| /*globals BB */ | |
| /** @class | |
| (Document your Model here) |
This file contains hidden or 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
| 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 = []; |
This file contains hidden or 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: BB.listSelectionController | |
| // Copyright: ©2009 My Company, Inc. | |
| // ========================================================================== | |
| /*globals BB */ | |
| /** @class | |
| (Document Your Controller Here) |
This file contains hidden or 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
| ///////////////////////////////////////////////////// | |
| // state transformers | |
| // | |
| goStateVdatabase: function(){ | |
| if (this.activeB) this.activeB.disconnect(); | |
| this.databaseB.connect().sync(); | |
| this.activeB = this.databaseB; | |
| this.viewController.set('tabSelection', 'database'); | |
| }, |
This file contains hidden or 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
| /** | |
| * Global formatters | |
| * from display to internal representation and back | |
| * | |
| * @author Thomas Langemann | |
| */ | |
| sc_require('core'); | |
| BB.mixin({ |