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
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> | |
<title>Terrain Demo - PlayfulJS</title> | |
</head> | |
<body style='background: #000'> | |
<canvas id='display' width='1' height='1' /> | |
<script> |
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
// fdee_new_form.js | |
class FDEENewForm { | |
constructor(formSelector, inputSelector) { | |
this.$form = $(formSelector); | |
this.$form.on('ajax:beforeSend', this.$form.isValid /*(_xhr, _settings)*/) | |
.on('ajax:success', (_data, status, _xhr) => window.location = status.link) | |
.on('ajax:error', (_xhr, status, _error) => { | |
$.each(status.responseJSON, (field, messages) => { | |
FDE.Form.showError($(`input${inputSelector}_${field}`, this.$form), messages); | |
}); |
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
// = require common | |
FDE.DrugClass.NewDrugClass = { | |
_selectors: { | |
submit: '.submit', | |
form: '#new_drug_class', | |
model: 'drug_class' | |
}, | |
add() { |
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
; | |
if (!FDE) { | |
let FDE = {}; | |
} | |
FDE.Manufacturer = { | |
formSelector: '.manufacturer-form', | |
_handleErrors(_event, data, _error, _status) { | |
$.each(data.responseJSON, function(field, message) { |
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
function sortNum(clickedIndex, sortDir) { | |
return function(x, y) { | |
const xVal = parseFloat(cellValue(x, clickedIndex)), | |
yVal = parseFloat(cellValue(y, clickedIndex)); | |
return (xVal - yVal) * sortDir; | |
} | |
} | |
function sortString(clickedIndex, sortDir) { // sort rows | |
return function(x, y) { |
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
'use strict'; | |
const fs = require('fs'); | |
const webpack = require('webpack'); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
const DRGBootstrapSASSPlugin = require('drg-bootstrap-sass'); | |
const prod = process.argv.indexOf('-p') !== -1; | |
const CSS_OUTPUT_TEMPLATE = prod ? 'app/assets/stylesheets/[name]-[hash].css' : 'stylesheets/[name].css'; | |
const JS_OUTPUT_TEMPLATE = prod ? 'app/assets/javascripts/[name]-[hash].js' : 'javascripts/[name].js'; |
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
arr: [[]], | |
lastAttrUpdate: 0, | |
didUpdateAttrs() { | |
this._super(); | |
this.set('lastAttrUpdate', performance.now()); | |
}, | |
didRender() { |
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
didInsertElement() { | |
this._super(...arguments); | |
this.changeColor(); | |
this.get('eventedObject').on('default', function() { | |
this.changeColor(); | |
}.bind(this)); | |
}, |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
arr: [ | |
{ id: 3, name: 'a' }, | |
{ id: 1, name: 'b' }, | |
{ id: 2, name: 'c' } | |
], | |
filterKey: 'name', | |
filterValue: 'c', |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
actions: { | |
noop: function() {} | |
} | |
}); |