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
| ORDER_DEFINITION: [ SC.T_ERROR, | |
| SC.T_UNDEFINED, | |
| SC.T_NULL, | |
| SC.T_BOOL, | |
| SC.T_NUMBER, | |
| SC.T_STRING, | |
| SC.T_ARRAY, | |
| SC.T_HASH, | |
| SC.T_OBJECT, | |
| SC.T_FUNCTION, |
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 Apple, Inc. and contributors. | |
| // License: Licened under MIT license (see license.js) | |
| // ========================================================================== | |
| /*globals module ok equals same test MyApp */ | |
| // test parsing of query string | |
| var v = []; | |
| module("SC.compare()", { |
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
| Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_6; de-de) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16 | |
| Hide passed testsCompleted 484 tests in 66935 msec. 1730 total assertions: 1651 passed 79 failed | |
| Test Result | |
| SC.compare() module: ordering should work - 93msec (26, 79, 0, 0) | |
| v[0] (null) should be smaller than v[1] (boolean), expected: -1 result: 0 FAILED | |
| v[0] (null) should be smaller than v[2] (boolean), expected: -1 result: 0 FAILED | |
| v[0] (null) should be smaller than v[3] (number), expected: -1 result: 0 FAILED | |
| v[0] (null) should be smaller than v[4] (number), expected: -1 result: 0 FAILED | |
| v[0] (null) should be smaller than v[5] (string), expected: -1 result: 0 FAILED | |
| v[0] (null) should be smaller than v[6] (string), expected: -1 result: 0 FAILED |
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
| /** | |
| Finds all storeKeys in this store | |
| and returns an array. | |
| @returns {Array} set of storeKeys | |
| */ | |
| storeKeys: function() { | |
| ret = []; | |
| if(!this.statuses) return; |
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
| _applyChangedOrder: function() { | |
| if (!this.queryKey) return; | |
| // clear cache | |
| this._records = null; | |
| // this actually sorts the store keys | |
| this.storeKeys.sort(); | |
| // setting them manually works as well | |
| //this.storeKeys = [key2, key1]; |
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) | |
| // ========================================================================== | |
| require('core') ; | |
| /** | |
| @class |
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) | |
| // ========================================================================== | |
| /** | |
| @class |
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
| SC.MyCouchdbDataSource = SC.DataSource.extend( { | |
| database: "", | |
| design: "", | |
| cancelStoreKeys: {}, | |
| fetchRequest: SC.Request.getUrl("").set('isJSON', YES), | |
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
| //descriptions: SC.RecordAttribute.create({ | |
| // toType: function(record, key, value) { | |
| // var cacheKey = '__descriptions__'+ SC.guidFor(record) ; | |
| // var query = record[cacheKey] ; | |
| // if (!query) { | |
| // query = record[cacheKey] = record.get('store').findAll(SC.Query.create({ | |
| // recordType: 'BB.Description', | |
| // conditions: "concept = %@", | |
| // parameters: [record] |
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
| // my main.js --------------------------------- | |
| 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); | |
| BB.store.dataSource.loadAllDocs(BB.store); |