diff --git a/.gitignore b/.gitignore index 072691512..fea147b0e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,27 +10,15 @@ app/assets/images/custom/ # Configuration files config/diaspora.yml -config/heroku.yml config/initializers/secret_token.rb -config/redis.conf -config/deploy_config.yml -config/schedule.rb .bundle vendor/bundle/ vendor/cache/ config/database.yml -.rvmrc_custom -.rvmrc.local config/oidc_key.pem -# Mailing list stuff -config/email_offset -config/mailing_list.csv - # Generated files log/ -public/stylesheets/*.css -public/diaspora spec/fixtures/*.y*ml spec/fixtures/*.fixture.* coverage/ @@ -39,6 +27,12 @@ public/404.html public/422.html public/500.html +# the db/schema.rb. Although this is contrary to rails best-practises, we +# cannot provide a schema.rb that works for both MySQL and PostgreSQL, so we +# have no choice. Our migrations are maintained, so it should always be +# possible to get back to a "clean" database schema anyway. +db/schema.rb + # Sprites app/assets/images/branding-*.png app/assets/images/branding/logos-*.png @@ -53,17 +47,13 @@ doc/ public/uploads/ public/assets/ public/source.tar* -public/.well-known -tmp/**/ tmp/ -*.sqlite3 # Temporary files of every sort .sass-cache/ .DS_Store .idea .redcar -.rvmrc .stgit* *.swap *.swo @@ -76,7 +66,6 @@ tmp/ nbproject patches-* capybara-*.html -dump.rdb # Rubinius's JIT *.rbc diff --git a/.rubocop.yml b/.rubocop.yml index 2ebb26cff..91f28fdb1 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -40,7 +40,7 @@ Metrics/BlockLength: # No space makes the method definition shorter and differentiates # from a regular assignment. -Style/SpaceAroundEqualsInParameterDefault: +Layout/SpaceAroundEqualsInParameterDefault: EnforcedStyle: no_space # Single quotes being faster is hardly measurable and only affects parse time. @@ -55,7 +55,7 @@ Style/SymbolArray: Enabled: true # Most readable form. -Style/AlignHash: +Layout/AlignHash: EnforcedHashRocketStyle: table EnforcedColonStyle: table @@ -92,7 +92,7 @@ Style/RaiseArgs: # Indenting the chained dots beneath each other is not supported by this cop, # see https://github.com/bbatsov/rubocop/issues/1633 -Style/MultilineOperationIndentation: +Layout/MultilineOperationIndentation: Enabled: false # Fail is an alias of raise. Avoid aliases, it's more cognitive load for no gain. @@ -107,7 +107,7 @@ Style/SignalException: Lint/HandleExceptions: Enabled: false -Style/SpaceInsideBlockBraces: +Layout/SpaceInsideBlockBraces: # The space here provides no real gain in readability while consuming # horizontal space that could be used for a better parameter name. # Also {| differentiates better from a hash than { | does. @@ -115,7 +115,7 @@ Style/SpaceInsideBlockBraces: # No trailing space differentiates better from the block: # foo} means hash, foo } means block. -Style/SpaceInsideHashLiteralBraces: +Layout/SpaceInsideHashLiteralBraces: EnforcedStyle: no_space # { ... } for multi-line blocks is okay, follow Weirichs rule instead: @@ -165,7 +165,7 @@ Style/NumericPredicate: EnforcedStyle: comparison # Reset some HoundCI changes back to Rubocop defaults -Style/DotPosition: +Layout/DotPosition: EnforcedStyle: leading ### backward compatibility diff --git a/.ruby-version b/.ruby-version index bb576dbde..6b4950e3d 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3 +2.4 diff --git a/.travis.yml b/.travis.yml index 1bcd8421a..e4b310171 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: ruby rvm: - - 2.3.1 - - 2.1 + - 2.4.1 + - 2.3.4 env: - DB=postgresql BUILD_TYPE=cucumber @@ -15,6 +15,7 @@ cache: bundler: true directories: - app/assets/images + - tmp/cache/assets branches: only: @@ -29,7 +30,7 @@ before_install: - tar -xvf $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis-phantomjs - export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH -bundler_args: "--deployment --without development production --with mysql postgresql --jobs 3 --retry 3" +bundler_args: "--deployment --without development --with mysql postgresql --jobs 3 --retry 3" script: "./script/ci/build.sh" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..797e62775 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,42 @@ +# Contributing to diaspora\* + +First of all: thank you very much for helping us out! + +## Things you need to know before contributing + +If you want to get in touch with other diaspora\* developers, [check our wiki][how-we-communicate] for information on how we communicate. Feel free to ask if you have any questions! + +Everyone interacting with our code, issue trackers, chat rooms, mailing lists, the wiki, and the discourse forum is expected to follow the [diaspora\* code of conduct][code-of-conduct]. + +## Report a security issue + +Found a security issue? Please disclose it responsibly. We have a team of developers listening to [security@diasporafoundation.org][sec-mail]. The PGP fingerprint is [AB0D AB02 0FC5 D398 03AB 3CE1 6F70 243F 27AD 886A][pgp]. + +## Contributing to translations + +We use [WebTranslateIt][webtranslateit] to manage translations of the app interface. Please read [our wiki page][translation-wiki] to find out more about this. If your language is featured on WebTranslateIt, please do **not** open a pull request to update translations. If it is not already featured on WebTranslateIt, please read the wiki article above to find out how to proceed. + +## Contributing to the code + +**Before opening a pull request** please read [how to contribute][contribute]. Doing things the right way from the start will save us time and mean that your contribution can be integrated quicker! +- Follow our [git workflow][git-workflow] method. In particular, *do not* open a pull request from the `master` or the `develop` branch. +- Follow our [styleguide][styleguide] and run pronto, our syntax analyzer, **locally before opening a pull request**. See [our wiki][pronto] for information on how to do this. +- [Write tests][testing-workflow]. +- Use meaningful commit-messages and split larger tasks, e.g. refactoring, into separate commits. This makes the review process much easier. + +## Other ways to contribute + +You don’t know code? No worries, there are plenty other ways to help the diaspora* project! Please find out how you can help [on our wiki][other-ways]. + +[code-of-conduct]: https://github.com/diaspora/diaspora/blob/develop/CODE_OF_CONDUCT.md +[how-we-communicate]: https://wiki.diasporafoundation.org/How_we_communicate +[pgp]: https://pgp.mit.edu/pks/lookup?op=get&search=0x6F70243F27AD886A +[sec-mail]: mailto:security@diasporafoundation.org +[webtranslateit]: https://webtranslateit.com/en/projects/3020-Diaspora +[translation-wiki]: https://wiki.diasporafoundation.org/Contribute_translations +[contribute]: https://wiki.diasporafoundation.org/Getting_started_with_contributing +[git-workflow]: https://wiki.diasporafoundation.org/Git_Workflow +[styleguide]: https://wiki.diasporafoundation.org/Styleguide +[pronto]: https://wiki.diasporafoundation.org/Styleguide#Automatic_local_review +[testing-workflow]: https://wiki.diasporafoundation.org/Testing_Workflow +[other-ways]: https://wiki.diasporafoundation.org/Other_ways_to_contribute diff --git a/Changelog.md b/Changelog.md index dad01e1dd..879ca4e86 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,63 @@ +# 0.7.0.0 + +## Supported Ruby versions + +This release recommends using Ruby 2.4, while retaining Ruby 2.3 as an officially supported version. +Ruby 2.1 is no longer officially supported. + +## Delete public/.well-known/ + +Before upgrading, please check if your `public/` folder contains a hidden `.well-known/` folder. +If so, please delete it since it will prevent the federation from working properly. + +## Refactor + +* Make the mention syntax more flexible [#7305](https://github.com/diaspora/diaspora/pull/7305) +* Display @ before mentions [#7324](https://github.com/diaspora/diaspora/pull/7324) +* Simplify mentions in the publisher [#7302](https://github.com/diaspora/diaspora/pull/7302) +* Remove chartbeat and mixpanel support [#7280](https://github.com/diaspora/diaspora/pull/7280) +* Upgrade to jQuery 3 [#7303](https://github.com/diaspora/diaspora/pull/7303) +* Add i18n for color themes [#7369](https://github.com/diaspora/diaspora/pull/7369) +* Remove deprecated statistics.json [#7399](https://github.com/diaspora/diaspora/pull/7399) +* Always link comment count text on mobile [#7483](https://github.com/diaspora/diaspora/pull/7483) +* Switch to new federation protocol [#7436](https://github.com/diaspora/diaspora/pull/7436) +* Send public profiles publicly [#7501](https://github.com/diaspora/diaspora/pull/7501) +* Change sender for mails [#7495](https://github.com/diaspora/diaspora/pull/7495) +* Move back to top to the right to avoid misclicks [#7516](https://github.com/diaspora/diaspora/pull/7516) +* Include count in mobile post action link [#7520](https://github.com/diaspora/diaspora/pull/7520) +* Update the user data export archive format [#6726](https://github.com/diaspora/diaspora/pull/6726) +* Use id as fallback when sorting posts [#7523](https://github.com/diaspora/diaspora/pull/7523) +* Remove no-posts-info when adding posts to the stream [#7523](https://github.com/diaspora/diaspora/pull/7523) +* Upgrade to rails 5.1 [#7514](https://github.com/diaspora/diaspora/pull/7514) +* Refactoring single post view interactions [#7182](https://github.com/diaspora/diaspora/pull/7182) +* Update help pages [#7528](https://github.com/diaspora/diaspora/pull/7528) +* Disable rendering logging in production [#7529](https://github.com/diaspora/diaspora/pull/7529) +* Add some missing indexes and cleanup the database if needed [#7533](https://github.com/diaspora/diaspora/pull/7533) +* Remove avatar, name, timestamp and interactions from publisher preview [#7536](https://github.com/diaspora/diaspora/pull/7536) + +## Bug fixes + +* Fix height too high on mobile SPV [#7480](https://github.com/diaspora/diaspora/pull/7480) +* Improve stream when ignoring a person who posts a lot of tagged posts [#7503](https://github.com/diaspora/diaspora/pull/7503) +* Fix order of comments across pods [#7436](https://github.com/diaspora/diaspora/pull/7436) +* Prevent publisher from closing in preview mode [#7518](https://github.com/diaspora/diaspora/pull/7518) +* Increase reshare counter after reshare on mobile [#7520](https://github.com/diaspora/diaspora/pull/7520) +* Reset stuck exports and handle errors [#7535](https://github.com/diaspora/diaspora/pull/7535) + +## Features +* Add support for mentions in comments to the backend [#6818](https://github.com/diaspora/diaspora/pull/6818) +* Add support for new mention syntax [#7300](https://github.com/diaspora/diaspora/pull/7300) [#7394](https://github.com/diaspora/diaspora/pull/7394) +* Render mentions as links in comments [#7327](https://github.com/diaspora/diaspora/pull/7327) +* Add support for mentions in comments to the front-end [#7386](https://github.com/diaspora/diaspora/pull/7386) +* Support direct links to comments on mobile [#7508](https://github.com/diaspora/diaspora/pull/7508) +* Add inviter first and last name in the invitation e-mail [#7484](https://github.com/diaspora/diaspora/pull/7484) +* Add markdown editor for comments and conversations [#7482](https://github.com/diaspora/diaspora/pull/7482) +* Improve responsive header in desktop version [#7509](https://github.com/diaspora/diaspora/pull/7509) +* Support cmd+enter to submit posts, comments and conversations [#7524](https://github.com/diaspora/diaspora/pull/7524) +* Add markdown editor for posts, comments and conversations on mobile [#7235](https://github.com/diaspora/diaspora/pull/7235) +* Mark as "Mobile Web App Capable" on Android [#7534](https://github.com/diaspora/diaspora/pull/7534) +* Add support for receiving account migrations [#6750](https://github.com/diaspora/diaspora/pull/6750) + # 0.6.7.0 ## Refactor diff --git a/Gemfile b/Gemfile index a8e4f3e5b..532d4dd9e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,29 +1,30 @@ source "https://rubygems.org" -gem "rails", "4.2.8" +gem "rails", "5.1.3" # Legacy Rails features, remove me! # responders (class level) -gem "responders", "2.3.0" +gem "responders", "2.4.0" # Appserver -gem "unicorn", "5.2.0", require: false +gem "unicorn", "5.3.0", require: false gem "unicorn-worker-killer", "0.4.4" # Federation -gem "diaspora_federation-rails", "0.1.9" +gem "diaspora_federation-json_schema", "0.2.1" +gem "diaspora_federation-rails", "0.2.1" # API and JSON -gem "acts_as_api", "1.0.0" -gem "json", "1.8.6" +gem "acts_as_api", "1.0.1" +gem "json", "2.1.0" gem "json-schema", "2.8.0" # Authentication -gem "devise", "4.2.0" +gem "devise", "4.3.0" gem "devise_lastseenable", "0.0.6" # Captcha @@ -32,15 +33,15 @@ gem "simple_captcha2", "0.4.3", require: "simple_captcha" # Background processing -gem "sidekiq", "4.2.9" +gem "sidekiq", "5.0.4" # Scheduled processing -gem "sidekiq-cron", "0.4.5" +gem "sidekiq-cron", "0.6.3" # Compression -gem "uglifier", "3.1.2" +gem "uglifier", "3.2.0" # Configuration @@ -48,33 +49,34 @@ gem "configurate", "0.3.1" # Cross-origin resource sharing -gem "rack-cors", "0.4.1", require: "rack/cors" +gem "rack-cors", "1.0.1", require: "rack/cors" # CSS -gem "autoprefixer-rails", "6.7.6" +gem "autoprefixer-rails", "7.1.2.4" gem "bootstrap-sass", "3.3.7" gem "bootstrap-switch-rails", "3.3.3" -gem "compass-rails", "2.0.5" +gem "compass-rails", "3.0.2" gem "sass-rails", "5.0.6" +gem "sprockets-rails", "3.2.0" # Database group :mysql, optional: true do - gem "mysql2", "0.4.5" + gem "mysql2", "0.4.9" end group :postgresql, optional: true do - gem "pg", "0.19.0" + gem "pg", "0.21.0" end -gem "activerecord-import", "0.17.1" +gem "activerecord-import", "0.19.1" # File uploading -gem "fog-aws", "1.2.1" -gem "carrierwave", "0.11.2" -gem "mini_magick", "4.6.1" +gem "carrierwave", "1.1.0" +gem "fog-aws", "1.4.0" +gem "mini_magick", "4.8.0" # GUID generation gem "uuid", "2.3.8" @@ -85,19 +87,19 @@ gem "entypo-rails", "3.0.0" # JavaScript -gem "handlebars_assets", "0.23.1" -gem "jquery-rails", "4.2.1" -gem "jquery-ui-rails", "5.0.5" +gem "handlebars_assets", "0.23.2" +gem "jquery-rails", "4.3.1" gem "js-routes", "1.3.3" -gem "js_image_paths", "0.1.0" +gem "js_image_paths", "0.1.1" source "https://rails-assets.org" do - gem "rails-assets-jquery", "2.2.4" # Should be kept in sync with jquery-rails + gem "rails-assets-jquery", "3.2.1" # Should be kept in sync with jquery-rails + gem "rails-assets-jquery.ui", "1.11.4" - gem "rails-assets-highlightjs", "9.9.0" - gem "rails-assets-markdown-it", "8.3.0" + gem "rails-assets-highlightjs", "9.12.0" + gem "rails-assets-markdown-it", "8.3.2" gem "rails-assets-markdown-it-hashtag", "0.4.0" - gem "rails-assets-markdown-it-diaspora-mention", "1.1.1" + gem "rails-assets-markdown-it-diaspora-mention", "1.2.0" gem "rails-assets-markdown-it-sanitizer", "0.4.3" gem "rails-assets-markdown-it--markdown-it-for-inline", "0.1.1" gem "rails-assets-markdown-it-sub", "1.0.0" @@ -110,8 +112,8 @@ source "https://rails-assets.org" do # jQuery plugins - gem "rails-assets-autosize", "3.0.20" - gem "rails-assets-blueimp-gallery", "2.25.0" + gem "rails-assets-autosize", "4.0.0" + gem "rails-assets-blueimp-gallery", "2.25.2" gem "rails-assets-jquery.are-you-sure", "1.9.0" gem "rails-assets-jquery-placeholder", "2.3.1" gem "rails-assets-jquery-textchange", "0.2.3" @@ -120,24 +122,24 @@ end # Localization -gem "http_accept_language", "2.1.0" +gem "http_accept_language", "2.1.1" gem "i18n-inflector-rails", "1.0.7" -gem "rails-i18n", "4.0.8" +gem "rails-i18n", "5.0.4" # Mail gem "markerb", "1.1.0" # Map -gem "leaflet-rails", "0.7.7" +gem "leaflet-rails", "1.1.0" # Parsing -gem "nokogiri", "1.7.2" +gem "nokogiri", "1.8.0" gem "open_graph_reader", "0.6.2" # also update User-Agent in features/support/webmock.rb gem "redcarpet", "3.4.0" -gem "ruby-oembed", "0.10.1" -gem "twitter-text", "1.14.5" +gem "ruby-oembed", "0.12.0" +gem "twitter-text", "1.14.7" # RTL support @@ -145,11 +147,11 @@ gem "string-direction", "1.2.0" # Security Headers -gem "secure_headers", "3.6.1" +gem "secure_headers", "3.6.7" # Services -gem "omniauth", "1.4.2" +gem "omniauth", "1.6.1" gem "omniauth-facebook", "4.0.0" gem "omniauth-tumblr", "1.2" gem "omniauth-twitter", "1.4.0" @@ -157,11 +159,11 @@ gem "twitter", "6.1.0" gem "omniauth-wordpress", "0.2.2" # OpenID Connect -gem "openid_connect", "0.12.0" +gem "openid_connect", "1.1.3" # Serializers -gem "active_model_serializers", "0.9.5" +gem "active_model_serializers", "0.9.7" # XMPP chat dependencies gem "diaspora-prosody-config", "0.0.7" @@ -169,11 +171,11 @@ gem "rails-assets-diaspora_jsxc", "0.1.5.develop.7", source: "https://rails-asse # Tags -gem "acts-as-taggable-on", "3.5.0" +gem "acts-as-taggable-on", "5.0.0" # URIs and HTTP -gem "addressable", "2.5.0", require: "addressable/uri" +gem "addressable", "2.5.1", require: "addressable/uri" gem "faraday", "0.11.0" # also update User-Agent in OpenID specs gem "faraday_middleware", "0.11.0.1" gem "faraday-cookie_jar", "0.0.6" @@ -182,14 +184,14 @@ gem "typhoeus", "1.1.2" # Views gem "gon", "6.1.0" -gem "hamlit", "2.8.0" -gem "mobile-fu", "1.3.1" +gem "hamlit", "2.8.4" +gem "mobile_fu", "1.4.0", require: "mobile-fu" gem "rails-timeago", "2.16.0" -gem "will_paginate", "3.1.5" +gem "will_paginate", "3.1.6" # Logging -gem "logging-rails", "0.5.0", require: "logging/rails" +gem "logging-rails", "0.6.0", require: "logging/rails" # Reading and writing zip files @@ -202,13 +204,7 @@ gem "rubyzip", "1.2.1", require: "zip" # https://github.com/discourse/discourse/pull/238 gem "minitest" -gem "versionist", "1.5.0" - -# Prevent accidental upgrades of thor -# TODO: remove this when either all gems depending on thor have fixed the warnings -# or thor released a version where they are clearly marked as warnings -# see: https://github.com/erikhuda/thor/issues/538 -gem "thor", "0.19.1" +gem "versionist", "1.6.0" # Windows and OSX have an execjs compatible runtime built-in, Linux users should # install Node.js or use "therubyracer". @@ -225,7 +221,7 @@ group :production do # we don"t install these on travis to speed up test runs # Process management - gem "eye", "0.9.1" + gem "eye", "0.9.2" # Redirects @@ -234,7 +230,7 @@ group :production do # we don"t install these on travis to speed up test runs # Third party asset hosting - gem "asset_sync", "2.0.0", require: false + gem "asset_sync", "2.2.0", require: false end group :development do @@ -242,22 +238,22 @@ group :development do gem "guard", "2.14.1", require: false gem "guard-cucumber", "2.1.2", require: false gem "guard-rspec", "4.7.3", require: false - gem "guard-rubocop", "1.2.0", require: false - gem "rb-fsevent", "0.9.8", require: false - gem "rb-inotify", "0.9.8", require: false + gem "guard-rubocop", "1.3.0", require: false + gem "rb-fsevent", "0.10.2", require: false + gem "rb-inotify", "0.9.10", require: false # Linters - gem "haml_lint", "0.24.0", require: false - gem "pronto", "0.9.3", require: false + gem "haml_lint", "0.26.0", require: false + gem "pronto", "0.9.4", require: false gem "pronto-eslint", "0.9.1", require: false gem "pronto-haml", "0.9.0", require: false gem "pronto-rubocop", "0.9.0", require: false gem "pronto-scss", "0.9.1", require: false - gem "rubocop", "0.48.1", require: false + gem "rubocop", "0.49.1", require: false # Preloading environment - gem "spring", "2.0.1" + gem "spring", "2.0.2" gem "spring-commands-rspec", "1.0.4" gem "spring-commands-cucumber", "1.0.1" @@ -266,7 +262,7 @@ group :development do gem "pry-byebug" # test coverage - gem "simplecov", "0.12.0", require: false + gem "simplecov", "0.14.1", require: false gem "turbo_dev_assets", "0.0.2" end @@ -274,44 +270,45 @@ end group :test do # RSpec (unit tests, some integration tests) - gem "fixture_builder", "0.4.1" + gem "fixture_builder", "0.5.0" gem "fuubar", "2.2.0" - gem "test_after_commit", "1.1.0" + gem "json-schema-rspec", "0.0.4" + gem "rspec-json_expectations", "~> 2.1" # Cucumber (integration tests) - gem "capybara", "2.12.1" - gem "database_cleaner", "1.5.3" - gem "poltergeist", "1.13.0" + gem "capybara", "2.15.1" + gem "database_cleaner", "1.6.1" + gem "poltergeist", "1.16.0" gem "cucumber-api-steps", "0.13", require: false # General helpers gem "factory_girl_rails", "4.8.0" - gem "timecop", "0.8.1" - gem "webmock", "2.3.2", require: false - gem "shoulda-matchers", "3.1.1" + gem "shoulda-matchers", "3.1.2" + gem "timecop", "0.9.1" + gem "webmock", "3.0.1", require: false - gem "diaspora_federation-test", "0.1.9" + gem "diaspora_federation-test", "0.2.1" # Coverage - gem 'coveralls', require: false + gem "coveralls", "0.8.21", require: false end group :development, :test do # RSpec (unit tests, some integration tests) - gem "rspec-rails", "3.5.2" + gem "rspec-rails", "3.6.1" # Cucumber (integration tests) - gem "cucumber-rails", "1.4.5", require: false + gem "cucumber-rails", "1.5.0", require: false # Jasmine (client side application tests (JS)) - gem "jasmine", "2.5.2" + gem "jasmine", "2.7.0" gem "jasmine-jquery-rails", "2.0.3" gem "rails-assets-jasmine-ajax", "3.3.1", source: "https://rails-assets.org" gem "sinon-rails", "1.15.0" - # silence assets - gem "quiet_assets", "1.1.0" + # For `assigns` in controller specs + gem "rails-controller-testing", "1.0.2" end diff --git a/Gemfile.lock b/Gemfile.lock index 2012458cb..5bc4f2ec5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,64 +2,68 @@ GEM remote: https://rubygems.org/ remote: https://rails-assets.org/ specs: - actionmailer (4.2.8) - actionpack (= 4.2.8) - actionview (= 4.2.8) - activejob (= 4.2.8) + actioncable (5.1.3) + actionpack (= 5.1.3) + nio4r (~> 2.0) + websocket-driver (~> 0.6.1) + actionmailer (5.1.3) + actionpack (= 5.1.3) + actionview (= 5.1.3) + activejob (= 5.1.3) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.8) - actionview (= 4.2.8) - activesupport (= 4.2.8) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) + rails-dom-testing (~> 2.0) + actionpack (5.1.3) + actionview (= 5.1.3) + activesupport (= 5.1.3) + rack (~> 2.0) + rack-test (~> 0.6.3) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.8) - activesupport (= 4.2.8) + actionview (5.1.3) + activesupport (= 5.1.3) builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - active_model_serializers (0.9.5) + active_model_serializers (0.9.7) activemodel (>= 3.2) - activejob (4.2.8) - activesupport (= 4.2.8) - globalid (>= 0.3.0) - activemodel (4.2.8) - activesupport (= 4.2.8) - builder (~> 3.1) - activerecord (4.2.8) - activemodel (= 4.2.8) - activesupport (= 4.2.8) - arel (~> 6.0) - activerecord-import (0.17.1) + concurrent-ruby (~> 1.0) + activejob (5.1.3) + activesupport (= 5.1.3) + globalid (>= 0.3.6) + activemodel (5.1.3) + activesupport (= 5.1.3) + activerecord (5.1.3) + activemodel (= 5.1.3) + activesupport (= 5.1.3) + arel (~> 8.0) + activerecord-import (0.19.1) activerecord (>= 3.2) - activesupport (4.2.8) + activesupport (5.1.3) + concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - acts-as-taggable-on (3.5.0) - activerecord (>= 3.2, < 5) - acts_as_api (1.0.0) + acts-as-taggable-on (5.0.0) + activerecord (>= 4.2.8) + acts_as_api (1.0.1) activemodel (>= 3.0.0) activesupport (>= 3.0.0) rack (>= 1.1.0) - addressable (2.5.0) + addressable (2.5.1) public_suffix (~> 2.0, >= 2.0.2) - arel (6.0.4) - asset_sync (2.0.0) - activemodel + arel (8.0.0) + asset_sync (2.2.0) + activemodel (>= 4.1.0) fog-core - mime-types + mime-types (>= 2.99) unf ast (2.3.0) attr_required (1.0.1) - autoprefixer-rails (6.7.6) + autoprefixer-rails (7.1.2.4) execjs bcrypt (3.1.11) - bindata (2.3.5) + bindata (2.4.0) bootstrap-sass (3.3.7) autoprefixer-rails (>= 5.2.1) sass (>= 3.3.4) @@ -67,19 +71,17 @@ GEM buftok (0.2.0) builder (3.2.3) byebug (9.0.6) - capybara (2.12.1) + capybara (2.15.1) addressable - mime-types (>= 1.16) + mini_mime (>= 0.1.3) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) - carrierwave (0.11.2) - activemodel (>= 3.2.0) - activesupport (>= 3.2.0) - json (>= 1.7) + carrierwave (1.1.0) + activemodel (>= 4.0.0) + activesupport (>= 4.0.0) mime-types (>= 1.16) - mimemagic (>= 0.3.0) celluloid (0.17.3) celluloid-essentials celluloid-extras @@ -116,18 +118,18 @@ GEM sass (>= 3.3.0, < 3.5) compass-import-once (1.0.5) sass (>= 3.2, < 3.5) - compass-rails (2.0.5) + compass-rails (3.0.2) compass (~> 1.0.0) sass-rails (< 5.1) - sprockets (< 2.13) + sprockets (< 4.0) concurrent-ruby (1.0.5) configurate (0.3.1) connection_pool (2.2.1) - coveralls (0.8.19) + coveralls (0.8.21) json (>= 1.8, < 3) - simplecov (~> 0.12.0) + simplecov (~> 0.14.1) term-ansicolor (~> 1.3) - thor (~> 0.19.1) + thor (~> 0.19.4) tins (~> 1.6) crack (0.4.3) safe_yaml (~> 1.0.0) @@ -145,59 +147,63 @@ GEM rspec (>= 2.12.0) cucumber-core (1.5.0) gherkin (~> 4.0) - cucumber-rails (1.4.5) + cucumber-rails (1.5.0) capybara (>= 1.1.2, < 3) cucumber (>= 1.3.8, < 4) - mime-types (>= 1.16, < 4) + mime-types (>= 1.17, < 4) nokogiri (~> 1.5) - railties (>= 3, < 5.1) + railties (>= 4, < 5.2) cucumber-wire (0.0.1) - database_cleaner (1.5.3) - devise (4.2.0) + database_cleaner (1.6.1) + devise (4.3.0) bcrypt (~> 3.0) orm_adapter (~> 0.1) - railties (>= 4.1.0, < 5.1) + railties (>= 4.1.0, < 5.2) responders warden (~> 1.2.3) devise_lastseenable (0.0.6) devise rails (>= 3.0.4) diaspora-prosody-config (0.0.7) - diaspora_federation (0.1.9) - faraday (>= 0.9.0, < 0.12.0) - faraday_middleware (>= 0.10.0, < 0.12.0) + diaspora_federation (0.2.1) + faraday (>= 0.9.0, < 0.13.0) + faraday_middleware (>= 0.10.0, < 0.13.0) nokogiri (~> 1.6, >= 1.6.8) typhoeus (~> 1.0) valid (~> 1.0) - diaspora_federation-rails (0.1.9) - diaspora_federation (= 0.1.9) - rails (>= 4.2, < 6) - diaspora_federation-test (0.1.9) - diaspora_federation (= 0.1.9) - factory_girl (~> 4.7) + diaspora_federation-json_schema (0.2.1) + diaspora_federation-rails (0.2.1) + actionpack (>= 4.2, < 6) + diaspora_federation (= 0.2.1) + diaspora_federation-test (0.2.1) + diaspora_federation (= 0.2.1) + fabrication (~> 2.16.0) uuid (~> 2.3.8) diff-lcs (1.3) docile (1.1.5) - domain_name (0.5.20170223) + domain_name (0.5.20170404) unf (>= 0.0.5, < 1.0.0) entypo-rails (3.0.0) railties (>= 4.1, < 6) equalizer (0.0.11) - erubis (2.7.0) + erubi (1.6.1) eslintrb (2.1.0) execjs multi_json (>= 1.3) rake + et-orbi (1.0.5) + tzinfo ethon (0.10.1) ffi (>= 1.3.0) - excon (0.55.0) + excon (0.58.0) execjs (2.7.0) - eye (0.9.1) + eye (0.9.2) celluloid (~> 0.17.3) celluloid-io (~> 0.17.0) sigar (~> 0.7.3) state_machines thor + fabrication (2.16.2) factory_girl (4.8.0) activesupport (>= 3.0.0) factory_girl_rails (4.8.0) @@ -211,35 +217,35 @@ GEM faraday_middleware (0.11.0.1) faraday (>= 0.7.4, < 1.0) ffi (1.9.18) - fixture_builder (0.4.1) + fixture_builder (0.5.0) activerecord (>= 2) activesupport (>= 2) - fog-aws (1.2.1) + fog-aws (1.4.0) fog-core (~> 1.38) fog-json (~> 1.0) fog-xml (~> 0.1) ipaddress (~> 0.8) - fog-core (1.43.0) + fog-core (1.45.0) builder - excon (~> 0.49) + excon (~> 0.58) formatador (~> 0.2) fog-json (1.0.2) fog-core (~> 1.0) multi_json (~> 1.10) - fog-xml (0.1.2) + fog-xml (0.1.3) fog-core - nokogiri (~> 1.5, >= 1.5.11) + nokogiri (>= 1.5.11, < 2.0.0) formatador (0.2.5) fuubar (2.2.0) rspec-core (~> 3.0) ruby-progressbar (~> 1.4) get_process_mem (0.2.1) - gherkin (4.0.0) - gitlab (4.0.0) + gherkin (4.1.3) + gitlab (4.2.0) httparty - terminal-table (= 1.7.1) - globalid (0.3.7) - activesupport (>= 4.1.0) + terminal-table + globalid (0.4.0) + activesupport (>= 4.2.0) gon (6.1.0) actionpack (>= 3.0) json @@ -263,44 +269,43 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) - guard-rubocop (1.2.0) + guard-rubocop (1.3.0) guard (~> 2.0) rubocop (~> 0.20) - haml (4.0.7) + haml (5.0.2) + temple (>= 0.8.0) tilt - haml_lint (0.24.0) + haml_lint (0.26.0) haml (>= 4.0, < 5.1) rainbow rake (>= 10, < 13) - rubocop (>= 0.47.0) + rubocop (>= 0.49.0) sysexits (~> 1.1) - hamlit (2.8.0) + hamlit (2.8.4) temple (>= 0.8.0) thor tilt - handlebars_assets (0.23.1) + handlebars_assets (0.23.2) execjs (~> 2.0) - multi_json (~> 1.0) sprockets (>= 2.0.0) tilt (>= 1.2) - hashdiff (0.3.2) - hashie (3.5.5) - hike (1.2.3) - hitimes (1.2.4) - http (2.2.1) + hashdiff (0.3.5) + hashie (3.5.6) + hitimes (1.2.6) + http (2.2.2) addressable (~> 2.3) http-cookie (~> 1.0) http-form_data (~> 1.0.1) http_parser.rb (~> 0.6.0) http-cookie (1.0.3) domain_name (~> 0.5) - http-form_data (1.0.1) - http_accept_language (2.1.0) + http-form_data (1.0.3) + http_accept_language (2.1.1) http_parser.rb (0.6.0) httparty (0.14.0) multi_xml (>= 0.5.2) httpclient (2.8.3) - i18n (0.8.1) + i18n (0.8.6) i18n-inflector (2.6.7) i18n (>= 0.4.1) i18n-inflector-rails (1.0.7) @@ -308,26 +313,25 @@ GEM i18n-inflector (~> 2.6) railties (>= 3.0.0) ipaddress (0.8.3) - jasmine (2.5.2) - jasmine-core (>= 2.5.1, < 3.0.0) + jasmine (2.7.0) + jasmine-core (>= 2.7.0, < 3.0.0) phantomjs rack (>= 1.2.1) rake - jasmine-core (2.5.2) + jasmine-core (2.7.0) jasmine-jquery-rails (2.0.3) - jquery-rails (4.2.1) + jquery-rails (4.3.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - jquery-ui-rails (5.0.5) - railties (>= 3.2.16) js-routes (1.3.3) railties (>= 3.2) sprockets-rails - js_image_paths (0.1.0) - rails (~> 4.0) - json (1.8.6) - json-jwt (1.7.1) + js_image_paths (0.1.1) + rails (>= 4.0, < 6.0) + sprockets (>= 3.0.0) + json (2.1.0) + json-jwt (1.7.2) activesupport bindata multi_json (>= 1.3) @@ -335,27 +339,31 @@ GEM url_safe_base64 json-schema (2.8.0) addressable (>= 2.4) - jsonpath (0.5.8) + json-schema-rspec (0.0.4) + json-schema (~> 2.5) + rspec + jsonpath (0.8.7) multi_json jwt (1.5.6) kgio (2.11.0) - leaflet-rails (0.7.7) + leaflet-rails (1.1.0) + rails (>= 4.2.0) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) little-plugger (1.1.4) - logging (2.1.0) + logging (2.2.2) little-plugger (~> 1.1) multi_json (~> 1.10) - logging-rails (0.5.0) + logging-rails (0.6.0) logging (>= 1.8) loofah (2.0.3) nokogiri (>= 1.5.9) - lumberjack (1.0.11) + lumberjack (1.0.12) macaddr (1.7.1) systemu (~> 2.6.2) - mail (2.6.4) + mail (2.6.6) mime-types (>= 1.16, < 4) markerb (1.1.0) memoizable (0.4.2) @@ -364,38 +372,38 @@ GEM mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) - mimemagic (0.3.2) - mini_magick (4.6.1) - mini_portile2 (2.1.0) - minitest (5.10.1) - mobile-fu (1.3.1) + mini_magick (4.8.0) + mini_mime (0.1.4) + mini_portile2 (2.2.0) + minitest (5.10.3) + mobile_fu (1.4.0) rack-mobile-detect rails multi_json (1.12.1) multi_test (0.1.2) multi_xml (0.6.0) multipart-post (2.0.0) - mysql2 (0.4.5) + mysql2 (0.4.9) naught (1.1.0) nenv (0.3.0) - nio4r (2.0.0) - nokogiri (1.7.2) - mini_portile2 (~> 2.1.0) + nio4r (2.1.0) + nokogiri (1.8.0) + mini_portile2 (~> 2.2.0) notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) - oauth (0.5.1) - oauth2 (1.3.1) - faraday (>= 0.8, < 0.12) + oauth (0.5.3) + oauth2 (1.4.0) + faraday (>= 0.8, < 0.13) jwt (~> 1.0) multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) octokit (4.7.0) sawyer (~> 0.8.0, >= 0.5.3) - omniauth (1.4.2) - hashie (>= 1.2, < 4) - rack (>= 1.0, < 3) + omniauth (1.6.1) + hashie (>= 3.4.6, < 3.6.0) + rack (>= 1.6.2, < 3) omniauth-facebook (4.0.0) omniauth-oauth2 (~> 1.2) omniauth-oauth (1.1.0) @@ -415,28 +423,29 @@ GEM open_graph_reader (0.6.2) faraday (>= 0.9.0) nokogiri (~> 1.6) - openid_connect (0.12.0) + openid_connect (1.1.3) activemodel attr_required (>= 1.0.0) json (>= 1.4.3) json-jwt (>= 1.5.0) - rack-oauth2 (>= 1.3.1) + rack-oauth2 (>= 1.6.1) swd (>= 1.0.0) tzinfo validate_email validate_url webfinger (>= 1.0.1) orm_adapter (0.5.0) + parallel (1.12.0) parser (2.4.0.0) ast (~> 2.2) - pg (0.19.0) + pg (0.21.0) phantomjs (2.1.1.0) - poltergeist (1.13.0) + poltergeist (1.16.0) capybara (~> 2.1) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) powerpack (0.1.1) - pronto (0.9.3) + pronto (0.9.4) gitlab (~> 4.0, >= 4.0.0) httparty (>= 0.13.7, < 0.15) octokit (~> 4.7, >= 4.7.0) @@ -463,44 +472,43 @@ GEM byebug (~> 9.0) pry (~> 0.10) public_suffix (2.0.5) - quiet_assets (1.1.0) - railties (>= 3.1, < 5.0) - rack (1.6.5) - rack-cors (0.4.1) + rack (2.0.3) + rack-cors (1.0.1) rack-google-analytics (1.2.0) actionpack activesupport rack-mobile-detect (0.4.0) rack - rack-oauth2 (1.5.1) + rack-oauth2 (1.6.2) activesupport (>= 2.3) attr_required (>= 0.0.5) httpclient (>= 2.4) multi_json (>= 1.3.6) rack (>= 1.1) rack-piwik (0.3.0) - rack-protection (1.5.3) + rack-protection (2.0.0) rack rack-rewrite (1.5.1) rack-ssl (1.4.1) rack rack-test (0.6.3) rack (>= 1.0) - rails (4.2.8) - actionmailer (= 4.2.8) - actionpack (= 4.2.8) - actionview (= 4.2.8) - activejob (= 4.2.8) - activemodel (= 4.2.8) - activerecord (= 4.2.8) - activesupport (= 4.2.8) - bundler (>= 1.3.0, < 2.0) - railties (= 4.2.8) - sprockets-rails - rails-assets-autosize (3.0.20) + rails (5.1.3) + actioncable (= 5.1.3) + actionmailer (= 5.1.3) + actionpack (= 5.1.3) + actionview (= 5.1.3) + activejob (= 5.1.3) + activemodel (= 5.1.3) + activerecord (= 5.1.3) + activesupport (= 5.1.3) + bundler (>= 1.3.0) + railties (= 5.1.3) + sprockets-rails (>= 2.0.0) + rails-assets-autosize (4.0.0) rails-assets-backbone (1.3.3) rails-assets-underscore (>= 1.8.3) - rails-assets-blueimp-gallery (2.25.0) + rails-assets-blueimp-gallery (2.25.2) rails-assets-bootstrap (3.3.7) rails-assets-jquery (>= 1.9.1, < 4) rails-assets-bootstrap-markdown (2.10.0) @@ -517,11 +525,11 @@ GEM rails-assets-emojione (2.0.1) rails-assets-favico.js (0.3.10) rails-assets-fine-uploader (5.13.0) - rails-assets-highlightjs (9.9.0) - rails-assets-jasmine (2.5.2) + rails-assets-highlightjs (9.12.0) + rails-assets-jasmine (2.7.0) rails-assets-jasmine-ajax (3.3.1) rails-assets-jasmine (~> 2) - rails-assets-jquery (2.2.4) + rails-assets-jquery (3.2.1) rails-assets-jquery-colorbox (1.6.4) rails-assets-jquery (>= 1.3.2) rails-assets-jquery-fullscreen-plugin (0.5.0) @@ -535,83 +543,86 @@ GEM rails-assets-jquery.ui (1.11.4) rails-assets-jquery (>= 1.6) rails-assets-markdown-it--markdown-it-for-inline (0.1.1) - rails-assets-markdown-it (8.3.0) - rails-assets-markdown-it-diaspora-mention (1.1.1) + rails-assets-markdown-it (8.3.2) + rails-assets-markdown-it-diaspora-mention (1.2.0) rails-assets-markdown-it-hashtag (0.4.0) rails-assets-markdown-it-sanitizer (0.4.3) rails-assets-markdown-it-sub (1.0.0) rails-assets-markdown-it-sup (1.0.0) rails-assets-perfect-scrollbar (0.6.16) rails-assets-underscore (1.8.3) - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.8) - activesupport (>= 4.2.0.beta, < 5.0) - nokogiri (~> 1.6) - rails-deprecated_sanitizer (>= 1.0.1) + rails-controller-testing (1.0.2) + actionpack (~> 5.x, >= 5.0.1) + actionview (~> 5.x, >= 5.0.1) + activesupport (~> 5.x) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) rails-html-sanitizer (1.0.3) loofah (~> 2.0) - rails-i18n (4.0.8) + rails-i18n (5.0.4) i18n (~> 0.7) - railties (~> 4.0) + railties (~> 5.0) rails-timeago (2.16.0) actionpack (>= 3.1) activesupport (>= 3.1) - railties (4.2.8) - actionpack (= 4.2.8) - activesupport (= 4.2.8) + railties (5.1.3) + actionpack (= 5.1.3) + activesupport (= 5.1.3) + method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (2.2.2) rake - raindrops (0.17.0) + raindrops (0.19.0) rake (12.0.0) - rb-fsevent (0.9.8) - rb-inotify (0.9.8) - ffi (>= 0.5.0) + rb-fsevent (0.10.2) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) redcarpet (3.4.0) redis (3.3.3) - redis-namespace (1.5.3) - redis (~> 3.0, >= 3.0.4) request_store (1.3.2) - responders (2.3.0) - railties (>= 4.2.0, < 5.1) - rspec (3.5.0) - rspec-core (~> 3.5.0) - rspec-expectations (~> 3.5.0) - rspec-mocks (~> 3.5.0) - rspec-core (3.5.4) - rspec-support (~> 3.5.0) - rspec-expectations (3.5.0) + responders (2.4.0) + actionpack (>= 4.2.0, < 5.3) + railties (>= 4.2.0, < 5.3) + rspec (3.6.0) + rspec-core (~> 3.6.0) + rspec-expectations (~> 3.6.0) + rspec-mocks (~> 3.6.0) + rspec-core (3.6.0) + rspec-support (~> 3.6.0) + rspec-expectations (3.6.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-mocks (3.5.0) + rspec-support (~> 3.6.0) + rspec-json_expectations (2.1.0) + rspec-mocks (3.6.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-rails (3.5.2) + rspec-support (~> 3.6.0) + rspec-rails (3.6.1) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) - rspec-core (~> 3.5.0) - rspec-expectations (~> 3.5.0) - rspec-mocks (~> 3.5.0) - rspec-support (~> 3.5.0) - rspec-support (3.5.0) - rubocop (0.48.1) + rspec-core (~> 3.6.0) + rspec-expectations (~> 3.6.0) + rspec-mocks (~> 3.6.0) + rspec-support (~> 3.6.0) + rspec-support (3.6.0) + rubocop (0.49.1) + parallel (~> 1.10) parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) - ruby-oembed (0.10.1) + ruby-oembed (0.12.0) ruby-progressbar (1.8.1) ruby_dep (1.5.0) rubyzip (1.2.1) - rufus-scheduler (3.3.4) - tzinfo - rugged (0.25.1.1) + rufus-scheduler (3.4.2) + et-orbi (~> 1.0) + rugged (0.26.0) safe_yaml (1.0.4) - sass (3.4.23) + sass (3.4.25) sass-rails (5.0.6) railties (>= 4.0.0, < 6) sass (~> 3.1) @@ -621,52 +632,49 @@ GEM sawyer (0.8.1) addressable (>= 2.3.5, < 2.6) faraday (~> 0.8, < 1.0) - scss_lint (0.53.0) + scss_lint (0.54.0) rake (>= 0.9, < 13) sass (~> 3.4.20) - secure_headers (3.6.1) + secure_headers (3.6.7) useragent securecompare (1.0.0) shellany (0.0.1) - shoulda-matchers (3.1.1) + shoulda-matchers (3.1.2) activesupport (>= 4.0.0) - sidekiq (4.2.9) + sidekiq (5.0.4) concurrent-ruby (~> 1.0) connection_pool (~> 2.2, >= 2.2.0) rack-protection (>= 1.5.0) - redis (~> 3.2, >= 3.2.1) - sidekiq-cron (0.4.5) - redis-namespace (>= 1.5.2) - rufus-scheduler (>= 2.0.24) + redis (~> 3.3, >= 3.3.3) + sidekiq-cron (0.6.3) + rufus-scheduler (>= 3.3.0) sidekiq (>= 4.2.1) sigar (0.7.3) simple_captcha2 (0.4.3) rails (>= 4.1) simple_oauth (0.3.1) - simplecov (0.12.0) + simplecov (0.14.1) docile (~> 1.1.0) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) - simplecov-html (0.10.0) + simplecov-html (0.10.1) sinon-rails (1.15.0) railties (>= 3.1) slop (3.6.0) - spring (2.0.1) + spring (2.0.2) activesupport (>= 4.2) spring-commands-cucumber (1.0.1) spring (>= 0.9.1) spring-commands-rspec (1.0.4) spring (>= 0.9.1) - sprockets (2.12.4) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.3.3) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (>= 2.8, < 4.0) - state_machines (0.4.0) + sprockets (3.7.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.0) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + state_machines (0.5.0) string-direction (1.2.0) yard (~> 0.8) swd (1.0.1) @@ -678,19 +686,17 @@ GEM sysexits (1.2.0) systemu (2.6.5) temple (0.8.0) - term-ansicolor (1.4.0) + term-ansicolor (1.6.0) tins (~> 1.0) - terminal-table (1.7.1) - unicode-display_width (~> 1.1.1) - test_after_commit (1.1.0) - activerecord (>= 3.2) - thor (0.19.1) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + thor (0.19.4) thread_safe (0.3.6) - tilt (1.4.1) - timecop (0.8.1) + tilt (2.0.8) + timecop (0.9.1) timers (4.1.2) hitimes - tins (1.13.2) + tins (1.15.0) turbo_dev_assets (0.0.2) twitter (6.1.0) addressable (~> 2.5) @@ -702,19 +708,19 @@ GEM memoizable (~> 0.4.2) naught (~> 1.1) simple_oauth (~> 0.3.1) - twitter-text (1.14.5) + twitter-text (1.14.7) unf (~> 0.1.0) typhoeus (1.1.2) ethon (>= 0.9.0) tzinfo (1.2.3) thread_safe (~> 0.1) - uglifier (3.1.2) + uglifier (3.2.0) execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext - unf_ext (0.0.7.2) - unicode-display_width (1.1.3) - unicorn (5.2.0) + unf_ext (0.0.7.4) + unicode-display_width (1.3.0) + unicorn (5.3.0) kgio (~> 2.6) raindrops (~> 0.7) unicorn-worker-killer (0.4.4) @@ -731,7 +737,7 @@ GEM validate_url (1.0.2) activemodel (>= 3.0.0) addressable - versionist (1.5.0) + versionist (1.6.0) activesupport (>= 3) railties (>= 3) yard (~> 0.7) @@ -741,159 +747,161 @@ GEM activesupport httpclient (>= 2.4) multi_json - webmock (2.3.2) + webmock (3.0.1) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) - will_paginate (3.1.5) - xpath (2.0.0) + will_paginate (3.1.6) + xpath (2.1.0) nokogiri (~> 1.3) - yard (0.9.8) + yard (0.9.9) PLATFORMS ruby DEPENDENCIES - active_model_serializers (= 0.9.5) - activerecord-import (= 0.17.1) - acts-as-taggable-on (= 3.5.0) - acts_as_api (= 1.0.0) - addressable (= 2.5.0) - asset_sync (= 2.0.0) - autoprefixer-rails (= 6.7.6) + active_model_serializers (= 0.9.7) + activerecord-import (= 0.19.1) + acts-as-taggable-on (= 5.0.0) + acts_as_api (= 1.0.1) + addressable (= 2.5.1) + asset_sync (= 2.2.0) + autoprefixer-rails (= 7.1.2.4) bootstrap-sass (= 3.3.7) bootstrap-switch-rails (= 3.3.3) - capybara (= 2.12.1) - carrierwave (= 0.11.2) - compass-rails (= 2.0.5) + capybara (= 2.15.1) + carrierwave (= 1.1.0) + compass-rails (= 3.0.2) configurate (= 0.3.1) - coveralls + coveralls (= 0.8.21) cucumber-api-steps (= 0.13) - cucumber-rails (= 1.4.5) - database_cleaner (= 1.5.3) - devise (= 4.2.0) + cucumber-rails (= 1.5.0) + database_cleaner (= 1.6.1) + devise (= 4.3.0) devise_lastseenable (= 0.0.6) diaspora-prosody-config (= 0.0.7) - diaspora_federation-rails (= 0.1.9) - diaspora_federation-test (= 0.1.9) + diaspora_federation-json_schema (= 0.2.1) + diaspora_federation-rails (= 0.2.1) + diaspora_federation-test (= 0.2.1) entypo-rails (= 3.0.0) - eye (= 0.9.1) + eye (= 0.9.2) factory_girl_rails (= 4.8.0) faraday (= 0.11.0) faraday-cookie_jar (= 0.0.6) faraday_middleware (= 0.11.0.1) - fixture_builder (= 0.4.1) - fog-aws (= 1.2.1) + fixture_builder (= 0.5.0) + fog-aws (= 1.4.0) fuubar (= 2.2.0) gon (= 6.1.0) guard (= 2.14.1) guard-cucumber (= 2.1.2) guard-rspec (= 4.7.3) - guard-rubocop (= 1.2.0) - haml_lint (= 0.24.0) - hamlit (= 2.8.0) - handlebars_assets (= 0.23.1) - http_accept_language (= 2.1.0) + guard-rubocop (= 1.3.0) + haml_lint (= 0.26.0) + hamlit (= 2.8.4) + handlebars_assets (= 0.23.2) + http_accept_language (= 2.1.1) i18n-inflector-rails (= 1.0.7) - jasmine (= 2.5.2) + jasmine (= 2.7.0) jasmine-jquery-rails (= 2.0.3) - jquery-rails (= 4.2.1) - jquery-ui-rails (= 5.0.5) + jquery-rails (= 4.3.1) js-routes (= 1.3.3) - js_image_paths (= 0.1.0) - json (= 1.8.6) + js_image_paths (= 0.1.1) + json (= 2.1.0) json-schema (= 2.8.0) - leaflet-rails (= 0.7.7) - logging-rails (= 0.5.0) + json-schema-rspec (= 0.0.4) + leaflet-rails (= 1.1.0) + logging-rails (= 0.6.0) markerb (= 1.1.0) - mini_magick (= 4.6.1) + mini_magick (= 4.8.0) minitest - mobile-fu (= 1.3.1) - mysql2 (= 0.4.5) - nokogiri (= 1.7.2) - omniauth (= 1.4.2) + mobile_fu (= 1.4.0) + mysql2 (= 0.4.9) + nokogiri (= 1.8.0) + omniauth (= 1.6.1) omniauth-facebook (= 4.0.0) omniauth-tumblr (= 1.2) omniauth-twitter (= 1.4.0) omniauth-wordpress (= 0.2.2) open_graph_reader (= 0.6.2) - openid_connect (= 0.12.0) - pg (= 0.19.0) - poltergeist (= 1.13.0) - pronto (= 0.9.3) + openid_connect (= 1.1.3) + pg (= 0.21.0) + poltergeist (= 1.16.0) + pronto (= 0.9.4) pronto-eslint (= 0.9.1) pronto-haml (= 0.9.0) pronto-rubocop (= 0.9.0) pronto-scss (= 0.9.1) pry pry-byebug - quiet_assets (= 1.1.0) - rack-cors (= 0.4.1) + rack-cors (= 1.0.1) rack-google-analytics (= 1.2.0) rack-piwik (= 0.3.0) rack-rewrite (= 1.5.1) rack-ssl (= 1.4.1) - rails (= 4.2.8) - rails-assets-autosize (= 3.0.20)! + rails (= 5.1.3) + rails-assets-autosize (= 4.0.0)! rails-assets-backbone (= 1.3.3)! - rails-assets-blueimp-gallery (= 2.25.0)! + rails-assets-blueimp-gallery (= 2.25.2)! rails-assets-bootstrap-markdown (= 2.10.0)! rails-assets-corejs-typeahead (= 1.1.1)! rails-assets-diaspora_jsxc (= 0.1.5.develop.7)! rails-assets-fine-uploader (= 5.13.0)! - rails-assets-highlightjs (= 9.9.0)! + rails-assets-highlightjs (= 9.12.0)! rails-assets-jasmine-ajax (= 3.3.1)! - rails-assets-jquery (= 2.2.4)! + rails-assets-jquery (= 3.2.1)! rails-assets-jquery-placeholder (= 2.3.1)! rails-assets-jquery-textchange (= 0.2.3)! rails-assets-jquery.are-you-sure (= 1.9.0)! - rails-assets-markdown-it (= 8.3.0)! + rails-assets-jquery.ui (= 1.11.4)! + rails-assets-markdown-it (= 8.3.2)! rails-assets-markdown-it--markdown-it-for-inline (= 0.1.1)! - rails-assets-markdown-it-diaspora-mention (= 1.1.1)! + rails-assets-markdown-it-diaspora-mention (= 1.2.0)! rails-assets-markdown-it-hashtag (= 0.4.0)! rails-assets-markdown-it-sanitizer (= 0.4.3)! rails-assets-markdown-it-sub (= 1.0.0)! rails-assets-markdown-it-sup (= 1.0.0)! rails-assets-perfect-scrollbar (= 0.6.16)! - rails-i18n (= 4.0.8) + rails-controller-testing (= 1.0.2) + rails-i18n (= 5.0.4) rails-timeago (= 2.16.0) - rb-fsevent (= 0.9.8) - rb-inotify (= 0.9.8) + rb-fsevent (= 0.10.2) + rb-inotify (= 0.9.10) redcarpet (= 3.4.0) - responders (= 2.3.0) - rspec-rails (= 3.5.2) - rubocop (= 0.48.1) - ruby-oembed (= 0.10.1) + responders (= 2.4.0) + rspec-json_expectations (~> 2.1) + rspec-rails (= 3.6.1) + rubocop (= 0.49.1) + ruby-oembed (= 0.12.0) rubyzip (= 1.2.1) sass-rails (= 5.0.6) - secure_headers (= 3.6.1) - shoulda-matchers (= 3.1.1) - sidekiq (= 4.2.9) - sidekiq-cron (= 0.4.5) + secure_headers (= 3.6.7) + shoulda-matchers (= 3.1.2) + sidekiq (= 5.0.4) + sidekiq-cron (= 0.6.3) simple_captcha2 (= 0.4.3) - simplecov (= 0.12.0) + simplecov (= 0.14.1) sinon-rails (= 1.15.0) - spring (= 2.0.1) + spring (= 2.0.2) spring-commands-cucumber (= 1.0.1) spring-commands-rspec (= 1.0.4) + sprockets-rails (= 3.2.0) string-direction (= 1.2.0) - test_after_commit (= 1.1.0) - thor (= 0.19.1) - timecop (= 0.8.1) + timecop (= 0.9.1) turbo_dev_assets (= 0.0.2) twitter (= 6.1.0) - twitter-text (= 1.14.5) + twitter-text (= 1.14.7) typhoeus (= 1.1.2) - uglifier (= 3.1.2) - unicorn (= 5.2.0) + uglifier (= 3.2.0) + unicorn (= 5.3.0) unicorn-worker-killer (= 0.4.4) uuid (= 2.3.8) - versionist (= 1.5.0) - webmock (= 2.3.2) - will_paginate (= 3.1.5) + versionist (= 1.6.0) + webmock (= 3.0.1) + will_paginate (= 3.1.6) BUNDLED WITH - 1.14.5 + 1.15.3 diff --git a/app/assets/javascripts/app/app.js b/app/assets/javascripts/app/app.js index 57066f68d..1360e952e 100644 --- a/app/assets/javascripts/app/app.js +++ b/app/assets/javascripts/app/app.js @@ -121,12 +121,6 @@ var app = { app.flashMessages = new app.views.FlashMessages({el: $("#flash-container")}); }, - /* mixpanel wrapper function */ - instrument : function(type, name, object, callback) { - if(!window.mixpanel) { return; } - window.mixpanel[type](name, object, callback); - }, - setupDisabledLinks: function() { $("a.disabled").click(function(event) { event.preventDefault(); diff --git a/app/assets/javascripts/app/models/post.js b/app/assets/javascripts/app/models/post.js index c351ee787..b693d7b2d 100644 --- a/app/assets/javascripts/app/models/post.js +++ b/app/assets/javascripts/app/models/post.js @@ -48,12 +48,6 @@ app.models.Post = Backbone.Model.extend(_.extend({}, app.models.formatDateMixin, var body = this.get("text").trim() , newlineIdx = body.indexOf("\n"); return (newlineIdx > 0 ) ? body.substr(newlineIdx+1, body.length) : ""; - }, - - //returns a promise - preloadOrFetch : function(){ - var action = app.hasPreload("post") ? this.set(app.parsePreload("post")) : this.fetch(); - return $.when(action); } })); // @license-end diff --git a/app/assets/javascripts/app/models/post/interactions.js b/app/assets/javascripts/app/models/post/interactions.js index 3615387e2..5770b3291 100644 --- a/app/assets/javascripts/app/models/post/interactions.js +++ b/app/assets/javascripts/app/models/post/interactions.js @@ -3,10 +3,6 @@ //require ../post app.models.Post.Interactions = Backbone.Model.extend({ - url : function(){ - return this.post.url() + "/interactions"; - }, - initialize : function(options){ this.post = options.post; this.comments = new app.collections.Comments(this.get("comments"), {post : this.post}); @@ -14,33 +10,16 @@ app.models.Post.Interactions = Backbone.Model.extend({ this.reshares = new app.collections.Reshares(this.get("reshares"), {post : this.post}); }, - parse : function(resp){ - this.comments.reset(resp.comments); - this.likes.reset(resp.likes); - this.reshares.reset(resp.reshares); - - var comments = this.comments - , likes = this.likes - , reshares = this.reshares; - - return { - comments : comments, - likes : likes, - reshares : reshares, - fetched : true - }; - }, - likesCount : function(){ - return this.get("fetched") ? this.likes.models.length : this.get("likes_count"); + return this.get("likes_count"); }, resharesCount : function(){ - return this.get("fetched") ? this.reshares.models.length : this.get("reshares_count"); + return this.get("reshares_count"); }, commentsCount : function(){ - return this.get("fetched") ? this.comments.models.length : this.get("comments_count"); + return this.get("comments_count"); }, userLike : function(){ @@ -76,8 +55,6 @@ app.models.Post.Interactions = Backbone.Model.extend({ app.flashMessages.handleAjaxError(response); } }); - - app.instrument("track", "Like"); }, unlike : function() { @@ -87,8 +64,6 @@ app.models.Post.Interactions = Backbone.Model.extend({ self.set({"likes_count" : self.get("likes_count") - 1}); self.likes.trigger("change"); }}); - - app.instrument("track", "Unlike"); }, comment: function(text, options) { @@ -104,8 +79,6 @@ app.models.Post.Interactions = Backbone.Model.extend({ self.trigger('change'); //updates after sync if (options.success) { options.success(); } }); - - app.instrument("track", "Comment"); }, reshare : function(){ @@ -126,8 +99,6 @@ app.models.Post.Interactions = Backbone.Model.extend({ .fail(function(response) { app.flashMessages.handleAjaxError(response); }); - - app.instrument("track", "Reshare"); }, userCanReshare : function(){ diff --git a/app/assets/javascripts/app/models/stream.js b/app/assets/javascripts/app/models/stream.js index f1978eb76..119107144 100644 --- a/app/assets/javascripts/app/models/stream.js +++ b/app/assets/javascripts/app/models/stream.js @@ -13,8 +13,16 @@ app.models.Stream = Backbone.Collection.extend({ }, collectionOptions :function(){ - var order = this.sortOrder(); - return { comparator : function(item) { return -item[order](); } }; + var order = this.sortOrder(); + return { + comparator: function(item1, item2) { + if (item1[order]() < item2[order]()) { return 1; } + if (item1[order]() > item2[order]()) { return -1; } + if (item1.id < item2.id) { return 1; } + if (item1.id > item2.id) { return -1; } + return 0; + } + }; }, url : function(){ diff --git a/app/assets/javascripts/app/pages/single-post-viewer.js b/app/assets/javascripts/app/pages/single-post-viewer.js index c5a30f1c9..f12f45a33 100644 --- a/app/assets/javascripts/app/pages/single-post-viewer.js +++ b/app/assets/javascripts/app/pages/single-post-viewer.js @@ -9,9 +9,8 @@ app.pages.SinglePostViewer = app.views.Base.extend({ }, initialize : function() { - this.model = new app.models.Post({ id : gon.post.id }); - this.model.preloadOrFetch().done(_.bind(this.initViews, this)); - this.model.interactions.fetch(); //async, yo, might want to throttle this later. + this.model = new app.models.Post(gon.post); + this.initViews(); }, initViews : function() { diff --git a/app/assets/javascripts/app/router.js b/app/assets/javascripts/app/router.js index b189cad86..ab9e11a69 100644 --- a/app/assets/javascripts/app/router.js +++ b/app/assets/javascripts/app/router.js @@ -9,7 +9,7 @@ app.Router = Backbone.Router.extend({ "commented(/)": "stream", "community_spotlight(/)": "spotlight", "contacts(/)": "contacts", - "conversations(/)(:id)(/)": "conversations", + "conversations(/)(:id)(?conversation_id=:conversation_id)(/)": "conversations", "followed_tags(/)": "followed_tags", "getting_started(/)": "gettingStarted", "help(/)": "help", @@ -93,8 +93,8 @@ app.Router = Backbone.Router.extend({ app.page = new app.pages.Contacts({stream: stream}); }, - conversations: function(id) { - app.conversations = app.conversations || new app.views.ConversationsInbox(); + conversations: function(id, conversationId) { + app.conversations = app.conversations || new app.views.ConversationsInbox(conversationId); if (parseInt("" + id, 10)) { app.conversations.renderConversation(id); } @@ -182,7 +182,7 @@ app.Router = Backbone.Router.extend({ }, singlePost: function(id) { - this.renderPage(function() { return new app.pages.SinglePostViewer({id: id}); }); + this.renderPage(function() { return new app.pages.SinglePostViewer({id: id, el: $("#container")}); }); }, spotlight: function() { diff --git a/app/assets/javascripts/app/views/comment_mention_view.js b/app/assets/javascripts/app/views/comment_mention_view.js new file mode 100644 index 000000000..52b125774 --- /dev/null +++ b/app/assets/javascripts/app/views/comment_mention_view.js @@ -0,0 +1,10 @@ +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later +//= require ./publisher/mention_view + +app.views.CommentMention = app.views.PublisherMention.extend({ + initialize: function(opts) { + opts.url = Routes.mentionablePost(opts.postId); + app.views.PublisherMention.prototype.initialize.call(this, opts); + } +}); +// @license-end diff --git a/app/assets/javascripts/app/views/comment_stream_view.js b/app/assets/javascripts/app/views/comment_stream_view.js index 05ba192db..2a1b81612 100644 --- a/app/assets/javascripts/app/views/comment_stream_view.js +++ b/app/assets/javascripts/app/views/comment_stream_view.js @@ -9,8 +9,8 @@ app.views.CommentStream = app.views.Base.extend({ events: { "keydown .comment_box": "keyDownOnCommentBox", "submit form": "createComment", - "focus .comment_box": "commentTextareaFocused", - "click .toggle_post_comments": "expandComments" + "click .toggle_post_comments": "expandComments", + "click form": "openForm" }, initialize: function() { @@ -21,12 +21,22 @@ app.views.CommentStream = app.views.Base.extend({ setupBindings: function() { this.model.comments.bind("add", this.appendComment, this); this.model.comments.bind("remove", this.removeComment, this); + $(document.body).click(this.onFormBlur.bind(this)); }, postRenderTemplate : function() { this.model.comments.each(this.appendComment, this); this.commentBox = this.$(".comment_box"); this.commentSubmitButton = this.$("input[name='commit']"); + this.mentions = new app.views.CommentMention({el: this.$el, postId: this.model.get("id")}); + + this.mdEditor = new Diaspora.MarkdownEditor(this.$(".comment_box"), { + onPreview: function($mdInstance) { + var renderedText = app.helpers.textFormatter($mdInstance.getContent(), this.mentions.getMentionedPeople()); + return "
" + renderedText + "
"; + }.bind(this), + onFocus: this.openForm.bind(this) + }); }, presenter: function(){ @@ -52,11 +62,14 @@ app.views.CommentStream = app.views.Base.extend({ success: function() { this.commentBox.val(""); this.enableCommentBox(); + this.mdEditor.hidePreview(); + this.closeForm(); autosize.update(this.commentBox); }.bind(this), error: function() { this.enableCommentBox(); - this.commentBox.focus(); + this.mdEditor.hidePreview(); + this.openForm(); }.bind(this) }); }, @@ -72,7 +85,7 @@ app.views.CommentStream = app.views.Base.extend({ }, keyDownOnCommentBox: function(evt) { - if(evt.which === Keycodes.ENTER && evt.ctrlKey) { + if (evt.which === Keycodes.ENTER && (evt.metaKey || evt.ctrlKey)) { this.$("form").submit(); return false; } @@ -105,7 +118,8 @@ app.views.CommentStream = app.views.Base.extend({ // on post ownership in the Comment view. comment.set({parent : this.model.toJSON()}); - var commentHtml = new this.CommentView({model: comment}).render().el; + var commentView = new this.CommentView({model: comment}); + var commentHtml = commentView.render().el; var commentBlocks = this.$(".comments div.comment.media"); this._moveInsertPoint(comment.get("created_at"), commentBlocks); if (this._insertPoint >= commentBlocks.length) { @@ -115,16 +129,13 @@ app.views.CommentStream = app.views.Base.extend({ } else { commentBlocks.eq(this._insertPoint).before(commentHtml); } + commentView.renderPluginWidgets(); }, removeComment: function(comment) { this.$("#" + comment.get("guid")).closest(".comment.media").remove(); }, - commentTextareaFocused: function(){ - this.$("form").removeClass('hidden').addClass("open"); - }, - expandComments: function(evt){ this.$(".loading-comments").removeClass("hidden"); if(evt){ evt.preventDefault(); } @@ -134,6 +145,37 @@ app.views.CommentStream = app.views.Base.extend({ this.$(".loading-comments").addClass("hidden"); }.bind(this) }); + }, + + openForm: function() { + this.$("form").addClass("open"); + this.$(".md-editor").addClass("active"); + }, + + closeForm: function() { + this.$("form").removeClass("open"); + this.$(".md-editor").removeClass("active"); + this.commentBox.blur(); + autosize.update(this.commentBox); + }, + + isCloseAllowed: function() { + if (this.mdEditor === undefined) { + return true; + } + return !this.mdEditor.isPreviewMode() && this.mdEditor.userInputEmpty(); + }, + + onFormBlur: function(evt) { + if (!this.isCloseAllowed()) { + return; + } + + var $target = $(evt.target); + var isForm = $target.hasClass("new-comment") || $target.parents(".new-comment").length !== 0; + if (!isForm && !$target.hasClass("focus_comment_textarea")) { + this.closeForm(); + } } }); // @license-end diff --git a/app/assets/javascripts/app/views/comment_view.js b/app/assets/javascripts/app/views/comment_view.js index 7f74d1146..788344478 100644 --- a/app/assets/javascripts/app/views/comment_view.js +++ b/app/assets/javascripts/app/views/comment_view.js @@ -4,6 +4,7 @@ app.views.Comment = app.views.Content.extend({ templateName: "comment", className : "comment media", + tooltipSelector: "time", events : function() { return _.extend({}, app.views.Content.prototype.events, { @@ -20,7 +21,7 @@ app.views.Comment = app.views.Content.extend({ presenter : function() { return _.extend(this.defaultPresenter(), { canRemove: this.canRemove(), - text : app.helpers.textFormatter(this.model.get("text")) + text: app.helpers.textFormatter(this.model.get("text"), this.model.get("mentioned_people")) }); }, diff --git a/app/assets/javascripts/app/views/content_view.js b/app/assets/javascripts/app/views/content_view.js index 7027ea97c..5a5a9e9af 100644 --- a/app/assets/javascripts/app/views/content_view.js +++ b/app/assets/javascripts/app/views/content_view.js @@ -17,15 +17,14 @@ app.views.Content = app.views.Base.extend({ largePhoto : function() { var photos = this.model.get("photos"); - if(!photos || photos.length === 0) { return } + if (!photos || photos.length === 0) { return false; } return photos[0]; }, smallPhotos : function() { var photos = this.model.get("photos"); - if(!photos || photos.length < 2) { return } - photos.splice(0, 1); // remove first photo as it is already shown as largePhoto - return photos; + if (!photos || photos.length < 2) { return false; } + return photos.slice(1); // remove first photo as it is already shown as largePhoto }, expandPost: function(evt) { diff --git a/app/assets/javascripts/app/views/conversations_form_view.js b/app/assets/javascripts/app/views/conversations_form_view.js index e3b553b7a..a28b6d426 100644 --- a/app/assets/javascripts/app/views/conversations_form_view.js +++ b/app/assets/javascripts/app/views/conversations_form_view.js @@ -24,6 +24,8 @@ app.views.ConversationsForm = app.views.Base.extend({ remoteRoute: {url: "/contacts", extraParameters: "mutual=true"} }); + this.newConversationMdEditor = this.renderMarkdownEditor("#new-message-text"); + this.bindTypeaheadEvents(); this.tagListElement.empty(); @@ -31,10 +33,16 @@ app.views.ConversationsForm = app.views.Base.extend({ this.prefill(opts.prefill); } - this.$("form#new-conversation").on("ajax:success", this.conversationCreateSuccess); + this.$("form#new-conversation").on("ajax:success", this.conversationCreateSuccess.bind(this)); this.$("form#new-conversation").on("ajax:error", this.conversationCreateError); }, + renderMarkdownEditor: function(element) { + return new Diaspora.MarkdownEditor($(element), { + onPreview: Diaspora.MarkdownEditor.simplePreview + }); + }, + addRecipient: function(person) { this.conversationRecipients.push(person); this.updateContactIdsListInput(); @@ -66,7 +74,7 @@ app.views.ConversationsForm = app.views.Base.extend({ }, keyDown: function(evt) { - if (evt.which === Keycodes.ENTER && evt.ctrlKey) { + if (evt.which === Keycodes.ENTER && (evt.metaKey || evt.ctrlKey)) { $(evt.target).parents("form").submit(); } }, @@ -84,6 +92,7 @@ app.views.ConversationsForm = app.views.Base.extend({ }, conversationCreateSuccess: function(evt, data) { + this.newConversationMdEditor.hidePreview(); app._changeLocation(Routes.conversation(data.id)); }, diff --git a/app/assets/javascripts/app/views/conversations_inbox_view.js b/app/assets/javascripts/app/views/conversations_inbox_view.js index 67292cc75..9dc556343 100644 --- a/app/assets/javascripts/app/views/conversations_inbox_view.js +++ b/app/assets/javascripts/app/views/conversations_inbox_view.js @@ -8,11 +8,21 @@ app.views.ConversationsInbox = app.views.Base.extend({ "click .new-conversation-btn": "displayNewConversation" }, - initialize: function() { - new app.views.ConversationsForm(); + initialize: function(conversationId) { + this.conversationForm = new app.views.ConversationsForm(); + + // Creates markdown editor in case of displaying preloaded conversation + if (conversationId != null) { + this.renderMarkdownEditor(); + } + this.setupConversation(); }, + renderMarkdownEditor: function() { + this.conversationForm.renderMarkdownEditor("#conversation-show .conversation-message-text"); + }, + renderConversation: function(conversationId) { var self = this; $.ajax({ @@ -23,6 +33,8 @@ app.views.ConversationsInbox = app.views.Base.extend({ self.$el.find("#conversation-show").removeClass("hidden").html(data); self.selectConversation(conversationId); self.setupConversation(); + self.renderMarkdownEditor(); + autosize(self.$("#conversation-show textarea")); } }); }, diff --git a/app/assets/javascripts/app/views/help_view.js b/app/assets/javascripts/app/views/help_view.js index 48731e55c..24052f09f 100644 --- a/app/assets/javascripts/app/views/help_view.js +++ b/app/assets/javascripts/app/views/help_view.js @@ -4,27 +4,29 @@ app.views.Help = app.views.StaticContentView.extend({ templateName : "help", events : { - "click .faq-link" : "sectionClicked", - "click .faq-link-getting-help" : "gettingHelp", - "click .faq-link-sharing" : "sharing", - "click .faq-link-posts-and-posting" : "postsAndPosting", + "click .faq-link": "sectionClicked", + "click .faq-link-getting-help": "gettingHelp", + "click .faq-link-sharing": "sharing", + "click .faq-link-posts-and-posting": "postsAndPosting", "click .faq-link-tags": "tags", - "click .faq-link-keyboard-shortcuts" : "keyboardShortcuts", - "click .faq-link-chat" : "chat" + "click .faq-link-keyboard-shortcuts": "keyboardShortcuts", + "click .faq-link-chat": "chat" }, initialize : function() { this.GETTING_HELP_SUBS = { - getting_started_a: { tutorial_series: this.linkHtml("http://diasporafoundation.org/getting_started/sign_up", Diaspora.I18n.t( 'getting_started_tutorial' )) }, - get_support_a_website: { link: this.linkHtml("https://diasporafoundation.org/", Diaspora.I18n.t( 'foundation_website' ))}, - get_support_a_tutorials: { tutorials: this.linkHtml("https://diasporafoundation.org/tutorials", Diaspora.I18n.t( 'tutorials' ))}, - get_support_a_wiki: { link: this.linkHtml("https://wiki.diasporafoundation.org/Special:Search", Diaspora.I18n.t( 'wiki' ))}, - get_support_a_irc: { irc: this.linkHtml("https://wiki.diasporafoundation.org/How_We_Communicate#IRC", Diaspora.I18n.t( 'irc' ))}, - get_support_a_faq: { faq: this.linkHtml("https://wiki.diasporafoundation.org/FAQ_for_users", Diaspora.I18n.t( 'faq' ))}, - get_support_a_hashtag: { question: this.linkHtml("/tags/question", "#question")} + getting_started_a: {tutorial_series: this.linkHtml("http://diasporafoundation.org/getting_started/sign_up", Diaspora.I18n.t("getting_started_tutorial"))}, + get_support_a_website: {link: this.linkHtml("https://diasporafoundation.org/", Diaspora.I18n.t("foundation_website"))}, + get_support_a_tutorials: {tutorials: this.linkHtml("https://diasporafoundation.org/tutorials", Diaspora.I18n.t("tutorials"))}, + get_support_a_wiki: {link: this.linkHtml("https://wiki.diasporafoundation.org/Special:Search", Diaspora.I18n.t("wiki"))}, + get_support_a_irc: {irc: this.linkHtml("https://wiki.diasporafoundation.org/How_We_Communicate#IRC", Diaspora.I18n.t("irc"))}, + get_support_a_faq: {faq: this.linkHtml("https://wiki.diasporafoundation.org/FAQ_for_users", Diaspora.I18n.t("faq"))}, + get_support_a_hashtag: {question: this.linkHtml("/tags/question", "#question")}, + get_support_a_discourse: {discourse: this.linkHtml("https://discourse.diasporafoundation.org/c/support", "discussions & support")} }; this.POSTS_AND_POSTING_SUBS = { + post_report_a: {community_guidelines: this.linkHtml("https://diasporafoundation.org/community_guidelines", Diaspora.I18n.t("community_guidelines"))}, format_text_a: { markdown: this.linkHtml("http://diasporafoundation.org/formatting", Diaspora.I18n.t( 'markdown' )), here: this.linkHtml("http://daringfireball.net/projects/markdown/syntax", Diaspora.I18n.t( 'here' )) @@ -53,10 +55,9 @@ app.views.Help = app.views.StaticContentView.extend({ title_pods: Diaspora.I18n.t( 'pods.title' ), title_posts_and_posting: Diaspora.I18n.t( 'posts_and_posting.title' ), title_private_posts: Diaspora.I18n.t( 'private_posts.title' ), - title_private_profiles: Diaspora.I18n.t( 'private_profiles.title' ), title_public_posts: Diaspora.I18n.t( 'public_posts.title' ), - title_public_profiles: Diaspora.I18n.t( 'public_profiles.title' ), title_resharing_posts: Diaspora.I18n.t( 'resharing_posts.title' ), + title_profile: Diaspora.I18n.t("profile.title"), title_sharing: Diaspora.I18n.t( 'sharing.title' ), title_tags: Diaspora.I18n.t( 'tags.title' ), title_keyboard_shortcuts: Diaspora.I18n.t( 'keyboard_shortcuts.title' ), diff --git a/app/assets/javascripts/app/views/infinite_stream_view.js b/app/assets/javascripts/app/views/infinite_stream_view.js index d5783d559..0a800da42 100644 --- a/app/assets/javascripts/app/views/infinite_stream_view.js +++ b/app/assets/javascripts/app/views/infinite_stream_view.js @@ -51,6 +51,12 @@ app.views.InfScroll = app.views.Base.extend({ } }, + postRenderTemplate: function() { + if (this.postViews.length > 0) { + this.$(".no-posts-info").closest(".stream-element").remove(); + } + }, + showNoPostsInfo: function() { if (this.postViews.length === 0) { var noPostsInfo = new app.views.NoPostsInfo(); diff --git a/app/assets/javascripts/app/views/notification_dropdown_view.js b/app/assets/javascripts/app/views/notification_dropdown_view.js index c33287787..1d14cac08 100644 --- a/app/assets/javascripts/app/views/notification_dropdown_view.js +++ b/app/assets/javascripts/app/views/notification_dropdown_view.js @@ -26,7 +26,6 @@ app.views.NotificationDropdown = app.views.Base.extend({ toggleDropdown: function(evt){ evt.stopPropagation(); - if (!$("#notifications-link .entypo-bell:visible").length) { return true; } evt.preventDefault(); if(this.dropdownShowing()){ this.hideDropdown(evt); } else{ this.showDropdown(); } diff --git a/app/assets/javascripts/app/views/preview_post_view.js b/app/assets/javascripts/app/views/preview_post_view.js index d3b975f65..41a793f7b 100644 --- a/app/assets/javascripts/app/views/preview_post_view.js +++ b/app/assets/javascripts/app/views/preview_post_view.js @@ -5,7 +5,6 @@ app.views.PreviewPost = app.views.Post.extend({ className: "stream-element loaded", subviews: { - ".feedback": "feedbackView", ".post-content": "postContentView", ".oembed": "oEmbedView", ".opengraph": "openGraphView", @@ -13,12 +12,6 @@ app.views.PreviewPost = app.views.Post.extend({ ".status-message-location": "postLocationStreamView" }, - tooltipSelector: [ - ".timeago", - ".delete", - ".permalink" - ].join(", "), - initialize: function() { this.model.set("preview", true); this.oEmbedView = new app.views.OEmbed({model: this.model}); @@ -26,10 +19,6 @@ app.views.PreviewPost = app.views.Post.extend({ this.pollView = new app.views.Poll({model: this.model}); }, - feedbackView: function() { - return new app.views.Feedback({model: this.model}); - }, - postContentView: function() { return new app.views.StatusMessage({model: this.model}); }, diff --git a/app/assets/javascripts/app/views/publisher/mention_view.js b/app/assets/javascripts/app/views/publisher/mention_view.js index 86b3b07aa..bf15dc85e 100644 --- a/app/assets/javascripts/app/views/publisher/mention_view.js +++ b/app/assets/javascripts/app/views/publisher/mention_view.js @@ -2,29 +2,20 @@ app.views.PublisherMention = app.views.SearchBase.extend({ triggerChar: "@", - invisibleChar: "\u200B", // zero width space mentionRegex: /@([^@\s]+)$/, - - templates: { - mentionItemSyntax: _.template("@{<%= name %> ; <%= handle %>}"), - mentionItemHighlight: _.template("<%= name %>") - }, + mentionSyntaxTemplate: function(person) { return "@{" + person.handle + "}"; }, events: { - "keydown #status_message_fake_text": "onInputBoxKeyDown", - "input #status_message_fake_text": "onInputBoxInput", - "click #status_message_fake_text": "onInputBoxClick", - "blur #status_message_fake_text": "onInputBoxBlur" + "keydown .mention-textarea": "onInputBoxKeyDown", + "input .mention-textarea": "updateTypeaheadInput", + "click .mention-textarea": "onInputBoxClick", + "blur .mention-textarea": "onInputBoxBlur" }, - initialize: function() { + initialize: function(opts) { this.mentionedPeople = []; - - // contains the 'fake text' displayed to the user - // also has a data-messageText attribute with the original text - this.inputBox = this.$("#status_message_fake_text"); - // contains the mentions displayed to the user - this.mentionsBox = this.$(".mentions-box"); + var url = (opts && opts.url) || "/contacts"; + this.inputBox = this.$(".mention-textarea"); this.typeaheadInput = this.$(".typeahead-mention-box"); this.bindTypeaheadEvents(); @@ -32,7 +23,7 @@ app.views.PublisherMention = app.views.SearchBase.extend({ typeaheadInput: this.typeaheadInput, customSearch: true, autoselect: true, - remoteRoute: {url: "/contacts"} + remoteRoute: {url: url} }); }, @@ -55,8 +46,8 @@ app.views.PublisherMention = app.views.SearchBase.extend({ cleanMentionedPeople: function() { var inputText = this.inputBox.val(); this.mentionedPeople = this.mentionedPeople.filter(function(person) { - return person.name && inputText.indexOf(person.name) > -1; - }); + return person.handle && inputText.indexOf(this.mentionSyntaxTemplate(person)) > -1; + }.bind(this)); this.ignoreDiasporaIds = this.mentionedPeople.map(function(person) { return person.handle; }); }, @@ -70,41 +61,16 @@ app.views.PublisherMention = app.views.SearchBase.extend({ this.addPersonToMentions(person); this.closeSuggestions(); - messageText = messageText.substring(0, triggerCharPosition) + - this.invisibleChar + person.name + messageText.substring(caretPosition); + var mentionText = this.mentionSyntaxTemplate(person); + + messageText = messageText.substring(0, triggerCharPosition) + mentionText + messageText.substring(caretPosition); this.inputBox.val(messageText); - this.updateMessageTexts(); - this.inputBox.focus(); - var newCaretPosition = triggerCharPosition + person.name.length + 1; + var newCaretPosition = triggerCharPosition + mentionText.length; this.inputBox[0].setSelectionRange(newCaretPosition, newCaretPosition); }, - /** - * Replaces every combination of this.invisibleChar + mention.name by the - * correct syntax for both hidden text and visible one. - * - * For instance, the text "Hello \u200Buser1" will be tranformed to - * "Hello @{user1 ; user1@pod.tld}" in the hidden element and - * "Hello user1" in the element visible to the user. - */ - updateMessageTexts: function() { - var fakeMessageText = this.inputBox.val(), - mentionBoxText = _.escape(fakeMessageText), - messageText = fakeMessageText; - - this.mentionedPeople.forEach(function(person) { - var mentionName = this.invisibleChar + person.name; - messageText = messageText.replace(mentionName, this.templates.mentionItemSyntax(person)); - var textHighlight = this.templates.mentionItemHighlight({name: _.escape(person.name)}); - mentionBoxText = mentionBoxText.replace(mentionName, textHighlight); - }, this); - - this.inputBox.data("messageText", messageText); - this.mentionsBox.find(".mentions").html(mentionBoxText); - }, - updateTypeaheadInput: function() { var messageText = this.inputBox.val(); var caretPosition = this.inputBox[0].selectionStart; @@ -115,6 +81,8 @@ app.views.PublisherMention = app.views.SearchBase.extend({ return; } + this.cleanMentionedPeople(); + // result[1] is the string between the last '@' and the current caret position this.typeaheadInput.typeahead("val", result[1]); this.typeaheadInput.typeahead("open"); @@ -128,12 +96,11 @@ app.views.PublisherMention = app.views.SearchBase.extend({ prefillMention: function(persons) { persons.forEach(function(person) { this.addPersonToMentions(person); - var text = this.invisibleChar + person.name; + var text = this.mentionSyntaxTemplate(person); if(this.inputBox.val().length !== 0) { text = this.inputBox.val() + " " + text; } this.inputBox.val(text); - this.updateMessageTexts(); }, this); }, @@ -154,15 +121,6 @@ app.views.PublisherMention = app.views.SearchBase.extend({ this.typeaheadInput.trigger($.Event("keydown", {keyCode: e.keyCode, which: e.which})); }, - /** - * Listens for user input and opens results dropdown when input contains the trigger char - */ - onInputBoxInput: function() { - this.cleanMentionedPeople(); - this.updateMessageTexts(); - this.updateTypeaheadInput(); - }, - onInputBoxKeyDown: function(e) { // This also matches HOME/END on OSX which is CMD+LEFT, CMD+RIGHT if(e.which === Keycodes.LEFT || e.which === Keycodes.RIGHT || @@ -205,7 +163,7 @@ app.views.PublisherMention = app.views.SearchBase.extend({ reset: function() { this.inputBox.val(""); - this.onInputBoxInput(); + this.updateTypeaheadInput(); }, closeSuggestions: function() { @@ -217,7 +175,8 @@ app.views.PublisherMention = app.views.SearchBase.extend({ return this.$(".tt-menu").is(":visible"); }, - getTextForSubmit: function() { - return this.mentionedPeople.length ? this.inputBox.data("messageText") : this.inputBox.val(); + getMentionedPeople: function() { + this.cleanMentionedPeople(); + return this.mentionedPeople; } }); diff --git a/app/assets/javascripts/app/views/publisher_view.js b/app/assets/javascripts/app/views/publisher_view.js index a80ef3555..baffa26da 100644 --- a/app/assets/javascripts/app/views/publisher_view.js +++ b/app/assets/javascripts/app/views/publisher_view.js @@ -18,11 +18,11 @@ app.views.Publisher = Backbone.View.extend({ el : "#publisher", events : { - "keydown #status_message_fake_text" : "keyDown", + "keydown #status_message_text": "keyDown", "focus textarea" : "open", "submit form" : "createStatusMessage", "click #submit" : "createStatusMessage", - "textchange #status_message_fake_text": "handleTextchange", + "textchange #status_message_text": "checkSubmitAvailability", "click #locator" : "showLocation", "click #poll_creator" : "togglePollCreator", "click #hide_location" : "destroyLocation", @@ -35,8 +35,7 @@ app.views.Publisher = Backbone.View.extend({ this.disabled = false; // init shortcut references to the various elements - this.inputEl = this.$("#status_message_fake_text"); - this.hiddenInputEl = this.$("#status_message_text"); + this.inputEl = this.$("#status_message_text"); this.wrapperEl = this.$("#publisher_textarea_wrapper"); this.submitEl = this.$("input[type=submit], button#submit"); this.photozoneEl = this.$("#photodropzone"); @@ -46,14 +45,6 @@ app.views.Publisher = Backbone.View.extend({ $(window).on("beforeunload", _.bind(this._beforeUnload, this)); $(window).on("unload", this.clear.bind(this)); - // sync textarea content - if( this.hiddenInputEl.val() === "" ) { - this.hiddenInputEl.val( this.inputEl.val() ); - } - if( this.inputEl.val() === "" ) { - this.inputEl.val( this.hiddenInputEl.val() ); - } - // hide close and preview buttons and manage services link // in case publisher is standalone // (e.g. bookmarklet, mentions popup) @@ -163,7 +154,7 @@ app.views.Publisher = Backbone.View.extend({ this.viewPollCreator.render(); if (this.prefillMention) { - this.handleTextchange(); + this.checkSubmitAvailability(); } }, @@ -175,12 +166,11 @@ app.views.Publisher = Backbone.View.extend({ // inject content into the publisher textarea setText: function(txt) { this.inputEl.val(txt); - this.hiddenInputEl.val(txt); this.prefillText = txt; this.inputEl.trigger("input"); autosize.update(this.inputEl); - this.handleTextchange(); + this.checkSubmitAvailability(); }, // show the "getting started" popups around the publisher @@ -202,9 +192,6 @@ app.views.Publisher = Backbone.View.extend({ // empty poll answer and failing validation. this.viewPollCreator.removeLastAnswer(); - //add missing mentions at end of post: - this.handleTextchange(); - var serializedForm = $(evt.target).closest("form").serializeObject(); // disable input while posting, must be after the form is serialized this.setInputEnabled(false); @@ -255,7 +242,7 @@ app.views.Publisher = Backbone.View.extend({ self.setButtonsEnabled(true); self.setInputEnabled(true); self.wrapperEl.removeClass("submitting"); - self.handleTextchange(); + self.checkSubmitAvailability(); autosize.update(self.inputEl); } }); @@ -330,13 +317,8 @@ app.views.Publisher = Backbone.View.extend({ }, createPostPreview: function() { - //add missing mentions at end of post: - this.handleTextchange(); - var serializedForm = $("#new_status_message").serializeObject(); - var text = this.mention.getTextForSubmit(); var photos = this.getUploadedPhotos(); - var mentionedPeople = this.mention.mentionedPeople; var poll = this.getPollData(serializedForm); var locationCoords = serializedForm["location[coords]"]; if(!locationCoords || locationCoords === "") { @@ -352,12 +334,12 @@ app.views.Publisher = Backbone.View.extend({ var previewMessage = { "id": 0, - "text": text, + "text": serializedForm["status_message[text]"], "public": serializedForm["aspect_ids[]"] === "public", "created_at": new Date().toISOString(), "interacted_at": new Date().toISOString(), "author": app.currentUser ? app.currentUser.attributes : {}, - "mentioned_people": mentionedPeople, + "mentioned_people": this.mention.getMentionedPeople(), "photos": photos, "title": serializedForm["status_message[text]"], "location": location, @@ -370,7 +352,7 @@ app.views.Publisher = Backbone.View.extend({ }, keyDown : function(evt) { - if(evt.which === Keycodes.ENTER && evt.ctrlKey) { + if (evt.which === Keycodes.ENTER && (evt.metaKey || evt.ctrlKey)) { this.$("form").submit(); this.open(); return false; @@ -381,11 +363,10 @@ app.views.Publisher = Backbone.View.extend({ // remove mentions this.mention.reset(); - // clear text(s) + // clear text this.inputEl.val(""); - this.hiddenInputEl.val(""); this.inputEl.trigger("keyup") - .trigger("keydown"); + .trigger("keydown"); autosize.update(this.inputEl); // remove photos @@ -421,14 +402,13 @@ app.views.Publisher = Backbone.View.extend({ // force textchange plugin to update lastValue this.inputEl.data("lastValue", ""); - this.hiddenInputEl.data("lastValue", ""); return this; }, tryClose : function(){ - // if it is not submittable, close it. - if( !this._submittable() ){ + // if it is not submittable and not in preview mode, close it. + if (!this._submittable() && !this.markdownEditor.isPreviewMode()) { this.close(); } }, @@ -472,8 +452,7 @@ app.views.Publisher = Backbone.View.extend({ setEnabled: function(bool) { this.setInputEnabled(bool); this.disabled = !bool; - - this.handleTextchange(); + this.checkSubmitAvailability(); }, setButtonsEnabled: function(bool) { @@ -487,10 +466,8 @@ app.views.Publisher = Backbone.View.extend({ setInputEnabled: function(bool) { if (bool) { this.inputEl.removeAttr("disabled"); - this.hiddenInputEl.removeAttr("disabled"); } else { this.inputEl.prop("disabled", true); - this.hiddenInputEl.prop("disabled", true); } }, @@ -503,11 +480,6 @@ app.views.Publisher = Backbone.View.extend({ return (!onlyWhitespaces || isPhotoAttached) && isValidPoll && !this.disabled; }, - handleTextchange: function() { - this.checkSubmitAvailability(); - this.hiddenInputEl.val(this.mention.getTextForSubmit()); - }, - _beforeUnload: function(e) { if(this._submittable() && this.inputEl.val() !== this.prefillText){ var confirmationMessage = Diaspora.I18n.t("confirm_unload"); diff --git a/app/assets/javascripts/app/views/single-post-viewer/single_post_comment_stream.js b/app/assets/javascripts/app/views/single-post-viewer/single_post_comment_stream.js index 49ddf11db..6981bdc3a 100644 --- a/app/assets/javascripts/app/views/single-post-viewer/single_post_comment_stream.js +++ b/app/assets/javascripts/app/views/single-post-viewer/single_post_comment_stream.js @@ -7,7 +7,9 @@ app.views.SinglePostCommentStream = app.views.CommentStream.extend({ this.CommentView = app.views.ExpandedComment; $(window).on('hashchange',this.highlightPermalinkComment); this.setupBindings(); - this.model.comments.on("reset", this.render, this); + this.model.comments.fetch({success: function() { + setTimeout(this.highlightPermalinkComment, 0); + }.bind(this)}); }, highlightPermalinkComment: function() { @@ -17,14 +19,13 @@ app.views.SinglePostCommentStream = app.views.CommentStream.extend({ $(".highlighted").removeClass("highlighted"); element.addClass("highlighted"); var pos = element.offset().top - headerSize; - window.scroll(0, pos); + $("html,body").animate({scrollTop: pos}); } }, postRenderTemplate: function() { app.views.CommentStream.prototype.postRenderTemplate.apply(this); this.$(".new-comment-form-wrapper").removeClass("hidden"); - _.defer(this.highlightPermalinkComment); }, presenter: function(){ diff --git a/app/assets/javascripts/app/views/single-post-viewer/single_post_interaction_counts.js b/app/assets/javascripts/app/views/single-post-viewer/single_post_interaction_counts.js index 42348627c..abc4f5d9e 100644 --- a/app/assets/javascripts/app/views/single-post-viewer/single_post_interaction_counts.js +++ b/app/assets/javascripts/app/views/single-post-viewer/single_post_interaction_counts.js @@ -4,8 +4,15 @@ app.views.SinglePostInteractionCounts = app.views.Base.extend({ templateName: "single-post-viewer/single-post-interaction-counts", tooltipSelector: ".avatar.micro", + events: { + "click #show-all-likes": "showAllLikes", + "click #show-all-reshares": "showAllReshares" + }, + initialize: function() { this.model.interactions.on("change", this.render, this); + this.model.interactions.likes.on("change", this.render, this); + this.model.interactions.reshares.on("change", this.render, this); }, presenter: function() { @@ -15,8 +22,28 @@ app.views.SinglePostInteractionCounts = app.views.Base.extend({ reshares: interactions.reshares.toJSON(), commentsCount: interactions.commentsCount(), likesCount: interactions.likesCount(), - resharesCount: interactions.resharesCount() + resharesCount: interactions.resharesCount(), + showMoreLikes: interactions.likes.length < interactions.likesCount(), + showMoreReshares: interactions.reshares.length < interactions.resharesCount() }; + }, + + _showAll: function(interactionType, models) { + this.$("#show-all-" + interactionType).addClass("hidden"); + this.$("#" + interactionType + " .loader").removeClass("hidden"); + models.fetch({success: function() { + models.trigger("change"); + }}); + }, + + showAllLikes: function(evt) { + evt.preventDefault(); + this._showAll("likes", this.model.interactions.likes); + }, + + showAllReshares: function(evt) { + evt.preventDefault(); + this._showAll("reshares", this.model.interactions.reshares); } }); // @license-end diff --git a/app/assets/javascripts/helpers/markdown_editor.js b/app/assets/javascripts/helpers/markdown_editor.js index 5706888a1..5da96bbf0 100644 --- a/app/assets/javascripts/helpers/markdown_editor.js +++ b/app/assets/javascripts/helpers/markdown_editor.js @@ -9,7 +9,8 @@ Diaspora.MarkdownEditor.prototype = { this.options = { resize: "none", onHidePreview: $.noop, - onPostPreview: $.noop + onPostPreview: $.noop, + onChange: function(e) { autosize.update(e.$textarea); } }; $.extend(this.options, opts); @@ -130,6 +131,14 @@ Diaspora.MarkdownEditor.prototype = { } }, + isPreviewMode: function() { + return this.instance !== undefined && this.instance.$editor.find(".md-preview").length > 0; + }, + + userInputEmpty: function() { + return this.instance === undefined || this.instance.getContent().length === 0; + }, + localize: function() { var locale = Diaspora.I18n.language; @@ -160,3 +169,7 @@ Diaspora.MarkdownEditor.prototype = { return locale; } }; + +Diaspora.MarkdownEditor.simplePreview = function($mdInstance) { + return "
" + app.helpers.textFormatter($mdInstance.getContent()) + "
"; +}; diff --git a/app/assets/javascripts/jasmine-load-all.js b/app/assets/javascripts/jasmine-load-all.js index be83acdec..b465abdad 100644 --- a/app/assets/javascripts/jasmine-load-all.js +++ b/app/assets/javascripts/jasmine-load-all.js @@ -1,4 +1,4 @@ -//= require jquery2 +//= require jquery3 //= require handlebars.runtime //= require templates //= require main diff --git a/app/assets/javascripts/jsxc.js b/app/assets/javascripts/jsxc.js index 9e90634ca..66ed5d622 100644 --- a/app/assets/javascripts/jsxc.js +++ b/app/assets/javascripts/jsxc.js @@ -1,5 +1,5 @@ //= require emojione -//= require favico.js +//= require favico.js/favico //= require jquery.ui/ui/resizable //= require jquery.ui/ui/draggable diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index dccddf014..a59460b96 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -10,10 +10,10 @@ //= require charcount //= require jquery-placeholder //= require jquery.timeago -//= require jquery-ui/core -//= require jquery-ui/widget -//= require jquery-ui/mouse -//= require jquery-ui/sortable +//= require jquery.ui/ui/core +//= require jquery.ui/ui/widget +//= require jquery.ui/ui/mouse +//= require jquery.ui/ui/sortable //= require keycodes //= require jquery.autoSuggest.custom //= require fine-uploader/fine-uploader.core diff --git a/app/assets/javascripts/mobile/mobile.js b/app/assets/javascripts/mobile/mobile.js index f0fb64c39..0bb660573 100644 --- a/app/assets/javascripts/mobile/mobile.js +++ b/app/assets/javascripts/mobile/mobile.js @@ -1,9 +1,9 @@ -// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later - /* Copyright (c) 2010-2011, Diaspora Inc. This file is * licensed under the Affero General Public License version 3 or later. See * the COPYRIGHT file. */ +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later + //= require jquery-textchange //= require charcount //= require js-routes @@ -18,6 +18,8 @@ //= require helpers/i18n //= require helpers/profile_photo_uploader //= require helpers/tags_autocomplete +//= require bootstrap-markdown/bootstrap-markdown +//= require helpers/markdown_editor //= require widgets/timeago //= require mobile/mobile_application //= require mobile/mobile_file_uploader diff --git a/app/assets/javascripts/mobile/mobile_comments.js b/app/assets/javascripts/mobile/mobile_comments.js index 49858bc1c..a10c60639 100644 --- a/app/assets/javascripts/mobile/mobile_comments.js +++ b/app/assets/javascripts/mobile/mobile_comments.js @@ -11,6 +11,8 @@ initialize: function() { var self = this; + new Diaspora.MarkdownEditor(".comment_box"); + this.stream().on("tap click", "a.show-comments", function(evt){ evt.preventDefault(); self.toggleComments($(this)); @@ -35,7 +37,7 @@ self.scrollToOffset(commentContainer); }); - this.stream().on("submit", ".new_comment", this.submitComment); + this.stream().on("submit", ".new-comment", this.submitComment); }, submitComment: function(evt){ diff --git a/app/assets/javascripts/mobile/mobile_conversations.js b/app/assets/javascripts/mobile/mobile_conversations.js index bf88bb5ff..5d42b5813 100644 --- a/app/assets/javascripts/mobile/mobile_conversations.js +++ b/app/assets/javascripts/mobile/mobile_conversations.js @@ -1,6 +1,7 @@ (function() { Diaspora.Mobile.Conversations = { initialize: function() { + new Diaspora.MarkdownEditor(".conversation-message-text"); if (Diaspora.Page !== "ConversationsNew") { return; } $(document).on("ajax:success", "form#new-conversation", this.conversationCreateSuccess); $(document).on("ajax:error", "form#new-conversation", this.conversationCreateError); diff --git a/app/assets/javascripts/mobile/mobile_file_uploader.js b/app/assets/javascripts/mobile/mobile_file_uploader.js index 86c784818..3a33ef5ee 100644 --- a/app/assets/javascripts/mobile/mobile_file_uploader.js +++ b/app/assets/javascripts/mobile/mobile_file_uploader.js @@ -33,7 +33,6 @@ function createUploader(){ $("#fileInfo-publisher").text(fileName + " " + progress + "%"); }, onSubmit: function() { - $("#file-upload-publisher").addClass("loading"); $("#publisher_textarea_wrapper").addClass("with_attachments"); $("#photodropzone").append( "
  • " + diff --git a/app/assets/javascripts/mobile/mobile_post_actions.js b/app/assets/javascripts/mobile/mobile_post_actions.js index 7df54d6a9..76f1126d5 100644 --- a/app/assets/javascripts/mobile/mobile_post_actions.js +++ b/app/assets/javascripts/mobile/mobile_post_actions.js @@ -75,7 +75,7 @@ onLike: function(evt){ evt.preventDefault(); - var link = $(evt.target), + var link = $(evt.target).closest(".like-action"), likeCounter = $(evt.target).closest(".stream-element").find(".like-count"); if(!link.hasClass("loading") && link.hasClass("inactive")) { @@ -89,7 +89,7 @@ onReshare: function(evt) { evt.preventDefault(); - var link = $(this), + var link = $(this).closest(".reshare-action"), href = link.attr("href"), confirmText = link.attr("title"); @@ -103,6 +103,10 @@ }, success: function() { Diaspora.Mobile.PostActions.toggleActive(link); + var reshareCounter = $(evt.target).closest(".stream-element").find(".reshare-count"); + if (reshareCounter) { + reshareCounter.text(parseInt(reshareCounter.text(), 10) + 1); + } }, error: function(response) { Diaspora.Mobile.Alert.handleAjaxError(response); diff --git a/app/assets/javascripts/mobile/publisher.js b/app/assets/javascripts/mobile/publisher.js index 6954631cf..f50c6aa71 100644 --- a/app/assets/javascripts/mobile/publisher.js +++ b/app/assets/javascripts/mobile/publisher.js @@ -46,4 +46,6 @@ $(document).ready(function(){ evt.preventDefault(); $("#new_status_message").submit(); }); + + new Diaspora.MarkdownEditor("#status_message_text"); }); diff --git a/app/assets/stylesheets/_application.scss b/app/assets/stylesheets/_application.scss index 8bd3810d0..169bf1e1c 100644 --- a/app/assets/stylesheets/_application.scss +++ b/app/assets/stylesheets/_application.scss @@ -9,7 +9,6 @@ @import 'media-box'; @import 'entypo'; @import 'icons'; -@import 'mentions'; @import 'animations'; @import 'flash_messages'; @import 'sprites'; diff --git a/app/assets/stylesheets/base.scss b/app/assets/stylesheets/base.scss index 13293c941..4bc53b49a 100644 --- a/app/assets/stylesheets/base.scss +++ b/app/assets/stylesheets/base.scss @@ -71,7 +71,7 @@ pre { word-wrap: break-word; } line-height: 50px; opacity: 0; position: fixed; - right: 54px; + right: 20px; transition: opacity ease 400ms; width: 50px; z-index: 49; diff --git a/app/assets/stylesheets/bootstrap-complete.scss b/app/assets/stylesheets/bootstrap-complete.scss index df03c6ad0..0e49df681 100644 --- a/app/assets/stylesheets/bootstrap-complete.scss +++ b/app/assets/stylesheets/bootstrap-complete.scss @@ -1,7 +1,7 @@ // Calling this file bootstrap would cause an infinite recursion during asset compilation. @import "bootstrap-sprockets"; @import "bootstrap-variables"; //our overwrites of bootstrap variables -@import "bootstrap"; +@import "_bootstrap"; // Plugins 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 74c305068..ec5e4ef46 100644 --- a/app/assets/stylesheets/color_themes/_color_theme_override_dark.scss +++ b/app/assets/stylesheets/color_themes/_color_theme_override_dark.scss @@ -1,24 +1,20 @@ // Only overriding existing selectors here, so disable some lint rules // scss-lint:disable IdSelector, SelectorFormat, NestingDepth, SelectorDepth, QualifyingElement body { - .navbar.navbar-fixed-top #user_menu .dropdown-menu > li > a { - color: $text-color; - &:hover { color: $white; } - } - .publisher { - .mentions-input-box { background-color: $gray; } form { #publisher_textarea_wrapper { background-color: $gray; } .btn.btn-link.question_mark:hover .entypo-cog { color: $gray-light; } } - - .write-preview-tabs > li.active * { color: $text-color; } - .md-preview { background-color: $gray; } - .md-cancel:hover .entypo-cross { color: $gray-light; } .publisher-buttonbar .btn.btn-link:hover i { color: $gray-light; } } + .write-preview-tabs > li.active * { color: $text-color; } + .md-cancel:hover .entypo-cross { color: $gray-light; } + + .md-input, + .md-preview { background-color: $gray; } + .aspect_dropdown li a .text { color: $dropdown-link-color; } .info .tag { background-color: $gray-light; } @@ -96,6 +92,7 @@ body { #welcome-to-diaspora { background: $orange; } + .md-editor, .block-form fieldset .form-control:focus { border-color: $input-border; } &.page-registrations.action-new, diff --git a/app/assets/stylesheets/color_themes/dark/_style.scss b/app/assets/stylesheets/color_themes/dark/_style.scss index 1078d86bc..62e74dee6 100644 --- a/app/assets/stylesheets/color_themes/dark/_style.scss +++ b/app/assets/stylesheets/color_themes/dark/_style.scss @@ -59,7 +59,8 @@ $dropdown-link-hover-color: $dropdown-link-color; //== Navbar $navbar-inverse-bg: $gray-darker; -$navbar-inverse-link-hover-color: $text-color; +$navbar-inverse-link-color: $gray-lighter; +$navbar-inverse-link-hover-color: $white; $navbar-inverse-brand-hover-color: $navbar-inverse-link-hover-color; //== Tabs diff --git a/app/assets/stylesheets/comments.scss b/app/assets/stylesheets/comments.scss index 533c9cffb..1c111d57f 100644 --- a/app/assets/stylesheets/comments.scss +++ b/app/assets/stylesheets/comments.scss @@ -46,13 +46,12 @@ .comment.new-comment-form-wrapper { padding-bottom: 0; } - .submit_button { + .submit-button { margin-top: 10px; input { float: right; } padding-left: 12px; - display: none; } .comment_box { height: 35px; @@ -60,8 +59,27 @@ } textarea.comment_box:focus, textarea.comment_box:valid, textarea.comment_box:active { border-color: $border-dark-grey; - & + .submit_button { display: block; } - min-height: 35px; box-shadow: none; } + + .twitter-typeahead { + // typeahead sets this to `display: inline-block` which adds additional space between + // the comment textarea and the submit button. + // scss-lint:disable ImportantRule + display: block !important; + // scss-lint:enable ImportantRule + } +} + +.new-comment { + &:not(.open) .submit-button, + &:not(.open) .md-header { + display: none; + } + + // The rule for .md-preview is required until we switch to the newer release of bootstrap-markdown with + // the following commit in: + // https://github.com/toopay/bootstrap-markdown/commit/14a21c3837140144b27efc19c795d1a37fad70fb + .md-preview, + &.open .md-editor textarea { min-height: 70px; } } diff --git a/app/assets/stylesheets/conversations.scss b/app/assets/stylesheets/conversations.scss index 7c0bf90c5..f627e8059 100644 --- a/app/assets/stylesheets/conversations.scss +++ b/app/assets/stylesheets/conversations.scss @@ -238,3 +238,9 @@ } .new-conversation.form-horizontal .form-group:last-of-type { margin-bottom: 0; } + +// This rule is required until we switch to the newer release of bootstrap-markdown with +// the following commit in: https://github.com/toopay/bootstrap-markdown/commit/14a21c3837140144b27efc19c795d1a37fad70fb +.conversations-form-container .md-preview { + min-height: 105px; +} diff --git a/app/assets/stylesheets/header.scss b/app/assets/stylesheets/header.scss index 4e883094e..9bd9df45a 100644 --- a/app/assets/stylesheets/header.scss +++ b/app/assets/stylesheets/header.scss @@ -1,68 +1,68 @@ +.not-connected-menu { + .navbar-left { + float: left; + } + + .navbar-right, + .navbar-right li { + float: right; + } +} + .navbar.navbar-fixed-top { border-bottom: none; box-shadow: 1px 0 2px $black; - a:focus {outline: 0 none; } + a:focus { outline: 0 none; } + + .in { + overflow-y: visible; // Avoid search result dropdown to be hidden + } .navbar-brand { font-weight: bold; font-size: $font-size-h3; + margin-left: -15px; } - @media (max-width: $grid-float-breakpoint-max) { - .navbar-header > .nav li { display: inline-block !important; } - .nav-badge { - color: $navbar-inverse-link-color; - padding-left: 12px; - padding-right: 12px; - &:hover { color: $navbar-inverse-link-hover-color; } - &:hover, - &:focus { - background-color: transparent; - } + .header-title { + margin: (($navbar-height - 32px - 2 * $navbar-padding-vertical) / 2) 0; + + img { + height: 32px; + opacity: .7; } - #navbar-collapse { - .form-group, .twitter-typeahead { - display: block !important; - margin-bottom: 0; - &, & input { width: 100% } - } + + img:hover { + opacity: 1; } } - @media (min-width: $grid-float-breakpoint) { - input[type="search"] { - @include transition(width); - margin-top: 2px; - width: 200px; - &:not(.active) { - background-color: $navbar-inverse-bg; - border-color: $gray-light; - width: 150px; - } - } - #user_menu { - &.open .dropdown-toggle { background-color: darken($navbar-inverse-bg, 7%); } - .dropdown-toggle { - margin: 0 1px; - min-width: 160px; - } - .dropdown-menu { - background-color: darken($navbar-inverse-bg, 7%); - border-top: none; - width: 100%; - & > li > a { - color: $gray-light; - padding-left: 55px; - &:hover { - background-color: $brand-primary; - color: $gray-lighter; - } - } - } + + .navbar-header > ul, + .navbar-header > ul li { + float: left; + } + + [class^="entypo-"], + [class*="entypo-"] { + color: inherit; + font-size: $font-size-h3; + vertical-align: middle; + } + + .nav-badge { + padding: $navbar-padding-vertical 12px; + + .badge { + position: absolute; + right: 10px; + top: 10px; } } .navbar-nav:not(.nav-badges) > li > a { font-weight: bold; } .nav-badges { + margin: 0; + li { height: $navbar-height; } .dropdown-open { background-color: $dropdown-bg; @@ -118,31 +118,141 @@ } } } - [class^="entypo-"], [class*="entypo-"] { - color: inherit; - font-size: $font-size-h3; - vertical-align: middle; - } - .nav-badge { - margin-bottom: -2px; - .badge { - position: absolute; - right: 10px; - top: 10px; - } + + .user-menu-dropdown { + padding: 0; } - #user_menu { + .user-avatar { + height: $navbar-height; + margin-bottom: -$navbar-padding-vertical; + margin-right: 10px; + margin-top: -$navbar-padding-vertical; + padding: ($navbar-height - 30px) / 2 0; + .avatar { height: 30px; width: 30px; } - .user-avatar { - height: $navbar-height; - padding: ($navbar-height - 30px)/2 0; - margin-bottom: -$navbar-padding-vertical; - margin-top: -$navbar-padding-vertical; - margin-right: 10px; + } + + .navbar-form .form-control { display: inline-block; } + + @media (max-width: $grid-float-breakpoint-max) { + + .navbar-nav.hidden-xs { + margin: 0; + + a { + padding-bottom: $navbar-padding-vertical; + padding-top: $navbar-padding-vertical; + } + } + + .nav-badge { + color: $navbar-inverse-link-color; + &:hover { color: $navbar-inverse-link-hover-color; } + &:hover, + &:focus { + background-color: transparent; + } + } + + .form-group, + .twitter-typeahead { + margin-bottom: 0; + + &, + input { width: 100%; } + } + + .nav-badges .dropdown-menu { + width: 300px; + } + + .navbar-collapse { + padding-top: $navbar-padding-vertical / 2; + + .navbar-nav { + margin-bottom: 0; + margin-top: 0; + } + } + + .user-menu-dropdown { + background-color: transparent; + border: 0; + box-shadow: none; + display: block; + padding: 0; + position: static; + width: 100%; + + a { + color: $navbar-inverse-link-color; + font-weight: bold; + padding: $nav-link-padding; + + &:hover { + background-color: $navbar-inverse-link-hover-bg; + color: $navbar-inverse-link-hover-color; + } + } + } + } + + @media (min-width: $grid-float-breakpoint) { + + .navbar-form { // set correct margin for small inputs + margin-bottom: ($navbar-height - $input-height-small) / 2; + margin-top: ($navbar-height - $input-height-small) / 2; + } + + [type="search"] { + @include transition(width); + width: 200px; + + &:not(.active) { + background-color: $navbar-inverse-bg; + border-color: $gray-light; + width: 150px; + } + } + + .user-menu { + &.open .dropdown-toggle { background-color: darken($navbar-inverse-bg, 7%); } + .dropdown-toggle { + margin: 0 1px; + min-width: 160px; + } + } + + .user-menu-dropdown { + background-color: darken($navbar-inverse-bg, 7%); + border-top: 0; + width: 100%; + + a { + color: $navbar-inverse-link-color; + padding-left: 55px; + + &:hover { + background-color: $list-group-hover-bg; + color: $list-group-link-hover-color; + } + } + + li:last-child a { + padding-bottom: 6px; + } + } + } + + @media (max-width: $screen-xs-max) { + .nav-badges .dropdown-menu { + position: fixed; + top: $navbar-height; + width: 100%; } } } diff --git a/app/assets/stylesheets/markdown-editor.scss b/app/assets/stylesheets/markdown-editor.scss index b077a7b44..e5e3b5a77 100644 --- a/app/assets/stylesheets/markdown-editor.scss +++ b/app/assets/stylesheets/markdown-editor.scss @@ -1,3 +1,18 @@ +.md-editor { + border: 1px solid $border-grey; + border-radius: $border-radius-small; + overflow: hidden; + + &.active { border: 1px solid $border-dark-grey; } + + textarea, + textarea:focus { + border: 0; + box-shadow: none; + margin: 0; + } +} + .md-footer, .md-header { background: $white; @@ -27,6 +42,7 @@ .btn-group { margin-bottom: 8px; + &:first-child { margin-left: 0; } [class^="entypo-"], [class*="entypo-"] { @@ -77,13 +93,11 @@ .md-preview { - background: $white; color: $text-color; // !important is needed to override the CSS rules dynamically added to the element // scss-lint:disable ImportantRule height: auto !important; // scss-lint:enable ImportantRule - min-height: 90px; overflow: auto; position: relative; // !important is needed to override the CSS rules dynamically added to the element @@ -91,6 +105,8 @@ width: 100% !important; // scss-lint:enable ImportantRule z-index: 10; + + .preview-content { padding: 10px; } } .md-controls { diff --git a/app/assets/stylesheets/mentions.scss b/app/assets/stylesheets/mentions.scss deleted file mode 100644 index a6920e7b3..000000000 --- a/app/assets/stylesheets/mentions.scss +++ /dev/null @@ -1,91 +0,0 @@ -.mentions-input-box { - border-radius: 3px; - - background: #fff; - position: relative; - - textarea { - display: block; - background: transparent; - border: 1px solid #dcdcdc; - border-radius: 3px; - outline: 0; - overflow: hidden; - position: relative; - resize: none; - width: 100%; - - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - } - - .form-control[disabled] { background-color: transparent; } - - .mentions-autocomplete-list { - background: white; - display: none; - left: 0; - margin-left: -1px; - position: absolute; - right: 0; - z-index: 10000; - - ul { - border: 1px solid $border-dark-grey; - margin: 0; - padding: 0; - - border-radius: 0px 0px 5px 5px; - - li { - color: #444; - background: white; - border-bottom: 1px solid #ccc; - cursor: pointer; - font-size: 15px; - height: 26px; - line-height: 26px; - list-style: none; - margin: 0; - overflow: hidden; - padding: 5px; - white-space: nowrap; - - &:hover, &.active { background: $background-grey; } - &:last-child { border-radius: 0px 0px 5px 5px; } - - img, div.icon { - float: left; - height: 25px; - margin-right: 5px; - width: 25px; - } - } - } - } - - .mentions-box { - position: absolute; - right: 0px; - bottom: 0px; - left: 0px; - top: 0px; - padding: $padding-base-vertical $padding-base-horizontal; - } - - .mentions { - color: transparent; - font-size: $font-size-base; - font-family: Arial, Helvetica, sans-serif; - overflow: hidden; - width: 100%; - white-space: pre-wrap; - word-wrap: break-word; - - > strong { - background: $background-blue; - font-weight: normal; - } - } -} diff --git a/app/assets/stylesheets/mobile/comments.scss b/app/assets/stylesheets/mobile/comments.scss index 7588a47fe..62db27354 100644 --- a/app/assets/stylesheets/mobile/comments.scss +++ b/app/assets/stylesheets/mobile/comments.scss @@ -43,16 +43,15 @@ display: flex; .count { + color: $text-color; + font-family: $font-family-base; + font-size: $font-size-base; line-height: 22px; margin-left: 5px; + vertical-align: top; z-index: 2; } - .icon-count-group { - display: flex; - margin: 0 7px; - } - [class^="entypo"] { color: $text-grey; font-size: 24px; @@ -73,6 +72,9 @@ } .post-action { + display: flex; + margin: 0 7px; + .disabled { color: $medium-gray; } } diff --git a/app/assets/stylesheets/mobile/header.scss b/app/assets/stylesheets/mobile/header.scss index c1813042e..159e6a536 100644 --- a/app/assets/stylesheets/mobile/header.scss +++ b/app/assets/stylesheets/mobile/header.scss @@ -33,10 +33,15 @@ $mobile-navbar-height: 46px; li { float: left; } } - #header-title { + .header-title { padding: 7px 15px; margin: 0 0 0 -15px; height: $mobile-navbar-height; + + img { + height: 30px; + width: 30px; + } } #nav-badges { @@ -87,12 +92,6 @@ $mobile-navbar-height: 46px; background-color: $red; } } - #header-title{ - img { - height: 30px; - width: 30px; - } - } } #drawer { diff --git a/app/assets/stylesheets/mobile/markdown_editor.scss b/app/assets/stylesheets/mobile/markdown_editor.scss new file mode 100644 index 000000000..b39f5a0ba --- /dev/null +++ b/app/assets/stylesheets/mobile/markdown_editor.scss @@ -0,0 +1,6 @@ +.md-editor { + border: 1px solid $light-grey; + border-radius: $btn-border-radius-base; + + &.active { border-color: $text-grey; } +} diff --git a/app/assets/stylesheets/mobile/mobile.scss b/app/assets/stylesheets/mobile/mobile.scss index e9d612991..dc9958164 100644 --- a/app/assets/stylesheets/mobile/mobile.scss +++ b/app/assets/stylesheets/mobile/mobile.scss @@ -16,6 +16,8 @@ @import "mobile/stream_element"; @import "mobile/comments"; @import 'mobile/openid_connect_error_page'; +@import 'markdown-editor'; +@import 'mobile/markdown_editor'; @import 'typography'; @@ -42,8 +44,6 @@ h3 { margin-top: 0; } .clear { clear: both; } #main { padding: 56px 10px 0 10px; } -textarea { resize: vertical; } - .avatar { border-radius: 4px; } @@ -55,7 +55,6 @@ textarea { resize: vertical; } overflow: auto; position: relative; text-align: left; - min-height: 34px; padding: 10px 0 0 0; list-style: none; @@ -404,11 +403,6 @@ footer { .counter { font-size: 14px; } - - textarea { - min-width: 100%; - max-width: 100%; - } } select { @@ -539,13 +533,6 @@ form#new_conversation.new_conversation { } } -textarea#conversation_text { - font-size: larger; - width: 100%; - min-width: 100%; - max-width: 100%; -} - .registrations_error, .registrations_notice { color: #DF0101; @@ -714,33 +701,6 @@ select#aspect_ids_ { position: relative; padding-right: 10px; - #hide_publisher { - opacity: 0.3; - z-index: 5; - padding: 3px; - position: absolute; - right: 6px; - top: 0; - - &:hover { - opacity: 1; - } - } - - &.active { - border: 1px solid $border-dark-grey; - } - - textarea { - z-index: 2; - border: none; - - &:focus { - outline: 0; - background: transparent; - } - } - &.with_attachments { padding-bottom: 55px; border: 1px solid $border-medium-grey; diff --git a/app/assets/stylesheets/publisher.scss b/app/assets/stylesheets/publisher.scss index 0ce5b462c..93cd34d19 100644 --- a/app/assets/stylesheets/publisher.scss +++ b/app/assets/stylesheets/publisher.scss @@ -14,21 +14,11 @@ display: none !important; } - .mentions-box { - margin-top: 0; - } - #publisher_textarea_wrapper { border: 1px solid $border-grey !important; } } .container-fluid{ padding: 0; } - .twitter-typeahead { - width: calc(100% + 2px); - - .tt-menu { width: 100%; } - } - form { margin: 0; #fileInfo { display: none !important; } @@ -86,11 +76,10 @@ } textarea { + background: transparent; border: 0 solid $light-grey; - margin: 0; - box-shadow: none; - resize: none; height: 50px; + resize: none; } &.active textarea { @@ -202,9 +191,27 @@ margin-bottom: 0; } } + + .md-editor, + .md-editor.active { + border: 0; + } + + .md-preview { + // This rule is required until we switch to the newer release of bootstrap-markdown with + // the following commit in: + // https://github.com/toopay/bootstrap-markdown/commit/14a21c3837140144b27efc19c795d1a37fad70fb + min-height: 90px; + + .stream-element .post-content .markdown-content { + padding-top: 0; + } + } } .publisher-textarea-wrapper { + position: relative; + &:not(.with-location) .location-container, &.markdown-preview .location-container, &:not(.with-poll) .poll-creator-container, @@ -248,20 +255,12 @@ .locator { display: none; } } - &.submitting .mentions-box { display: none; } - .twitter-typeahead { - left: -1px; // Override inline rule of Typeahead // scss-lint:disable ImportantRule position: absolute !important; // scss-lint:enable ImportantRule } - - .mentions-box { - // Leave space for markdown editor header - margin-top: 42px; - } } .publisher-buttonbar { diff --git a/app/assets/stylesheets/single-post-view.scss b/app/assets/stylesheets/single-post-view.scss index 15fdbcbde..ceaabc4fa 100644 --- a/app/assets/stylesheets/single-post-view.scss +++ b/app/assets/stylesheets/single-post-view.scss @@ -152,5 +152,16 @@ .interaction-avatars { overflow: hidden; + + .author-name:focus, + .author-name:hover { + text-decoration: none; + } + + .loader { + height: $line-height-computed; + vertical-align: text-bottom; + width: $line-height-computed; + } } } diff --git a/app/assets/stylesheets/typeahead.scss b/app/assets/stylesheets/typeahead.scss index af635352b..89e1ef8fd 100644 --- a/app/assets/stylesheets/typeahead.scss +++ b/app/assets/stylesheets/typeahead.scss @@ -43,3 +43,21 @@ } } } + +.typeahead-mention-box-wrap .twitter-typeahead { + left: -1px; + width: calc(100% + 2px); + + .tt-menu { + // Override inline rule of Typeahead + // If this is not overridden (`position: absolute` by default in Typeahead) then + // the box is cut when opened because of the `overflow: hidden` from parent classes of comment form styles. By + // having `position: relative` here we make it visible by inserting it in the flow. + // This has a side effect of "Comment" button move down when box is open, but it feels like the least evil. + // scss-lint:disable ImportantRule + position: relative !important; + // scss-lint:enable ImportantRule + + width: 100%; + } +} diff --git a/app/assets/templates/comment-stream_tpl.jst.hbs b/app/assets/templates/comment-stream_tpl.jst.hbs index e7343507d..592cf408b 100644 --- a/app/assets/templates/comment-stream_tpl.jst.hbs +++ b/app/assets/templates/comment-stream_tpl.jst.hbs @@ -25,9 +25,16 @@ {{/with}}
    -
    -