]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #9916 from MrPetovan/task/babel-twitter-url
authorMichael Vogel <icarus@dabo.de>
Sun, 14 Feb 2021 22:42:35 +0000 (23:42 +0100)
committerGitHub <noreply@github.com>
Sun, 14 Feb 2021 22:42:35 +0000 (23:42 +0100)
Babel: Support tweet URL

bin/dev/minifyjs.sh
doc/Text_comment.md
doc/Text_editor.md
doc/de/Text_comment.md
doc/de/Text_editor.md
doc/img/editor_frost.png [deleted file]
doc/img/frost.png [deleted file]
src/Content/OEmbed.php
src/Content/Text/BBCode.php
view/theme/vier/style.css

index caa2b3846a4d8b7809d2367a708b7388d9015209..2c38cf8801c6425b8768a9a47590b65d1f7826ff 100755 (executable)
@@ -9,13 +9,6 @@ JSFILES=(
        "view/js/country.js"
        "view/js/main.js"
        "vendor/asset/base64/base64.min.js"
-       "view/theme/frost/js/jquery.divgrow-1.3.1.f1.js"
-       "view/theme/frost/js/main.js"
-       "view/theme/frost/js/theme.js"
-       "view/theme/frost-mobile/js/jquery.divgrow-1.3.1.f1.js"
-       "view/theme/frost-mobile/js/main.js"
-       "view/theme/frost-mobile/js/theme.js"
-       "view/theme/decaf-mobile/js/theme.js"
 )
 JSFILES2=(
        "library/colorbox/jquery.colorbox.js"
index 2aac568378d1c708f18f01f84bb3f2b06ed65e6e..7cd26d55f6d5e23a61944bdb43c1c45bf2bc9d44 100644 (file)
@@ -40,5 +40,3 @@ Darkzero  <img src="doc/img/darkzero.png" alt="darkzero.png" style="padding-left
 <span style="padding-left: 10px; font-style:italic;">(incl. more "zero"-themes, slackr, comix, easterbunny, facepark)</span>
 
 Dispy  <img src="doc/img/dispy.png" alt="dispy.png" style="padding-left: 57px; vertical-align:middle;"> <i>(incl. smoothly, testbubble)</i>
-
-Frost Mobile  <img src="doc/img/frost.png" alt="frost.png" style="padding-left: 16px; vertical-align:middle;">
index 07e1fa929e13ba47668ed20ad119f7c4f6da309d..ebbaf225492d0ca491e3af659c95dbf86be1ed59 100644 (file)
@@ -78,11 +78,6 @@ These icons can change depending on the theme. Some examples:
     <td><img src="doc/img/editor_darkbubble.png" alt="darkbubble.png" style="vertical-align:middle;"></td>
     <td>&nbsp;</td>
 </tr>
-<tr>
-    <td>Frost: </td>
-    <td><img src="doc/img/editor_frost.png" alt="frost.png" style="vertical-align:middle;"> </td>
-    <td>&nbsp;</td>
-</tr>
 </table>
 <i><b>*</b> how to [upload](help/FAQ#upload) files</i>
 <p style="clear:both;">&nbsp;</p>
index 88e5e0b119c605cb24d37ea5394db472c9cd960b..6dc47a524d8cbe9aa8bf9067b437f9896b47122b 100644 (file)
@@ -57,5 +57,3 @@ Darkzero  <img src="doc/img/darkzero.png" alt="darkzero.png" style="padding-left
 <span style="padding-left: 10px; font-style:italic;">(inkl. weiterer "zero"-Themen, slackr, comix, easterbunny, facepark)</span>
 
 Dispy  <img src="doc/img/dispy.png" alt="dispy.png" style="padding-left: 57px; vertical-align:middle;"> <i>(inkl. smoothly, testbubble)</i>
-
-Frost Mobile  <img src="doc/img/frost.png" alt="frost.png" style="padding-left: 16px; vertical-align:middle;">
index 33fc104dff0c539c8600bcc6748d2cde149e28c2..5f90f3b91a3528a64a9cd46346503bded68c2ab2 100644 (file)
@@ -54,6 +54,4 @@ Darkbubble  <img src="doc/img/editor_darkbubble.png" alt="darkbubble.png" style=
 
 Frio  <img src="doc/img/editor_frio.png" alt="frio.png" style="padding-left: 44px; vertical-align:middle;">
 
-Frost  <img src="doc/img/editor_frost.png" alt="frost.png" style="padding-left: 42px; vertical-align:middle;"> 
-
 Vier  <img src="doc/img/editor_vier.png" alt="vier.png" style="padding-left: 44px; vertical-align:middle;"> <i>(inkl. dispy)</i>
diff --git a/doc/img/editor_frost.png b/doc/img/editor_frost.png
deleted file mode 100644 (file)
index d0ac5a4..0000000
Binary files a/doc/img/editor_frost.png and /dev/null differ
diff --git a/doc/img/frost.png b/doc/img/frost.png
deleted file mode 100644 (file)
index 1b619a6..0000000
Binary files a/doc/img/frost.png and /dev/null differ
index 355dda3fc1c09c1206633c3ba13846d5aadb50a2..1a5d1d9042ac80cd6d4e30580ba0fa7dd8e915e5 100644 (file)
@@ -98,21 +98,23 @@ class OEmbed
                                // try oembed autodiscovery
                                $html_text = DI::httpRequest()->fetch($embedurl, 15, 'text/*');
                                if ($html_text) {
-                                       $dom = @DOMDocument::loadHTML($html_text);
-                                       if ($dom) {
+                                       $dom = new DOMDocument();
+                                       if ($dom->loadHTML($html_text)) {
                                                $xpath = new DOMXPath($dom);
-                                               $entries = $xpath->query("//link[@type='application/json+oembed']");
-                                               foreach ($entries as $e) {
-                                                       $href = $e->getAttributeNode('href')->nodeValue;
-                                                       $json_string = DI::httpRequest()->fetch($href . '&maxwidth=' . $a->videowidth);
-                                                       break;
-                                               }
-
-                                               $entries = $xpath->query("//link[@type='text/json+oembed']");
-                                               foreach ($entries as $e) {
-                                                       $href = $e->getAttributeNode('href')->nodeValue;
-                                                       $json_string = DI::httpRequest()->fetch($href . '&maxwidth=' . $a->videowidth);
-                                                       break;
+                                               foreach (
+                                                       $xpath->query("//link[@type='application/json+oembed'] | //link[@type='text/json+oembed']")
+                                                       as $link)
+                                               {
+                                                       $href = $link->getAttributeNode('href')->nodeValue;
+                                                       // Both Youtube and Vimeo output OEmbed endpoint URL with HTTP
+                                                       // but their OEmbed endpoint is only accessible by HTTPS ¯\_(ツ)_/¯
+                                                       $href = str_replace(['http://www.youtube.com/', 'http://player.vimeo.com/'],
+                                                               ['https://www.youtube.com/', 'https://player.vimeo.com/'], $href);
+                                                       $result = DI::httpRequest()->fetchFull($href . '&maxwidth=' . $a->videowidth);
+                                                       if ($result->getReturnCode() === 200) {
+                                                               $json_string = $result->getBody();
+                                                               break;
+                                                       }
                                                }
                                        }
                                }
@@ -337,10 +339,6 @@ class OEmbed
 
        public static function getHTML($url, $title = null)
        {
-               // Always embed the SSL version
-               $url = str_replace(["http://www.youtube.com/", "http://player.vimeo.com/"],
-                                       ["https://www.youtube.com/", "https://player.vimeo.com/"], $url);
-
                $o = self::fetchURL($url, !self::isAllowedURL($url));
 
                if (!is_object($o) || property_exists($o, 'type') && $o->type == 'error') {
index 66c180052d89c7abf875345e571f85e0dadeaeac..29b8d2525f308c608a187b3a2e17568097068067 100644 (file)
@@ -1616,12 +1616,13 @@ class BBCode
                                        // html5 video and audio
                                        $text = preg_replace("/\[video\](.*?\.(ogg|ogv|oga|ogm|webm|mp4).*?)\[\/video\]/ism",
                                                '<video src="$1" controls width="' . $a->videowidth . '" height="' . $a->videoheight . '" loop="true"><a href="$1">$1</a></video>', $text);
-                                       $text = preg_replace("/\[video\](.*?)\[\/video\]/ism",
-                                               '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>', $text);
-                                       $text = preg_replace("/\[audio\](.*?)\[\/audio\]/ism", '<audio src="$1" controls><a href="$1">$1</a></audio>', $text);
 
                                        $text = preg_replace_callback("/\[video\](.*?)\[\/video\]/ism", $try_oembed_callback, $text);
                                        $text = preg_replace_callback("/\[audio\](.*?)\[\/audio\]/ism", $try_oembed_callback, $text);
+
+                                       $text = preg_replace("/\[video\](.*?)\[\/video\]/ism",
+                                               '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>', $text);
+                                       $text = preg_replace("/\[audio\](.*?)\[\/audio\]/ism", '<audio src="$1" controls><a href="$1">$1</a></audio>', $text);
                                } else {
                                        $text = preg_replace("/\[video\](.*?)\[\/video\]/ism",
                                                '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>', $text);
index 0ef69f2caa97c65a8df69112592dac106f743f52..8bf982018e0c9b4474f42cc213a6b6f68f9b0da0 100644 (file)
@@ -2073,22 +2073,6 @@ section.minimal {
        margin-left: 15px;
        cursor: pointer;
 }
-#profile-smiley-wrapper {
-       float: left;
-       margin-left: 15px;
-       cursor: pointer;
-       margin-top: 3px;
-       height: 10px;
-       display: inline-block;
-}
-#smileybutton {
-       position: absolute;
-       z-index: 99;
-}
-table.smiley-preview {
-       background-color: #FFF;
-       box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7);
-}
 #jot-perms-icon {
        float: right;
        margin-left: 15px;