]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorThibaut Girka <thib@sitedethib.com>
Mon, 22 Apr 2019 18:40:04 +0000 (20:40 +0200)
committerThibaut Girka <thib@sitedethib.com>
Mon, 22 Apr 2019 18:40:04 +0000 (20:40 +0200)
Conflicts:
- app/javascript/mastodon/features/compose/components/compose_form.js
  Upstream cleaned up a bit, including on lines in which
  we replaced the hardcoded 500 character limit with a maxChar
  constant. Applied the changes while keeping maxChar instead of 500.
- app/javascript/packs/public.js
  Moved upstream's new animated avatar hover handling in
  app/javascript/core/public.js
- app/javascript/styles/fonts/montserrat.scss
  Upstream fixed local font name, applied those changes.
- app/javascript/styles/fonts/roboto.scss
  Upstream fixed local font name, applied those changes.
- lib/mastodon/version.rb
  Upstream made repo URL configurable, did the same, but
  default to glitch-soc

12 files changed:
1  2 
Gemfile
Gemfile.lock
app/javascript/core/public.js
app/javascript/mastodon/features/compose/components/compose_form.js
app/javascript/mastodon/initial_state.js
app/javascript/styles/fonts/montserrat.scss
app/javascript/styles/fonts/roboto.scss
app/javascript/styles/mastodon/components.scss
app/serializers/initial_state_serializer.rb
app/views/accounts/_header.html.haml
config/locales/simple_form.pl.yml
lib/mastodon/version.rb

diff --cc Gemfile
Simple merge
diff --cc Gemfile.lock
Simple merge
index f00709dad0f0341554fc6e90f3fbc403dc9fae97,0000000000000000000000000000000000000000..4be75647af2f41827e67b6f4e4180c5d36cfe6ca
mode 100644,000000..100644
--- /dev/null
@@@ -1,43 -1,0 +1,66 @@@
 +//  This file will be loaded on public pages, regardless of theme.
 +
 +import createHistory from 'history/createBrowserHistory';
 +import ready from '../mastodon/ready';
 +
 +const { delegate } = require('rails-ujs');
 +const { length } = require('stringz');
 +
 +delegate(document, '.webapp-btn', 'click', ({ target, button }) => {
 +  if (button !== 0) {
 +    return true;
 +  }
 +  window.location.href = target.href;
 +  return false;
 +});
 +
 +delegate(document, '.status__content__spoiler-link', 'click', ({ target }) => {
 +  const contentEl = target.parentNode.parentNode.querySelector('.e-content');
 +
 +  if (contentEl.style.display === 'block') {
 +    contentEl.style.display = 'none';
 +    target.parentNode.style.marginBottom = 0;
 +  } else {
 +    contentEl.style.display = 'block';
 +    target.parentNode.style.marginBottom = null;
 +  }
 +
 +  return false;
 +});
 +
 +delegate(document, '.modal-button', 'click', e => {
 +  e.preventDefault();
 +
 +  let href;
 +
 +  if (e.target.nodeName !== 'A') {
 +    href = e.target.parentNode.href;
 +  } else {
 +    href = e.target.href;
 +  }
 +
 +  window.open(href, 'mastodon-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes');
 +});
++
++const getProfileAvatarAnimationHandler = (swapTo) => {
++  //animate avatar gifs on the profile page when moused over
++  return ({ target }) => {
++    const swapSrc = target.getAttribute(swapTo);
++    //only change the img source if autoplay is off and the image src is actually different
++    if(target.getAttribute('data-autoplay') === 'false' && target.src !== swapSrc) {
++      target.src = swapSrc;
++    }
++  };
++};
++
++delegate(document, 'img#profile_page_avatar', 'mouseover', getProfileAvatarAnimationHandler('data-original'));
++
++delegate(document, 'img#profile_page_avatar', 'mouseout', getProfileAvatarAnimationHandler('data-static'));
++
++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;
++});
index d47b788ce12d1e61d49823e32d2711b2864fe6a2,ddb610a89c8aed376cabf44f3daac72c0ea8f9ba..13514fa0ff590ac545008d5f07369a588000fd61
@@@ -86,10 -84,10 +85,10 @@@ class ComposeForm extends ImmutablePure
      }
  
      // Submit disabled:
-     const { is_submitting, is_changing_upload, is_uploading, anyMedia } = this.props;
-     const fulltext = [this.props.spoiler_text, countableText(this.props.text)].join('');
+     const { isSubmitting, isChangingUpload, isUploading, anyMedia } = this.props;
+     const fulltext = [this.props.spoilerText, countableText(this.props.text)].join('');
  
-     if (is_submitting || is_uploading || is_changing_upload || length(fulltext) > maxChars || (fulltext.length !== 0 && fulltext.trim().length === 0 && !anyMedia)) {
 -    if (isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (fulltext.length !== 0 && fulltext.trim().length === 0 && !anyMedia)) {
++    if (isSubmitting || isUploading || isChangingUpload || length(fulltext) > maxChars || (fulltext.length !== 0 && fulltext.trim().length === 0 && !anyMedia)) {
        return;
      }
  
  
    render () {
      const { intl, onPaste, showSearch, anyMedia } = this.props;
-     const disabled = this.props.is_submitting;
-     const text     = [this.props.spoiler_text, countableText(this.props.text)].join('');
-     const disabledButton = disabled || this.props.is_uploading || this.props.is_changing_upload || length(text) > maxChars || (text.length !== 0 && text.trim().length === 0 && !anyMedia);
+     const disabled = this.props.isSubmitting;
+     const text     = [this.props.spoilerText, countableText(this.props.text)].join('');
 -    const disabledButton = disabled || this.props.isUploading || this.props.isChangingUpload || length(text) > 500 || (text.length !== 0 && text.trim().length === 0 && !anyMedia);
++    const disabledButton = disabled || this.props.isUploading || this.props.isChangingUpload || length(text) > maxChars || (text.length !== 0 && text.trim().length === 0 && !anyMedia);
      let publishText = '';
  
      if (this.props.privacy === 'private' || this.props.privacy === 'direct') {
index 6068246ae5011c31a957eb3493eccfa00be65256,74bcfee5868123482aa070480e048fc8f47b2761..d74f5ceb135f44b5f65cc1b2af0f29a40dfb0e08
@@@ -12,8 -12,9 +12,10 @@@ export const boostModal = getMeta('boos
  export const deleteModal = getMeta('delete_modal');
  export const me = getMeta('me');
  export const searchEnabled = getMeta('search_enabled');
 +export const maxChars = (initialState && initialState.max_toot_chars) || 500;
  export const invitesEnabled = getMeta('invites_enabled');
+ export const repository = getMeta('repository');
+ export const source_url = getMeta('source_url');
  export const version = getMeta('version');
  export const mascot = getMeta('mascot');
  export const profile_directory = getMeta('profile_directory');
index 3d2b5a93f2143c5d61ea226275128b615530de1f,8079dc6fc9766de2723f5742ace4976823406477..80c2329b008662c606781d370ea44ffed511ea78
@@@ -10,8 -10,8 +10,8 @@@
  
  @font-face {
    font-family: 'mastodon-font-display';
-   src: local('Montserrat'),
+   src: local('Montserrat Medium'),
 -    url('../fonts/montserrat/Montserrat-Medium.ttf') format('truetype');
 +    url('~fonts/montserrat/Montserrat-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
  }
index 79034c018f873c3e5f3e663b7c407f11982f3385,f9c7c50fea4354f0db1d4803f9dd213b307b3645..b75fdb927575b36ba91627f4840656a0c64ffba1
@@@ -1,32 -1,32 +1,32 @@@
  @font-face {
    font-family: 'mastodon-font-sans-serif';
-   src: local('Roboto'),
+   src: local('Roboto Italic'),
 -    url('../fonts/roboto/roboto-italic-webfont.woff2') format('woff2'),
 -    url('../fonts/roboto/roboto-italic-webfont.woff') format('woff'),
 -    url('../fonts/roboto/roboto-italic-webfont.ttf') format('truetype'),
 -    url('../fonts/roboto/roboto-italic-webfont.svg#roboto-italic-webfont') format('svg');
 +    url('~fonts/roboto/roboto-italic-webfont.woff2') format('woff2'),
 +    url('~fonts/roboto/roboto-italic-webfont.woff') format('woff'),
 +    url('~fonts/roboto/roboto-italic-webfont.ttf') format('truetype'),
 +    url('~fonts/roboto/roboto-italic-webfont.svg#roboto-italic-webfont') format('svg');
    font-weight: normal;
    font-style: italic;
  }
  
  @font-face {
    font-family: 'mastodon-font-sans-serif';
-   src: local('Roboto'),
+   src: local('Roboto Bold'),
 -    url('../fonts/roboto/roboto-bold-webfont.woff2') format('woff2'),
 -    url('../fonts/roboto/roboto-bold-webfont.woff') format('woff'),
 -    url('../fonts/roboto/roboto-bold-webfont.ttf') format('truetype'),
 -    url('../fonts/roboto/roboto-bold-webfont.svg#roboto-bold-webfont') format('svg');
 +    url('~fonts/roboto/roboto-bold-webfont.woff2') format('woff2'),
 +    url('~fonts/roboto/roboto-bold-webfont.woff') format('woff'),
 +    url('~fonts/roboto/roboto-bold-webfont.ttf') format('truetype'),
 +    url('~fonts/roboto/roboto-bold-webfont.svg#roboto-bold-webfont') format('svg');
    font-weight: bold;
    font-style: normal;
  }
  
  @font-face {
    font-family: 'mastodon-font-sans-serif';
-   src: local('Roboto'),
+   src: local('Roboto Medium'),
 -    url('../fonts/roboto/roboto-medium-webfont.woff2') format('woff2'),
 -    url('../fonts/roboto/roboto-medium-webfont.woff') format('woff'),
 -    url('../fonts/roboto/roboto-medium-webfont.ttf') format('truetype'),
 -    url('../fonts/roboto/roboto-medium-webfont.svg#roboto-medium-webfont') format('svg');
 +    url('~fonts/roboto/roboto-medium-webfont.woff2') format('woff2'),
 +    url('~fonts/roboto/roboto-medium-webfont.woff') format('woff'),
 +    url('~fonts/roboto/roboto-medium-webfont.ttf') format('truetype'),
 +    url('~fonts/roboto/roboto-medium-webfont.svg#roboto-medium-webfont') format('svg');
    font-weight: 500;
    font-style: normal;
  }
Simple merge
Simple merge
index 5d1b8e6d98b7c3ce3ca7c40c8b7e78ff95a3af42,a656031b11ed6d22d7aacdb648df5eb0f8064a62..8172aeb9415b815dd83c6b92f2e2c5669b2bdcca
@@@ -37,7 -33,7 +37,7 @@@ module Mastodo
      end
  
      def repository
-       'glitch-soc/mastodon'
 -      ENV.fetch('GITHUB_REPOSITORY') { 'tootsuite/mastodon' }
++      ENV.fetch('GITHUB_REPOSITORY') { 'glitch-soc/mastodon' }
      end
  
      def source_base_url