added close buttons which clear getting started when they're all closed

This commit is contained in:
Ilya Zhitomirskiy 2011-11-06 00:24:18 -07:00
parent 15e7a0cc6e
commit d1d24a049c
6 changed files with 42 additions and 4 deletions

View file

@ -16,7 +16,7 @@
= render 'shared/publisher', :selected_aspects => stream.aspects, :aspect_ids => stream.aspect_ids, :for_all_aspects => stream.for_all_aspects?, :aspect => stream.aspect
= render 'aspects/no_posts_message'
#gs-shim{:title => "3. #{t('.stay_updated')}", 'data-content' => t('.stay_updated_explanation')}
#gs-shim{:title => popover_with_close_html("3. #{t('.stay_updated')}"), 'data-content' => t('.stay_updated_explanation')}
#main_stream.stream{:data => {:guids => stream.aspect_ids.join(','), :time_for_scroll => time_for_scroll(stream.ajax_stream?, stream)}}
- if !stream.ajax_stream? && stream.stream_posts.length > 0

View file

@ -55,7 +55,7 @@
= link_to (image_tag "icons/monotone_wrench_settings.png"), "#question_mark_pane", :class => 'question_mark', :rel => 'facebox', :title => t('shared.public_explain.manage')
// NOTE(dropdown special casing to DRY up -- taken from the aspect_dropdown partial)
.dropdown{:class => "hang_right", :title => "2. #{t('shared.public_explain.control_your_audience')}", 'data-content'=> t('shared.public_explain.visibility_dropdown')}
.dropdown{:class => "hang_right", :title => popover_with_close_html("2. #{t('shared.public_explain.control_your_audience')}"), 'data-content'=> t('shared.public_explain.visibility_dropdown')}
.button.toggle.publisher
- if publisher_public
= t('public')

View file

@ -26,3 +26,14 @@ Feature: new user registration
When I preemptively confirm the alert
And I follow "awesome_button"
Then I should be on the multi page
Scenario: closing a popover clears getting started
When I preemptively confirm the alert
And I follow "awesome_button"
Then I should be on the multi page
And I have turned off jQuery effects
And I wait for the popovers to appear
And I click close on all the popovers
And I wait for 3 seconds
And I go to the home page
Then I should not see "Welcome to Diaspora"

View file

@ -207,3 +207,15 @@ end
Then 'I press the attached image' do
Then %{I press the 1st "img" within ".stream_element div.photo_attachments"}
end
And "I wait for the popovers to appear" do
wait_until(30) { evaluate_script('$(".popover").length') == 3 }
end
And /^I click close on all the popovers$/ do
page.execute_script("var time = 400; $('.popover .close').each(
function(index, element){ setTimeout(function(){ $(element).click()},time);
time += 800;
});")
end

View file

@ -453,9 +453,9 @@ var Publisher = {
},
triggerGettingStarted: function(){
Publisher.setUpPopovers("#publisher .dropdown", {trigger: 'manual', offset: 10, placement:'below'}, 1000);
Publisher.setUpPopovers("#publisher .dropdown", {trigger: 'manual', offset: 10, id: "message_visibility_explain", placement:'below', html:true}, 1000);
Publisher.setUpPopovers("#publisher #status_message_fake_text", {trigger: 'manual', placement: 'right', offset: 30, id: "first_message_explain", html:true}, 600);
Publisher.setUpPopovers("#gs-shim", {trigger: 'manual', placement: 'left', offset: -5}, 1400);
Publisher.setUpPopovers("#gs-shim", {trigger: 'manual', placement: 'left', id:"stream_explain", offset: -5, html:true}, 1400);
$("#publisher .button.creation").bind("click", function(){
$("#publisher .dropdown").popover("hide");
@ -468,8 +468,20 @@ var Publisher = {
selection.popover(options);
selection.bind("click", function(){$(this).popover("hide")});
setTimeout(function(){
selection.popover("show");
var popup = selection.data('popover').$tip[0],
closeIcon = $(popup).find(".close");
closeIcon.bind("click",function(){
if($(".popover").length == 1){
$.get("/getting_started_completed");
};
selection.popover("hide");
});
}, timeout);
},

View file

@ -3457,3 +3457,6 @@ a.toggle_selector
.popover
.close
:float right
:position relative
:top -9px
:right -5px