Compare commits
8 commits
Author | SHA1 | Date | |
---|---|---|---|
|
31424205e9 | ||
|
8c1d527068 | ||
|
bd441eac0e | ||
|
14e536947b | ||
|
c1bbb23daf | ||
|
c322df38c0 | ||
|
5b0a94eca4 | ||
|
e883b8dcba |
9 changed files with 47 additions and 33 deletions
13
CHANGELOG.md
13
CHANGELOG.md
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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, "&");
|
||||
data = data.replace(hrefreg, "<a href=\"" + href + "\">");
|
||||
}
|
||||
t = t.replace(/&/g, "&");
|
||||
t = t.replace(/<3/g, "\u2764");
|
||||
t = t.replace(/</g, "<");
|
||||
t = t.replace(/>/g, ">");
|
||||
return t;
|
||||
}
|
||||
return data;
|
||||
}
|
|
@ -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 -->
|
||||
|
|
|
@ -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) \
|
||||
|
|
18
src/Pnut.cpp
18
src/Pnut.cpp
|
@ -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)
|
||||
|
|
|
@ -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>
|
||||
|
|
Reference in a new issue