This file contains 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
Nav.testArray = []; | |
Nav.TestItem = SC.StaticContentView.extend({}); | |
Nav.mainPage = SC.Page.design({ | |
add: function() { | |
Nav.testArray.insertAt(Nav.testArray.length, 'some content some content some content some content some content some content'); | |
} | |
childViews: [ | |
SC.ScrollView.design({ | |
layout: {top: 60, left: 10, width: 200, height: 300}, |
This file contains 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
/* | |
This example shows how to use SC.StackedView with complex items. | |
The item view (List.ItemView) must use SC.StaticLayout mixin and | |
set useStaticLayout to YES -- that's a requirement of SC.StackedView. | |
Note that children views of List.ItemView also need to add SC.StaticLayout | |
and set useStaticLayout to YES. This setting doesn't preclude positioning | |
of child views within its block, by using layout's "left", "width" | |
*/ |
This file contains 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
/** | |
* Profile view | |
*/ | |
Nav.ProfileView = SC.View.extend(SC.Animatable, { | |
classNames: 'profile-view'.w(), | |
// initially positioned off screen | |
transitions: { | |
left: { duration: .2, timing: SC.Animatable.TRANSITION_EASE_OUT } // with timing curve | |
}, |
This file contains 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
Below, the path /Users/alexis/workspace/donomo.trunk/inzen/nav contains a SC project | |
Installed abbot from gem, SC is from quilmes | |
See abbot error at the end of the output | |
/Users/alexis/workspace/donomo.trunk/inzen/nav# /usr/bin/sc-build --build app --verbose | |
INFO ~ Loaded project at: /Users/alexis/workspace/donomo.trunk/inzen/nav | |
INFO ~ Building targets: /sproutcore/documentation,/sproutcore/datejs,/sproutcore/testing,/sproutcore/tests,/sproutcore/desktop,/sproutcore/test_controls,/nav,/sproutcore/bootstrap,/sproutcore/debug,/sproutcore/table,/sproutcore/docs,/sproutcore/media,/sproutcore/jquery,/nav/src,/sproutcore/runtime,/sproutcore/standard_theme,/sproutcore/mobile,/sproutcore/welcome,/signup,/sproutcore/foundation,/sproutcore/empty_theme,/sproutcore/forms,/sproutcore/greenhouse,/sproutcore/designer,/sproutcore/datastore,/sproutcore/iphone_theme,/sproutcore/ace,/sproutcore/animation,/sproutcore/mini,/sproutcore,/sproutcore/core_tools,/sproutcore/statechart |
This file contains 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
App.ObjectsController = SC.ArrayController.extend({ | |
/** | |
* Pseudo-synchronous API to handle all objects of a given type. | |
* | |
* This API in intended to hide the asynchronous nature of retrieving | |
* records by providing a callback to be called when the data in available. | |
* | |
* Example usage: | |
* App.MyModel.objects().all(function(obj) {console.log(obj);)); |
This file contains 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
from django.middleware import locale | |
from django.utils import translation | |
class QueryParameterLocaleMiddleware(locale.LocaleMiddleware): | |
""" | |
Django's LocaleMiddleware picks the locale setting of the request from | |
multiple sources such as a cookie, Accept-Language header and server-side | |
session. | |
This middleware adds one more way to specify the language by supplying |
This file contains 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
App.contactsState = SC.Responder.create( { | |
didBecomeFirstResponder : function() { | |
var records = App.store.find(App.contactsQuery); | |
App.contactsController.set('content', records); | |
} | |
}); |
This file contains 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
view = App.ContactsView.design({ | |
contentBinding : 'App.contactsController.arrangedObjects' | |
}); |
This file contains 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
onClickSendMessageToFavoriteContacts: function() { | |
var favoriteContacts = App.store.find(App.favoriteContactsQuery); | |
favoriteContacts.forEach(function(contact) { | |
App.sendSomeMessage(contact); | |
}); | |
} |
This file contains 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
App.Contact.objects().filter({varotite: YES}, | |
function(contacts) { | |
sendMessage(contacts); | |
} | |
); |
OlderNewer