Skip to content

Commit

Permalink
merge from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
ctr49 committed Apr 14, 2020
2 parents 31cbc00 + 1c229b9 commit 3a0041d
Show file tree
Hide file tree
Showing 20 changed files with 520 additions and 47 deletions.
7 changes: 0 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,5 @@ matrix:
- libpng-dev
- libxtst-dev

before_script:
- | # Fix chrome-sandbox: https://github.com/electron/electron/issues/17972
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
echo "Fixing chrome-sandbox permissions..."
sudo chown root ./node_modules/electron/dist/chrome-sandbox
sudo chmod 4755 ./node_modules/electron/dist/chrome-sandbox
fi
script:
- npm run dist
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ sudo apt-get install libnss3

</details>

### Homebrew

For *MacOS* user, you can install the application using the following command:

```
brew cask install jitsi-meet
```

### Using it with your own Jitsi Meet installation

In order to use this application with your own Jitsi Meet installation it's
Expand All @@ -49,6 +57,13 @@ location /external_api.js {
}
```

The following additional HTTP header are known not work with the Electron App:

```
Content-Security-Policy "frame-ancestors 'none'";
X-Frame-Options "DENY";
```

## Development

If you want to hack on this project, here is how you do it.
Expand Down
25 changes: 15 additions & 10 deletions app/features/conference/components/Conference.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { connect } from 'react-redux';
import { push } from 'react-router-redux';

import config from '../../config';
import { setEmail, setName } from '../../settings';
import { getSetting, setEmail, setName } from '../../settings';

import { conferenceEnded, conferenceJoined } from '../actions';
import { LoadingIndicator, Wrapper } from '../styled';
Expand All @@ -26,6 +26,11 @@ type Props = {
*/
location: Object;

/**
* AlwaysOnTop Window Enabled.
*/
_alwaysOnTopWindowEnabled: boolean;

/**
* Avatar URL.
*/
Expand Down Expand Up @@ -265,7 +270,12 @@ class Conference extends Component<Props, State> {

setupScreenSharingRender(this._api);
new RemoteControl(iframe); // eslint-disable-line no-new
setupAlwaysOnTopRender(this._api);

// Allow window to be on top if enabled in settings
if (this.props._alwaysOnTopWindowEnabled) {
setupAlwaysOnTopRender(this._api);
}

setupWiFiStats(iframe);
setupPowerMonitorRender(this._api);

Expand Down Expand Up @@ -393,17 +403,12 @@ class Conference extends Component<Props, State> {
* Maps (parts of) the redux state to the React props.
*
* @param {Object} state - The redux state.
* @returns {{
* _avatarURL: string,
* _email: string,
* _name: string,
* _serverURL: string,
* _startWithAudioMuted: boolean,
* _startWithVideoMuted: boolean
* }}
* @returns {Props}
*/
function _mapStateToProps(state: Object) {
return {
_alwaysOnTopWindowEnabled:
getSetting(state, 'alwaysOnTopWindowEnabled', true),
_avatarURL: state.settings.avatarURL,
_email: state.settings.email,
_name: state.settings.name,
Expand Down
5 changes: 5 additions & 0 deletions app/features/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ export default {
*/
aboutURL: 'https://hilfe.netzbegruenung.de/jitsi',

/**
* The URL to the source code repository.
*/
sourceURL: 'https://github.com/jitsi/jitsi-meet-electron',

/**
* Application name.
*/
Expand Down
6 changes: 6 additions & 0 deletions app/features/navbar/components/HelpButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default class HelpButton extends Component< *, State> {
};

this._onAboutClick = openExternalLink.bind(undefined, config.aboutURL);
this._onSourceClick = openExternalLink.bind(undefined, config.sourceURL);
this._onIconClick = this._onIconClick.bind(this);
this._onOpenChange = this._onOpenChange.bind(this);
this._onPrivacyClick
Expand All @@ -46,6 +47,8 @@ export default class HelpButton extends Component< *, State> {

_onAboutClick: (*) => void;

_onSourceClick: (*) => void;

_onIconClick: (*) => void;

/**
Expand Down Expand Up @@ -104,6 +107,9 @@ export default class HelpButton extends Component< *, State> {
<Item onActivate = { this._onAboutClick }>
About
</Item>
<Item onActivate = { this._onSourceClick }>
Source
</Item>
<Item>
Version: { version }
</Item>
Expand Down
78 changes: 78 additions & 0 deletions app/features/onboarding/components/AlwaysOnTopWindowSpotlight.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// @flow

import { Spotlight } from '@atlaskit/onboarding';

import React, { Component } from 'react';
import { connect } from 'react-redux';
import type { Dispatch } from 'redux';

import { closeDrawer } from '../../navbar';

import { continueOnboarding } from '../actions';

type Props = {

/**
* Redux dispatch.
*/
dispatch: Dispatch<*>;
};

/**
* Always on Top Windows Spotlight Component.
*/
class AlwaysOnTopWindowSpotlight extends Component<Props, *> {
/**
* Initializes a new {@code StartMutedTogglesSpotlight} instance.
*
* @inheritdoc
*/
constructor(props: Props) {
super(props);

this._next = this._next.bind(this);
}

/**
* Render function of component.
*
* @returns {ReactElement}
*/
render() {
return (
<Spotlight
actions = { [
{
onClick: this._next,
text: 'Next'
}
] }
dialogPlacement = 'left top'
target = { 'always-on-top-window' } >
You can toggle whether you want to enable the "always-on-top" window,
which is displayed when the main window loses focus.
This will be applied to all conferences.
</Spotlight>
);
}

_next: (*) => void;

/**
* Close the spotlight component.
*
* @returns {void}
*/
_next() {
const { dispatch } = this.props;

dispatch(continueOnboarding());

// FIXME: find a better way to do this.
setTimeout(() => {
dispatch(closeDrawer());
}, 300);
}
}

export default connect()(AlwaysOnTopWindowSpotlight);
11 changes: 1 addition & 10 deletions app/features/onboarding/components/StartMutedTogglesSpotlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import React, { Component } from 'react';
import { connect } from 'react-redux';
import type { Dispatch } from 'redux';

import { closeDrawer } from '../../navbar';

import { continueOnboarding } from '../actions';

type Props = {
Expand Down Expand Up @@ -63,14 +61,7 @@ class StartMutedTogglesSpotlight extends Component<Props, *> {
* @returns {void}
*/
_next() {
const { dispatch } = this.props;

dispatch(continueOnboarding());

// FIXME: find a better way to do this.
setTimeout(() => {
dispatch(closeDrawer());
}, 300);
this.props.dispatch(continueOnboarding());
}
}

Expand Down
3 changes: 3 additions & 0 deletions app/features/onboarding/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ export { default as SettingsDrawerSpotlight } from './SettingsDrawerSpotlight';
export {
default as StartMutedTogglesSpotlight
} from './StartMutedTogglesSpotlight';
export {
default as AlwaysOnTopWindowSpotlight
} from './AlwaysOnTopWindowSpotlight';
9 changes: 6 additions & 3 deletions app/features/onboarding/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
NameSettingSpotlight,
EmailSettingSpotlight,
ServerSettingSpotlight,
StartMutedTogglesSpotlight
StartMutedTogglesSpotlight,
AlwaysOnTopWindowSpotlight
} from './components';

export const onboardingSteps = {
Expand All @@ -20,7 +21,8 @@ export const onboardingSteps = {
'name-setting',
'email-setting',
'server-setting',
'start-muted-toggles'
'start-muted-toggles',
'always-on-top-window'
]
};

Expand All @@ -31,5 +33,6 @@ export const onboardingComponents = {
'name-setting': NameSettingSpotlight,
'email-setting': EmailSettingSpotlight,
'server-setting': ServerSettingSpotlight,
'start-muted-toggles': StartMutedTogglesSpotlight
'start-muted-toggles': StartMutedTogglesSpotlight,
'always-on-top-window': AlwaysOnTopWindowSpotlight
};
11 changes: 11 additions & 0 deletions app/features/settings/actionTypes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/**
* The type of (redux) action that sets Window always on top.
*
* @type {
* type: SET_ALWAYS_ON_TOP_WINDOW_ENABLED,
* alwaysOnTopWindowEnabled: boolean
* }
*/
export const SET_ALWAYS_ON_TOP_WINDOW_ENABLED
= Symbol('SET_ALWAYS_ON_TOP_WINDOW_ENABLED');

/**
* The type of (redux) action that sets Start with Audio Muted.
*
Expand Down
16 changes: 16 additions & 0 deletions app/features/settings/actions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @flow

import {
SET_ALWAYS_ON_TOP_WINDOW_ENABLED,
SET_AUDIO_MUTED,
SET_AVATAR_URL,
SET_EMAIL,
Expand Down Expand Up @@ -108,3 +109,18 @@ export function setStartWithVideoMuted(startWithVideoMuted: boolean) {
}


/**
* Set window always on top.
*
* @param {boolean} alwaysOnTopWindowEnabled - Whether to set AlwaysOnTop Window Enabled.
* @returns {{
* type: SET_ALWAYS_ON_TOP_WINDOW_ENABLED,
* alwaysOnTopWindowEnabled: boolean
* }}
*/
export function setWindowAlwaysOnTop(alwaysOnTopWindowEnabled: boolean) {
return {
type: SET_ALWAYS_ON_TOP_WINDOW_ENABLED,
alwaysOnTopWindowEnabled
};
}
Loading

0 comments on commit 3a0041d

Please sign in to comment.