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
<% if(Taxon.easy_accessors.blank?) %> | |
<%= f.field_container :name do %> | |
<%= f.label :name, t("name") %> <span class="required">*</span><br /> | |
<%= error_message_on :taxon, :name, :class => 'fullwidth title' %> | |
<%= text_field :taxon, :name %> | |
<% end %> | |
<% else %> | |
<%- Taxon.easy_accessors.each do |locale| %> | |
<% fieldsym = "name_#{locale}".to_sym %> |
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
<% if(Taxonomy.easy_accessors.blank?) %> | |
<%= f.field_container :name do %> | |
<%= f.label :name, t("name") %> <span class="required">*</span><br /> | |
<%= error_message_on :taxonomy, :name, :class => 'fullwidth title' %> | |
<%= text_field :taxonomy, :name %> | |
<% end %> | |
<% else %> | |
<%- Taxonomy.easy_accessors.each do |locale| %> | |
<% fieldsym = "name_#{locale}".to_sym %> |
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
// disable overscroll when top/bottom body egde reached on Safari | |
// bounce scrolling is still working after touch event compleated | |
var touchEvent; | |
document.body.addEventListener('touchstart', function(e) { | |
touchEvent = e; | |
} | |
document.body.addEventListener('touchmove', function(e) { | |
if ((e.originalEvent.pageY > touchEvent.originalEvent.pageY && this.scrollTop === 0) || | |
(e.originalEvent.pageY < touchEvent.originalEvent.pageY && this.scrollTop + this.offsetHeight >= this.scrollHeight)) { |
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
(def app-history (atom [@app-state])) | |
(add-watch app-state :history | |
(fn [_ _ _ n] | |
(when-not (= (last @app-history) n) | |
(swap! app-history conj n)) | |
(aset js/window "undo" | |
(fn [e] | |
(when (> (count @app-history) 1) |
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
<Route name="root" path="/" handler={App}> | |
<Route name="inbox" handler={Inbox}> | |
<Route name="message" path=":messageId" handler={Message}/> | |
<DefaultRoute handler={InboxStats}/> | |
</Route> | |
</Route> |
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 Wrapper extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { handler: null }; | |
} | |
componentDidMount() { | |
Router.run(routes, this.handleNavigation.bind(this)); | |
} | |
handleNavigation(Handler, state) { | |
this.setState({ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link href="style.css" rel="stylesheet"/> | |
</head> | |
<body> | |
<label for="overlay">open</label> | |
<input type="checkbox" id="overlay"> | |
<div class="overlay"> | |
<div class="content"> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link href="style.css" rel="stylesheet"/> | |
</head> | |
<body> | |
<label for="overlay">open</label> | |
<input type="checkbox" id="overlay"> | |
<div class="overlay"> | |
<div class="content"> |
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* files() { | |
var results = []; | |
for (var k = 0; k < files.length; ++k) | |
results.push(yield files[k]); | |
return results; | |
} | |
var iterator = files(); | |
function process(iterator, sendValue) { | |
var fileTask = iterator.next(sendValue); |
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 C { | |
constructor() { | |
this.c = new Set(); | |
} | |
add(x) { | |
this.c.add(x); | |
} | |
[Symbol.iterator]() { | |
return this.c[Symbol.iterator](); | |
} |
OlderNewer