]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorThibaut Girka <thib@sitedethib.com>
Thu, 4 Apr 2019 12:53:52 +0000 (14:53 +0200)
committerThibaut Girka <thib@sitedethib.com>
Thu, 4 Apr 2019 12:53:52 +0000 (14:53 +0200)
Conflicts:
- app/controllers/following_accounts_controller.rb
  Conflicts were due to glitch-soc's theming system.
- app/javascript/packs/public.js
  Some code has been change upstream, but it has been
  moved to app/javascript/core/settings.js in glitch-soc.
  Applied the changes there.

1  2 
Gemfile.lock
app/controllers/follower_accounts_controller.rb
app/controllers/following_accounts_controller.rb
app/javascript/core/settings.js

diff --cc Gemfile.lock
index 620651983e56e5cf427304e5a7e910d2585bf238,22bb2adc2864eab46442fc3c7325d12008ed0209..a4b76c7969030acde340573cd6fcfc220df8ca1f
@@@ -254,11 -254,9 +254,11 @@@ GE
      hashdiff (0.3.7)
      hashie (3.6.0)
      heapy (0.1.4)
-     highline (2.0.0)
+     highline (2.0.1)
      hiredis (0.6.3)
      hkdf (0.3.0)
 +    html2text (0.2.1)
 +      nokogiri (~> 1.6)
      htmlentities (4.3.4)
      http (3.3.0)
        addressable (~> 2.3)
index 098b2a20cb086947f0812a9785ba540874894a42,1bfd901cfb38b7c9ba85a425b4fd345d0f8bd9e9..181f852216b7dd3c34cde8903a934dbb293b175c
@@@ -6,7 -8,7 +8,8 @@@ class FollowingAccountsController < App
    def index
      respond_to do |format|
        format.html do
 +        use_pack 'public'
+         mark_cacheable! unless user_signed_in?
  
          next if @account.user_hides_network?
  
index af97fb25fb92c5f8e3e26b00f895cf53869b63f7,0000000000000000000000000000000000000000..e0cb944e0f6b7ddbde628a67214e3f4324d6d5f5
mode 100644,000000..100644
--- /dev/null
@@@ -1,66 -1,0 +1,74 @@@
 +//  This file will be loaded on settings pages, regardless of theme.
 +
 +import escapeTextContentForBrowser from 'escape-html';
 +const { delegate } = require('rails-ujs');
 +import emojify from '../mastodon/features/emoji/emoji';
 +
 +delegate(document, '#account_display_name', 'input', ({ target }) => {
 +  const name = document.querySelector('.card .display-name strong');
 +  if (name) {
 +    if (target.value) {
 +      name.innerHTML = emojify(escapeTextContentForBrowser(target.value));
 +    } else {
 +      name.textContent = document.querySelector('#default_account_display_name').textContent;
 +    }
 +  }
 +});
 +
 +delegate(document, '#account_avatar', 'change', ({ target }) => {
 +  const avatar = document.querySelector('.card .avatar img');
 +  const [file] = target.files || [];
 +  const url = file ? URL.createObjectURL(file) : avatar.dataset.originalSrc;
 +
 +  avatar.src = url;
 +});
 +
 +delegate(document, '#account_header', 'change', ({ target }) => {
 +  const header = document.querySelector('.card .card__img img');
 +  const [file] = target.files || [];
 +  const url = file ? URL.createObjectURL(file) : header.dataset.originalSrc;
 +
 +  header.src = url;
 +});
 +
 +delegate(document, '#account_locked', 'change', ({ target }) => {
 +  const lock = document.querySelector('.card .display-name i');
 +
 +  if (target.checked) {
 +    lock.style.display = 'inline';
 +  } else {
 +    lock.style.display = 'none';
 +  }
 +});
 +
 +delegate(document, '.input-copy input', 'click', ({ target }) => {
++  target.focus();
 +  target.select();
++  target.setSelectionRange(0, target.value.length);
 +});
 +
 +delegate(document, '.input-copy button', 'click', ({ target }) => {
 +  const input = target.parentNode.querySelector('.input-copy__wrapper input');
 +
++  const oldReadOnly = input.readonly;
++
++  input.readonly = false;
 +  input.focus();
 +  input.select();
++  input.setSelectionRange(0, input.value.length);
 +
 +  try {
 +    if (document.execCommand('copy')) {
 +      input.blur();
 +      target.parentNode.classList.add('copied');
 +
 +    setTimeout(() => {
 +        target.parentNode.classList.remove('copied');
 +      }, 700);
 +    }
 +  } catch (err) {
 +    console.error(err);
 +  }
++
++  input.readonly = oldReadOnly;
 +});