From bc978622e768b3b0af5413f8af8152872a5883a7 Mon Sep 17 00:00:00 2001 From: bsag Date: Wed, 15 Jun 2005 17:32:50 +0000 Subject: [PATCH] * Ambiguous wording "Add next action to this context" and "Completed actions in this context" was fixed on home page. Fixes #71 * Replaced the built-in Effect.Squish() effect on deleted and completed actions with Effect2.Fade() by [http://mir.aculo.us/effects/index.html Thomas Fuchs]. This looks much nicer, and doesn't generate the visual oddities that Kris noted. I've also added an Effect.Highlight for when new actions are added to help inform the user that something has happened. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@109 a4c988fc-2ded-0310-b66e-134b36920a42 --- .../app/views/context/_context_listing.rhtml | 2 +- tracks/app/views/context/_show_items.rhtml | 8 +- tracks/app/views/context/show.rhtml | 2 +- tracks/app/views/layouts/standard.rhtml | 1 + .../app/views/project/_project_listing.rhtml | 2 +- tracks/app/views/project/_show_items.rhtml | 10 +- tracks/app/views/project/show.rhtml | 2 +- tracks/app/views/todo/_show_items.rhtml | 8 +- tracks/app/views/todo/list.rhtml | 6 +- tracks/public/javascripts/effects2.js | 349 ++++++++++++++++++ 10 files changed, 370 insertions(+), 20 deletions(-) create mode 100644 tracks/public/javascripts/effects2.js diff --git a/tracks/app/views/context/_context_listing.rhtml b/tracks/app/views/context/_context_listing.rhtml index 623a6821..f5cfa0d5 100644 --- a/tracks/app/views/context/_context_listing.rhtml +++ b/tracks/app/views/context/_context_listing.rhtml @@ -31,7 +31,7 @@ <%= link_to_remote( image_tag("blank", :title =>"Delete context", :class=>"delete_item"), :update => "context-#{context.id}-container", - :loading => "new Effect.Squish('context-#{context.id}-container')", + :loading => "new Effect2.Fade('context-#{context.id}-container', true)", :url => { :controller => "context", :action => "destroy", :id => context.id }, :confirm => "Are you sure that you want to delete the context \'#{context.name}\'?" ) + " " + link_to_function( image_tag( "blank", :title => "Edit context", :class=>"edit_item"), "Element.toggle('context-#{context.id}','context-#{context.id}-edit-form'); new Effect.Appear('context-#{context.id}-edit-form'); Form.focus_first('form-context-#{context.id}');" ) %> diff --git a/tracks/app/views/context/_show_items.rhtml b/tracks/app/views/context/_show_items.rhtml index 3dbaa0bd..4318b36d 100644 --- a/tracks/app/views/context/_show_items.rhtml +++ b/tracks/app/views/context/_show_items.rhtml @@ -6,7 +6,7 @@ :update => "completed", :position => "top", :loading => "Form.disable('checkbox-notdone-#{item.id}');", - :complete => "new Effect.Squish('item-#{item.id}-container', true);" + :complete => "new Effect2.Fade('item-#{item.id}-container', true);" ) %>
@@ -14,7 +14,7 @@ <%= link_to_remote( image_tag("blank", :title =>"Delete this action", :class=>"delete_item"), :update => "item-#{item.id}-container", - :loading => "new Effect.Squish('item-#{item.id}-container')", + :loading => "new Effect2.Fade('item-#{item.id}-container', true)", :url => { :controller => "context", :action => "destroy_action", :id => item.id }, :confirm => "Are you sure that you want to delete the action \'#{item.description}\'?" ) + " " + link_to_function(image_tag( "blank", :title => "Edit item", :class=>"edit_item"), "Element.toggle('item-#{item.id}','action-#{item.id}-edit-form'); new Effect.Appear('action-#{item.id}-edit-form'); Form.focusFirstElement('form-action-#{item.id}');" ) + " " %> @@ -61,7 +61,7 @@ :update => "next_actions", :position => "bottom", :loading => "Form.disable('checkbox-done-#{item.id}');", - :complete => "new Effect.Squish('done-item-#{item.id}-container', true);" + :complete => "new Effect2.Fade('done-item-#{item.id}-container', true);" ) %>
@@ -69,7 +69,7 @@ <%= link_to_remote( image_tag("blank", :title =>"Delete this action", :class=>"delete_item"), :update => "done-item-#{item.id}-container", - :loading => "new Effect.Squish('done-item-#{item.id}-container')", + :loading => "new Effect2.Fade('done-item-#{item.id}-container', true)", :url => { :controller => "context", :action => "destroy_action", :id => item.id }, :confirm => "Are you sure that you want to delete the action \'#{item.description}\'?" ) + " " %> <%= image_tag("blank") %> diff --git a/tracks/app/views/context/show.rhtml b/tracks/app/views/context/show.rhtml index 21a166e6..a609b619 100644 --- a/tracks/app/views/context/show.rhtml +++ b/tracks/app/views/context/show.rhtml @@ -40,7 +40,7 @@ :update=> "next_actions", :position=> "bottom", :loading => "context.reset()", - :complete => "Form.focusFirstElement('context-form-new-action');", + :complete => "Form.focusFirstElement('context-form-new-action'); new Effect.Highlight('next_actions');", :html=> { :id=>'context-form-new-action', :name=>'context', :class => 'inline-form' } %> <%= hidden_field( "new_item", "context_id", "value" => "#{@context.id}") %>
diff --git a/tracks/app/views/layouts/standard.rhtml b/tracks/app/views/layouts/standard.rhtml index 5d2aca2e..0175a569 100644 --- a/tracks/app/views/layouts/standard.rhtml +++ b/tracks/app/views/layouts/standard.rhtml @@ -5,6 +5,7 @@ <%= javascript_include_tag "toggle_notes" %> <%= javascript_include_tag "prototype" %> <%= javascript_include_tag "prototype-ex" %> + <%= javascript_include_tag "effects2" %> <%= stylesheet_link_tag 'calendar-system.css' %> <%= javascript_include_tag 'calendar', 'calendar-en', 'calendar-setup' %> diff --git a/tracks/app/views/project/_project_listing.rhtml b/tracks/app/views/project/_project_listing.rhtml index 6f2d0ef7..9607b23b 100644 --- a/tracks/app/views/project/_project_listing.rhtml +++ b/tracks/app/views/project/_project_listing.rhtml @@ -29,7 +29,7 @@ <%= link_to_remote( image_tag("blank", :title =>"Delete project", :class=>"delete_item"), :update => "project-#{project.id}-container", - :loading => "new Effect.Squish('project-#{project.id}-container')", + :loading => "new Effect2.Fade('project-#{project.id}-container', true)", :url => { :controller => "project", :action => "destroy", :id => project.id }, :confirm => "Are you sure that you want to delete the project \'#{project.name}\'?" ) + " " + link_to_function(image_tag( "blank", :title => "Edit item", :class=>"edit_item"), "Element.toggle('project-#{project.id}','project-#{project.id}-edit-form'); new Effect.Appear('project-#{project.id}-edit-form'); Form.focus_first('form-project-#{project.id}');" ) %>
diff --git a/tracks/app/views/project/_show_items.rhtml b/tracks/app/views/project/_show_items.rhtml index 3a29cc57..8be82621 100644 --- a/tracks/app/views/project/_show_items.rhtml +++ b/tracks/app/views/project/_show_items.rhtml @@ -6,7 +6,7 @@ :update => "completed", :position => "top", :loading => "Form.disable('checkbox-notdone-#{item.id}');", - :complete => "new Effect.Squish('item-#{item.id}-container', true);" + :complete => "new Effect2.Fade('item-#{item.id}-container', true);" ) %>
@@ -14,7 +14,7 @@ <%= link_to_remote( image_tag("blank", :title =>"Delete action", :class=>"delete_item"), :update => "item-#{item.id}-container", - :loading => "new Effect.Squish('item-#{item.id}-container')", + :loading => "new Effect2.Fade('item-#{item.id}-container', true)", :url => { :controller => "project", :action => "destroy_action", :id => item.id }, :confirm => "Are you sure that you want to delete the action \'#{item.description}\'?" ) + " " + link_to_function(image_tag( "blank", :title => "Edit action", :class=>"edit_item"), "Element.toggle('item-#{item.id}','action-#{item.id}-edit-form'); new Effect.Appear('action-#{item.id}-edit-form'); Form.focusFirstElement('form-action-#{item.id}');" ) + " " %> @@ -49,7 +49,7 @@ <%= form_remote_tag :url => { :controller => 'project', :action => 'update_action', :id => item.id }, :html => { :id => "form-action-#{item.id}", :class => "inline-form" }, :update => "item-#{item.id}-container", - :complete => "new Effect.Appear('item-#{item.id}-container');" %> + :complete => "new Effect.Appear('item-#{item.id}-container', true);" %> <%= render_partial 'todo/action_edit_form', item %> <%= end_form_tag %>
@@ -62,7 +62,7 @@ :update => "next_actions", :position => "bottom", :loading => "Form.disable('checkbox-done-#{item.id}');", - :complete => "new Effect.Squish('done-item-#{item.id}-container', true);" + :complete => "new Effect2.Fade('done-item-#{item.id}-container', true);" ) %>
@@ -70,7 +70,7 @@ <%= link_to_remote( image_tag("blank", :title =>"Delete action", :class=>"delete_item"), :update => "done-item-#{item.id}-container", - :loading => "new Effect.Squish('done-item-#{item.id}-container')", + :loading => "new Effect2.Fade('done-item-#{item.id}-container', true)", :url => { :controller => "project", :action => "destroy_action", :id => item.id }, :confirm => "Are you sure that you want to delete the action \'#{item.description}\'?" ) + " " %>
diff --git a/tracks/app/views/project/show.rhtml b/tracks/app/views/project/show.rhtml index dbfbc0df..cf7b22b0 100644 --- a/tracks/app/views/project/show.rhtml +++ b/tracks/app/views/project/show.rhtml @@ -45,7 +45,7 @@ :update=> "next_actions", :position=> "bottom", :loading => "project.reset()", - :complete => "Form.focusFirstElement('project-form-new-action');", + :complete => "Form.focusFirstElement('project-form-new-action'); new Effect.Highlight('next_actions');", :html=> { :id=>'project-form-new-action', :name=>'project', :class => 'inline-form' } %> <%= hidden_field( "new_item", "project_id", "value" => "#{@project.id}") %>
diff --git a/tracks/app/views/todo/_show_items.rhtml b/tracks/app/views/todo/_show_items.rhtml index 238e9e84..1dd359af 100644 --- a/tracks/app/views/todo/_show_items.rhtml +++ b/tracks/app/views/todo/_show_items.rhtml @@ -6,7 +6,7 @@ :update => "completed", :position => "top", :loading => "Form.disable('checkbox-notdone-#{item.id}');", - :complete => "new Effect.Squish('item-#{item.id}-container', true);" + :complete => "new Effect2.Fade('item-#{item.id}-container', true);" ) %>
@@ -14,7 +14,7 @@ <%= link_to_remote( image_tag("blank", :title =>"Delete action", :class=>"delete_item"), :update => "item-#{item.id}-container", - :loading => "new Effect.Squish('item-#{item.id}-container')", + :loading => "new Effect2.Fade('item-#{item.id}-container', true)", :url => { :controller => "todo", :action => "destroy_action", :id => item.id }, :confirm => "Are you sure that you want to delete the action, \'#{item.description}\'?") + " " + link_to_function(image_tag( "blank", :title => "Edit action", :class => "edit_item"), @@ -61,7 +61,7 @@ :update => "new_actions", :position => "bottom", :loading => "Form.disable('checkbox-done-#{item.id}');", - :complete => "Element.toggle('new_actions');new Effect.Squish('done-item-#{item.id}-container', true);" + :complete => "Element.toggle('new_actions');new Effect2.Fade('done-item-#{item.id}-container', true);" ) %>
@@ -69,7 +69,7 @@ <%= link_to_remote( image_tag("blank", :title =>"Delete action", :class=>"delete_item"), :update => "done-item-#{item.id}-container", - :loading => "new Effect.Squish('done-item-#{item.id}-container')", + :loading => "new Effect2.Fade('done-item-#{item.id}-container', true)", :url => { :controller => "todo", :action => "destroy_action", :id => item.id }, :confirm => "Are you sure that you want to delete the action \'#{item.description}\'?" ) + " " %> <%= image_tag("blank") %> diff --git a/tracks/app/views/todo/list.rhtml b/tracks/app/views/todo/list.rhtml index 610e82ac..b1835413 100644 --- a/tracks/app/views/todo/list.rhtml +++ b/tracks/app/views/todo/list.rhtml @@ -27,7 +27,7 @@ <% end -%>
-

Completed actions in this context

+

Completed actions

<% if @done.empty? -%> @@ -49,7 +49,7 @@
<%= @flash["warning"] %>
<% end -%> -<%= link_to_function( "Add the next action in this context »", "Element.toggle('todo_new_action');Element.toggle('new_actions');Form.focusFirstElement('todo-form-new-action');", {:title => "Add the next action [Alt+n]", :accesskey => "n"}) %> +<%= link_to_function( "Add a next action »", "Element.toggle('todo_new_action');Element.toggle('new_actions');Form.focusFirstElement('todo-form-new-action');", {:title => "Add the next action [Alt+n]", :accesskey => "n"}) %>