diff --git a/app/assets/javascripts/app/pages/settings.js b/app/assets/javascripts/app/pages/settings.js index d34226016..be522514f 100644 --- a/app/assets/javascripts/app/pages/settings.js +++ b/app/assets/javascripts/app/pages/settings.js @@ -11,7 +11,7 @@ app.pages.Settings = Backbone.View.extend({ new Diaspora.ProfilePhotoUploader(); this.viewAspectSelector = new app.views.PublisherAspectSelector({ - el: $(".aspect_dropdown"), + el: $(".aspect-dropdown"), form: $("#post-default-aspects") }); $("#update_profile_form").areYouSure(); diff --git a/app/assets/javascripts/app/views/aspect_membership_view.js b/app/assets/javascripts/app/views/aspect_membership_view.js index b5017bec6..65bd571b5 100644 --- a/app/assets/javascripts/app/views/aspect_membership_view.js +++ b/app/assets/javascripts/app/views/aspect_membership_view.js @@ -9,7 +9,7 @@ */ app.views.AspectMembership = app.views.Base.extend({ templateName: "aspect_membership_dropdown", - className: "btn-group aspect_dropdown aspect_membership_dropdown", + className: "btn-group aspect-dropdown aspect_membership_dropdown", subviews: { ".newAspectContainer": "aspectCreateView" diff --git a/app/assets/javascripts/app/views/publisher_view.js b/app/assets/javascripts/app/views/publisher_view.js index c33d27602..25e156c60 100644 --- a/app/assets/javascripts/app/views/publisher_view.js +++ b/app/assets/javascripts/app/views/publisher_view.js @@ -101,13 +101,13 @@ app.views.Publisher = Backbone.View.extend({ }); this.viewAspectSelector = new app.views.PublisherAspectSelector({ - el: this.$(".public_toggle .aspect_dropdown"), + el: this.$(".public_toggle .aspect-dropdown"), form: form }); this.viewGettingStarted = new app.views.PublisherGettingStarted({ firstMessageEl: this.inputEl, - visibilityEl: this.$(".public_toggle .aspect_dropdown > .dropdown-toggle"), + visibilityEl: this.$(".public_toggle .aspect-dropdown > .dropdown-toggle"), streamEl: $("#main-stream") }); diff --git a/app/assets/stylesheets/aspects.scss b/app/assets/stylesheets/aspects.scss index 115e2bcfa..2fcb3edd7 100644 --- a/app/assets/stylesheets/aspects.scss +++ b/app/assets/stylesheets/aspects.scss @@ -1,4 +1,4 @@ -.aspect_dropdown { +.aspect-dropdown { li { @include selectable-list; diff --git a/app/assets/stylesheets/color_themes/_color_theme_override_dark.scss b/app/assets/stylesheets/color_themes/_color_theme_override_dark.scss index 90f859910..42e4b3257 100644 --- a/app/assets/stylesheets/color_themes/_color_theme_override_dark.scss +++ b/app/assets/stylesheets/color_themes/_color_theme_override_dark.scss @@ -15,7 +15,7 @@ body { .md-input, .md-preview { background-color: $gray; } - .aspect_dropdown li a .text { color: $dropdown-link-color; } + .aspect-dropdown li a .text { color: $dropdown-link-color; } .info .tag { background-color: $gray-light; } diff --git a/app/assets/stylesheets/profile.scss b/app/assets/stylesheets/profile.scss index 7ac209b53..8163542f1 100644 --- a/app/assets/stylesheets/profile.scss +++ b/app/assets/stylesheets/profile.scss @@ -8,7 +8,7 @@ margin-top: -20px; box-shadow: $card-shadow; - #edit_profile, #unblock_user_button, .aspect_dropdown { + #edit_profile, #unblock_user_button, .aspect-dropdown { margin-top: 15px; } diff --git a/app/assets/stylesheets/publisher.scss b/app/assets/stylesheets/publisher.scss index 93cd34d19..b570a388b 100644 --- a/app/assets/stylesheets/publisher.scss +++ b/app/assets/stylesheets/publisher.scss @@ -53,8 +53,8 @@ .btn-toolbar { width: 100%; display: flex; - .btn, .aspect_dropdown{ flex-grow: 1; } - .aspect_dropdown .btn { width: 100%; } + .btn, .aspect-dropdown{ flex-grow: 1; } + .aspect-dropdown .btn { width: 100%; } } .btn-group:first-child { margin: 0; } .dropdown-menu.pull-right { @@ -183,7 +183,7 @@ } } - .aspect_dropdown { + .aspect-dropdown { .radio { min-height: 0; padding-left: 0; diff --git a/app/views/aspect_memberships/_aspect_membership_dropdown.mobile.haml b/app/views/aspect_memberships/_aspect_membership_dropdown.mobile.haml index 02ebe2e48..8c4a46ec8 100644 --- a/app/views/aspect_memberships/_aspect_membership_dropdown.mobile.haml +++ b/app/views/aspect_memberships/_aspect_membership_dropdown.mobile.haml @@ -1,5 +1,5 @@ %div - %select.aspect_dropdown.form-control.user_aspects{"name" => "user_aspects", "data-person-id" => @person.id} + %select.aspect-dropdown.form-control.user_aspects{"name" => "user_aspects", "data-person-id" => @person.id} %option{value: 'list_cover', class: 'list_cover', disabled: 'true', selected: 'true'} = t("contacts.index.add_contact") - contact = current_user.contact_for(@person) diff --git a/app/views/aspects/_aspect_dropdown.html.haml b/app/views/aspects/_aspect_dropdown.html.haml index 226bbc068..04c9ecf96 100644 --- a/app/views/aspects/_aspect_dropdown.html.haml +++ b/app/views/aspects/_aspect_dropdown.html.haml @@ -6,7 +6,7 @@ dropdown_css["data-content"] = t("shared.public_explain.visibility_dropdown") end -.btn-group.aspect_dropdown +.btn-group.aspect-dropdown %button.btn.btn-default.dropdown-toggle{dropdown_css} - if public_selected?(selected_aspects) %i.entypo-globe.small#visibility-icon diff --git a/features/desktop/change_settings.feature b/features/desktop/change_settings.feature index 6bc8ae641..d30f6f137 100644 --- a/features/desktop/change_settings.feature +++ b/features/desktop/change_settings.feature @@ -36,7 +36,7 @@ Feature: Change settings Scenario: Change my post default aspects When I go to the stream page And I expand the publisher - Then I should see "All aspects" within ".aspect_dropdown" + Then I should see "All aspects" within ".aspect-dropdown" When I go to the edit user page And I press the aspect dropdown And I toggle the aspect "Family" @@ -44,7 +44,7 @@ Feature: Change settings And I press "Change" within "#post-default-aspects" And I go to the stream page And I expand the publisher - Then I should see "Family" within ".aspect_dropdown" + Then I should see "Family" within ".aspect-dropdown" Scenario: Change my post default to public When I press the aspect dropdown @@ -52,7 +52,7 @@ Feature: Change settings And I press "Change" within "#post-default-aspects" And I go to the stream page And I expand the publisher - Then I should see "Public" within ".aspect_dropdown" + Then I should see "Public" within ".aspect-dropdown" Scenario: exporting profile data When I click on the first selector "#account_data a" diff --git a/features/desktop/search.feature b/features/desktop/search.feature index 03e8fc343..b96de002c 100644 --- a/features/desktop/search.feature +++ b/features/desktop/search.feature @@ -31,7 +31,7 @@ Scenario: search for a user in background And I search for "user@pod.tld" And a person with ID "user@pod.tld" has been discovered Then I should see "user@pod.tld" within ".stream .info.diaspora_handle" - And I should see a ".aspect_dropdown" within ".stream" + And I should see a ".aspect-dropdown" within ".stream" Scenario: search for a not searchable user When I sign in as "carol@example.com" diff --git a/features/desktop/signs_up.feature b/features/desktop/signs_up.feature index bed865064..2703069e0 100644 --- a/features/desktop/signs_up.feature +++ b/features/desktop/signs_up.feature @@ -42,7 +42,7 @@ Feature: new user registration When I confirm the alert after I follow "awesome_button" Then I should be on the stream page And the publisher should be expanded - And I should see "Public" within ".aspect_dropdown" + And I should see "Public" within ".aspect-dropdown" Scenario: new user without any tags posts first status message When I confirm the alert after I follow "awesome_button" diff --git a/features/step_definitions/aspects_steps.rb b/features/step_definitions/aspects_steps.rb index 89f7cb5aa..8d05a421e 100644 --- a/features/step_definitions/aspects_steps.rb +++ b/features/step_definitions/aspects_steps.rb @@ -1,6 +1,6 @@ module AspectCukeHelpers def click_aspect_dropdown - find(".aspect_dropdown .dropdown-toggle").trigger "click" + find(".aspect-dropdown .dropdown-toggle").trigger "click" end def toggle_aspect(a_name) @@ -9,7 +9,7 @@ module AspectCukeHelpers else @me.aspects.where(name: a_name).pluck(:id).first end - aspect_css = ".aspect_dropdown li[data-aspect_id='#{a_id}']" + aspect_css = ".aspect-dropdown li[data-aspect_id='#{a_id}']" expect(page).to have_selector(aspect_css) find(aspect_css).click end diff --git a/features/step_definitions/posts_steps.rb b/features/step_definitions/posts_steps.rb index a13779a2c..7065f9083 100644 --- a/features/step_definitions/posts_steps.rb +++ b/features/step_definitions/posts_steps.rb @@ -128,7 +128,7 @@ end When /^I select "([^"]*)" on the aspect dropdown$/ do |text| page.execute_script( - "$('#publisher .dropdown .dropdown_list, #publisher .aspect_dropdown .dropdown-menu') + "$('#publisher .dropdown .dropdown_list, #publisher .aspect-dropdown .dropdown-menu') .find('li').each(function(i,el){ var elem = $(el); if ('" + text + "' == $.trim(elem.text()) ) { diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index 7eb0e2b6e..62af8aee7 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -233,7 +233,7 @@ end And /^I should be able to friend "([^\"]*)"$/ do |email| user = User.find_by_email(email) - step 'I should see a ".aspect_dropdown"' + step 'I should see a ".aspect-dropdown"' step "I should see \"#{user.name}\"" end diff --git a/spec/javascripts/app/views/aspects_dropdown_view_spec.js b/spec/javascripts/app/views/aspects_dropdown_view_spec.js index 004706b1d..77f0a75a0 100644 --- a/spec/javascripts/app/views/aspects_dropdown_view_spec.js +++ b/spec/javascripts/app/views/aspects_dropdown_view_spec.js @@ -1,7 +1,7 @@ describe("app.views.AspectsDropdown", function(){ beforeEach(function() { spec.loadFixture("bookmarklet"); - this.view = new app.views.AspectsDropdown({el: $('.aspect_dropdown')}); + this.view = new app.views.AspectsDropdown({el: $('.aspect-dropdown')}); }); context('_toggleCheckbox', function() { diff --git a/spec/javascripts/app/views/publisher_view_spec.js b/spec/javascripts/app/views/publisher_view_spec.js index 1a8b4a3bf..9b9540feb 100644 --- a/spec/javascripts/app/views/publisher_view_spec.js +++ b/spec/javascripts/app/views/publisher_view_spec.js @@ -112,7 +112,7 @@ describe("app.views.Publisher", function() { expect("#publisher").not.toHaveClass("closed"); $("#publisher").find(".publisher-textarea-wrapper").click(); expect("#publisher").not.toHaveClass("closed"); - $("#publisher").find(".aspect_dropdown button").click(); + $("#publisher").find(".aspect-dropdown button").click(); expect("#publisher").not.toHaveClass("closed"); }); @@ -121,10 +121,10 @@ describe("app.views.Publisher", function() { // that take the whole page when it detects a mobile. // Clicking on this element should not close the publisher. // See https://github.com/diaspora/diaspora/issues/6979. - $("#publisher").find(".aspect_dropdown").append("") + $("#publisher").find(".aspect-dropdown").append("") .css({position: "fixed", left: 0, right: 0, bottom: 0, top: 0, "z-index": 990}); expect("#publisher").not.toHaveClass("closed"); - $("#publisher").find(".aspect_dropdown button").click(); + $("#publisher").find(".aspect-dropdown button").click(); expect("#publisher").not.toHaveClass("closed"); $("#publisher").find(".dropdown-backdrop").click(); expect("#publisher").not.toHaveClass("closed"); @@ -403,13 +403,13 @@ describe("app.views.Publisher", function() { describe("toggles the selected entry visually", function(){ it("click on the first aspect", function(){ - this.view.$(".aspect_dropdown li.aspect_selector:first").click(); + this.view.$(".aspect-dropdown li.aspect_selector:first").click(); expect($("#publisher #visibility-icon")).not.toHaveClass("entypo-globe"); expect($("#publisher #visibility-icon")).toHaveClass("entypo-lock"); }); it("click on public", function(){ - this.view.$(".aspect_dropdown li.public").click(); + this.view.$(".aspect-dropdown li.public").click(); expect($("#publisher #visibility-icon")).toHaveClass("entypo-globe"); expect($("#publisher #visibility-icon")).not.toHaveClass("entypo-lock"); }); @@ -430,7 +430,7 @@ describe("app.views.Publisher", function() { expect(selected.length).toBe(1); expect(selected.first().val()).toBe('all_aspects'); - var evt = $.Event("click", { target: $('.aspect_dropdown li.aspect_selector:last') }); + var evt = $.Event("click", { target: $('.aspect-dropdown li.aspect_selector:last') }); this.view.viewAspectSelector.toggleAspect(evt); selected = $('input[name="aspect_ids[]"]'); @@ -441,20 +441,20 @@ describe("app.views.Publisher", function() { it("toggles the same item", function() { expect($('input[name="aspect_ids[]"][value="42"]').length).toBe(0); - var evt = $.Event("click", { target: $('.aspect_dropdown li.aspect_selector:last') }); + var evt = $.Event("click", { target: $('.aspect-dropdown li.aspect_selector:last') }); this.view.viewAspectSelector.toggleAspect(evt); expect($('input[name="aspect_ids[]"][value="42"]').length).toBe(1); - evt = $.Event("click", { target: $('.aspect_dropdown li.aspect_selector:last') }); + evt = $.Event("click", { target: $('.aspect-dropdown li.aspect_selector:last') }); this.view.viewAspectSelector.toggleAspect(evt); expect($('input[name="aspect_ids[]"][value="42"]').length).toBe(0); }); it("keeps other fields with different values", function() { $('.dropdown-menu').append('
  • '); - var evt = $.Event("click", { target: $('.aspect_dropdown li.aspect_selector:eq(-2)') }); + var evt = $.Event("click", { target: $('.aspect-dropdown li.aspect_selector:eq(-2)') }); this.view.viewAspectSelector.toggleAspect(evt); - evt = $.Event("click", { target: $('.aspect_dropdown li.aspect_selector:eq(-1)') }); + evt = $.Event("click", { target: $('.aspect-dropdown li.aspect_selector:eq(-1)') }); this.view.viewAspectSelector.toggleAspect(evt); expect($('input[name="aspect_ids[]"][value="42"]').length).toBe(1);