render oembed photos, issue #12

This commit is contained in:
Morgan McMillian 2017-02-17 12:53:16 -08:00
parent a9ac1c4bb8
commit a4a50b6b5a
3 changed files with 27 additions and 10 deletions

View file

@ -29,7 +29,6 @@ Container {
rightPadding: ui.sdu(3.0)
topPadding: ui.sdu(2.0)
//bottomPadding: ui.sdu(2.0)
property string lorem: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse non enim tellus. Donec vestibulum enim urna, eget faucibus diam commodo a. Donec eget hendrerit metus. Pellentesque vehicula nisi nec vehicula ullamcorper. Aliquam a elit eget mi fringilla porta fermentum eget eros. Phasellus vestibulum nulla sed elit congue adipiscing. Cras imperdiet urna ac ipsum volutpat lobortis. Maecenas vehicula tortor at viverra convallis. Curabitur nibh massa, tristique id felis ut, venenatis faucibus dui. Donec fringilla, mi nec tincidunt dignissim, neque nunc semper mi, quis rutrum diam turpis sit amet erat. Cras a sodales nisi. Nunc sit amet diam sed lectus molestie cursus convallis et erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Duis vitae varius leo. Mauris eu leo a nunc bibendum rutrum euismod et ipsum. "
property variant theme : Application.themeSupport.theme.colorTheme.style
@ -144,6 +143,22 @@ Container {
navigation.focusPolicy: NavigationFocusPolicy.NotFocusable
}
}
Container {
horizontalAlignment: HorizontalAlignment.Center
bottomMargin: ui.sdu(2.0)
WebImageView {
url: {
var oembed = ""
ListItemData.raw.forEach(function (item) {
if (item["type"] == "io.pnut.core.oembed") {
oembed = item["value"]["url"]
}
})
return oembed
}
scalingMethod: ScalingMethod.AspectFit
}
}
Container {
layout: DockLayout {}
horizontalAlignment: HorizontalAlignment.Fill

View file

@ -335,6 +335,7 @@ void Pnut::getStream(QString endpoint, Pnut::RequestType rtype)
QUrl url(PNUT_API_ROOT + endpoint);
KQOAuthParameters parameters;
parameters.insert("count", "50");
parameters.insert("include_raw", "1");
switch (rtype)
{
case Pnut::STREAM_NEWER:
@ -400,6 +401,7 @@ void Pnut::getThread(QString pid)
{
QUrl url(PNUT_API_ROOT + "/posts/" + pid + "/thread");
KQOAuthParameters parameters;
parameters.insert("include_raw", "1");
req_map[++req_id] = ":thread";
getRequest(url, parameters, req_id);
}

View file

@ -30,47 +30,47 @@
<context>
<name>PostItem</name>
<message>
<location filename="../assets/PostItem.qml" line="172"/>
<location filename="../assets/PostItem.qml" line="189"/>
<source>Reply</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="181"/>
<location filename="../assets/PostItem.qml" line="198"/>
<source>Reply All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="191"/>
<location filename="../assets/PostItem.qml" line="208"/>
<source>Add Bookmark</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="191"/>
<location filename="../assets/PostItem.qml" line="208"/>
<source>Delete Bookmark</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="202"/>
<location filename="../assets/PostItem.qml" line="219"/>
<source>Repost</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="202"/>
<location filename="../assets/PostItem.qml" line="219"/>
<source>Delete Repost</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="213"/>
<location filename="../assets/PostItem.qml" line="230"/>
<source>Quote</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="222"/>
<location filename="../assets/PostItem.qml" line="239"/>
<source>View Profile</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="240"/>
<location filename="../assets/PostItem.qml" line="257"/>
<source>Delete</source>
<translation type="unfinished"></translation>
</message>