diff --git a/patches/delete_login_footer.sh b/patches/delete_login_footer.sh index 6d482f5..6c0256b 100755 --- a/patches/delete_login_footer.sh +++ b/patches/delete_login_footer.sh @@ -23,29 +23,13 @@ error() { } patch_content=$(cat << EOF ---- a/components.json -+++ b/components.json -@@ -1,5 +1,4 @@ - { -- "src/components/views/auth/AuthFooter.tsx": "src/components/views/auth/VectorAuthFooter.tsx", - "src/components/views/auth/AuthHeaderLogo.tsx": "src/components/views/auth/VectorAuthHeaderLogo.tsx", - "src/components/views/auth/AuthPage.tsx": "src/components/views/auth/VectorAuthPage.tsx" - } ---- a/src/components/views/auth/VectorAuthPage.tsx -+++ b/src/components/views/auth/VectorAuthPage.tsx -@@ -8,7 +8,6 @@ Please see LICENSE files in the repository root for full details. - import * as React from "react"; - - import SdkConfig from "../../../SdkConfig"; --import VectorAuthFooter from "./VectorAuthFooter"; - - export default class VectorAuthPage extends React.PureComponent { - private static welcomeBackgroundUrl?: string; -@@ -68,7 +67,6 @@ export default class VectorAuthPage extends React.PureComponent -- +- ); } @@ -53,6 +37,3 @@ EOF ) (cd "${1}" && echo "${patch_content}" | patch -p1) || error -rm -f "${1}"/src/components/views/auth/VectorAuthFooter.tsx \ - "${1}"/test/unit-tests/components/views/auth/VectorAuthFooter-test.tsx \ - "${1}"/test/unit-tests/components/views/auth/__snapshots__/VectorAuthFooter-test.tsx.snap diff --git a/patches/patch_all.sh b/patches/patch_all.sh index 2dd47ae..b37404f 100755 --- a/patches/patch_all.sh +++ b/patches/patch_all.sh @@ -20,7 +20,7 @@ element=../element-web ./add_custom_reactions.sh $element ./add_greentext.sh $element ./delete_login_footer.sh $element -./remove-share-to-nonfree-services.sh $element +./remove_share_to_nonfree_services.sh $element ./rename_remove_and_ban.sh $element ./replace_config_file.sh $element ./replace_login_background.sh $element diff --git a/patches/remove-share-to-nonfree-services.sh b/patches/remove-share-to-nonfree-services.sh deleted file mode 100755 index ba208fa..0000000 --- a/patches/remove-share-to-nonfree-services.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/sh - -# This file is part of the element-web-patches. -# -# element-web-patches is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, -# or (at your option) any later version. -# -# element-web-patches is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with element-web-patches. If not, see . - -set -euo pipefail -LWD="$PWD" - -echo "Removing links to nonfree services..." - -error() { - echo "Failed to patch, exiting..." - exit 1 -} - -cd "${1}" - -if test -f "./node_modules/matrix-react-sdk/lib/components/views/dialogs/ShareDialog.js"; then - -patchjs_content=$(cat << EOF ---- a/node_modules/matrix-react-sdk/lib/components/views/dialogs/ShareDialog.js -+++ b/node_modules/matrix-react-sdk/lib/components/views/dialogs/ShareDialog.js -@@ -37,28 +37,6 @@ - */ - - const socials = [{ -- name: "Facebook", -- img: require("../../../../res/img/social/facebook.png"), -- url: url => \`https://www.facebook.com/sharer/sharer.php?u=\${url}\` --}, { -- name: "Twitter", -- img: require("../../../../res/img/social/twitter-2.png"), -- url: url => \`https://twitter.com/home?status=\${url}\` --}, --/* // icon missing -- name: 'Google Plus', -- img: 'img/social/', -- url: (url) => \`https://plus.google.com/share?url=\${url}\`, --},*/ --{ -- name: "LinkedIn", -- img: require("../../../../res/img/social/linkedin.png"), -- url: url => \`https://www.linkedin.com/shareArticle?mini=true&url=\${url}\` --}, { -- name: "Reddit", -- img: require("../../../../res/img/social/reddit.png"), -- url: url => \`https://www.reddit.com/submit?url=\${url}\` --}, { - name: "email", - img: require("../../../../res/img/social/email-1.png"), - url: url => \`mailto:?body=\${url}\` -EOF -) - -echo "${patchjs_content}" | patch -t -p1 || error -fi - -if test -f ".${1}/src/components/views/dialogs/ShareDialog.tsx"; then - -patchtsx_content=$(cat << EOF ---- a${1}/src/components/views/dialogs/ShareDialog.tsx -+++ b${1}/src/components/views/dialogs/ShareDialog.tsx -@@ -31,30 +31,6 @@ - - const socials = [ - { -- name: "Facebook", -- img: require("../../../../res/img/social/facebook.png"), -- url: (url: String) => \`https://www.facebook.com/sharer/sharer.php?u=\${url}\`, -- }, -- { -- name: "Twitter", -- img: require("../../../../res/img/social/twitter-2.png"), -- url: (url: string) => \`https://twitter.com/home?status=\${url}\`, -- }, -- /* // icon missing -- name: 'Google Plus', -- img: 'img/social/', -- url: (url) => \`https://plus.google.com/share?url=\${url}\`, -- },*/ { -- name: "LinkedIn", -- img: require("../../../../res/img/social/linkedin.png"), -- url: (url: string) => \`https://www.linkedin.com/shareArticle?mini=true&url=\${url}\`, -- }, -- { -- name: "Reddit", -- img: require("../../../../res/img/social/reddit.png"), -- url: (url: string) => \`https://www.reddit.com/submit?url=\${url}\`, -- }, -- { - name: "email", - img: require("../../../../res/img/social/email-1.png"), - url: (url: string) => \`mailto:?body=\${url}\`, -EOF -) - -echo "${patchtsx_content}" | patch -t -p1 || error -fi -cd $LWD diff --git a/patches/remove_share_to_nonfree_services.sh b/patches/remove_share_to_nonfree_services.sh new file mode 100755 index 0000000..c7b1329 --- /dev/null +++ b/patches/remove_share_to_nonfree_services.sh @@ -0,0 +1,68 @@ +#!/bin/sh + +# This file is part of the element-web-patches. +# +# element-web-patches is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, +# or (at your option) any later version. +# +# element-web-patches is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with element-web-patches. If not, see . + +set -euo pipefail +LWD="$PWD" + +echo "Removing links to nonfree services..." + +error() { + echo "Failed to patch, exiting..." + exit 1 +} + +cd "${1}" + + +if test -f ".${1}/src/components/views/dialogs/ShareDialog.tsx"; then + +patchtsx_content=$(cat << EOF +--- a${1}/src/components/views/dialogs/ShareDialog.tsx ++++ b${1}/src/components/views/dialogs/ShareDialog.tsx +@@ -24,26 +24,6 @@ import { useSettingValue } from "../../../hooks/useSettings.ts"; + + /* eslint-disable @typescript-eslint/no-require-imports */ + const SOCIALS = [ +- { +- name: "Facebook", +- img: require("../../../../res/img/social/facebook.png"), +- url: (url: string) => `https://www.facebook.com/sharer/sharer.php?u=${url}`, +- }, +- { +- name: "Twitter", +- img: require("../../../../res/img/social/twitter-2.png"), +- url: (url: string) => `https://twitter.com/home?status=${url}`, +- }, +- { +- name: "LinkedIn", +- img: require("../../../../res/img/social/linkedin.png"), +- url: (url: string) => `https://www.linkedin.com/shareArticle?mini=true&url=${url}`, +- }, +- { +- name: "Reddit", +- img: require("../../../../res/img/social/reddit.png"), +- url: (url: string) => `https://www.reddit.com/submit?url=${url}`, +- }, + { + name: "email", + img: require("../../../../res/img/social/email-1.png"), +EOF +) + +echo "${patchtsx_content}" | patch -t -p1 || error +fi +cd $LWD