]> cat aescling's git repositories - mastodon.git/commitdiff
Fix #249 - use window.location hack to let people login from sandboxed iOS homescreen
authorEugen Rochko <eugen@zeonfederated.com>
Tue, 20 Dec 2016 23:13:13 +0000 (00:13 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Tue, 20 Dec 2016 23:13:13 +0000 (00:13 +0100)
app/assets/javascripts/extras.jsx
app/assets/stylesheets/stream_entries.scss
app/controllers/media_controller.rb
app/views/about/index.html.haml
app/views/home/index.html.haml
app/views/layouts/application.html.haml
app/views/stream_entries/_status.html.haml
config/locales/de.yml
config/locales/en.yml

index 9fd769c0b1011bbf107daafbf5af850da1afd526..b9f8e6842cd43c28c92fb4e184eaaa626fe6eb1e 100644 (file)
@@ -1,7 +1,7 @@
 import emojify from './components/emoji'
 
 $(() => {
-  $.each($('.entry .content, .entry .status__content, .display-name, .name, .account__header__content'), (_, content) => {
+  $.each($('.entry .content, .entry .status__content, .status__display-name, .display-name, .name, .account__header__content'), (_, content) => {
     const $content = $(content);
     $content.html(emojify($content.html()));
   });
@@ -17,4 +17,13 @@ $(() => {
   $('.media-spoiler').on('click', e => {
     $(e.target).hide();
   });
+
+  $('.webapp-btn').on('click', e => {
+    console.log(e);
+
+    if (e.button === 0) {
+      e.preventDefault();
+      window.location.href = $(e.target).attr('href');
+    }
+  });
 });
index 5cd140aac9ec6b742dbb6b68b1be3b2cfc72c743..7624bbdc80b8d68041f0673db8e8f8d2d635c040 100644 (file)
@@ -3,24 +3,26 @@
   box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
 
   .entry {
-    .status.light, .detailed-status.light {
+    background: lighten(#d9e1e8, 8%);
+
+    &, .detailed-status.light {
       border-bottom: 1px solid #d9e1e8;
     }
 
     &:last-child {
-      .status.light, .detailed-status.light {
+      &, .detailed-status.light {
         border-bottom: 0;
         border-radius: 0 0 4px 4px;
       }
     }
 
     &:first-child {
-      .status.light, .detailed-status.light {
+      &, .detailed-status.light {
         border-radius: 4px 4px 0 0;
       }
 
       &:last-child {
-        .status.light, .detailed-status.light {
+        &, .detailed-status.light {
           border-radius: 4px;
         }
       }
@@ -32,7 +34,6 @@
     position: relative;
     min-height: 48px;
     cursor: default;
-    background: lighten(#d9e1e8, 8%);
 
     .status__header {
       font-size: 15px;
       }
     }
   }
+
+  .pre-header {
+    padding: 14px 0px;
+    padding-left: (48px + 14px*2);
+    padding-bottom: 0;
+    margin-bottom: -4px;
+    color: #9baec8;
+    font-size: 14px;
+    position: relative;
+
+    .pre-header__icon {
+      position: absolute;
+      left: (48px + 14px*2 - 30px);
+    }
+
+    .status__display-name.muted strong {
+      color: #9baec8;
+    }
+  }
 }
 
 .embed {
index 9832a91b42ca5c772889d2073fafddb093021731..6f1f7ec482f1e1ecacc8b5550483414fa20bdaff 100644 (file)
@@ -4,7 +4,7 @@ class MediaController < ApplicationController
   before_action :set_media_attachment
 
   def show
-    redirect_to TagManager.instance.url_for(@media_attachment.status)
+    redirect_to @media_attachment.file.url(:original)
   end
 
   private
index 160a667107ab5b9ad0ad1ea4fcfe5c15015514b7..fe13de8377ffefda930d72e4061db3fdd77d6e52 100644 (file)
@@ -2,6 +2,7 @@
   = Rails.configuration.x.local_domain
 
 - content_for :header_tags do
+  = javascript_include_tag 'application_public'
   %meta{ property: 'og:site_name', content: 'Mastodon' }/
   %meta{ property: 'og:type', content: 'website' }/
   %meta{ property: 'og:title', content: Rails.configuration.x.local_domain }/
@@ -25,5 +26,5 @@
       = link_to t('about.terms'), terms_path
       = link_to t('about.source_code'), 'https://github.com/Gargron/mastodon'
 
-    = link_to t('about.get_started'), new_user_registration_path, class: 'button'
-    = link_to t('auth.login'), new_user_session_path, class: 'button'
+    = link_to t('about.get_started'), new_user_registration_path, class: 'button webapp-btn'
+    = link_to t('auth.login'), new_user_session_path, class: 'button webapp-btn'
index 0adce05bf0147cdaa85ac6619c20c244b20ac47b..498fae105c24923ec353a48528082fcb238d3825 100644 (file)
@@ -1,5 +1,4 @@
 - content_for :header_tags do
-  %meta{:name => "apple-mobile-web-app-capable", :content => "yes"}/
   = javascript_include_tag 'application'
 
 = react_component 'Mastodon', default_props, class: 'app-holder', prerender: false
index 7e28d27ec2e0991b67a1744991a50d0a07d1b2b1..87f98198c82419126f5d71f744c1b20d5982162f 100644 (file)
@@ -9,6 +9,7 @@
     %link{:rel => "manifest", :href => "/manifest.json"}/
     %meta{:name => "msapplication-config", :content => "/browserconfig.xml"}/
     %meta{:name => "theme-color", :content => "#2b90d9"}/
+    %meta{:name => "apple-mobile-web-app-capable", :content => "yes"}/
 
     %title
       = "#{yield(:page_title)} - " if content_for?(:page_title)
index 67cb06a83cd96515c2c87511daf6fd09299cc3b7..f70e2c890294301a0db08aa2b13b98bd1c0fadfa 100644 (file)
@@ -9,9 +9,12 @@
 .entry{ class: entry_classes(status, is_predecessor, is_successor, include_threads) }
   - if status.reblog?
     .pre-header
-      %i.fa.fa-retweet
-      Shared by
-      = link_to display_name(status.account), TagManager.instance.url_for(status.account), class: 'name'
+      %div.pre-header__icon
+        = fa_icon('retweet fw')
+      %span
+        = link_to TagManager.instance.url_for(status.account), class: 'status__display-name muted' do
+          %strong= display_name(status.account)
+        = t('stream_entries.reblogged')
 
   = render partial: centered ? 'stream_entries/detailed_status' : 'stream_entries/simple_status', locals: { status: proper_status(status) }
 
index 1285a11a1ee6d7e065772caa3244b196161807fd..ead3ae514435fd395cd09889ed2b44171c0f7172 100644 (file)
@@ -55,6 +55,7 @@ de:
   stream_entries:
     favourited: favorisierte einen Beitrag von
     is_now_following: folgt nun
+    reblogged: teilte
   users:
     invalid_email: Inkorrekte E-mail-Addresse
   will_paginate:
index f58ce9a717e4c76f76f571bc9bc815840af40f25..684c86f4ac268589fb25dd12a0300a6deff1e477 100644 (file)
@@ -71,6 +71,7 @@ en:
     favourited: favourited a post by
     is_now_following: is now following
     sensitive_content: Sensitive content
+    reblogged: boosted
   time:
     formats:
       default: "%b %d, %Y, %H:%M"