From a9b1954ff6c6b9be7f79d111c6bb361e2f4ce47d Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 26 Jul 2010 16:27:10 -0700 Subject: [PATCH] MS status message now updates the big one on the index page...hooray for jquery --- app/views/dashboards/index.html.haml | 3 ++- public/javascripts/publisher.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/views/dashboards/index.html.haml b/app/views/dashboards/index.html.haml index d205590e3..b358d5e5b 100644 --- a/app/views/dashboards/index.html.haml +++ b/app/views/dashboards/index.html.haml @@ -2,7 +2,8 @@ %h1#user_name = link_to current_user.real_name, root_path %span= title_for_page - %h3= my_latest_message + %h3 + #latest_message= my_latest_message = render "shared/publisher" %ul#stream - for post in @posts diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index 5e5386dbe..3bc3e9b13 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -4,6 +4,11 @@ $("#publisher_content_pickers .bookmark").click(selectPublisherTab); $("#publisher_content_pickers .blog").click(selectPublisherTab); $("#publisher_content_pickers .photo").click(selectPublisherTab); + + $("#new_status_message").submit(function() { + var new_status = $('#status_message_message').val() + " - just now"; + $('#latest_message').text( new_status ); + }); function selectPublisherTab(evt){ evt.preventDefault(); @@ -16,4 +21,12 @@ $(form_id).delay(50).fadeIn(200); } } + + function replaceCurrentStatus(evt){ + evt.preventDefault(); + var old_message = $("#latest_message"); + alert(old_message); + var status = $(".new_status_message"); + alert(status); + } });