Skip to content

Instantly share code, notes, and snippets.

new Ajax.request(YOUR_URL_HERE, {
method: 'get',
onSuccess: function(response) {
new S2.UI.Autocompleter('autocompleter2', {
choices: response.responseJSON.map(function(o) { return o.client }),
choiceAttribute: 'name',
listTemplate: new Template('#{text} <em>(#{object.login})</em>')
},
onFailure: function(response) {
// Handle failure here
DEPRECATION WARNING: Object#returning has been deprecated in favor of Object#tap. (called from root_path at (eval):4)
ActionView::TemplateError (wrong number of arguments (0 for 1)) on line #1 of app/views/public/index.html.erb:
1: <%= root_path %>
vendor/gems/routing-filter-0.1.6/lib/routing_filter/filters/locale.rb:55:in `around_generate'
vendor/gems/routing-filter-0.1.6/lib/routing_filter/filter.rb:11:in `run'
vendor/gems/routing-filter-0.1.6/lib/routing_filter/chain.rb:9:in `run'
(eval):4:in `block in root_path'
(eval):4:in `root_path'
// can be used on windows#resize, after personal resizing, ...
$('hcarousel').fire('carousel:updateSize');
var handler = $('content').on('click', function(event) {
console.log('ok');
handler.stop();
});
new Ajax.Request('http://github.com/api/v2/json/repos/show/madrobby/scripty2/contributors', {
method: 'get',
onSuccess: function(response) { console.log(response.responseJSON) }
});
var vCarousel = new S2.UI.Carousel("vcarousel", {orientation: 'vertical', cycle: 'loop'});
new PeriodicalExecuter(function(pe) { vCarousel.scrollNext(); }, 3);
var hCarousel = new S2.UI.Carousel("hcarousel", {cycle: 'loop'});
new PeriodicalExecuter(function(pe) { hCarousel.scrollNext(); }, 3);
S2.enableMultitouchSupport = true;
new S2.UI.Carousel("vcarousel", {flick: true, orientation: 'vertical'});
S2.enableMultitouchSupport = true;
new S2.UI.Carousel("hcarousel", {flick: true});
S2.enableMultitouchSupport = true;
new S2.UI.Carousel("vcarousel", {swipe: true, orientation: 'vertical'});