Guest User

Untitled

a guest
Feb 20th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. def message_update(reply_id, message = ' ', image_name = nil, type = nil)
  2. ratings = get_ratings
  3.  
  4. img = image_tag("icons/silk/#{image_name}#{session[:icon_filetype]}", :size => "16x16")
  5.  
  6. update_page do |page|
  7. if ratings.include?(type) && ratings[type][:alert]
  8. page.replace_html 'ratings_results_' + reply_id, "#{img}&nbsp;<span>#{ratings[type][:alert]}</span>"
  9. else
  10. page.replace_html 'ratings_results_' + reply_id, "#{img}&nbsp;<span>#{message}</span>"
  11. end
  12. page.visual_effect :highlight, 'ratings_results_' + reply_id, :duration => 3.0
  13. page.visual_effect :fade, 'ratings_results_' + reply_id, :duration => 4.0
  14. page.replace_html 'ratings_results_' + reply_id, ""
  15. page.visual_effect :appear, 'ratings_results_' + reply_id
  16. end
  17. end
Add Comment
Please, Sign In to add comment