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/).
|
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
|
## [0.9.3] - 2019-10-13
|
||||||
### Fixed
|
### Fixed
|
||||||
- Don't count markdown links against total post text count (issue #52)
|
- 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
|
### Added
|
||||||
- Initial release
|
- 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.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.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
|
[0.9.1]: https://gitlab.dreamfall.space/thrrgilag/goober-bb10/-/tags/Goober_0_9_1
|
||||||
|
|
|
@ -37,7 +37,7 @@ Page {
|
||||||
horizontalAlignment: HorizontalAlignment.Center
|
horizontalAlignment: HorizontalAlignment.Center
|
||||||
topPadding: ui.sdu(2)
|
topPadding: ui.sdu(2)
|
||||||
Label {
|
Label {
|
||||||
text: "Copyright © 2016-2019 Morgan McMillian"
|
text: "Copyright © 2016-2020 Morgan McMillian"
|
||||||
textStyle.fontSize: FontSize.XSmall
|
textStyle.fontSize: FontSize.XSmall
|
||||||
textFormat: TextFormat.Html
|
textFormat: TextFormat.Html
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,7 @@ Container {
|
||||||
topMargin: ui.sdu(2.0)
|
topMargin: ui.sdu(2.0)
|
||||||
bottomMargin: ui.sdu(2.0)
|
bottomMargin: ui.sdu(2.0)
|
||||||
Label {
|
Label {
|
||||||
text: Parser.parsePostText(ListItemData.content)
|
text: Parser.fixPostHtml(ListItemData.content.html)
|
||||||
multiline: true
|
multiline: true
|
||||||
textFormat: TextFormat.Html
|
textFormat: TextFormat.Html
|
||||||
navigation.focusPolicy: NavigationFocusPolicy.NotFocusable
|
navigation.focusPolicy: NavigationFocusPolicy.NotFocusable
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import bb.cascades 1.4
|
import bb.cascades 1.4
|
||||||
import com.netimage 1.0
|
import com.netimage 1.0
|
||||||
|
import "parser.js" as Parser
|
||||||
|
|
||||||
Container {
|
Container {
|
||||||
id: useritem
|
id: useritem
|
||||||
|
@ -54,7 +55,7 @@ Container {
|
||||||
Container {
|
Container {
|
||||||
Label {
|
Label {
|
||||||
id: description
|
id: description
|
||||||
text: ListItemData.content.html
|
text: Parser.fixPostHtml(ListItemData.content.html)
|
||||||
multiline: true
|
multiline: true
|
||||||
textFormat: TextFormat.Html
|
textFormat: TextFormat.Html
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,27 +17,14 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function parsePostText(data) {
|
function fixPostHtml(data) {
|
||||||
var t = data.text;
|
data = data.replace(/<\\?\/?span[^>]*>/g, "");
|
||||||
data.entities.links.forEach(function(link, indx) {
|
data = data.replace(/<br>/g, "<br/>");
|
||||||
var ltext = t.substring(link.pos, link.pos + link.len);
|
var hrefreg = /<a\shref=\\?"([^>]*)\\?">/;
|
||||||
var pretext = t.substring(0, link.pos);
|
var hrefm = hrefreg.exec(data);
|
||||||
var postext = t.substring(link.pos + link.len);
|
if (hrefm != null) {
|
||||||
pretext = convert(pretext);
|
var href = hrefm[1].replace(/&/g, "&");
|
||||||
ltext = convert(ltext);
|
data = data.replace(hrefreg, "<a href=\"" + href + "\">");
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
t = t.replace(/&/g, "&");
|
return data;
|
||||||
t = t.replace(/<3/g, "\u2764");
|
}
|
||||||
t = t.replace(/</g, "<");
|
|
||||||
t = t.replace(/>/g, ">");
|
|
||||||
return t;
|
|
||||||
}
|
|
|
@ -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.
|
<!-- 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.
|
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. -->
|
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
|
<!-- 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 -->
|
<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/*.cc) \
|
||||||
$$quote($$BASEDIR/../src/*.cpp) \
|
$$quote($$BASEDIR/../src/*.cpp) \
|
||||||
$$quote($$BASEDIR/../src/*.cxx) \
|
$$quote($$BASEDIR/../src/*.cxx) \
|
||||||
|
$$quote($$BASEDIR/..//*.qml) \
|
||||||
|
$$quote($$BASEDIR/..//*.js) \
|
||||||
|
$$quote($$BASEDIR/..//*.qs) \
|
||||||
$$quote($$BASEDIR/../assets/*.qml) \
|
$$quote($$BASEDIR/../assets/*.qml) \
|
||||||
$$quote($$BASEDIR/../assets/*.js) \
|
$$quote($$BASEDIR/../assets/*.js) \
|
||||||
$$quote($$BASEDIR/../assets/*.qs) \
|
$$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);
|
req_map.remove(id);
|
||||||
getPost(variant.toMap()["data"].toMap()["id"].toString());
|
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
|
else
|
||||||
{
|
{
|
||||||
qDebug() << "GOT SOMETHING NEW!";
|
qDebug() << "GOT SOMETHING NEW!";
|
||||||
|
@ -319,6 +325,12 @@ void Pnut::onAuthorizedRequestReady(QByteArray data, int id)
|
||||||
qDebug() << "Create post success!";
|
qDebug() << "Create post success!";
|
||||||
req_map.remove(id);
|
req_map.remove(id);
|
||||||
}
|
}
|
||||||
|
else if (endpoint.startsWith(":repost"))
|
||||||
|
{
|
||||||
|
qDebug() << "Repost successful!";
|
||||||
|
req_map.remove(id);
|
||||||
|
getPost(variant.toMap()["data"].toMap()["id"].toString());
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug() << "Good but not sure what";
|
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["type"] = "nl.chimpnut.blog.post";
|
||||||
rawobj["value"] = longpost;
|
rawobj["value"] = longpost;
|
||||||
raw.append(rawobj);
|
raw.append(rawobj);
|
||||||
text.truncate(80);
|
text.truncate(100);
|
||||||
text = text + "... - http://chimpnut.nl/u/";
|
text = text + "... - https://longpo.st/p/{object_id} - #longpost";
|
||||||
text = text + m_appSettings->value("username").toString();
|
|
||||||
text = text + "/lp/{object_id} - #longpost";
|
|
||||||
}
|
}
|
||||||
map["text"] = text;
|
map["text"] = text;
|
||||||
if (pid > 0)
|
if (pid > 0)
|
||||||
|
|
|
@ -256,12 +256,12 @@
|
||||||
<context>
|
<context>
|
||||||
<name>UserItem</name>
|
<name>UserItem</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../assets/UserItem.qml" line="67"/>
|
<location filename="../assets/UserItem.qml" line="68"/>
|
||||||
<source>Unfollow</source>
|
<source>Unfollow</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../assets/UserItem.qml" line="67"/>
|
<location filename="../assets/UserItem.qml" line="68"/>
|
||||||
<source>Follow</source>
|
<source>Follow</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
Reference in a new issue