2024-09-14 16:49:09 -04:00
|
|
|
#!/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 <https://www.gnu.org/licenses/>.
|
|
|
|
|
2024-09-14 19:05:29 -04:00
|
|
|
set -euo pipefail
|
|
|
|
LWD="$PWD"
|
|
|
|
|
2024-09-14 16:49:09 -04:00
|
|
|
echo "Removing links to nonfree services..."
|
|
|
|
|
|
|
|
error() {
|
|
|
|
echo "Failed to patch, exiting..."
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2024-09-14 19:05:29 -04:00
|
|
|
cd "${1}"
|
|
|
|
|
|
|
|
if test -f "./node_modules/matrix-react-sdk/lib/components/views/dialogs/ShareDialog.js"; then
|
|
|
|
|
|
|
|
patchjs_content=$(cat << EOF
|
2024-09-14 16:49:09 -04:00
|
|
|
--- 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}\`
|
2024-09-14 19:05:29 -04:00
|
|
|
EOF
|
|
|
|
)
|
|
|
|
|
|
|
|
echo "${patchjs_content}" | patch -t -p1 || error
|
|
|
|
fi
|
|
|
|
|
2024-10-30 14:21:22 -04:00
|
|
|
if test -f ".${1}/src/components/views/dialogs/ShareDialog.tsx"; then
|
2024-09-14 19:05:29 -04:00
|
|
|
|
|
|
|
patchtsx_content=$(cat << EOF
|
2024-10-30 14:21:22 -04:00
|
|
|
--- a${1}/src/components/views/dialogs/ShareDialog.tsx
|
|
|
|
+++ b${1}/src/components/views/dialogs/ShareDialog.tsx
|
2024-09-14 16:49:09 -04:00
|
|
|
@@ -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
|
|
|
|
)
|
|
|
|
|
2024-09-14 19:05:29 -04:00
|
|
|
echo "${patchtsx_content}" | patch -t -p1 || error
|
|
|
|
fi
|
|
|
|
cd $LWD
|