diff options
author | Ilya Zhitomirskiy <iz268@nyu.edu> | 2011-11-06 11:24:18 +0400 |
---|---|---|
committer | Ilya Zhitomirskiy <iz268@nyu.edu> | 2011-11-08 09:59:29 +0400 |
commit | d1d24a049c4eb1ce9d21a6260a929f6eb6f19bad (patch) | |
tree | d80fb520bc21e72dc18cf4effe6dd40691af610c | |
parent | 15e7a0cc6ee9f5acbfedd76b227ec9767d69e4f6 (diff) |
added close buttons which clear getting started when they're all closed
-rw-r--r-- | app/views/aspects/_aspect_stream.haml | 2 | ||||
-rw-r--r-- | app/views/shared/_publisher.html.haml | 2 | ||||
-rw-r--r-- | features/signs_up.feature | 11 | ||||
-rw-r--r-- | features/step_definitions/custom_web_steps.rb | 12 | ||||
-rw-r--r-- | public/javascripts/publisher.js | 16 | ||||
-rw-r--r-- | public/stylesheets/sass/application.sass | 3 |
6 files changed, 42 insertions, 4 deletions
diff --git a/app/views/aspects/_aspect_stream.haml b/app/views/aspects/_aspect_stream.haml index 4aa415ddd..f33cdc13f 100644 --- a/app/views/aspects/_aspect_stream.haml +++ b/app/views/aspects/_aspect_stream.haml @@ -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 diff --git a/app/views/shared/_publisher.html.haml b/app/views/shared/_publisher.html.haml index f51a3802e..dd9403586 100644 --- a/app/views/shared/_publisher.html.haml +++ b/app/views/shared/_publisher.html.haml @@ -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') diff --git a/features/signs_up.feature b/features/signs_up.feature index 4a2e13376..cd0e9e24e 100644 --- a/features/signs_up.feature +++ b/features/signs_up.feature @@ -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" diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 9682bbea5..1a8cc7bd8 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -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 + diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index cf093856b..92e17fd7a 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -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); }, diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index daa3c2c1d..449da2ffb 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -3457,3 +3457,6 @@ a.toggle_selector .popover .close :float right + :position relative + :top -9px + :right -5px |