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 is a little ember easyform hack to make errors display when the form is | |
# submitted | |
Ember.EasyForm.Input.reopen | |
errorsChanged: (-> | |
@set('hasFocusedOut', true) | |
@showValidationError() | |
) | |
didInsertElement: -> | |
@addObserver("context.errors.#{@property}.@each", @, 'errorsChanged') |
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
// ember-model-based adapter | |
Ember.WAMAdapter = Ember.Object.extend({ | |
table: null, | |
init: function() { | |
this.table = this.get('table'); | |
}, | |
find: function(record, id) { | |
var query = this.table.where({ id: id }); | |
return query.read().then(function(data) { |
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
// Debounced autosave for Ember.js | |
// Original code by Mitch Lloyd http://gaslight.co/blog/?author=mitchlloyd | |
// updated from http://gaslight.co/blog/an-autosave-pattern-for-ember-and-ember-data | |
// repo at https://github.com/gaslight/ember-autosaving | |
// Changed to work with latest Ember Data as of 2013-12-16 by Genkilabs | |
// Includes hooks for pacifier from http://ricostacruz.com/nprogress | |
// NOTE: This requires a 2 part install in which the controller and any models it loads have the corresponding mixin | |
// This is how long we will wait on a form before saving. I like to put this in App.AUTOSAVE_DELAY | |
var AUTOSAVE_DELAY = 1500 |
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.AccountEditRoute = Ember.Route.extend({ | |
setupController: function(controller) { | |
controller.set('content', this.get('currentUser')); | |
} | |
}); |
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
.form-group | |
label | |
| Time Zone | |
time-zone value=model.timezone |
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
(function () { | |
// Implement debounce until backburner implements a proper debounce | |
var debouncees = [], | |
pop = Array.prototype.pop; | |
var debounce = function (target, method /*, args, wait */) { | |
var self = Ember.run.backburner, | |
args = arguments, | |
wait = pop.call(args), |
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
/* global google */ | |
var GoogleMapComponent = Ember.Component.extend({ | |
places: [], | |
width: 500, | |
height: 500, | |
attributeBindings: ['style'], | |
style: function () { | |
return 'width:'+this.width+'px; height:'+this.height+'px'; |
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
<div class="control-group"> | |
<label class="control-label">Location</label> | |
<div class="controls"> | |
<input name="location" type="text" placeholder="City, State, Country" value=""> | |
<input name="location_city" type="hidden" value=""> | |
<input name="location_state" type="hidden" value=""> | |
<input name="location_country" type="hidden" value=""> | |
<input name="location_lat" type="hidden"> | |
<input name="location_lng" type="hidden"> | |
</div> |
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
// Extend Ember.Route to add support for sensible | |
// document.title integration. | |
Ember.Route.reopen({ | |
// `titleToken` can either be a static string or a function | |
// that accepts a model object and returns a string (or array | |
// of strings if there are multiple tokens). | |
titleToken: null, |
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
after "deploy:symlink", "deploy:restart_workers" | |
## | |
# Rake helper task. | |
# http://pastie.org/255489 | |
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
def run_remote_rake(rake_cmd) | |
rake_args = ENV['RAKE_ARGS'].to_s.split(',') | |
cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}" |
OlderNewer