diff --git a/actions/apiqvitteroembednotice.php b/actions/apiqvitteroembednotice.php index bfe9455..15f0c85 100644 --- a/actions/apiqvitteroembednotice.php +++ b/actions/apiqvitteroembednotice.php @@ -108,16 +108,38 @@ class ApiQvitterOembedNoticeAction extends ApiAction $oembed['version']='1.0'; $oembed['provider_name']=common_config('site', 'name'); $oembed['provider_url']=common_root_url(); + $oembed['type']='link'; // TRANS: oEmbed title. %1$s is the author name, %2$s is the creation date. - $oembed['title'] = sprintf(_('%1$s\'s status on %2$s'), - $authorname, - common_exact_date($notice->created)); + $oembed['title'] = ApiAction::dateTwitter($notice->created).' (Qvitter)'; $oembed['author_name']=$authorname; $oembed['author_url']=$profile->profileurl; $oembed['url']=$notice->getUrl(); $oembed['html']=$notice->getRendered(); + // maybe add thumbnail + $attachments = $notice->attachments(); + if (!empty($attachments)) { + foreach ($attachments as $attachment) { + if(is_object($attachment)) { + try { + $thumb = $attachment->getThumbnail(); + } catch (ServerException $e) { + // + } + if(method_exists('File_thumbnail','url')) { + try { + $thumb_url = File_thumbnail::url($thumb->filename); + $oembed['thumbnail_url'] = $thumb_url; + break; // only first one + } catch (ClientException $e) { + // + } + } + } + } + } + if($this->format == 'json') { $this->initDocument('json'); print json_encode($oembed); diff --git a/css/qvitter.css b/css/qvitter.css index 58b5e38..ee0d292 100644 --- a/css/qvitter.css +++ b/css/qvitter.css @@ -2132,7 +2132,7 @@ body.rtl .queet.rtl .expanded-content { text-overflow: ellipsis; white-space: nowrap; } -.oembed-twitter-username { +.oembed-username { font-size:13px; color:#999; font-weight:normal; diff --git a/js/dom-functions.js b/js/dom-functions.js index b04a05f..ec8a7e6 100644 --- a/js/dom-functions.js +++ b/js/dom-functions.js @@ -2202,7 +2202,7 @@ function buildAttachmentHTML(attachments){ var twitterHTML = '
\ ' + this.oembed.author_name + '\ - ' + this.oembed.title + '\ + ' + this.oembed.title + '\
\
' + this.oembed.oembedHTML + '
\