├── public
├── .gitkeep
├── robots.txt
├── assets
│ ├── images
│ │ ├── webrtc.png
│ │ ├── sharedrop-icon.png
│ │ ├── sharedrop-icon-128x128.png
│ │ ├── sharedrop-icon-1024x1024.png
│ │ ├── select-arrow.svg
│ │ ├── github.svg
│ │ ├── avatars
│ │ │ ├── 46.svg
│ │ │ ├── 37.svg
│ │ │ ├── 36.svg
│ │ │ ├── 38.svg
│ │ │ ├── 86.svg
│ │ │ ├── 64.svg
│ │ │ ├── 87.svg
│ │ │ ├── 112.svg
│ │ │ ├── 109.svg
│ │ │ ├── 50.svg
│ │ │ ├── 63.svg
│ │ │ ├── 23.svg
│ │ │ ├── 61.svg
│ │ │ ├── 52.svg
│ │ │ ├── 40.svg
│ │ │ ├── 74.svg
│ │ │ ├── 65.svg
│ │ │ ├── 66.svg
│ │ │ ├── 59.svg
│ │ │ ├── 95.svg
│ │ │ └── 71.svg
│ │ └── sharedrop-light.svg
│ └── fonts
│ │ └── glyphicons
│ │ ├── glyphicons-filetypes-regular.eot
│ │ ├── glyphicons-filetypes-regular.ttf
│ │ └── glyphicons-filetypes-regular.woff
├── .well-known
│ └── brave-rewards-verification.txt
└── crossdomain.xml
├── vendor
├── .gitkeep
└── ba-tiny-pubsub.min.js
├── tests
├── helpers
│ └── .gitkeep
├── unit
│ └── .gitkeep
├── integration
│ └── .gitkeep
├── test-helper.js
└── index.html
├── Procfile
├── Procfile.dev
├── .watchmanconfig
├── app
├── styles
│ ├── base
│ │ ├── _variables.sass
│ │ ├── _element_defaults.sass
│ │ ├── _mixins.sass
│ │ └── _reset.sass
│ ├── app.sass
│ ├── layout
│ │ ├── _content.sass
│ │ ├── _footer.sass
│ │ ├── _header.sass
│ │ └── _media.sass
│ └── modules
│ │ ├── _modules.sass
│ │ ├── _popover.sass
│ │ ├── _modal.sass
│ │ └── _users.sass
├── templates
│ ├── about-you.hbs
│ ├── errors
│ │ ├── popovers
│ │ │ ├── connection-failed.hbs
│ │ │ └── multiple-files.hbs
│ │ ├── browser-unsupported.hbs
│ │ └── filesystem-unavailable.hbs
│ ├── components
│ │ ├── modal-dialog.hbs
│ │ ├── user-widget.hbs
│ │ ├── popover-confirm.hbs
│ │ └── peer-widget.hbs
│ ├── index.hbs
│ ├── about-room.hbs
│ ├── application.hbs
│ └── about-app.hbs
├── helpers
│ └── is-equal.js
├── components
│ ├── circular-progress.hbs
│ ├── user-widget.js
│ ├── modal-dialog.js
│ ├── room-url.js
│ ├── circular-progress.js
│ ├── popover-confirm.js
│ ├── file-field.js
│ ├── peer-avatar.js
│ └── peer-widget.js
├── services
│ ├── analytics.js
│ ├── room.js
│ ├── avatar.js
│ └── file.js
├── routes
│ ├── error.js
│ ├── application.js
│ ├── room.js
│ └── index.js
├── models
│ ├── user.js
│ └── peer.js
├── router.js
├── app.js
├── controllers
│ ├── application.js
│ └── index.js
├── index.html
└── initializers
│ └── prerequisites.js
├── lib
└── google-analytics
│ ├── package.json
│ └── index.js
├── config
├── optional-features.json
├── targets.js
├── dotenv.js
└── environment.js
├── .env.sample
├── .prettierignore
├── Dockerfile
├── .template-lintrc.js
├── .ember-cli
├── prettier.config.js
├── .eslintignore
├── sharedrop.crx
├── .travis.yml
├── .editorconfig
├── .gitignore
├── newrelic.js
├── testem.js
├── LICENSE
├── firebase_rules.json
├── ember-cli-build.js
├── .eslintrc.js
├── server.js
├── README.md
└── package.json
/public/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/helpers/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/unit/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/integration/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | web: node server.js
2 |
--------------------------------------------------------------------------------
/Procfile.dev:
--------------------------------------------------------------------------------
1 | server: node server.js
2 | web: ember build --watch
3 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # http://www.robotstxt.org
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {
2 | "ignore_dirs": [
3 | "tmp",
4 | "dist"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/app/styles/base/_variables.sass:
--------------------------------------------------------------------------------
1 | $font-family: "Helvetica Neue", sans-serif
2 |
3 | $blue: #0088cc
4 | $green: #a4c540
5 |
--------------------------------------------------------------------------------
/public/assets/images/webrtc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ShareDropio/sharedrop/HEAD/public/assets/images/webrtc.png
--------------------------------------------------------------------------------
/app/templates/about-you.hbs:
--------------------------------------------------------------------------------
1 | ShareDrop lets you share files with others.
2 | Other people will see you as {{you.label}}.
--------------------------------------------------------------------------------
/app/templates/errors/popovers/connection-failed.hbs:
--------------------------------------------------------------------------------
1 | It was not possible to establish direct connection with the other peer.
2 |
--------------------------------------------------------------------------------
/lib/google-analytics/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "google-analytics",
3 | "keywords": [
4 | "ember-addon"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/public/assets/images/sharedrop-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ShareDropio/sharedrop/HEAD/public/assets/images/sharedrop-icon.png
--------------------------------------------------------------------------------
/public/assets/images/sharedrop-icon-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ShareDropio/sharedrop/HEAD/public/assets/images/sharedrop-icon-128x128.png
--------------------------------------------------------------------------------
/public/assets/images/sharedrop-icon-1024x1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ShareDropio/sharedrop/HEAD/public/assets/images/sharedrop-icon-1024x1024.png
--------------------------------------------------------------------------------
/app/helpers/is-equal.js:
--------------------------------------------------------------------------------
1 | import { helper as buildHelper } from '@ember/component/helper';
2 |
3 | export default buildHelper(([leftSide, rightSide]) => leftSide === rightSide);
4 |
--------------------------------------------------------------------------------
/public/assets/fonts/glyphicons/glyphicons-filetypes-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ShareDropio/sharedrop/HEAD/public/assets/fonts/glyphicons/glyphicons-filetypes-regular.eot
--------------------------------------------------------------------------------
/public/assets/fonts/glyphicons/glyphicons-filetypes-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ShareDropio/sharedrop/HEAD/public/assets/fonts/glyphicons/glyphicons-filetypes-regular.ttf
--------------------------------------------------------------------------------
/public/assets/fonts/glyphicons/glyphicons-filetypes-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ShareDropio/sharedrop/HEAD/public/assets/fonts/glyphicons/glyphicons-filetypes-regular.woff
--------------------------------------------------------------------------------
/app/components/circular-progress.hbs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/templates/errors/popovers/multiple-files.hbs:
--------------------------------------------------------------------------------
1 | The files you have selected exceed the maximum allowed size of 200MB
2 |
3 | TIP: You can send single files without size restriction
4 |
--------------------------------------------------------------------------------
/app/components/user-widget.js:
--------------------------------------------------------------------------------
1 | import Component from '@ember/component';
2 |
3 | export default Component.extend({
4 | classNames: ['peer'],
5 | classNameBindings: ['peer.peer.state'],
6 | });
7 |
--------------------------------------------------------------------------------
/config/optional-features.json:
--------------------------------------------------------------------------------
1 | {
2 | "application-template-wrapper": false,
3 | "default-async-observers": true,
4 | "jquery-integration": true,
5 | "template-only-glimmer-components": true
6 | }
7 |
--------------------------------------------------------------------------------
/public/.well-known/brave-rewards-verification.txt:
--------------------------------------------------------------------------------
1 | This is a Brave Rewards publisher verification file.
2 |
3 | Domain: sharedrop.io
4 | Token: d463c371edd92de3a09b0ccf1ce8143b9ee7f8c5611734f7ab58e2b67934b4bb
5 |
--------------------------------------------------------------------------------
/.env.sample:
--------------------------------------------------------------------------------
1 | PORT=8000
2 | SECRET=qwerty
3 | FIREBASE_URL=https://your-firebase.firebaseio.com
4 | FIREBASE_SECRET=qwerty
5 | NEW_RELIC_ENABLED=false
6 | NEW_RELIC_LICENSE_KEY=qwerty
7 | GOOGLE_ANALYTICS_ID=UA-XXXX-Y
8 |
--------------------------------------------------------------------------------
/app/services/analytics.js:
--------------------------------------------------------------------------------
1 | export default {
2 | trackEvent(name, parameters) {
3 | if (window.gtag && typeof window.gtag === 'function') {
4 | window.gtag('event', name, parameters);
5 | }
6 | },
7 | };
8 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | ##########
2 | # Common
3 | ##########
4 |
5 | # Duh
6 | .git/
7 |
8 | # Third party
9 | /node_modules/
10 | /vendor/
11 |
12 | # Build products
13 | /dist/
14 | /tmp/
15 | /coverage/
16 | /.sass-cache/
17 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:14-buster
2 | RUN mkdir -p /srv/app
3 | WORKDIR /srv/app
4 | COPY package.json yarn.lock ./
5 | RUN yarn --frozen-lockfile --non-interactive
6 |
7 | COPY . /srv/app
8 | EXPOSE 8000
9 | CMD [ "yarn", "develop" ]
10 |
--------------------------------------------------------------------------------
/app/templates/errors/browser-unsupported.hbs:
--------------------------------------------------------------------------------
1 |
2 |
We're really sorry, but your browser is not supported.
Please use the latest desktop or Android version of
Chrome, Opera or Firefox.
3 |
4 |
--------------------------------------------------------------------------------
/app/templates/components/modal-dialog.hbs:
--------------------------------------------------------------------------------
1 | {{! template-lint-disable no-invalid-interactive }}
2 |
3 |
4 | {{yield}}
5 |
6 | {{! template-lint-enable no-invalid-interactive }}
--------------------------------------------------------------------------------
/config/targets.js:
--------------------------------------------------------------------------------
1 | const browsers = [
2 | 'last 2 Chrome versions',
3 | 'last 2 Firefox versions',
4 | 'last 2 Safari versions',
5 | 'last 2 iOS versions',
6 | 'last 2 Edge versions',
7 | ];
8 |
9 | module.exports = {
10 | browsers,
11 | };
12 |
--------------------------------------------------------------------------------
/app/templates/errors/filesystem-unavailable.hbs:
--------------------------------------------------------------------------------
1 |
2 |
Uh oh. Looks like there's some issue and we won't be able
to save your files.
3 |
If you've opened this app in incognito/private window,
try again in a normal one.
4 |
5 |
--------------------------------------------------------------------------------
/.template-lintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: 'octane',
3 |
4 | // TODO: enable these
5 | rules: {
6 | 'no-action': false,
7 | 'no-curly-component-invocation': false,
8 | 'no-implicit-this': false,
9 | 'no-partial': false,
10 | },
11 | };
12 |
--------------------------------------------------------------------------------
/config/dotenv.js:
--------------------------------------------------------------------------------
1 | module.exports = function () {
2 | return {
3 | clientAllowedKeys: ['FIREBASE_URL'],
4 | // Fail build when there is missing any of clientAllowedKeys environment variables.
5 | // By default false.
6 | failOnMissingKey: false,
7 | };
8 | };
9 |
--------------------------------------------------------------------------------
/tests/test-helper.js:
--------------------------------------------------------------------------------
1 | /* eslint */
2 | import { setApplication } from '@ember/test-helpers';
3 | import { start } from 'ember-qunit';
4 | import Application from 'sharedrop/app';
5 | import config from 'sharedrop/config/environment';
6 |
7 | setApplication(Application.create(config.APP));
8 |
9 | start();
10 |
--------------------------------------------------------------------------------
/public/assets/images/select-arrow.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/.ember-cli:
--------------------------------------------------------------------------------
1 | {
2 | /**
3 | Ember CLI sends analytics information by default. The data is completely
4 | anonymous, but there are times when you might want to disable this behavior.
5 |
6 | Setting `disableAnalytics` to true will prevent any data from being sent.
7 | */
8 | "disableAnalytics": false
9 | }
10 |
--------------------------------------------------------------------------------
/app/components/modal-dialog.js:
--------------------------------------------------------------------------------
1 | import Component from '@ember/component';
2 |
3 | export default Component.extend({
4 | actions: {
5 | close() {
6 | // This sends an action to application route.
7 | // eslint-disable-next-line ember/closure-actions
8 | return this.onClose();
9 | },
10 | },
11 | });
12 |
--------------------------------------------------------------------------------
/prettier.config.js:
--------------------------------------------------------------------------------
1 | // https://prettier.io/docs/en/options.html
2 |
3 | module.exports = {
4 | printWidth: 80,
5 | tabWidth: 2,
6 | useTabs: false,
7 | semi: true,
8 | singleQuote: true,
9 | trailingComma: 'all',
10 | bracketSpacing: true,
11 | jsxBracketSameLine: false,
12 | arrowParens: 'always',
13 | };
14 |
--------------------------------------------------------------------------------
/app/templates/components/user-widget.hbs:
--------------------------------------------------------------------------------
1 |
2 |

3 |
4 |
5 |
You
6 |
7 | {{user.label}}
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | # unconventional js
2 | /blueprints/*/files/
3 | /vendor/
4 |
5 | # compiled output
6 | /dist/
7 | /tmp/
8 |
9 | # dependencies
10 | /bower_components/
11 | /node_modules/
12 |
13 | # misc
14 | /coverage/
15 | !.*
16 |
17 | # ember-try
18 | /.node_modules.ember-try/
19 | /bower.json.ember-try
20 | /package.json.ember-try
21 |
--------------------------------------------------------------------------------
/vendor/ba-tiny-pubsub.min.js:
--------------------------------------------------------------------------------
1 | /*! Tiny Pub/Sub - v0.7.0 - 2013-01-29
2 | * https://github.com/cowboy/jquery-tiny-pubsub
3 | * Copyright (c) 2013 "Cowboy" Ben Alman; Licensed MIT */
4 | (function(n){var u=n({});n.subscribe=function(){u.on.apply(u,arguments)},n.unsubscribe=function(){u.off.apply(u,arguments)},n.publish=function(){u.trigger.apply(u,arguments)}})(jQuery);
--------------------------------------------------------------------------------
/app/routes/error.js:
--------------------------------------------------------------------------------
1 | import Route from '@ember/routing/route';
2 |
3 | export default Route.extend({
4 | renderTemplate(controller, error) {
5 | const errors = ['browser-unsupported', 'filesystem-unavailable'];
6 | const name = `errors/${error.message}`;
7 |
8 | if (errors.indexOf(error.message) !== -1) {
9 | this.render(name);
10 | }
11 | },
12 | });
13 |
--------------------------------------------------------------------------------
/app/styles/app.sass:
--------------------------------------------------------------------------------
1 | @import base/reset
2 |
3 | @import base/variables
4 | @import base/mixins
5 | @import base/element_defaults
6 | @import base/glyphicons_filetypes
7 |
8 | @import modules/modules
9 | @import modules/modal
10 | @import modules/users
11 | @import modules/popover
12 |
13 | @import layout/header
14 | @import layout/content
15 | @import layout/footer
16 | @import layout/media
17 |
--------------------------------------------------------------------------------
/sharedrop.crx:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ShareDrop",
3 | "description": "Simple file sharing",
4 | "version": "1",
5 | "app": {
6 | "urls": [
7 | "https:/www.sharedrop.io/"
8 | ],
9 | "launch": {
10 | "web_url": "https:/www.sharedrop.io/"
11 | }
12 | },
13 | "icons": {
14 | "128": "sharedrop-icon-128.png"
15 | },
16 | "permissions": [
17 | "notifications"
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/app/models/user.js:
--------------------------------------------------------------------------------
1 | import Peer from './peer';
2 |
3 | const User = Peer.extend({
4 | serialize() {
5 | const data = {
6 | uuid: this.uuid,
7 | public_ip: this.public_ip,
8 | label: this.label,
9 | avatarUrl: this.avatarUrl,
10 | peer: {
11 | id: this.get('peer.id'),
12 | },
13 | };
14 |
15 | return data;
16 | },
17 | });
18 |
19 | export default User;
20 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | ---
2 | language: node_js
3 | node_js:
4 | - "12"
5 |
6 | dist: xenial
7 |
8 | addons:
9 | chrome: stable
10 |
11 | cache:
12 | yarn: true
13 |
14 | env:
15 | global:
16 | # See https://git.io/vdao3 for details.
17 | - JOBS=1
18 |
19 | before_install:
20 | - curl -o- -L https://yarnpkg.com/install.sh | bash
21 | - export PATH=$HOME/.yarn/bin:$PATH
22 |
23 | script:
24 | - yarn test
25 |
--------------------------------------------------------------------------------
/app/router.js:
--------------------------------------------------------------------------------
1 | import EmberRouter from '@ember/routing/router';
2 | import config from 'sharedrop/config/environment';
3 |
4 | export default class Router extends EmberRouter {
5 | location = config.locationType;
6 |
7 | rootURL = config.rootURL;
8 | }
9 |
10 | // eslint-disable-next-line array-callback-return
11 | Router.map(function () {
12 | this.route('room', {
13 | path: '/rooms/:room_id',
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # editorconfig.org
4 |
5 | root = true
6 |
7 | [*]
8 | end_of_line = lf
9 | charset = utf-8
10 | trim_trailing_whitespace = true
11 | insert_final_newline = true
12 | indent_style = space
13 | indent_size = 2
14 |
15 | [*.hbs]
16 | insert_final_newline = false
17 |
18 | [*.{diff,md}]
19 | trim_trailing_whitespace = false
20 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist/
5 | /tmp/
6 |
7 | # dependencies
8 | /bower_components/
9 | /node_modules/
10 |
11 | # misc
12 | /.env*
13 | /.pnp*
14 | /.sass-cache
15 | /connect.lock
16 | /coverage/
17 | /libpeerconnection.log
18 | /npm-debug.log*
19 | /testem.log
20 | /yarn-error.log
21 |
22 | # ember-try
23 | /.node_modules.ember-try/
24 | /bower.json.ember-try
25 | /package.json.ember-try
26 |
--------------------------------------------------------------------------------
/app/styles/base/_element_defaults.sass:
--------------------------------------------------------------------------------
1 | *, *::before, *::after
2 | box-sizing: border-box
3 |
4 | html
5 | height: 100%
6 | font-family: $font-family
7 | font-size: 10px
8 |
9 | body
10 | height: 100%
11 |
12 | a
13 | text-decoration: none
14 |
15 | b, strong
16 | font-weight: bold
17 |
18 | input, select
19 | font-family: inherit
20 | padding: 1rem
21 | border: 1px solid #ccc
22 | width: 100%
23 | border-radius: .3rem
24 | font-size: 1.4rem
25 |
26 | .invisible
27 | height: 0
28 | width: 0
29 | opacity: 0
30 |
--------------------------------------------------------------------------------
/app/routes/application.js:
--------------------------------------------------------------------------------
1 | import Route from '@ember/routing/route';
2 |
3 | export default Route.extend({
4 | setupController(controller) {
5 | controller.set('currentRoute', this);
6 | },
7 |
8 | actions: {
9 | openModal(modalName) {
10 | return this.render(modalName, {
11 | outlet: 'modal',
12 | into: 'application',
13 | });
14 | },
15 |
16 | closeModal() {
17 | return this.disconnectOutlet({
18 | outlet: 'modal',
19 | parentView: 'application',
20 | });
21 | },
22 | },
23 | });
24 |
--------------------------------------------------------------------------------
/app/components/room-url.js:
--------------------------------------------------------------------------------
1 | import TextField from '@ember/component/text-field';
2 | import $ from 'jquery';
3 |
4 | export default TextField.extend({
5 | classNames: ['room-url'],
6 |
7 | didInsertElement() {
8 | $(this.element).focus().select();
9 | },
10 |
11 | copyValueToClipboard() {
12 | if (window.ClipboardEvent) {
13 | const pasteEvent = new window.ClipboardEvent('paste', {
14 | dataType: 'text/plain',
15 | data: this.element.value,
16 | });
17 | document.dispatchEvent(pasteEvent);
18 | }
19 | },
20 | });
21 |
--------------------------------------------------------------------------------
/app/styles/base/_mixins.sass:
--------------------------------------------------------------------------------
1 | =ellipsis
2 | overflow: hidden
3 | white-space: nowrap
4 | text-overflow: ellipsis
5 |
6 | =button_reset
7 | margin: 0
8 | padding: 0
9 | display: inline-block
10 | border: none
11 | background: none
12 | outline: none
13 | width: auto
14 | cursor: pointer
15 | font-family: inherit
16 |
17 | =shape($size, $shape)
18 | display: inline-block
19 | width: $size
20 | height: $size
21 | line-height: $size
22 | text-align: center
23 | vertical-align: middle
24 | @if $shape == circle
25 | border-radius: 50%
26 |
--------------------------------------------------------------------------------
/app/styles/layout/_content.sass:
--------------------------------------------------------------------------------
1 | .l-content
2 | position: relative
3 | height: 100vh
4 | min-height: 600px
5 |
6 | .visually-hidden
7 | clip: rect(0 0 0 0)
8 | clip-path: inset(50%)
9 | height: 1px
10 | overflow: hidden
11 | position: absolute
12 | white-space: nowrap
13 | width: 1px
14 |
15 | .ribbon
16 | position: fixed
17 | left: -80px
18 | bottom: 0px
19 | width: 300px
20 | height: 64px
21 | transform: rotate(45deg)
22 | z-index: 999
23 | background: linear-gradient(-180deg, rgb(0, 91, 187) 50%, rgb(255, 213, 0) 50%)
24 | opacity: 0.8
25 |
--------------------------------------------------------------------------------
/app/templates/components/popover-confirm.hbs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
{{yield}}
8 |
9 |
10 |
11 | {{#if cancelButtonLabel}}
12 |
13 | {{/if}}
14 |
15 | {{#if confirmButtonLabel}}
16 |
17 | {{/if}}
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/newrelic.js:
--------------------------------------------------------------------------------
1 | /**
2 | * New Relic agent configuration.
3 | *
4 | * See lib/config.defaults.js in the agent distribution for a more complete
5 | * description of configuration variables and their potential values.
6 | */
7 | exports.config = {
8 | /**
9 | * Array of application names.
10 | */
11 | app_name: ['ShareDrop'],
12 |
13 | logging: {
14 | /**
15 | * Level at which to log. 'trace' is most useful to New Relic when diagnosing
16 | * issues with the agent, 'info' and higher will impose the least overhead on
17 | * production applications.
18 | */
19 | level: 'info',
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/public/crossdomain.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
15 |
16 |
--------------------------------------------------------------------------------
/testem.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | test_page: 'tests/index.html?hidepassed',
3 | disable_watching: true,
4 | launch_in_ci: ['Chrome'],
5 | launch_in_dev: ['Chrome'],
6 | browser_start_timeout: 120,
7 | browser_args: {
8 | Chrome: {
9 | ci: [
10 | // --no-sandbox is needed when running Chrome inside a container
11 | process.env.CI ? '--no-sandbox' : null,
12 | '--headless',
13 | '--disable-dev-shm-usage',
14 | '--disable-software-rasterizer',
15 | '--mute-audio',
16 | '--remote-debugging-port=0',
17 | '--window-size=1440,900',
18 | ].filter(Boolean),
19 | },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/lib/google-analytics/index.js:
--------------------------------------------------------------------------------
1 | const { name } = require('./package');
2 |
3 | module.exports = {
4 | name,
5 |
6 | isDevelopingAddon() {
7 | return true;
8 | },
9 |
10 | contentFor(type, config) {
11 | const id = config.googleAnalyticsId;
12 |
13 | if (type === 'head' && id) {
14 | return `
15 |
16 |
22 | `;
23 | }
24 |
25 | return '';
26 | },
27 | };
28 |
--------------------------------------------------------------------------------
/app/app.js:
--------------------------------------------------------------------------------
1 | import Application from '@ember/application';
2 | import Resolver from 'ember-resolver';
3 | import loadInitializers from 'ember-load-initializers';
4 | import config from 'sharedrop/config/environment';
5 | import * as Sentry from '@sentry/browser';
6 | import { Ember as EmberIntegration } from '@sentry/integrations';
7 |
8 | Sentry.init({
9 | dsn:
10 | 'https://ba1292a9c759401dbbda4272f183408d@o432021.ingest.sentry.io/5384091',
11 | integrations: [new EmberIntegration()],
12 | });
13 |
14 | export default class App extends Application {
15 | modulePrefix = config.modulePrefix;
16 |
17 | podModulePrefix = config.podModulePrefix;
18 |
19 | Resolver = Resolver;
20 | }
21 |
22 | loadInitializers(App, config.modulePrefix);
23 |
--------------------------------------------------------------------------------
/app/components/circular-progress.js:
--------------------------------------------------------------------------------
1 | import Component from '@glimmer/component';
2 | import { htmlSafe } from '@ember/template';
3 |
4 | const COLORS = {
5 | blue: '0, 136, 204',
6 | orange: '197, 197, 51',
7 | };
8 |
9 | export default class CircularProgress extends Component {
10 | constructor(owner, args) {
11 | super(owner, args);
12 |
13 | const rgb = COLORS[args.color];
14 | this.style = htmlSafe(`fill: rgba(${rgb}, .5)`);
15 | }
16 |
17 | get path() {
18 | const π = Math.PI;
19 | const α = this.args.value * 360;
20 | const r = (α * π) / 180;
21 | const mid = α > 180 ? 1 : 0;
22 | const x = Math.sin(r) * 38;
23 | const y = Math.cos(r) * -38;
24 |
25 | return `M 0 0 v -38 A 38 38 1 ${mid} 1 ${x} ${y} z`;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/components/popover-confirm.js:
--------------------------------------------------------------------------------
1 | import Component from '@ember/component';
2 | import { computed } from '@ember/object';
3 |
4 | export default Component.extend({
5 | classNames: ['popover-confirm'],
6 | iconClass: computed('filename', function () {
7 | const { filename } = this;
8 |
9 | if (filename) {
10 | const regex = /\.([0-9a-z]+)$/i;
11 | const match = filename.match(regex);
12 | const extension = match && match[1];
13 |
14 | if (extension) {
15 | return `glyphicon-${extension.toLowerCase()}`;
16 | }
17 | }
18 |
19 | return undefined;
20 | }),
21 |
22 | actions: {
23 | confirm() {
24 | this.onConfirm();
25 | },
26 |
27 | cancel() {
28 | this.onCancel();
29 | },
30 | },
31 | });
32 |
--------------------------------------------------------------------------------
/app/components/file-field.js:
--------------------------------------------------------------------------------
1 | import TextField from '@ember/component/text-field';
2 | import $ from 'jquery';
3 |
4 | export default TextField.extend({
5 | type: 'file',
6 | classNames: ['invisible'],
7 |
8 | click(event) {
9 | event.stopPropagation();
10 | },
11 |
12 | change(event) {
13 | const input = event.target;
14 | const { files } = input;
15 | this.onChange({ files });
16 | this.reset();
17 | },
18 |
19 | // Hackish way to reset file input when sender cancels file transfer,
20 | // so if sender wants later to send the same file again,
21 | // the 'change' event is triggered correctly.
22 | reset() {
23 | const field = $(this.element);
24 | field.wrap('