From 0b1d521bbfd1858603951e3d314ed572ccd18976 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Wed, 27 Jun 2012 21:40:12 +0200 Subject: [PATCH] ugly fix for deprecation warnings fopr mouseover and fix failing tests --- app/helpers/todos_helper.rb | 12 ++++++++++-- app/views/layouts/standard.html.erb | 2 +- app/views/preferences/_authentication.html.erb | 2 +- app/views/stats/_tags.html.erb | 14 ++++++-------- config/routes.rb | 5 ++++- test/functional/preferences_controller_test.rb | 3 +++ test/functional/stats_controller_test.rb | 8 +++++--- test/functional/users_controller_test.rb | 17 ++++++++++------- 8 files changed, 40 insertions(+), 23 deletions(-) diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index bc1e24a2..917ced19 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -16,8 +16,12 @@ module TodosHelper end def remote_delete_menu_item(todo) + # TODO: what is the current way to do mouseover with css? return link_to( - image_tag("delete_off.png", :mouseover => "delete_on.png", :alt => t('todos.delete'), :align => "absmiddle")+" "+t('todos.delete'), + image_tag("delete_off.png", + :onmouseover => "this.src='#{path_to_image("delete_on.png")}'", + :onmouseout => "this.src='#{path_to_image("delete_off.png")}'", + :alt => t('todos.delete'), :align => "absmiddle")+" "+t('todos.delete'), {:controller => 'todos', :action => 'destroy', :id => todo.id}, :class => "icon_delete_item", :id => "delete_#{dom_id(todo)}", @@ -59,7 +63,11 @@ module TodosHelper end def image_tag_for_defer(days) - image_tag("defer_#{days}_off.png", :mouseover => "defer_#{days}.png", :alt => t('todos.defer_x_days', :count => days), :align => "absmiddle")+" "+t('todos.defer_x_days', :count => days) + # TODO: what is the current way to do mouseover with css? + image_tag("defer_#{days}_off.png", + :onmouseover => "this.src='#{path_to_image("defer_#{days}.png")}'", + :onmouseout => "this.src='#{path_to_image("defer_#{days}_off.png")}'", + :alt => t('todos.defer_x_days', :count => days), :align => "absmiddle")+" "+t('todos.defer_x_days', :count => days) end def collapsed_notes_image(todo) diff --git a/app/views/layouts/standard.html.erb b/app/views/layouts/standard.html.erb index 3e80e184..3ea698e8 100644 --- a/app/views/layouts/standard.html.erb +++ b/app/views/layouts/standard.html.erb @@ -8,7 +8,7 @@ <%= csrf_meta_tag %>