add weechat

This commit is contained in:
Bruno Windels 2020-12-01 19:00:26 +01:00
parent 64657c196a
commit cf489284c9
4 changed files with 217 additions and 2 deletions

View file

@ -169,6 +169,9 @@ button.text:hover {
background-image: url('../images/client-icons/element.svg');
}
.ClientView .icon.weechat {
background-image: url('../images/client-icons/weechat.svg');
}
button.primary, a.primary, button.secondary, a.secondary {
text-decoration: none;

View file

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:export-ydpi="797.66998"
inkscape:export-xdpi="797.66998"
inkscape:export-filename="/tmp/weechat512.png"
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
sodipodi:docname="weechat2.svg"
width="64"
height="64"
version="1.1"
id="svg8">
<sodipodi:namedview
inkscape:current-layer="svg8"
inkscape:window-maximized="1"
inkscape:window-y="42"
inkscape:window-x="148"
inkscape:cy="32"
inkscape:cx="11.643564"
inkscape:zoom="12.625"
showgrid="false"
id="namedview1443"
inkscape:window-height="968"
inkscape:window-width="1638"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
bordercolor="#666666"
pagecolor="#ffffff" />
<defs
id="defs2">
<linearGradient
id="linearGradient891">
<stop
style="stop-color:#0e16be;stop-opacity:1;"
offset="0"
id="stop887" />
<stop
style="stop-color:#63a4e1;stop-opacity:1"
offset="1"
id="stop889" />
</linearGradient>
<linearGradient
id="linearGradient883">
<stop
style="stop-color:#008726;stop-opacity:1;"
offset="0"
id="stop879" />
<stop
style="stop-color:#7ecc6f;stop-opacity:1"
offset="1"
id="stop881" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient883"
id="linearGradient885"
x1="115.09375"
y1="42.862499"
x2="26.987501"
y2="42.862499"
gradientUnits="userSpaceOnUse" />
<linearGradient
xlink:href="#linearGradient891"
id="linearGradient893"
x1="60.854168"
y1="97.102089"
x2="60.854168"
y2="62.706253"
gradientUnits="userSpaceOnUse" />
<filter
style="color-interpolation-filters:sRGB"
id="filter5519">
<feFlood
flood-opacity="0.60422568746132421"
flood-color="rgb(0,0,0)"
result="flood"
id="feFlood5509" />
<feComposite
in="flood"
in2="SourceGraphic"
operator="in"
result="composite1"
id="feComposite5511" />
<feGaussianBlur
in="composite1"
stdDeviation="0.5"
result="blur"
id="feGaussianBlur5513" />
<feOffset
dx="1.9"
dy="1.4"
result="offset"
id="feOffset5515" />
<feComposite
in="SourceGraphic"
in2="offset"
operator="over"
result="fbSourceGraphic"
id="feComposite5517" />
</filter>
<filter
style="color-interpolation-filters:sRGB"
id="filter5531">
<feFlood
flood-opacity="0.60101983098700495"
flood-color="rgb(0,0,0)"
result="flood"
id="feFlood5521" />
<feComposite
in="flood"
in2="SourceGraphic"
operator="in"
result="composite1"
id="feComposite5523" />
<feGaussianBlur
in="composite1"
stdDeviation="0.5"
result="blur"
id="feGaussianBlur5525" />
<feOffset
dx="1.9"
dy="1.4"
result="offset"
id="feOffset5527" />
<feComposite
in="SourceGraphic"
in2="offset"
operator="over"
result="fbSourceGraphic"
id="feComposite5529" />
</filter>
</defs>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer2"
style="display:inline"
transform="translate(-59.26667,-59.26667)">
<path
style="fill:url(#linearGradient885);fill-opacity:1;stroke:none;stroke-width:0.26458335px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter5519)"
d="m 121.70834,29.368751 -68.262505,1.5875 c -6.711747,0.156087 -13.464507,2.719336 -18.785501,7.005035 -5.124508,4.228038 -8.190215,10.463836 -9.7895,16.807465 l 24.341667,-1.058333 c 0.214884,-2.67862 1.733902,-5.109484 3.689147,-6.885223 1.76299,-1.5286 4.013062,-2.554657 6.365024,-2.639795 l 58.472918,-2.116649 z"
id="path195"
transform="matrix(0.47244092,0,0,0.47244092,59.26667,59.26667)" />
<path
style="fill:url(#linearGradient893);fill-opacity:1;stroke:none;stroke-width:0.26458335px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter5531)"
d="m 22.489584,61.647918 -10.31875,27.252084 c -1.362514,3.598435 -1.128016,8.11836 1.70141,10.913234 3.337143,3.296424 8.403518,3.779984 12.85067,3.374224 l 72.495838,-6.614541 16.139588,-47.625001 -20.637504,0.79375 -12.435417,35.189584 -11.112501,0.79375 12.435417,-35.454167 -22.225,1.058333 -13.229167,36.512501 -7.408314,0.264613 c -2.145162,0.07662 -3.30664,-2.908063 -2.645853,-4.76253 l 8.202083,-23.01875 z"
id="path32"
transform="matrix(0.47244092,0,0,0.47244092,59.26667,59.26667)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.5 KiB

View file

@ -18,6 +18,7 @@ import {Link} from "./Link.js";
import {ViewModel} from "./utils/ViewModel.js";
import {PreviewViewModel} from "./preview/PreviewViewModel.js";
import {Element} from "./client/clients/Element.js";
import {Weechat} from "./client/clients/Weechat.js";
import {Platform} from "./client/Platform.js";
export class RootViewModel extends ViewModel {
@ -30,11 +31,10 @@ export class RootViewModel extends ViewModel {
_updateChildVMs(oldLink) {
if (this.link) {
if (!oldLink || !oldLink.equals(this.link)) {
const element = new Element();
this.previewViewModel = new PreviewViewModel(this.childOptions({
link: this.link,
consentedServers: this.link.servers,
clients: [element]
clients: [new Element(), new Weechat()]
}));
this.previewViewModel.load();
}

View file

@ -0,0 +1,42 @@
/*
Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import {Maturity, Platform, LinkKind, WebsiteLink} from "../types.js";
/**
* Information on how to deep link to a given matrix client.
*/
export class Weechat {
/* should only contain alphanumerical and -_, no dots (needs to be usable as css class) */
get id() { return "weechat"; }
getName(platform) { return "Weechat"; }
get platforms() { return [Platform.Windows, Platform.macOS, Platform.Linux]; }
get description() { return 'Command-line Matrix interface using Weechat'; }
getMaturity(platform) { return Maturity.Beta; }
getDeepLink(platform, link) {}
canInterceptMatrixToLinks(platform) { return false; }
getLinkInstructions(platform, link) {
switch (link.kind) {
case LinkKind.User: return `Type /invite ${link.identifier}`;
case LinkKind.Room: return `Type /join ${link.identifier}`;
}
}
getInstallLinks(platform) {
return [new WebsiteLink("https://github.com/poljar/weechat-matrix")];
}
}