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
### | |
Multi-item carousel. | |
Written by Kevin Whitaker | |
Apply to a div to create a carousel out of a contained UL. | |
Animation is handled by CSS. | |
HTML structure looks like this: | |
<div id="#some-id"> | |
<div class="carousel-wrap"> | |
<ul class="carousel-list"> |
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
# Use superagent's standard plugin architecture: | |
# superagent.get('/some/url').use(agentInterceptor).end(function(res){...}); | |
agentInterceptor = (res) -> | |
Request = superagent.Request | |
oldCb = Request.prototype.callback | |
Request.prototype.callback = (err, r) -> | |
switch r.status | |
when 404 | |
some404Func() |
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
export function createCharacter(char) { | |
return dispatch => { | |
dispatch(submitCharacter(char)); | |
return request.post('/new-character') | |
.send(JSON.stringify(char)) | |
.then((response) => { | |
dispatch(routeToNewCharacter(response.body.id)); | |
}, (error) => { | |
dispatch(receiveCharError(error.message)); | |
}); |
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
ids | |
Selectors should not contain IDs. | |
adjoining-classes | |
Don't use adjoining classes. | |
import | |
Don't use @import, use <link> instead. | |
box-sizing |
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
class window.PlacementFiltersView extends Backbone.View | |
el: "#placements form#filters" | |
initialize: -> | |
currentView = @ | |
# Create a hash of labels for the filter type-aheads | |
@filterLabels = [] | |
jQuery(@el).find('.filter-top-level option').each -> | |
if jQuery(@).val() isnt '' |
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
var adjustForParentOffsetAndScroll = function(xy, el) { | |
var offsetParent = null, result = xy; | |
if (el.tagName.toLowerCase() === "svg" && el.parentNode) { | |
offsetParent = el.parentNode; | |
} | |
else if (el.offsetParent) { | |
offsetParent = el.offsetParent; | |
} | |
if (offsetParent != 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
license: gpl-3.0 |
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
const config = Object.assign({}, require(`./webpack.${process.env.NODE_ENV}`), pkgOpts) | |
config.entry.push(`${pkg}/build/init`) | |
config.output.filename = `${pkg}.js` | |
config.plugins.push( | |
new HtmlWebpackPlugin({ | |
favicon: 'src/favicon.ico', | |
title: pkgOpts.name || 'Needs a name', | |
}) | |
) | |
const compiler = webpack(config) |
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
module Story exposing (Model, init, view) | |
import Html exposing (Html, span, text) | |
type alias Model = | |
{ id : Int | |
, title: String | |
} | |
init : Int -> String -> Model |
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
export const UPDATE_RANGE = 'discovery/dashboard/timeline/UPDATE_RANGE' | |
export const UPDATE_RESOLUTION = 'discovery/dashboard/timeline/UPDATE_RESOLUTION' | |
export const UPDATE_LENS = 'discovery/dashboard/timeline/UPDATE_LENS' | |
const setRange = (range: ITimeRange) => (widgetState: TimelineWidgetState): TimelineWidgetState => assoc('range', range, widgetState) | |
const setResolution = (resolution: TimelineResolution) => (widgetState: TimelineWidgetState): TimelineWidgetState => assoc('resolution', resolution, widgetState) | |
const setNavItems = (navItems: TimelineNav) => (widgetState: TimelineWidgetState): TimelineWidgetState => assoc('navItems', navItems, widgetState) | |
export const TimelineContainer = Object.assign({}, GenericItem, { | |
updateNavItems: (id: IdKey, navItems: TimelineNav, iterable: Iter<TimelineWidgetState>) => GenericItem.adjust(id, setNavItems(navItems), iterable), |
OlderNewer