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
| var matchersForFilter = function(properties) { | |
| var attributes = util.keys(properties); | |
| var attributesFilters = util.values(properties); | |
| var arrayOfMatchersForAttribute = util.map( | |
| util.zip(attributes, attributesFilters), matchersForAttribute | |
| ); | |
| var matchers = util.flatten(arrayOfMatchersForAttribute, true); | |
| return matchers; |
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
| var matchersForFilter = function(properties) { | |
| var attributes = util.keys(properties); | |
| var attributesFilters = util.values(properties); | |
| var arrayOfMatchersForAttribute = util.map(util.zip(attributes, | |
| attributesFilters), | |
| matchersForAttribute); | |
| var matchers = util.flatten(arrayOfMatchersForAttribute, true); | |
| return matchers; |
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
| myRestrictedProp: function(key, value) { | |
| myAllowedValues = ['here', 'there']; | |
| if (value !== undefined) { | |
| if (myAllowedValues.indexOf(value) === -1) { | |
| throw "You tried to set a value that isn't allowed! " + value; | |
| } else { | |
| this._myRestrictedProp = value; | |
| } | |
| } |
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-2011 Strobe Inc. and contributors. | |
| // Portions ©2008-2011 Apple Inc. All rights reserved. | |
| // License: Licensed under MIT license (see license.js) | |
| // ========================================================================== | |
| var get = SC.get, set = SC.set, getPath = SC.getPath; | |
| /** |
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
| MyApp.someController = SC.Object.create({ | |
| nowShowing: "index" | |
| }); |
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
| MyApp.Application = SC.Record.extend({ | |
| assignments: function() { | |
| var data = this._data_assignments, | |
| id = this.get('id'), query; | |
| if (!data && id) { | |
| query = SC.Query.local(MyApp.Assignment, 'application = {application}', {application: this}); | |
| data = this._data_assignments = MyApp.get('store').find(query); | |
| } |
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-2011 Strobe Inc. and contributors. | |
| // Portions ©2008-2011 Apple Inc. All rights reserved. | |
| // License: Licensed under MIT license (see license.js) | |
| // ========================================================================== | |
| var get = SC.get, set = SC.set, getPath = SC.getPath; | |
| /** |
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
| Authoring = SC.Application.create( | |
| store: SC.Store.create().from(SC.Record.fixtures) | |
| }) ; |
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
| var data = MyApp.store.find([Scm.Product, Scm.Taxon]); | |
| data.addObserver('status', this, function observer() { | |
| if (data.get('status') === SC.Record.READY_CLEAN) { | |
| data.removeObserer('status', this, observer); | |
| var products = data.find(SC.Query.local(Scm.Product)); | |
| var taxons = data.find(SC.Query.local(Scm.Taxon)); | |
| } | |
| }); |
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 Handlebar Views | |
| // Copyright: ©2011 Strobe Inc. and contributors. | |
| // License: Licensed under MIT license (see license.js) | |
| // ========================================================================== | |
| var get = SC.get, set = SC.set; | |
| SC.SelectOption = SC.View.extend({ |
NewerOlder