]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Embed attachments marked up as microformats2 (I think rather properly)
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 27 Mar 2016 14:21:43 +0000 (16:21 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 27 Mar 2016 14:21:43 +0000 (16:21 +0200)
plugins/Oembed/OembedPlugin.php
plugins/Oembed/css/oembed.css

index 56ce3cf0988a9ce548b0f6efbdc08bd09ab4eb9f..6950fb0a9a453e06abb3ed07e110c47cc23d9d26 100644 (file)
@@ -243,24 +243,24 @@ class OembedPlugin extends Plugin
             return true;
         }
 
-        $out->elementStart('article', ['class'=>'oembed-item']);
+        $out->elementStart('article', ['class'=>'h-entry oembed']);
         $out->elementStart('header');
         try  {
             $thumb = $file->getThumbnail(128, 128);
-            $out->element('img', $thumb->getHtmlAttrs(['class'=>'oembed-thumb']));
+            $out->element('img', $thumb->getHtmlAttrs(['class'=>'u-photo oembed']));
             unset($thumb);
         } catch (Exception $e) {
             $out->element('div', ['class'=>'error'], $e->getMessage());
         }
-        $out->elementStart('h5', ['class'=>'oembed-title']);
-        $out->element('a', ['href'=>$file->getUrl()], common_strip_html($oembed->title));
+        $out->elementStart('h5', ['class'=>'p-name oembed']);
+        $out->element('a', ['class'=>'u-url', 'href'=>$file->getUrl()], common_strip_html($oembed->title));
         $out->elementEnd('h5');
-        $out->elementStart('div', ['class'=>'oembed-source']);
+        $out->elementStart('div', ['class'=>'p-author oembed']);
         if (!empty($oembed->author_name)) {
             // TRANS: text before the author name of oEmbed attachment representation
             // FIXME: The whole "By x from y" should be i18n because of different language constructions.
             $out->text(_('By '));
-            $attrs = ['class'=>'h-card'];
+            $attrs = ['class'=>'h-card p-author'];
             if (!empty($oembed->author_url)) {
                 $attrs['href'] = $oembed->author_url;
                 $tag = 'a';
@@ -284,7 +284,7 @@ class OembedPlugin extends Plugin
         }
         $out->elementEnd('div');
         $out->elementEnd('header');
-        $out->elementStart('div', ['class'=>'oembed-html']);
+        $out->elementStart('div', ['class'=>'p-summary oembed']);
         $out->raw(common_purify($oembed->html));
         $out->elementEnd('div');
         $out->elementStart('footer');
index ad7b3fb9b088492781de5082977139e7bf92a16b..68227e5dab7f7816aeb5120f07c147e37e131e3e 100644 (file)
@@ -1,15 +1,16 @@
-.oembed-thumb {
+.u-photo.oembed {
     float: left;
     margin-bottom: 1ex;
     margin-right: 1em;
     padding-bottom: 1ex;
 }
 
-.oembed-source {
+.p-author.oembed {
     font-style: italic;
 }
 
-.oembed-html {
-    max-height: 100px;
+.p-summary.oembed {
+    line-height: 1.25em;
+    max-height: 5em;
     overflow: auto;
 }