From 65528fc54e2943aa259ec9129781d3fb1161ec63 Mon Sep 17 00:00:00 2001 From: Chronister Date: Mon, 29 May 2017 00:09:12 +0000 Subject: All cybrespace changes through 5/28 --- app/views/layouts/admin.html.haml | 2 +- app/views/layouts/auth.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views/layouts') diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index 59d95a0c6..b49aa83f5 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -6,7 +6,7 @@ .sidebar-wrapper .sidebar = link_to root_path do - = image_tag asset_pack_path('logo.png'), class: 'logo' + = image_tag asset_pack_path('logo-cybre.png'), class: 'logo' = render_navigation .content-wrapper diff --git a/app/views/layouts/auth.html.haml b/app/views/layouts/auth.html.haml index e5429a8ed..097fc6d08 100644 --- a/app/views/layouts/auth.html.haml +++ b/app/views/layouts/auth.html.haml @@ -6,7 +6,7 @@ .logo-container %h1 = link_to root_path do - = image_tag asset_pack_path('logo.png') + = image_tag asset_pack_path('logo-cybre.png') .form-container = render 'flashes' -- cgit From b27842dc70847cb936ae2b49777095ba12c5917b Mon Sep 17 00:00:00 2001 From: Charlotte Fields Date: Mon, 19 Jun 2017 11:23:25 +1000 Subject: cybre cleanup --- app/javascript/images/background-cybre.png | Bin 237414 -> 0 bytes app/javascript/images/logo-cybre.png | Bin 187946 -> 0 bytes .../mastodon/components/status_action_bar.js | 2 +- .../mastodon/features/getting_started/index.js | 22 ++++---- .../notifications/components/notification.js | 2 +- .../features/status/components/action_bar.js | 2 +- .../features/status/components/detailed_status.js | 2 +- app/javascript/mastodon/locales/en.json | 58 ++++++++++----------- app/javascript/styles/custom.scss | 19 ------- app/views/about/show.html.haml | 2 +- app/views/layouts/admin.html.haml | 2 +- app/views/layouts/auth.html.haml | 2 +- config/locales/en.yml | 36 ++++++------- config/locales/simple_form.en.yml | 6 +-- config/settings.yml | 2 +- public/500.html | 4 +- public/android-chrome-192x192.png | Bin 41911 -> 14344 bytes public/apple-touch-icon.png | Bin 37614 -> 4217 bytes public/emoji/1f418.png | Bin 7535 -> 1293 bytes public/emoji/1f418.svg | 18 +------ public/mstile-150x150.png | Bin 27611 -> 6916 bytes 21 files changed, 72 insertions(+), 107 deletions(-) delete mode 100644 app/javascript/images/background-cybre.png delete mode 100644 app/javascript/images/logo-cybre.png (limited to 'app/views/layouts') diff --git a/app/javascript/images/background-cybre.png b/app/javascript/images/background-cybre.png deleted file mode 100644 index 151fd5584..000000000 Binary files a/app/javascript/images/background-cybre.png and /dev/null differ diff --git a/app/javascript/images/logo-cybre.png b/app/javascript/images/logo-cybre.png deleted file mode 100644 index 41dd8fd4c..000000000 Binary files a/app/javascript/images/logo-cybre.png and /dev/null differ diff --git a/app/javascript/mastodon/components/status_action_bar.js b/app/javascript/mastodon/components/status_action_bar.js index a8ac7a70a..edb2d6eb0 100644 --- a/app/javascript/mastodon/components/status_action_bar.js +++ b/app/javascript/mastodon/components/status_action_bar.js @@ -140,7 +140,7 @@ export default class StatusActionBar extends ImmutablePureComponent {
- +
diff --git a/app/javascript/mastodon/features/getting_started/index.js b/app/javascript/mastodon/features/getting_started/index.js index c8490abe9..f8ea01024 100644 --- a/app/javascript/mastodon/features/getting_started/index.js +++ b/app/javascript/mastodon/features/getting_started/index.js @@ -10,19 +10,19 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; const messages = defineMessages({ heading: { id: 'getting_started.heading', defaultMessage: 'Getting started' }, - home_timeline: { id: 'tabs_bar.home', defaultMessage: '/timelines/home' }, - notifications: { id: 'tabs_bar.notifications', defaultMessage: '~/.notifications' }, - public_timeline: { id: 'navigation_bar.public_timeline', defaultMessage: '/timelines/federated' }, + home_timeline: { id: 'tabs_bar.home', defaultMessage: 'Home' }, + notifications: { id: 'tabs_bar.notifications', defaultMessage: 'Notifications' }, + public_timeline: { id: 'navigation_bar.public_timeline', defaultMessage: 'Federated timeline' }, navigation_subheading: { id: 'column_subheading.navigation', defaultMessage: 'Navigation' }, settings_subheading: { id: 'column_subheading.settings', defaultMessage: 'Settings' }, - community_timeline: { id: 'navigation_bar.community_timeline', defaultMessage: '/timelines/local' }, + community_timeline: { id: 'navigation_bar.community_timeline', defaultMessage: 'Local timeline' }, preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' }, - follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: '~/.follow-requests' }, - sign_out: { id: 'navigation_bar.logout', defaultMessage: 'exit' }, - favourites: { id: 'navigation_bar.favourites', defaultMessage: '~/.florps' }, - blocks: { id: 'navigation_bar.blocks', defaultMessage: '~/.blocked' }, - mutes: { id: 'navigation_bar.mutes', defaultMessage: '~/.muted' }, - info: { id: 'navigation_bar.info', defaultMessage: '/about/more' }, + follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' }, + sign_out: { id: 'navigation_bar.logout', defaultMessage: 'Logout' }, + favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' }, + blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' }, + mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' }, + info: { id: 'navigation_bar.info', defaultMessage: 'Extended information' }, }); const mapStateToProps = state => ({ @@ -65,7 +65,7 @@ export default class GettingStarted extends ImmutablePureComponent { } navItems = navItems.concat([ - , + , ]); if (me.get('locked')) { diff --git a/app/javascript/mastodon/features/notifications/components/notification.js b/app/javascript/mastodon/features/notifications/components/notification.js index 0a4ba0214..9d631644a 100644 --- a/app/javascript/mastodon/features/notifications/components/notification.js +++ b/app/javascript/mastodon/features/notifications/components/notification.js @@ -39,7 +39,7 @@ export default class Notification extends ImmutablePureComponent {
- +
diff --git a/app/javascript/mastodon/features/status/components/action_bar.js b/app/javascript/mastodon/features/status/components/action_bar.js index 03779c2c1..29080529d 100644 --- a/app/javascript/mastodon/features/status/components/action_bar.js +++ b/app/javascript/mastodon/features/status/components/action_bar.js @@ -82,7 +82,7 @@ export default class ActionBar extends React.PureComponent {
-
+
diff --git a/app/javascript/mastodon/features/status/components/detailed_status.js b/app/javascript/mastodon/features/status/components/detailed_status.js index 6f2415965..619957dbe 100644 --- a/app/javascript/mastodon/features/status/components/detailed_status.js +++ b/app/javascript/mastodon/features/status/components/detailed_status.js @@ -76,7 +76,7 @@ export default class DetailedStatus extends ImmutablePureComponent { · - + diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 84579f188..608d911e9 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -2,7 +2,7 @@ "account.block": "Block @{name}", "account.block_domain": "Hide everything from {domain}", "account.disclaimer": "This user is from another instance. This number may be larger.", - "account.edit_profile": "edit ~/.profile", + "account.edit_profile": "Edit profile", "account.follow": "Follow", "account.followers": "Followers", "account.follows": "Follows", @@ -10,7 +10,7 @@ "account.media": "Media", "account.mention": "Mention @{name}", "account.mute": "Mute @{name}", - "account.posts": "Pings", + "account.posts": "Posts", "account.report": "Report @{name}", "account.requested": "Awaiting approval", "account.unblock": "Unblock @{name}", @@ -18,14 +18,14 @@ "account.unfollow": "Unfollow", "account.unmute": "Unmute @{name}", "boost_modal.combo": "You can press {combo} to skip this next time", - "column.blocks": "~/.blocked", - "column.community": "/timelines/local", - "column.favourites": "~/.florps", - "column.follow_requests": "~/.follow-requests", - "column.home": "/timelines/home", - "column.mutes": "~/.muted", - "column.notifications": "~/.notifications", - "column.public": "/timelines/federated", + "column.blocks": "Blocked users", + "column.community": "Local timeline", + "column.favourites": "Favourites", + "column.follow_requests": "Follow requests", + "column.home": "Home", + "column.mutes": "Muted users", + "column.notifications": "Notifications", + "column.public": "Federated timeline", "column_back_button.label": "Back", "column_header.pin": "Pin", "column_header.unpin": "Unpin", @@ -33,9 +33,9 @@ "column_subheading.settings": "Settings", "compose_form.lock_disclaimer": "Your account is not {locked}. Anyone can follow you to view your follower-only posts.", "compose_form.lock_disclaimer.lock": "locked", - "compose_form.placeholder": "What is in your databanks?", + "compose_form.placeholder": "What is on your mind?", "compose_form.privacy_disclaimer": "Your post will be delivered to mentioned users on {domains}. Do you trust {domainsCount, plural, one {that server} other {those servers}}? Post privacy only works on Mastodon instances. If {domains} {domainsCount, plural, one {is not a Mastodon instance} other {are not Mastodon instances}}, there will be no indication that your post is not a public post, and it may be boosted or otherwise made visible to unintended recipients.", - "compose_form.publish": "Ping", + "compose_form.publish": "Toot", "compose_form.publish_loud": "{publish}!", "compose_form.sensitive": "Mark media as sensitive", "compose_form.spoiler": "Hide text behind warning", @@ -61,7 +61,7 @@ "emoji_button.travel": "Travel & Places", "empty_column.community": "The local timeline is empty. Write something publicly to get the ball rolling!", "empty_column.hashtag": "There is nothing in this hashtag yet.", - "empty_column.home": "You aren't following anyone yet. Visit {public} or use query to get started and meet other users.", + "empty_column.home": "You aren't following anyone yet. Visit {public} or use search to get started and meet other users.", "empty_column.home.inactivity": "Your home feed is empty. If you have been inactive for a while, it will be regenerated for you soon.", "empty_column.home.public_timeline": "the public timeline", "empty_column.notifications": "You don't have any notifications yet. Interact with others to start the conversation.", @@ -76,24 +76,24 @@ "home.column_settings.advanced": "Advanced", "home.column_settings.basic": "Basic", "home.column_settings.filter_regex": "Filter out by regular expressions", - "home.column_settings.show_reblogs": "Show relays", + "home.column_settings.show_reblogs": "Show boosts", "home.column_settings.show_replies": "Show replies", "home.settings": "Column settings", "lightbox.close": "Close", "loading_indicator.label": "Loading...", "media_gallery.toggle_visible": "Toggle visibility", "missing_indicator.label": "Not found", - "navigation_bar.blocks": "~/.blocks", - "navigation_bar.community_timeline": "/timelines/local", - "navigation_bar.edit_profile": "edit ~/.profile", - "navigation_bar.favourites": "~/.florps", - "navigation_bar.follow_requests": "~/.follow-requests", - "navigation_bar.info": "/about/more", - "navigation_bar.logout": "Jack out", - "navigation_bar.mutes": "~/.muted", + "navigation_bar.blocks": "Blocked users", + "navigation_bar.community_timeline": "Local timeline", + "navigation_bar.edit_profile": "Edit profile", + "navigation_bar.favourites": "Favourites", + "navigation_bar.follow_requests": "Follow requests", + "navigation_bar.info": "About this instance", + "navigation_bar.logout": "Logout", + "navigation_bar.mutes": "Muted users", "navigation_bar.preferences": "Preferences", - "navigation_bar.public_timeline": "/timelines/federated", - "notification.favourite": "{name} florped your ping", + "navigation_bar.public_timeline": "Federated timeline", + "notification.favourite": "{name} favourited your status", "notification.follow": "{name} followed you", "notification.mention": "{name} mentioned you", "notification.reblog": "{name} boosted your status", @@ -140,18 +140,18 @@ "report.placeholder": "Additional comments", "report.submit": "Submit", "report.target": "Reporting", - "search.placeholder": "Query...", + "search.placeholder": "Search", "search_results.total": "{count, number} {count, plural, one {result} other {results}}", - "status.cannot_reblog": "This ping cannot be relayed", + "status.cannot_reblog": "This post cannot be boosted", "status.delete": "Delete", - "status.favourite": "Florp", + "status.favourite": "Favourite", "status.load_more": "Load more", "status.media_hidden": "Media hidden", "status.mention": "Mention @{name}", "status.mute_conversation": "Mute conversation", "status.open": "Expand this status", - "status.reblog": "Relay", - "status.reblogged_by": "{name} relayed", + "status.reblog": "Boost", + "status.reblogged_by": "{name} boosted", "status.reply": "Reply", "status.replyAll": "Reply to thread", "status.report": "Report @{name}", diff --git a/app/javascript/styles/custom.scss b/app/javascript/styles/custom.scss index 8c6c12316..5bfe2a412 100644 --- a/app/javascript/styles/custom.scss +++ b/app/javascript/styles/custom.scss @@ -1,14 +1,5 @@ -$ui-base-color: #181818; // darkest -$ui-secondary-color: #dae8da; // lightest -$ui-primary-color: #dae8da; // lighter -$ui-highlight-color: #1ea21e; // vibrant - @import 'application'; -body { - background: $ui-base-color url('../images/background-cybre.png'); -} - @media screen and (min-width: 1300px) { .column { flex-grow: 1 !important; @@ -59,16 +50,6 @@ body { .screenshot-with-signup .closed-registrations-message .clock { font-size:150%; -} - -.column .static-content.getting-started { - background-image: url('../images/logo-cybre.png'), url('../images/background-cybre.png'); - background-position: 50% 50%; - background-size:cover; -} - -.columns-area { - background: $ui-base-color url('../images/background-cybre.png'); } .drawer .drawer__inner { diff --git a/app/views/about/show.html.haml b/app/views/about/show.html.haml index 87a729055..2a7f8c752 100644 --- a/app/views/about/show.html.haml +++ b/app/views/about/show.html.haml @@ -17,7 +17,7 @@ .wrapper %h1 - = image_tag asset_pack_path('logo-cybre.png') + = image_tag asset_pack_path('logo.png') = Setting.site_title %p!= t('about.about_mastodon') diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index b49aa83f5..59d95a0c6 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -6,7 +6,7 @@ .sidebar-wrapper .sidebar = link_to root_path do - = image_tag asset_pack_path('logo-cybre.png'), class: 'logo' + = image_tag asset_pack_path('logo.png'), class: 'logo' = render_navigation .content-wrapper diff --git a/app/views/layouts/auth.html.haml b/app/views/layouts/auth.html.haml index 097fc6d08..e5429a8ed 100644 --- a/app/views/layouts/auth.html.haml +++ b/app/views/layouts/auth.html.haml @@ -6,7 +6,7 @@ .logo-container %h1 = link_to root_path do - = image_tag asset_pack_path('logo-cybre.png') + = image_tag asset_pack_path('logo.png') .form-container = render 'flashes' diff --git a/config/locales/en.yml b/config/locales/en.yml index 201651d17..0d33aae3f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,30 +1,30 @@ --- en: about: - about_mastodon: Cybrespace is an instance of Mastodon, a free, open-source social network. A decentralized alternative to commercial platforms, it avoids the risks of a single company monopolizing your communication. Pick a server that you trust — whichever you choose, you can interact with everyone else. Anyone can run their own Mastodon instance and participate in the social network seamlessly. + about_mastodon: Mastodon is a free, open-source social network. A decentralized alternative to commercial platforms, it avoids the risks of a single company monopolizing your communication. Pick a server that you trust — whichever you choose, you can interact with everyone else. Anyone can run their own Mastodon instance and participate in the social network seamlessly. about_this: About this instance apps: Apps business_email: 'Business e-mail:' closed_registrations: Registrations are currently closed on this instance. contact: Contact - description_headline: What's special about %{domain}? + description_headline: What is %{domain}? domain_count_after: other instances domain_count_before: Connected to features: api: Open API for apps and services blocks: Rich block and muting tools - characters: 512 characters per post + characters: 500 characters per post chronology: Timelines are chronological ethics: 'Ethical design: no ads, no tracking' gifv: GIFV sets and short videos - privacy: Granular, per-ping privacy settings + privacy: Granular, per-post privacy settings public: Public timelines features_headline: What sets Mastodon apart get_started: Get started links: Links other_instances: Other instances source_code: Source code - status_count_after: pings + status_count_after: statuses status_count_before: Who authored terms: Terms user_count_after: users @@ -37,7 +37,7 @@ en: nothing_here: There is nothing here! people_followed_by: People whom %{name} follows people_who_follow: People who follow %{name} - posts: Pings + posts: Posts remote_follow: Remote follow reserved_username: The username is reserved unfollow: Unfollow @@ -205,9 +205,9 @@ en: delete_account_html: If you wish to delete your account, you can proceed here. You will be asked for confirmation. didnt_get_confirmation: Didn't receive confirmation instructions? forgot_password: Forgot your password? - login: Jack in - logout: Jack out - register: Apply for upload + login: Log in + logout: Logout + register: Sign up resend_confirmation: Resend confirmation instructions reset_password: Reset password set_new_password: Set new password @@ -255,7 +255,7 @@ en: storage: Media storage followers: domain: Domain - explanation_html: If you want to ensure the privacy of your pings , you must be aware of who is following you. Your private pings are delivered to all instances where you have followers. You may wish to review them, and remove followers if you do not trust your privacy to be respected by the staff or software of those instances. + explanation_html: If you want to ensure the privacy of your statuses, you must be aware of who is following you. Your private statuses are delivered to all instances where you have followers. You may wish to review them, and remove followers if you do not trust your privacy to be respected by the staff or software of those instances. followers_count: Number of followers lock_link: Lock your account purge: Remove from followers @@ -263,7 +263,7 @@ en: one: In the process of soft-blocking followers from one domain... other: In the process of soft-blocking followers from %{count} domains... true_privacy_html: Please mind that true privacy can only be achieved with end-to-end encryption. - unlocked_warning_html: Anyone can follow you to immediately view your private pings. %{lock_link} to be able to review and reject followers. + unlocked_warning_html: Anyone can follow you to immediately view your private statuses. %{lock_link} to be able to review and reject followers. unlocked_warning_title: Your account is not locked generic: changes_saved_msg: Changes successfully saved! @@ -284,7 +284,7 @@ en: landing_strip_signup_html: If you don't, you can sign up here. media_attachments: validations: - images_and_video: Cannot attach a video to a ping that already contains images + images_and_video: Cannot attach a video to a status that already contains images too_many: Cannot attach more than 4 files notification_mailer: digest: @@ -297,8 +297,8 @@ en: one: "1 new notification since your last visit \U0001F418" other: "%{count} new notifications since your last visit \U0001F418" favourite: - body: 'Your ping was florped by %{name}:' - subject: "%{name} florped your ping" + body: 'Your status was favourited by %{name}:' + subject: "%{name} favourited your status" follow: body: "%{name} is now following you!" subject: "%{name} is now following you" @@ -309,8 +309,8 @@ en: body: 'You were mentioned by %{name} in:' subject: You were mentioned by %{name} reblog: - body: 'Your ping was relayed by %{name}:' - subject: "%{name} relayed your ping" + body: 'Your status was boosted by %{name}:' + subject: "%{name} boosted your status" pagination: next: Next prev: Prev @@ -324,7 +324,7 @@ en: authorized_apps: Authorized apps back: Back to Mastodon delete: Account deletion - edit_profile: edit ~/.profile + edit_profile: Edit profile export: Data export followers: Authorized followers import: Import @@ -344,7 +344,7 @@ en: unlisted_long: Everyone can see, but not listed on public timelines stream_entries: click_to_show: Click to show - reblogged: relayed + reblogged: boosted sensitive_content: Sensitive content time: formats: diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index 99173e948..3e769fb96 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -8,7 +8,7 @@ en: one: 1 character left other: %{count} characters left header: PNG, GIF or JPG. At most 2MB. Will be downscaled to 700x335px - locked: Requires you to manually approve followers and defaults ping privacy to followers-only + locked: Requires you to manually approve followers and defaults post privacy to followers-only note: one: 1 character left other: %{count} characters left @@ -46,11 +46,11 @@ en: must_be_following: Block notifications from people you don't follow notification_emails: digest: Send digest e-mails - favourite: Send e-mail when someone florps your ping + favourite: Send e-mail when someone favourites your status follow: Send e-mail when someone follows you follow_request: Send e-mail when someone requests to follow you mention: Send e-mail when someone mentions you - reblog: Send e-mail when someone boosts your ping + reblog: Send e-mail when someone boosts your status 'no': 'No' required: mark: "*" diff --git a/config/settings.yml b/config/settings.yml index 13ac097c6..19d2ca7be 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -7,7 +7,7 @@ # For more information, see docs/Running-Mastodon/Administration-guide.md # defaults: &defaults - site_title: 'Cybrespace' + site_title: 'dev.glitch.social' site_description: '' site_extended_description: '' site_contact_username: '' diff --git a/public/500.html b/public/500.html index 4197f5cdd..5812bb476 100644 --- a/public/500.html +++ b/public/500.html @@ -8,7 +8,7 @@ - - 1f418 - - - - + \ No newline at end of file diff --git a/public/mstile-150x150.png b/public/mstile-150x150.png index a79f11992..57eae8355 100644 Binary files a/public/mstile-150x150.png and b/public/mstile-150x150.png differ -- cgit From b61e3daf983d87c6d2de7e54d420c2e8f5a531e6 Mon Sep 17 00:00:00 2001 From: Gô Shoemake Date: Sun, 30 Jul 2017 10:28:21 -0700 Subject: Multiple frontend support (#110) * Initial multiple frontend support * Removed unnecessary require() * Moved styles/images out of common --- app/controllers/home_controller.rb | 1 + app/javascript/packs/application.js | 6 ++++++ app/javascript/packs/common.js | 7 ++----- app/javascript/packs/frontends/mastodon.js | 16 ++++++++++++++++ app/javascript/styles/application.scss | 3 --- app/javascript/styles/common.scss | 5 +++++ app/views/home/index.html.haml | 4 ++-- app/views/layouts/application.html.haml | 3 +++ config/initializers/frontends.rb | 7 +++++++ config/webpack/shared.js | 15 ++------------- 10 files changed, 44 insertions(+), 23 deletions(-) create mode 100644 app/javascript/packs/frontends/mastodon.js create mode 100644 app/javascript/styles/common.scss create mode 100644 config/initializers/frontends.rb (limited to 'app/views/layouts') diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 1585bc810..fbfb5473e 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -6,6 +6,7 @@ class HomeController < ApplicationController def index @body_classes = 'app-body' + @frontend = (params[:frontend] and Rails.configuration.x.available_frontends.include? params[:frontend] + '.js') ? params[:frontend] : 'mastodon' end private diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 116632dea..c06714dc1 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -1,5 +1,11 @@ import loadPolyfills from '../mastodon/load_polyfills'; +// import default stylesheet with variables +require('font-awesome/css/font-awesome.css'); +require('mastodon-application-style'); + +require.context('../images/', true); + loadPolyfills().then(() => { require('../mastodon/main').default(); }).catch(e => { diff --git a/app/javascript/packs/common.js b/app/javascript/packs/common.js index ba7053f1f..de0c68fa5 100644 --- a/app/javascript/packs/common.js +++ b/app/javascript/packs/common.js @@ -1,9 +1,6 @@ import { start } from 'rails-ujs'; -// import default stylesheet with variables -require('font-awesome/css/font-awesome.css'); -require('mastodon-application-style'); - -require.context('../images/', true); +// import common styling +require('../styles/common.scss'); start(); diff --git a/app/javascript/packs/frontends/mastodon.js b/app/javascript/packs/frontends/mastodon.js new file mode 100644 index 000000000..a983de36f --- /dev/null +++ b/app/javascript/packs/frontends/mastodon.js @@ -0,0 +1,16 @@ +// This file replaces `app/javascript/packs/application.js` for use +// with multiple frontends. + +import loadPolyfills from '../../mastodon/load_polyfills'; + +// import default stylesheet with variables +require('font-awesome/css/font-awesome.css'); +require('mastodon-application-style'); + +require.context('../../images/', true); + +loadPolyfills().then(() => { + require('../../mastodon/main').default(); +}).catch(e => { + console.error(e); +}); diff --git a/app/javascript/styles/application.scss b/app/javascript/styles/application.scss index b08b69449..33c7783f3 100644 --- a/app/javascript/styles/application.scss +++ b/app/javascript/styles/application.scss @@ -1,9 +1,6 @@ @import 'mixins'; @import 'variables'; @import 'variables-glitch'; -@import 'fonts/roboto'; -@import 'fonts/roboto-mono'; -@import 'fonts/montserrat'; @import 'reset'; @import 'basics'; diff --git a/app/javascript/styles/common.scss b/app/javascript/styles/common.scss new file mode 100644 index 000000000..c1772e7ae --- /dev/null +++ b/app/javascript/styles/common.scss @@ -0,0 +1,5 @@ +// This makes our fonts available everywhere. + +@import 'fonts/roboto'; +@import 'fonts/roboto-mono'; +@import 'fonts/montserrat'; diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 1ed5c1ae0..ec6e53461 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -2,8 +2,8 @@ %meta{name: 'applicationServerKey', content: Rails.configuration.x.vapid_public_key} %script#initial-state{ type: 'application/json' }!= json_escape(@initial_state_json) - = javascript_pack_tag 'application', integrity: true, crossorigin: 'anonymous' - = stylesheet_pack_tag 'application', media: 'all' + = javascript_pack_tag "frontends/#{@frontend}", integrity: true, crossorigin: 'anonymous' + = stylesheet_pack_tag "frontends/#{@frontend}", integrity: true, media: 'all' .app-holder#mastodon{ data: { props: Oj.dump(default_props) } } %noscript diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 82b20810a..399d70bc0 100755 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -32,6 +32,9 @@ = javascript_pack_tag "locale_#{I18n.locale}", integrity: true, crossorigin: 'anonymous' = csrf_meta_tags + - if controller_name != 'home' + = stylesheet_pack_tag 'application', integrity: true, media: 'all' + = yield :header_tags - body_classes ||= @body_classes diff --git a/config/initializers/frontends.rb b/config/initializers/frontends.rb new file mode 100644 index 000000000..2cb68cc61 --- /dev/null +++ b/config/initializers/frontends.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.configure do + frontends = [] + Rails.root.join('app', 'javascript', 'packs', 'frontends').each_child(false) { |f| frontends.push f.to_s } + config.x.available_frontends = frontends +end diff --git a/config/webpack/shared.js b/config/webpack/shared.js index 98e864a66..425918d66 100644 --- a/config/webpack/shared.js +++ b/config/webpack/shared.js @@ -2,7 +2,7 @@ const { existsSync } = require('fs'); const webpack = require('webpack'); -const { basename, dirname, join, relative, resolve, sep } = require('path'); +const { basename, dirname, join, relative, resolve } = require('path'); const { sync } = require('glob'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const ManifestPlugin = require('webpack-manifest-plugin'); @@ -54,18 +54,7 @@ module.exports = { }), new webpack.optimize.CommonsChunkPlugin({ name: 'common', - minChunks: (module, count) => { - const reactIntlPathRegexp = new RegExp(`node_modules\\${sep}react-intl`); - - if (module.resource && reactIntlPathRegexp.test(module.resource)) { - // skip react-intl because it's useless to put in the common chunk, - // e.g. because "shared" modules between zh-TW and zh-CN will never - // be loaded together - return false; - } - - return count >= 2; - }, + minChunks: Infinity, // It doesn't make sense to use common chunks with multiple frontend support. }), ], -- cgit From 15c9c2fd7e5603d48b5eeb966963138b454cfe2a Mon Sep 17 00:00:00 2001 From: kibigo! Date: Wed, 20 Sep 2017 02:50:53 -0700 Subject: Pinned toots; embeds --- .../glitch/components/status/action_bar.js | 56 ++++++++++++++++------ .../glitch/components/status/container.js | 14 ++++++ app/javascript/glitch/components/status/index.js | 3 ++ app/views/layouts/embedded.html.haml | 1 + 4 files changed, 60 insertions(+), 14 deletions(-) (limited to 'app/views/layouts') diff --git a/app/javascript/glitch/components/status/action_bar.js b/app/javascript/glitch/components/status/action_bar.js index 7c73002c1..d4d26c62c 100644 --- a/app/javascript/glitch/components/status/action_bar.js +++ b/app/javascript/glitch/components/status/action_bar.js @@ -8,7 +8,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; // Mastodon imports // import RelativeTimestamp from '../../../mastodon/components/relative_timestamp'; import IconButton from '../../../mastodon/components/icon_button'; -import DropdownMenu from '../../../mastodon/components/dropdown_menu'; +import DropdownMenuContainer from '../../../mastodon/containers/dropdown_menu_container'; const messages = defineMessages({ delete: { id: 'status.delete', defaultMessage: 'Delete' }, @@ -16,6 +16,7 @@ const messages = defineMessages({ mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' }, block: { id: 'account.block', defaultMessage: 'Block @{name}' }, reply: { id: 'status.reply', defaultMessage: 'Reply' }, + share: { id: 'status.share', defaultMessage: 'Share' }, replyAll: { id: 'status.replyAll', defaultMessage: 'Reply to thread' }, reblog: { id: 'status.reblog', defaultMessage: 'Boost' }, cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' }, @@ -24,6 +25,9 @@ const messages = defineMessages({ report: { id: 'status.report', defaultMessage: 'Report @{name}' }, muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' }, unmuteConversation: { id: 'status.unmute_conversation', defaultMessage: 'Unmute conversation' }, + pin: { id: 'status.pin', defaultMessage: 'Pin on profile' }, + unpin: { id: 'status.unpin', defaultMessage: 'Unpin from profile' }, + embed: { id: 'status.embed', defaultMessage: 'Embed' }, }); @injectIntl @@ -43,7 +47,9 @@ export default class StatusActionBar extends ImmutablePureComponent { onMute: PropTypes.func, onBlock: PropTypes.func, onReport: PropTypes.func, + onEmbed: PropTypes.func, onMuteConversation: PropTypes.func, + onPin: PropTypes.func, me: PropTypes.number, withDismiss: PropTypes.bool, intl: PropTypes.object.isRequired, @@ -61,6 +67,13 @@ export default class StatusActionBar extends ImmutablePureComponent { this.props.onReply(this.props.status, this.context.router.history); } + handleShareClick = () => { + navigator.share({ + text: this.props.status.get('search_index'), + url: this.props.status.get('url'), + }); + } + handleFavouriteClick = () => { this.props.onFavourite(this.props.status); } @@ -73,6 +86,10 @@ export default class StatusActionBar extends ImmutablePureComponent { this.props.onDelete(this.props.status); } + handlePinClick = () => { + this.props.onPin(this.props.status); + } + handleMentionClick = () => { this.props.onMention(this.props.status.get('account'), this.context.router.history); } @@ -89,6 +106,10 @@ export default class StatusActionBar extends ImmutablePureComponent { this.context.router.history.push(`/statuses/${this.props.status.get('id')}`); } + handleEmbed = () => { + this.props.onEmbed(this.props.status); + } + handleReport = () => { this.props.onReport(this.props.status); } @@ -99,9 +120,10 @@ export default class StatusActionBar extends ImmutablePureComponent { render () { const { status, me, intl, withDismiss } = this.props; - const reblogDisabled = status.get('visibility') === 'private' || status.get('visibility') === 'direct'; + const mutingConversation = status.get('muted'); const anonymousAccess = !me; + const publicStatus = ['public', 'unlisted'].includes(status.get('visibility')); let menu = []; let reblogIcon = 'retweet'; @@ -109,14 +131,23 @@ export default class StatusActionBar extends ImmutablePureComponent { let replyTitle; menu.push({ text: intl.formatMessage(messages.open), action: this.handleOpen }); + + if (publicStatus) { + menu.push({ text: intl.formatMessage(messages.embed), action: this.handleEmbed }); + } + menu.push(null); - if (withDismiss) { + if (status.getIn(['account', 'id']) === me || withDismiss) { menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick }); menu.push(null); } if (status.getIn(['account', 'id']) === me) { + if (publicStatus) { + menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick }); + } + menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick }); } else { menu.push({ text: intl.formatMessage(messages.mention, { name: status.getIn(['account', 'username']) }), action: this.handleMentionClick }); @@ -126,14 +157,6 @@ export default class StatusActionBar extends ImmutablePureComponent { menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport }); } - /* - if (status.get('visibility') === 'direct') { - reblogIcon = 'envelope'; - } else if (status.get('visibility') === 'private') { - reblogIcon = 'lock'; - } - */ - if (status.get('in_reply_to_id', null) === null) { replyIcon = 'reply'; replyTitle = intl.formatMessage(messages.reply); @@ -142,14 +165,19 @@ export default class StatusActionBar extends ImmutablePureComponent { replyTitle = intl.formatMessage(messages.replyAll); } + const shareButton = ('share' in navigator) && status.get('visibility') === 'public' && ( + + ); + return (
- - + + + {shareButton}
- +
diff --git a/app/javascript/glitch/components/status/container.js b/app/javascript/glitch/components/status/container.js index b4d7fb4cc..da2771c0b 100644 --- a/app/javascript/glitch/components/status/container.js +++ b/app/javascript/glitch/components/status/container.js @@ -38,6 +38,8 @@ import { favourite, unreblog, unfavourite, + pin, + unpin, } from '../../../mastodon/actions/interactions'; import { blockAccount } from '../../../mastodon/actions/accounts'; import { initMuteModal } from '../../../mastodon/actions/mutes'; @@ -187,6 +189,18 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ } }, + onPin (status) { + if (status.get('pinned')) { + dispatch(unpin(status)); + } else { + dispatch(pin(status)); + } + }, + + onEmbed (status) { + dispatch(openModal('EMBED', { url: status.get('url') })); + }, + onDelete (status) { if (!this.deleteModal) { dispatch(deleteStatus(status.get('id'))); diff --git a/app/javascript/glitch/components/status/index.js b/app/javascript/glitch/components/status/index.js index 55e6f1876..4a2a0e1d4 100644 --- a/app/javascript/glitch/components/status/index.js +++ b/app/javascript/glitch/components/status/index.js @@ -165,10 +165,13 @@ export default class Status extends ImmutablePureComponent { onReblog : PropTypes.func, onModalReblog : PropTypes.func, onDelete : PropTypes.func, + onPin : PropTypes.func, onMention : PropTypes.func, onMute : PropTypes.func, onMuteConversation : PropTypes.func, onBlock : PropTypes.func, + onEmbed : PropTypes.func, + onHeightChange : PropTypes.func, onReport : PropTypes.func, onOpenMedia : PropTypes.func, onOpenVideo : PropTypes.func, diff --git a/app/views/layouts/embedded.html.haml b/app/views/layouts/embedded.html.haml index 46dab2d0f..5fc60be17 100644 --- a/app/views/layouts/embedded.html.haml +++ b/app/views/layouts/embedded.html.haml @@ -6,6 +6,7 @@ = stylesheet_pack_tag 'common', media: 'all' = javascript_pack_tag 'common', integrity: true, crossorigin: 'anonymous' + = stylesheet_pack_tag 'application', integrity: true, media: 'all' = javascript_pack_tag "locale_#{I18n.locale}", integrity: true, crossorigin: 'anonymous' = javascript_pack_tag 'public', integrity: true, crossorigin: 'anonymous' %body.embed -- cgit From cf1f83ca2a35247184f1f27607960c21a37398ea Mon Sep 17 00:00:00 2001 From: kibigo! Date: Thu, 28 Sep 2017 17:45:16 -0700 Subject: Fixed lingering upstream Theme code --- app/views/layouts/error.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/layouts') diff --git a/app/views/layouts/error.html.haml b/app/views/layouts/error.html.haml index 31f322096..8b260c619 100644 --- a/app/views/layouts/error.html.haml +++ b/app/views/layouts/error.html.haml @@ -6,7 +6,7 @@ %title= safe_join([yield(:page_title), title], ' - ') %meta{ content: 'width=device-width,initial-scale=1', name: 'viewport' }/ = stylesheet_pack_tag 'common', media: 'all' - = stylesheet_pack_tag Setting.default_settings['theme'], media: 'all' + = stylesheet_pack_tag 'application', integrity: true, media: 'all' %body.error .dialog %img{ alt: title, src: '/oops.gif' }/ -- cgit