Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
to
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
matrix
to
Commits
5413480e
Commit
5413480e
authored
3 years ago
by
Thib
Browse files
Options
Downloads
Patches
Plain Diff
Moving static data out of Element client file
parent
44a7ce88
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/open/clients/Client.js
+35
-0
35 additions, 0 deletions
src/open/clients/Client.js
src/open/clients/Element.js
+6
-27
6 additions, 27 deletions
src/open/clients/Element.js
src/open/clients/ElementData.js
+18
-0
18 additions, 0 deletions
src/open/clients/ElementData.js
with
59 additions
and
27 deletions
src/open/clients/Client.js
0 → 100644
+
35
−
0
View file @
5413480e
import
{
Platform
}
from
"
../types.js
"
;
export
class
Client
{
constructor
(
data
)
{
this
.
data
=
data
;
}
get
id
()
{
return
this
.
data
.
id
;
}
get
platforms
()
{
return
this
.
data
.
platforms
;
}
get
icon
()
{
return
"
images/client-icons/
"
+
this
.
data
.
icon
;
}
get
name
()
{
return
this
.
data
.
name
;
}
get
description
()
{
return
this
.
data
.
description
;
}
get
homepage
()
{
return
this
.
data
.
homepage
;
}
get
author
()
{
return
this
.
data
.
author
;
}
getMaturity
(
platform
)
{
return
this
.
data
.
maturity
;
}
getLinkInstructions
(
platform
,
link
)
{}
getCopyString
(
platform
,
link
)
{}
getInstallLinks
(
platform
)
{
var
links
=
[];
if
(
platform
===
Platform
.
iOS
&&
this
.
platforms
().
includes
(
Platform
.
iOS
)
&&
this
.
data
.
applestorelink
)
{
links
.
push
(
this
.
data
.
applestorelink
);
}
else
if
(
platform
===
Platform
.
Android
&&
this
.
platforms
.
includes
(
Platform
.
Android
))
{
if
(
this
.
data
.
playstorelink
)
{
links
.
push
(
this
.
data
.
playstorelink
);
}
if
(
this
.
data
.
fdroidlink
)
{
links
.
push
(
this
.
data
.
fdroidlink
);
}
}
else
if
(
this
.
data
.
defaultInstallLink
)
{
links
.
push
(
this
.
data
.
defaultInstallLink
);
}
return
links
;
}
canInterceptMatrixToLinks
(
platform
)
{
return
false
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/open/clients/Element.js
+
6
−
27
View file @
5413480e
...
@@ -14,8 +14,9 @@ See the License for the specific language governing permissions and
...
@@ -14,8 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
import
{
Maturity
,
Platform
,
LinkKind
,
import
{
Platform
,
LinkKind
}
from
"
../types.js
"
;
FDroidLink
,
AppleStoreLink
,
PlayStoreLink
,
WebsiteLink
}
from
"
../types.js
"
;
import
{
Client
}
from
"
./Client.js
"
;
import
{
data
}
from
"
./ElementData.js
"
;
const
trustedWebInstances
=
[
const
trustedWebInstances
=
[
"
app.element.io
"
,
// first one is the default one
"
app.element.io
"
,
// first one is the default one
...
@@ -29,24 +30,12 @@ const trustedWebInstances = [
...
@@ -29,24 +30,12 @@ const trustedWebInstances = [
/**
/**
* Information on how to deep link to a given matrix client.
* Information on how to deep link to a given matrix client.
*/
*/
export
class
Element
{
export
class
Element
extends
Client
{
get
id
()
{
return
"
element.io
"
;
}
constructor
()
{
super
(
data
);
get
platforms
()
{
return
[
Platform
.
Android
,
Platform
.
iOS
,
Platform
.
Windows
,
Platform
.
macOS
,
Platform
.
Linux
,
Platform
.
DesktopWeb
];
}
}
get
icon
()
{
return
"
images/client-icons/element.svg
"
;
}
get
appleAssociatedAppId
()
{
return
"
7J4U792NQT.im.vector.app
"
;
}
get
appleAssociatedAppId
()
{
return
"
7J4U792NQT.im.vector.app
"
;
}
get
name
()
{
return
"
Element
"
;
}
get
description
()
{
return
'
Fully-featured Matrix client, used by millions.
'
;
}
get
homepage
()
{
return
"
https://element.io
"
;
}
get
author
()
{
return
"
Element
"
;
}
getMaturity
(
platform
)
{
return
Maturity
.
Stable
;
}
getDeepLink
(
platform
,
link
)
{
getDeepLink
(
platform
,
link
)
{
let
fragmentPath
;
let
fragmentPath
;
...
@@ -85,16 +74,6 @@ export class Element {
...
@@ -85,16 +74,6 @@ export class Element {
}
}
}
}
getLinkInstructions
(
platform
,
link
)
{}
getCopyString
(
platform
,
link
)
{}
getInstallLinks
(
platform
)
{
switch
(
platform
)
{
case
Platform
.
iOS
:
return
[
new
AppleStoreLink
(
'
vector
'
,
'
id1083446067
'
)];
case
Platform
.
Android
:
return
[
new
PlayStoreLink
(
'
im.vector.app
'
),
new
FDroidLink
(
'
im.vector.app
'
)];
default
:
return
[
new
WebsiteLink
(
"
https://element.io/get-started
"
)];
}
}
canInterceptMatrixToLinks
(
platform
)
{
canInterceptMatrixToLinks
(
platform
)
{
return
platform
===
Platform
.
Android
;
return
platform
===
Platform
.
Android
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/open/clients/ElementData.js
0 → 100644
+
18
−
0
View file @
5413480e
import
{
Maturity
,
Platform
,
FDroidLink
,
AppleStoreLink
,
PlayStoreLink
,
WebsiteLink
,
FlathubLink
}
from
"
../types.js
"
;
export
const
data
=
{
"
id
"
:
"
element.io
"
,
"
platforms
"
:
[
Platform
.
Android
,
Platform
.
iOS
,
Platform
.
Windows
,
Platform
.
macOS
,
Platform
.
Linux
,
Platform
.
DesktopWeb
],
"
icon
"
:
"
element.svg
"
,
"
appleAssociatedAppId
"
:
"
7J4U792NQT.im.vector.app
"
,
"
name
"
:
"
Element
"
,
"
description
"
:
"
Fully-featured Matrix client, used by millions.
"
,
"
homepage
"
:
"
https://element.io
"
,
"
author
"
:
"
Element
"
,
"
maturity
"
:
Maturity
.
Stable
,
"
applestorelink
"
:
new
AppleStoreLink
(
'
vector
'
,
'
id1083446067
'
),
"
playstorelink
"
:
new
PlayStoreLink
(
'
im.vector.app
'
),
"
fdroidlink
"
:
new
FDroidLink
(
'
im.vector.app
'
),
"
flathublink
"
:
new
FlathubLink
(
'
im.riot.Riot
'
),
"
defaultInstallLink
"
:
new
WebsiteLink
(
"
https://element.io/get-started
"
),
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment