Skip to content

Instantly share code, notes, and snippets.

View johanvalcoog's full-sized avatar

Johan Valcoog johanvalcoog

  • PuurApps
  • Sweden
View GitHub Profile
@johanvalcoog
johanvalcoog / swipe.css
Created January 7, 2012 17:17 — forked from ppcano/swipe.css
Ember SwipeView for mobile devices based on SwipeView's approach of @cubiq
.swipe_item {
position: absolute;
-webkit-transform: translateZ(0);
top: 0px;
height: 100%;
width: 100%;
}
.swipe_slider {
position: relative;
CliffDetector.stateManager = Ember.StateManager.create
rootElement: $("div[data-role=content]")
map: Ember.ViewState.create
view: CliffDetector.MapView.create()
enter: (stateManager) ->
@_super(stateManager)
console.log "hello"
var State = Ember.State.extend({});
var ViewState = Ember.ViewState.extend({});
App.statechart = Ember.StateManager.create({
loggedOut: ViewState.create({}),
loggingIn: ViewState.create({}),
loggedIn: State.create({
appLoadFailed: ViewState.create({}),
appLoading: ViewState.create({}),
appLoaded: State.create({
@johanvalcoog
johanvalcoog / gist:1590662
Created January 10, 2012 19:27 — forked from joewest/gist:1483578
ember.js concurrent substates?
var State = Ember.State.extend({});
var ViewState = Ember.ViewState.extend({});
// existing
App.statechart = Ember.StateManager.create({
loggedOut: ViewState.create({}),
loggingIn: ViewState.create({}),
loggedIn: Ember.StateManager.create({
appLoadFailed: ViewState.create({}),
appLoading: ViewState.create({}),
@johanvalcoog
johanvalcoog / gist:1590665
Created January 10, 2012 19:28 — forked from joewest/gist:1483543
ember.js test that all enter/exit states trigger when dealing with nested StateManagers
module("Ember.StateManager - nested StateManagers", {
setup: function() {
var State = Ember.State.extend(stateEventStub);
stateManager = Ember.StateManager.create(stateEventStub, {
grandparentA: State.create({
parent: Ember.StateManager.create(stateEventStub, {
child: State.create(),
sibling: State.create()
}),
@johanvalcoog
johanvalcoog / clickable_view.js
Created January 10, 2012 19:28 — forked from joewest/clickable_view.js
ember.js misc View stuff
App.ClickableView = Ember.View.extend({
click: function(evt) {
console.log("ClickableView was clicked!");
}
});
@johanvalcoog
johanvalcoog / app.js
Created January 10, 2012 19:29 — forked from joewest/app.js
ember.js login form
App = Ember.Application.create({});
App.loginController = Ember.Object.create({
// do login stuff
});
App.LoginFormView = Ember.View.extend({
login: null,
password: null,
@johanvalcoog
johanvalcoog / animatable_view.js
Created January 11, 2012 18:09 — forked from ppcano/animatable_view.js
Control Animations on Ember Views
AnimatableView = Ember.ContainerView.extend(Em.Animatable,{
executeAnimation: function() {
.......
this.animate({duration: that.duration, stopEventHandling:true}, function() {
# perform animations based on your JS choices
move('#'+id)
.x(translatePosition)
@johanvalcoog
johanvalcoog / app
Created January 11, 2012 20:16 — forked from zackdouglas/app
Test = SC.Application.create({ NAMESPACE: 'Test', VERSION: '0.1.0', store: SC.Store.create().from(SC.Record.fixtures) }) ;
Test.Top = SC.Record.extend({
middles: SC.Record.toMany(
SC.Record.extend({
bottoms: SC.Record.toMany(
SC.Record,
{
isNested: YES,
isMaster: NO
@johanvalcoog
johanvalcoog / carousel_view.js
Created January 13, 2012 19:27 — forked from ppcano/carousel_view.js
Ember Touch ScrollView without iScroll, and using movejs for transfomations.