File: 0004_Remove_Non_Free_Plugins.patch

package info (click to toggle)
glowing-bear 0.9.0%2Bds-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,332 kB
  • sloc: javascript: 5,212; makefile: 19; sh: 2
file content (81 lines) | stat: -rw-r--r-- 3,855 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Remove plugins that pull non-free JS automatically.
Index: glowing-bear/js/plugins.js
===================================================================
--- glowing-bear.orig/js/plugins.js
+++ glowing-bear/js/plugins.js
@@ -511,31 +511,6 @@ plugins.factory('userPlugins', function(
         }
     });
 
-    var tweetPlugin = new UrlPlugin('Tweet', function(url) {
-        var regexp = /^https?:\/\/twitter\.com\/(?:#!\/)?(\w+)\/status(?:es)?\/(\d+)/i;
-        var match = url.match(regexp);
-        if (match) {
-            url = 'https://api.twitter.com/1/statuses/oembed.json?id=' + match[2];
-            return function() {
-                var element = this.getElement();
-                jsonp(url, function(data) {
-                    // separate the HTML into content and script tag
-                    var scriptIndex = data.html.indexOf("<script ");
-                    var content = data.html.substr(0, scriptIndex);
-                    // Set DNT (Do Not Track)
-                    content = content.replace("<blockquote class=\"twitter-tweet\">", "<blockquote class=\"twitter-tweet\" data-dnt=\"true\">");
-                    element.innerHTML = content;
-
-                    // The script tag needs to be generated manually or the browser won't load it
-                    var scriptElem = document.createElement('script');
-                    // Hardcoding the URL here, I don't suppose it's going to change anytime soon
-                    scriptElem.src = "https://platform.twitter.com/widgets.js";
-                    element.appendChild(scriptElem);
-                });
-            };
-        }
-    });
-
     /*
      * Streamable Embedded Player
      */
@@ -553,42 +528,8 @@ plugins.factory('userPlugins', function(
         }
     });
 
-    /*
-     * TikTok embedded player
-     * Very similar to twitter
-     */
-    var tikTokPlugin = new UrlPlugin('TikTok', function(url) {
-        var regex = /^https?:\/\/(?:www\.)?tiktok\.com\/@(?:.+)\/video\/(?:.+)\/?$|^https?:\/\/vm\.tiktok\.com\/[a-zA-Z1-9]{7}\/?$/i;
-        var match = url.match(regex);
-
-        if (match) {
-
-            return function() {
-                var element = this.getElement();
-                
-                fetch("https://www.tiktok.com/oembed?url=" + url)
-                .then(function(response) {
-                    return response.json();
-                    })
-                .then(function(data) {
-                    // Separate the HTML into content and script tag
-                    var scriptIndex = data.html.indexOf("<script ");
-                    var content = data.html.substr(0, scriptIndex);
-                    element.innerHTML = content;
-                    // Change the width so we get the deskop version of the embed
-                    element.children[0].style.maxWidth = "650px";
-                    // The script tag needs to be generated manually or the browser won't load it
-                    var scriptElem = document.createElement('script');
-                    // Hardcoding the URL here, I don't suppose it's going to change anytime soon
-                    scriptElem.src = "https://www.tiktok.com/embed.js";
-                    element.appendChild(scriptElem);
-                });
-            };
-        }
-    });
-
     return {
-        plugins: [youtubePlugin, dailymotionPlugin, allocinePlugin, imagePlugin, videoPlugin, audioPlugin, spotifyPlugin, cloudmusicPlugin, googlemapPlugin, asciinemaPlugin, yrPlugin, gistPlugin, pastebinPlugin, giphyPlugin, tweetPlugin, streamablePlugin, tikTokPlugin]
+        plugins: [youtubePlugin, dailymotionPlugin, allocinePlugin, imagePlugin, videoPlugin, audioPlugin, spotifyPlugin, cloudmusicPlugin, googlemapPlugin, asciinemaPlugin, yrPlugin, gistPlugin, pastebinPlugin, giphyPlugin, streamablePlugin]
     };