浏览代码

Added unsuported browser and plugin required pages

j8
Ilya Daynatovich 8 年前
父节点
当前提交
1268afd3f8

+ 26
- 119
css/unsupported-browser/_unsupported-desktop-browser.scss 查看文件

1
-.supported-browser {
2
-    color: #929391;
3
-    display: inline-block;
4
-    font-size: 20px;
5
-    margin: 1em 7px;
6
-    vertical-align: middle;
7
-    width: 138px;
8
-
9
-    &__button {
10
-        background-color: #62c82a;
11
-        border: 1px solid #3c8117;
12
-        border-radius: 10px;
13
-        color: #FFFFFF;
14
-        font-size: 12px;
15
-        height: 26px;
16
-        margin: 15px auto 0px auto;
17
-        padding-top: 13px;
18
-        text-align: center;
19
-        width: 115px;
20
-    }
21
-
22
-    &__link {
23
-        color: #087dba;
24
-        text-decoration: none;
25
-
26
-        &:hover {
27
-            text-decoration: none;
28
-        }
29
-
30
-        &:active {
31
-            text-decoration: none;
32
-        }
33
-
34
-        &:focus {
35
-            text-decoration: none;
36
-        }
37
-    }
38
-
39
-    &-list
40
-    {
41
-        margin: 0 auto;
42
-    }
43
-
44
-    &__logo {
45
-        margin: 20px auto 0px auto;
46
-
47
-        &_chrome {
48
-            background-image: url('../../images/chrome.png');
49
-            height: 78px;
50
-            width: 78px;
51
-        }
52
-
53
-        &_chromium {
54
-            background-image: url('../../images/chromium.png');
55
-            height: 78px;
56
-            width: 77px;
57
-        }
58
-
59
-        &_firefox {
60
-            background-image: url('../../images/firefox.png');
61
-            height: 80px;
62
-            width: 86px;
63
-        }
64
-
65
-        &_opera {
66
-            background-image: url('../../images/opera.png');
67
-            height: 78px;
68
-            width: 73px;
69
-        }
1
+.unsupported-desktop-browser {
2
+    @include absoluteAligning();
70
 
3
 
71
-        &_ie {
72
-            background-image: url('../../images/ie.png');
73
-            height: 78px;
74
-            width: 80px;
75
-        }
4
+    display: block;
5
+    text-align: center;
76
 
6
 
77
-        &_safari {
78
-            background-image: url('../../images/safari.png');
79
-            height: 79px;
80
-            width: 78px;
81
-        }
7
+    &__title {
8
+        color: #fff;
9
+        font-weight: 300;
10
+        font-size: 24px;
11
+        letter-spacing: 1px;
82
     }
12
     }
83
 
13
 
84
-    &__text
85
-    {
86
-        line-height: 1.2em;
14
+    &__description {
15
+        margin-top: 16px;
16
+        color: rgba(255, 255, 255, 0.7);
17
+        font-weight: 300;
18
+        font-size: 21px;
19
+        letter-spacing: 1px;
87
 
20
 
88
         &_small {
21
         &_small {
89
-            font-size: small;
22
+            @extend .unsupported-desktop-browser__description;
23
+            font-size: 16px;
90
         }
24
         }
91
     }
25
     }
92
 
26
 
93
-    &__tile {
94
-        background-color: #e8e8e8;
95
-        border: 1px solid #cfcfcf;
96
-        border-radius: 10px;
97
-        height: 163px;
98
-        margin-top: 5px;
99
-        width: 138px;
100
-    }
101
-}
102
-
103
-.unsupported-desktop-browser {
104
-    display: block;
105
-    height: 565px;
106
-    margin: auto;
107
-    overflow:hidden;
108
-    position: absolute;
109
-    text-align: center;
110
-    top: 0; left: 0; bottom: 0; right: 0;
111
-    width:500px;
112
-
113
-    &__page {
114
-        display:inline-block;
115
-        font-size: 28px;
116
-        padding-top: 25px;
117
-        vertical-align:middle;
118
-    }
27
+    &__link {
28
+        color: $linkFontColor;
29
+        @include transition(color .1s ease-out);
119
 
30
 
120
-    &__title {
121
-        margin: 0 auto;
122
-        width: 20em;
123
-    }
31
+        &:hover {
32
+            color: $linkHoverFontColor;
33
+            cursor: pointer;
34
+            text-decoration: none;
124
 
35
 
125
-    &-wrapper {
126
-        background: #fff;
127
-        display: block;
128
-        height: 100%;
129
-        position: absolute;
130
-        width: 100%;
36
+            @include transition(color .1s ease-in);
37
+        }
131
     }
38
     }
132
 }
39
 }

+ 9
- 0
react/features/base/connection/actions.web.js 查看文件

8
 
8
 
9
 import { SET_DOMAIN } from './actionTypes';
9
 import { SET_DOMAIN } from './actionTypes';
10
 
10
 
11
+import { appNavigate } from '../../app';
12
+
11
 declare var APP: Object;
13
 declare var APP: Object;
12
 
14
 
13
 const logger = require('jitsi-meet-logger').getLogger(__filename);
15
 const logger = require('jitsi-meet-logger').getLogger(__filename);
32
         // XXX For web based version we use conference initialization logic
34
         // XXX For web based version we use conference initialization logic
33
         // from the old app (at the moment of writing).
35
         // from the old app (at the moment of writing).
34
         return APP.conference.init({ roomName: room }).then(() => {
36
         return APP.conference.init({ roomName: room }).then(() => {
37
+            // If during the conference initialization was defined that browser
38
+            // doesn't support WebRTC then we should define which route
39
+            // to render.
40
+            if (APP.unsupportedBrowser) {
41
+                dispatch(appNavigate(room));
42
+            }
43
+
35
             if (APP.logCollector) {
44
             if (APP.logCollector) {
36
                 // Start the LogCollector's periodic "store logs" task
45
                 // Start the LogCollector's periodic "store logs" task
37
                 APP.logCollector.start();
46
                 APP.logCollector.start();

+ 18
- 1
react/features/base/util/interceptComponent.js 查看文件

1
+/* global APP */
2
+
1
 import { Platform } from '../react';
3
 import { Platform } from '../react';
2
-import { UnsupportedMobileBrowser } from '../../unsupported-browser';
4
+import {
5
+    UnsupportedDesktopBrowser,
6
+    PluginRequiredBrowser,
7
+    UnsupportedMobileBrowser
8
+} from '../../unsupported-browser';
3
 
9
 
4
 /**
10
 /**
5
  * Array of rules defining whether we should intercept component to render
11
  * Array of rules defining whether we should intercept component to render
26
         if (OS === 'android' || OS === 'ios') {
32
         if (OS === 'android' || OS === 'ios') {
27
             return UnsupportedMobileBrowser;
33
             return UnsupportedMobileBrowser;
28
         }
34
         }
35
+    },
36
+    () => {
37
+        if (APP.unsupportedBrowser) {
38
+            const { isOldBrowser } = APP.unsupportedBrowser;
39
+
40
+            if (isOldBrowser) {
41
+                return UnsupportedDesktopBrowser;
42
+            }
43
+
44
+            return PluginRequiredBrowser;
45
+        }
29
     }
46
     }
30
 ];
47
 ];
31
 
48
 

+ 1
- 1
react/features/conference/components/Conference.web.js 查看文件

57
      * @inheritdoc
57
      * @inheritdoc
58
      */
58
      */
59
     componentWillUnmount() {
59
     componentWillUnmount() {
60
-        this.props.dispatch(disconnect());
60
+        APP.conference.isJoined() && this.props.dispatch(disconnect());
61
     }
61
     }
62
 
62
 
63
     /**
63
     /**

+ 44
- 0
react/features/unsupported-browser/components/PluginRequiredBrowser.js 查看文件

1
+import React, { Component } from 'react';
2
+
3
+import { CHROME, CHROMIUM, FIREFOX } from './browserLinks';
4
+
5
+/**
6
+ * React component representing plugin installation required page.
7
+ *
8
+ * @class PluginRequiredBrowser
9
+ */
10
+export default class PluginRequiredBrowser extends Component {
11
+
12
+    /**
13
+     * Renders the component.
14
+     *
15
+     * @returns {ReactElement}
16
+     */
17
+    render() {
18
+        const ns = 'unsupported-desktop-browser';
19
+
20
+        return (
21
+            <div className = { ns }>
22
+                <h2 className = { `${ns}__title` }>
23
+                    Your browser requires a plugin for this conversation.
24
+                </h2>
25
+                <p className = { `${ns}__description_small` }>
26
+                    Once you install the plugin, it will be possible for you
27
+                    to have your conversation here. For best experience,
28
+                    however, we strongly recommend that you do that using
29
+                    the&nbsp;
30
+                    <a
31
+                        className = { `${ns}__link` }
32
+                        href = { CHROME }>Chrome</a>,&nbsp;
33
+                    <a
34
+                        className = { `${ns}__link` }
35
+                        href = { CHROMIUM }>Chromium</a> or&nbsp;
36
+                    <a
37
+                        className = { `${ns}__link` }
38
+                        href = { FIREFOX }>Firefox</a> browsers.
39
+                </p>
40
+            </div>
41
+        );
42
+    }
43
+}
44
+

+ 20
- 101
react/features/unsupported-browser/components/UnsupportedDesktopBrowser.js 查看文件

1
 import React, { Component } from 'react';
1
 import React, { Component } from 'react';
2
 
2
 
3
-/**
4
- * The list of all browsers supported by the application.
5
- */
6
-const SUPPORTED_BROWSERS = [
7
-    {
8
-        link: 'http://google.com/chrome',
9
-        name: 'chrome',
10
-        title: 'Chrome 44+'
11
-    }, {
12
-        link: 'http://www.chromium.org/',
13
-        name: 'chromium',
14
-        title: 'Chromium 44+'
15
-    }, {
16
-        link: 'http://www.getfirefox.com/',
17
-        name: 'firefox',
18
-        title: 'Firefox and Iceweasel 40+'
19
-    }, {
20
-        link: 'http://www.opera.com',
21
-        name: 'opera',
22
-        title: 'Opera 32+'
23
-    }, {
24
-        link: 'https://temasys.atlassian.net/wiki/display/TWPP/WebRTC+Plugins',
25
-        name: 'ie',
26
-        plugin: 'Temasys 0.8.854+',
27
-        title: 'IE'
28
-    }, {
29
-        link: 'https://temasys.atlassian.net/wiki/display/TWPP/WebRTC+Plugins',
30
-        name: 'safari',
31
-        plugin: 'Temasys 0.8.854+',
32
-        title: 'Safari'
33
-    }
34
-];
3
+import { CHROME, FIREFOX, IE, SAFARI } from './browserLinks';
35
 
4
 
36
 /**
5
 /**
37
  * React component representing unsupported browser page.
6
  * React component representing unsupported browser page.
39
  * @class UnsupportedDesktopBrowser
8
  * @class UnsupportedDesktopBrowser
40
  */
9
  */
41
 export default class UnsupportedDesktopBrowser extends Component {
10
 export default class UnsupportedDesktopBrowser extends Component {
11
+
42
     /**
12
     /**
43
      * Renders the component.
13
      * Renders the component.
44
      *
14
      *
48
         const ns = 'unsupported-desktop-browser';
18
         const ns = 'unsupported-desktop-browser';
49
 
19
 
50
         return (
20
         return (
51
-            <div className = { `${ns}-wrapper` }>
52
-                <div className = { ns }>
53
-                    <div className = { `${ns}__content` }>
54
-                        <h2 className = { `${ns}__title` }>
55
-                            This application is currently only supported by
56
-                        </h2>
57
-                        {
58
-                            this._renderSupportedBrowsers()
59
-                        }
60
-                    </div>
61
-                </div>
62
-            </div>
63
-        );
64
-    }
65
-
66
-    /**
67
-     * Renders a specific browser supported by the application.
68
-     *
69
-     * @param {Object} browser - The (information about the) browser supported
70
-     * by the application to render.
71
-     * @private
72
-     * @returns {ReactElement}
73
-     */
74
-    _renderSupportedBrowser(browser) {
75
-        const { link, name, plugin, title } = browser;
76
-        const ns = 'supported-browser';
77
-
78
-        // Browsers which do not support WebRTC could support the application
79
-        // with the Temasys plugin.
80
-        const pluginElement
81
-            = plugin
82
-                ? <p className = { `${ns}__text_small` }>{ plugin }</p>
83
-                : null;
84
-
85
-        return (
86
-            <div
87
-                className = { ns }
88
-                key = { name }>
89
-                <div className = { `${ns}__text` }>
90
-                    {
91
-                        title
92
-                    }
93
-                    {
94
-                        pluginElement
95
-                    }
96
-                </div>
97
-                <div className = { `${ns}__tile` }>
98
-                    <div
99
-                        className = { `${ns}__logo ${ns}__logo_${name}` } />
21
+            <div className = { ns }>
22
+                <h2 className = { `${ns}__title` }>
23
+                    It looks like you're using a browser we don't support.
24
+                </h2>
25
+                <p className = { `${ns}__description` }>
26
+                    Please try again with&nbsp;
100
                     <a
27
                     <a
101
                         className = { `${ns}__link` }
28
                         className = { `${ns}__link` }
102
-                        href = { link }>
103
-                        <div className = { `${ns}__button` }>DOWNLOAD</div>
104
-                    </a>
105
-                </div>
106
-            </div>
107
-        );
108
-    }
109
-
110
-    /**
111
-     * Renders the list of browsers supported by the application.
112
-     *
113
-     * @private
114
-     * @returns {ReactElement}
115
-     */
116
-    _renderSupportedBrowsers() {
117
-        return (
118
-            <div className = 'supported-browser-list'>
119
-                {
120
-                    SUPPORTED_BROWSERS.map(this._renderSupportedBrowser)
121
-                }
29
+                        href = { CHROME } >Chrome</a>,&nbsp;
30
+                    <a
31
+                        className = { `${ns}__link` }
32
+                        href = { FIREFOX }>Firefox</a>,&nbsp;
33
+                    <a
34
+                        className = { `${ns}__link` }
35
+                        href = { SAFARI }>Safari</a> or&nbsp;
36
+                    <a
37
+                        className = { `${ns}__link` }
38
+                        href = { IE }>IE</a>.
39
+                </p>
122
             </div>
40
             </div>
123
         );
41
         );
124
     }
42
     }
125
 }
43
 }
44
+

+ 37
- 0
react/features/unsupported-browser/components/browserLinks.js 查看文件

1
+/* @flow */
2
+
3
+/**
4
+ * The URL at which Google Chrome is available for download.
5
+ *
6
+ * @type {string}
7
+ */
8
+export const CHROME = 'http://google.com/chrome';
9
+
10
+/**
11
+ * The URL at which Chromium is available for download.
12
+ *
13
+ * @type {string}
14
+ */
15
+export const CHROMIUM = 'http://www.chromium.org/';
16
+
17
+/**
18
+ * The URL at which Mozilla Firefox is available for download.
19
+ *
20
+ * @type {string}
21
+ */
22
+export const FIREFOX = 'http://www.getfirefox.com/';
23
+
24
+/**
25
+ * The URL at which Microsoft Internet Explorer is available for download.
26
+ *
27
+ * @type {string}
28
+ */
29
+export const IE
30
+    = 'https://www.microsoft.com/en-us/download/internet-explorer.aspx';
31
+
32
+/**
33
+ * The URL at which Safari is available for download.
34
+ *
35
+ * @type {string}
36
+ */
37
+export const SAFARI = 'https://support.apple.com/downloads/safari';

+ 1
- 0
react/features/unsupported-browser/components/index.js 查看文件

1
+export { default as PluginRequiredBrowser } from './PluginRequiredBrowser';
1
 export { default as UnsupportedDesktopBrowser }
2
 export { default as UnsupportedDesktopBrowser }
2
     from './UnsupportedDesktopBrowser';
3
     from './UnsupportedDesktopBrowser';
3
 export { default as UnsupportedMobileBrowser }
4
 export { default as UnsupportedMobileBrowser }

正在加载...
取消
保存