diff --git a/assets/.assets.index b/assets/.assets.index index 2f00cd3..564fe2e 100644 --- a/assets/.assets.index +++ b/assets/.assets.index @@ -1,6 +1,5 @@ 1 47 -AboutPage.qml AppCover.qml LoginSheet.qml main.qml @@ -47,3 +46,4 @@ PostItem.qml StreamTab.qml WebViewSheet.qml parser.js +AboutPage.qml diff --git a/assets/PostItem.qml b/assets/PostItem.qml index bde8abd..0bde87e 100644 --- a/assets/PostItem.qml +++ b/assets/PostItem.qml @@ -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 diff --git a/assets/ProfilePage.qml b/assets/ProfilePage.qml index 55466d2..0f831c0 100644 --- a/assets/ProfilePage.qml +++ b/assets/ProfilePage.qml @@ -19,6 +19,7 @@ import bb.cascades 1.4 import org.labsquare 1.0 +import "parser.js" as Parser Page { @@ -109,7 +110,7 @@ Page { preferredWidth: ui.du(45) Label { //text: lorem - text: user.content.html + text: Parser.parsePostData(user.content.html) multiline: true textFormat: TextFormat.Html } diff --git a/assets/parser.js b/assets/parser.js index a4e8c07..2b5202f 100644 --- a/assets/parser.js +++ b/assets/parser.js @@ -236,8 +236,9 @@ function parsePostData(t) { t = t.replace(/þ/g,"\u00FE"); t = t.replace(/ÿ/g,"\u00FF"); t = t.replace(/"/g,"\u0022"); - t = t.replace(/</g,"\u003C"); - t = t.replace(/>/g,"\u003E"); + t = t.replace(/<3/g, "\u2764"); + t = t.replace(/</g,"\u02C2"); + t = t.replace(/>/g,"\u02C3"); t = t.replace(/€/g,"\u0080"); t = t.replace(/‚/g,"\u0082"); t = t.replace(/ƒ/g,"\u0083"); diff --git a/src/Pnut.cpp b/src/Pnut.cpp index 9737c48..b92f6d2 100644 --- a/src/Pnut.cpp +++ b/src/Pnut.cpp @@ -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); } diff --git a/translations/Goober.ts b/translations/Goober.ts index 1e1cfda..e0f4432 100644 --- a/translations/Goober.ts +++ b/translations/Goober.ts @@ -30,47 +30,47 @@ PostItem - + Reply - + Reply All - + Add Bookmark - + Delete Bookmark - + Repost - + Delete Repost - + Quote - + View Profile - + Delete @@ -78,55 +78,55 @@ ProfilePage - - + + Following - - + + Followers - - + + Posts - + Bookmarks - + Unfollow - + Follow - + Unmute - + Mute - + Unblock - + Block