testem.json
{
"framework": "qunit",
"cwd": "dist",
"test_page": "tests/index.html",
}
model Rating < ActiveRecord::Base | |
VALUES = { 0 => 'Worst', 1 => 'Good', 2 => 'Best' } | |
validate :value, :in => VALUES.keys | |
end |
App.collectionController = Em.ArrayProxy.create(Ember.PaginationSupport, { | |
content: [], | |
fullContent: App.store.findAll(App.Job), | |
totalBinding: 'fullContent.length', | |
didRequestRange: function(rangeStart, rangeStop) { | |
var content = this.get('fullContent').slice(rangeStart, rangeStop); | |
this.replace(0, this.get('length'), content); | |
} | |
}); |
jQuery.fn.spin = (opts) -> | |
if opts != false | |
opts = | |
className: 'js-spinner' | |
lines: 13 | |
length: 5 | |
width: 3 | |
radius: 7 | |
speed: 1.2 | |
trail: 50 |
var get = Ember.get; | |
/** | |
* @extends Ember.Mixin | |
* | |
* Implements common filter / sort / pagination behavior for array controllers | |
* */ | |
Ember.FilterSortSliceMixin = Ember.Mixin.create({ | |
filterBy: '', |
PersonApp = Ember.Application.create(); | |
PersonApp.SearchField = Ember.TextField.extend({ | |
keyUp: function(e) { | |
var search = this.get('value'); | |
this.get('controller.target').send('searchUsers', {match:search}); | |
} | |
}); | |
PersonApp.PersonView = Ember.View.extend({ | |
templateName: 'person', |
<?php | |
/** | |
* @file | |
* The router.php for clean-urls when use PHP 5.4.0 built in webserver. | |
* | |
* Usage: | |
* | |
* php -S localhost:3000 .htrouter.php | |
* | |
*/ |
// just the assignments app, when server does routing | |
render(<AssignmentsApp params={SERVER_PARAMS}/>, el) | |
// just the courses app, same AssignmentsApp when server routed | |
render(( | |
<Router> | |
<Route path={SERVER_BASE_URL} component={CoursesApp}> | |
<IndexRoute component={CourseDashboardApp}> | |
<Route path="assignments" component={AssignmentsApp}> | |
</Route> |
import React, { Component } from 'react' | |
import logo from './logo.svg' | |
import './App.css' | |
import { Route, Link, Redirect } from './Zero' | |
const paths = [ 'one', 'two', 'three' ] | |
class App extends Component { | |
render() { |
/* | |
// Usage: | |
gulp.task('docs', function(cb) { | |
gulp.src('path/to/your/src') | |
.pipe(hologram(cb)); | |
}); | |
*/ | |
var gulp = require('gulp'), | |
notify = require('gulp-notify'), |