Skip to content

Instantly share code, notes, and snippets.

@kron4eg
Forked from vitaliel/snippets_rjs.rb
Created February 12, 2009 12:23
Show Gist options
  • Save kron4eg/62598 to your computer and use it in GitHub Desktop.
Save kron4eg/62598 to your computer and use it in GitHub Desktop.
link_to_remote("Post a comment", :update => "wiki-comment-form", :url => {:action => "show_add_comment", :id => @space, :wiki_id => @wiki_version},
:before => visual_effect(:appear, "load_dots", :queue => 'end'),
:complete => visual_effect(:fade, "load_dots") + visual_effect(:fade, 'flows-w') + visual_effect(:appear, 'wiki-comment-form', :queue => 'end'))
encodeURIComponent(location.href)
Form.getInputs(form, 'radio', name).each(function(input) {
if (input.value == value) {
input.checked = true
}
});
page.visual_effect(:highlight, "messages", :duration => 3)
page.replace_html('messages', '<p>Changes published</p>')
page[:alert_msg].replace_html @message
page[:alert_msg].visual_effect :fade, :duration => 2
page.dialog.close
page["theme_#{@index}"].visual_effect :drop_out
page['dialog-box'].replace_html :partial => 'tools'
page["comment-#{@comment.id}"].add_class_name 'disabled'
@comments.each do |comment|
page["comment-#{comment.id}"].add_class_name 'disabled'
end
page.replace_html 'live-preview', :partial => 'preview', :object => @article
page.flash.notice "#{@asset.title} added to bucket."
page.insert_html :bottom, :assets, "<li>afsfsdfsdfsdfsd</li>"
page.flash.notice "Asset bucket has been cleared."
page[:assets].replace_html ''
page.select('#cached-pages tr').each do |tr|
tr.addClassName('deleted')
end
page.select('#cached-pages .cached-page-link').each do |span|
span.toggle
end
page.call 'Flash.notice', 'Page Cache has been successfully cleared'
page.flash.errors error_messages_for(:section) if @section.errors.any?
page["cached-page-#{params[:id]}"].addClassName('deleted')
page.toggle("cached-page-link-#{params[:id]}", "cached-page-deleted-#{params[:id]}")
page.insert_html :bottom, 'sections', :partial => 'section'
page << "$('section_name').value = ''"
page[@section.dom_id].replace :partial => 'section'
page[@section.dom_id].visual_effect :highlight, :endcolor => '#99d3d5'
page["theme_#{@index}"].visual_effect :drop_out
page.visual_effect :shake, 'section_name'
page << 'function foo() {'
page[@user.dom_id].remove
page[:disabled_users].show
page.insert_html :bottom, :disabled_users, :partial => 'user'
page << '}'
page[@user.dom_id].visual_effect :drop_out, :afterFinish => ActiveSupport::JSON::Variable.new("foo")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment