Compare commits

...

8 commits
0.9.3 ... main

Author SHA1 Message Date
Morgan McMillian 31424205e9 prep for release of 0.9.5 2020-02-16 07:33:22 -08:00
Morgan McMillian 8c1d527068 fix html parsing of user profile description, issue #56 2020-02-05 22:37:32 -08:00
Morgan McMillian bd441eac0e Refresh post when repost (or remove repost) is performed, issue #57 2020-02-05 22:01:49 -08:00
Morgan McMillian 14e536947b Scope & rewrite in links to what is actually contained in the href 2020-02-05 22:00:52 -08:00
Morgan McMillian c1bbb23daf rewrite & as & so that links will render properly, issue #54 2020-02-02 07:26:42 -08:00
Morgan McMillian c322df38c0 prep for 0.9.4 release 2020-02-01 06:54:46 -08:00
Morgan McMillian 5b0a94eca4 fixed post rendering to properly display surrogate pair characters 2020-02-01 06:53:58 -08:00
Morgan McMillian e883b8dcba update longpost url, issue #53 2020-01-28 23:14:34 -08:00
9 changed files with 47 additions and 33 deletions

View file

@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
## [0.9.5] - 2020-02-16
### Fixed
- Refresh post following a repost (issue #57)
- Fix HTML parsing on user descriptions (issue #56)
- Fix parsing of links containing & (issue #54)
## [0.9.4] - 2020-02-01
### Fixed
- Updated longpost url (issue #53)
- Rendering posts with links containing surrogate pair characters
## [0.9.3] - 2019-10-13
### Fixed
- Don't count markdown links against total post text count (issue #52)
@ -101,6 +112,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Added
- Initial release
[0.9.5]: https://gitlab.dreamfall.space/thrrgilag/goober-bb10/-/tags/0.9.5
[0.9.4]: https://gitlab.dreamfall.space/thrrgilag/goober-bb10/-/tags/0.9.4
[0.9.3]: https://gitlab.dreamfall.space/thrrgilag/goober-bb10/-/tags/0.9.3
[0.9.2]: https://gitlab.dreamfall.space/thrrgilag/goober-bb10/-/tags/0.9.2
[0.9.1]: https://gitlab.dreamfall.space/thrrgilag/goober-bb10/-/tags/Goober_0_9_1

View file

@ -37,7 +37,7 @@ Page {
horizontalAlignment: HorizontalAlignment.Center
topPadding: ui.sdu(2)
Label {
text: "Copyright © 2016-2019 Morgan McMillian"
text: "Copyright © 2016-2020 Morgan McMillian"
textStyle.fontSize: FontSize.XSmall
textFormat: TextFormat.Html
}

View file

@ -149,7 +149,7 @@ Container {
topMargin: ui.sdu(2.0)
bottomMargin: ui.sdu(2.0)
Label {
text: Parser.parsePostText(ListItemData.content)
text: Parser.fixPostHtml(ListItemData.content.html)
multiline: true
textFormat: TextFormat.Html
navigation.focusPolicy: NavigationFocusPolicy.NotFocusable

View file

@ -1,5 +1,6 @@
import bb.cascades 1.4
import com.netimage 1.0
import "parser.js" as Parser
Container {
id: useritem
@ -54,7 +55,7 @@ Container {
Container {
Label {
id: description
text: ListItemData.content.html
text: Parser.fixPostHtml(ListItemData.content.html)
multiline: true
textFormat: TextFormat.Html
}

View file

@ -17,27 +17,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function parsePostText(data) {
var t = data.text;
data.entities.links.forEach(function(link, indx) {
var ltext = t.substring(link.pos, link.pos + link.len);
var pretext = t.substring(0, link.pos);
var postext = t.substring(link.pos + link.len);
pretext = convert(pretext);
ltext = convert(ltext);
postext = convert(postext);
t = pretext + "<a href=\"" + link.link + "\">" + ltext + "</a>" + postext;
});
return t;
}
function convert(t) {
if (t.indexOf('<a href=') > 0) {
return t;
function fixPostHtml(data) {
data = data.replace(/<\\?\/?span[^>]*>/g, "");
data = data.replace(/<br>/g, "<br/>");
var hrefreg = /<a\shref=\\?"([^>]*)\\?">/;
var hrefm = hrefreg.exec(data);
if (hrefm != null) {
var href = hrefm[1].replace(/&/g, "&amp;");
data = data.replace(hrefreg, "<a href=\"" + href + "\">");
}
t = t.replace(/&/g, "&amp;");
t = t.replace(/<3/g, "\u2764");
t = t.replace(/</g, "&lt;");
t = t.replace(/>/g, "&gt;");
return t;
}
return data;
}

View file

@ -56,7 +56,7 @@
<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
An updated version of application must have a versionNumber value higher than the previous version. Required. -->
<versionNumber>0.9.3</versionNumber>
<versionNumber>0.9.5</versionNumber>
<!-- Fourth digit segment of the package version. First three segments are taken from the
<versionNumber> element. Must be an integer from 0 to 2^16-1 -->

View file

@ -149,6 +149,9 @@ lupdate_inclusion {
$$quote($$BASEDIR/../src/*.cc) \
$$quote($$BASEDIR/../src/*.cpp) \
$$quote($$BASEDIR/../src/*.cxx) \
$$quote($$BASEDIR/..//*.qml) \
$$quote($$BASEDIR/..//*.js) \
$$quote($$BASEDIR/..//*.qs) \
$$quote($$BASEDIR/../assets/*.qml) \
$$quote($$BASEDIR/../assets/*.js) \
$$quote($$BASEDIR/../assets/*.qs) \

View file

@ -305,6 +305,12 @@ void Pnut::onAuthorizedRequestReady(QByteArray data, int id)
req_map.remove(id);
getPost(variant.toMap()["data"].toMap()["id"].toString());
}
else if (endpoint.startsWith(":repost"))
{
qDebug() << "Repost successful!";
req_map.remove(id);
getPost(variant.toMap()["data"].toMap()["id"].toString());
}
else
{
qDebug() << "GOT SOMETHING NEW!";
@ -319,6 +325,12 @@ void Pnut::onAuthorizedRequestReady(QByteArray data, int id)
qDebug() << "Create post success!";
req_map.remove(id);
}
else if (endpoint.startsWith(":repost"))
{
qDebug() << "Repost successful!";
req_map.remove(id);
getPost(variant.toMap()["data"].toMap()["id"].toString());
}
else
{
qDebug() << "Good but not sure what";
@ -370,10 +382,8 @@ void Pnut::sendPost(QString text, int pid=0)
rawobj["type"] = "nl.chimpnut.blog.post";
rawobj["value"] = longpost;
raw.append(rawobj);
text.truncate(80);
text = text + "... - http://chimpnut.nl/u/";
text = text + m_appSettings->value("username").toString();
text = text + "/lp/{object_id} - #longpost";
text.truncate(100);
text = text + "... - https://longpo.st/p/{object_id} - #longpost";
}
map["text"] = text;
if (pid > 0)

View file

@ -256,12 +256,12 @@
<context>
<name>UserItem</name>
<message>
<location filename="../assets/UserItem.qml" line="67"/>
<location filename="../assets/UserItem.qml" line="68"/>
<source>Unfollow</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/UserItem.qml" line="67"/>
<location filename="../assets/UserItem.qml" line="68"/>
<source>Follow</source>
<translation type="unfinished"></translation>
</message>