Compare commits

...

15 commits
0.9.2 ... 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
Morgan McMillian 8896b2c076 prepping for release 2019-10-13 19:08:59 -07:00
Morgan McMillian dd1a6f1672 well that was silly of me 2019-10-13 17:29:13 -07:00
Morgan McMillian 3e9499670d fix reply post counting and enable send action when there is something to post 2019-10-13 17:23:47 -07:00
Morgan McMillian 82d5a1bc0d update about page and version bump 2019-10-13 16:35:09 -07:00
Morgan McMillian fddd407504 handle international utf8 text when copying to the clipboard resolves issue #25 2019-10-13 16:32:36 -07:00
Morgan McMillian c024f45348 do not count markdown links against total post text length.
resolves issue #52
2019-10-13 14:39:42 -07:00
Morgan McMillian ecfc81e79c update link in changelog 2019-08-10 07:25:32 -07:00
15 changed files with 146 additions and 101 deletions

View file

@ -3,9 +3,23 @@ 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/).
## [Unreleased]
## [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.2]
## [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)
- Handle utf8 text copying to the clipboard (issue #25)
## [0.9.2] - 2019-08-10
### Fixed
- Authentication error with new install on 10.3.3 devices (issue #49)
- Own username populating as mention in replies (issue #51)
@ -98,6 +112,10 @@ 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
[0.9.0]: https://gitlab.dreamfall.space/thrrgilag/goober-bb10/-/tags/Goober_0_9_0
[0.8.0]: https://gitlab.dreamfall.space/thrrgilag/goober-bb10/-/tags/Goober_0_8_0

View file

@ -1,51 +1,51 @@
1
49
WebViewSheet.qml
PostItem.qml
RefreshItem.qml
icons/ic_favorite.png
icons/ic_cancel.png
icons/bookmark.png
icons/laughing_man.png
icons/at.png
icons/home.png
icons/ic_edit.png
icons/ic_doctype_picture.png
icons/globe.png
icons/ic_add_bookmarks.png
icons/ic_copy.png
icons/ic_to_top.png
icons/sign-out.png
icons/bell.png
icons/quote-left.png
icons/bell-slash.png
icons/ic_reply.png
icons/messages.png
icons/star-o.png
icons/ic_contact.png
icons/comments.png
icons/ic_info.png
icons/ic_to_bottom.png
icons/ic_add.png
icons/retweet.png
icons/ic_del_bookmarks.png
icons/minus-circle.png
icons/star.png
icons/ic_reload.png
icons/ic_reply_all.png
icons/refresh.png
icons/ic_compose.png
icons/default_cover.png
LoginSheet.qml
UserItem.qml
main.qml
StreamTab.qml
ThreadPage.qml
AboutPage.qml
parser.js
UserPage.qml
AppCover.qml
moment.js
NewPostSheet.qml
RefreshItem.qml
PostItem.qml
WebViewSheet.qml
UserItem.qml
icons/messages.png
icons/comments.png
icons/ic_add.png
icons/bell.png
icons/minus-circle.png
icons/ic_info.png
icons/laughing_man.png
icons/default_cover.png
icons/star.png
icons/ic_reply.png
icons/ic_reply_all.png
icons/sign-out.png
icons/ic_doctype_picture.png
icons/bookmark.png
icons/star-o.png
icons/ic_cancel.png
icons/at.png
icons/ic_reload.png
icons/home.png
icons/ic_copy.png
icons/retweet.png
icons/bell-slash.png
icons/ic_favorite.png
icons/ic_contact.png
icons/refresh.png
icons/quote-left.png
icons/globe.png
icons/ic_del_bookmarks.png
icons/ic_add_bookmarks.png
icons/ic_to_top.png
icons/ic_edit.png
icons/ic_compose.png
icons/ic_to_bottom.png
StreamTab.qml
ProfilePage.qml
ThreadPage.qml
parser.js
AboutPage.qml
LoginSheet.qml
AppCover.qml
SettingsPage.qml
main.qml
NewPostSheet.qml
UserPage.qml

View file

@ -37,7 +37,7 @@ Page {
horizontalAlignment: HorizontalAlignment.Center
topPadding: ui.sdu(2)
Label {
text: "Copyright © 2016-2018 Morgan McMillian"
text: "Copyright © 2016-2020 Morgan McMillian"
textStyle.fontSize: FontSize.XSmall
textFormat: TextFormat.Html
}
@ -46,7 +46,7 @@ Page {
horizontalAlignment: HorizontalAlignment.Center
topPadding: ui.sdu(3)
Label {
text: "<a href=\"https://monkeystew.org\">https://monkeystew.org</a>"
text: "<a href=\"https://thrrgilag.net\">https://thrrgilag.net</a>"
textFormat: TextFormat.Html
}
}

View file

@ -28,6 +28,7 @@ Sheet {
property string counttext
signal sendPost(string text)
signal postChanging(string text)
Page {
titleBar: TitleBar {
@ -57,16 +58,11 @@ Sheet {
id: postText
preferredHeight: 350.0
onTextChanging: {
postChanging(text)
if (postText.text.length > 0) {
sendAction.enabled = true;
sendAction.enabled = true
} else {
sendAction.enabled = false;
}
count = 256 - postText.text.length
if (count < 0) {
counttext = "longpost"
} else {
counttext = count.toString()
sendAction.enabled = false
}
}
}

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
@ -377,6 +377,14 @@ Container {
onSendPost: {
postitem.ListItem.view.sendReply(text, ListItemData.id);
}
onPostChanging: {
replySheet.count = 256 - postitem.ListItem.view.postLength(text)
if (replySheet.count < 0) {
replySheet.counttext = "longpost"
} else {
replySheet.counttext = replySheet.count.toString()
}
}
}
]
function parseMentions(mentions) {

View file

@ -113,6 +113,9 @@ NavigationPane {
function getPost(pid) {
pnut.getPost(pid)
}
function postLength(text) {
return pnut.postLength(text)
}
function ccOnReply() {
if (_app.setting("cc") === "true") {
return true
@ -253,6 +256,14 @@ NavigationPane {
console.log("send: " + text)
pnut.sendPost(text, 0)
}
onPostChanging: {
newPostSheet.count = 256 - pnut.postLength(text)
if (newPostSheet.count < 0) {
newPostSheet.counttext = "longpost"
} else {
newPostSheet.counttext = newPostSheet.count.toString()
}
}
},
WebViewSheet {
id: webViewSheet

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.2</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

@ -21,6 +21,7 @@
#include "globals.h"
#include <QDebug>
#include <QDateTime>
#include <QRegExp>
#include <bb/data/JsonDataAccess>
const QString Pnut::PNUT_API_ROOT = QString("https://api.pnut.io/v0");
@ -304,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!";
@ -318,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";
@ -359,7 +372,7 @@ void Pnut::sendPost(QString text, int pid=0)
QVariantMap map;
QVariantList raw;
if (text.length() > 254)
if (postLength(text) > 256)
{
QVariantMap longpost;
QVariantMap rawobj;
@ -369,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)
@ -569,6 +580,13 @@ void Pnut::getFollowing(QString uid)
getRequest(url, parameters, req_id);
}
int Pnut::postLength(QString text)
{
QRegExp mdlink("\\[([^\\]]+)\\][^\\)]+\\)");
text.replace(mdlink, "\\1");
return text.length();
}
void Pnut::onOpenBrowser(QUrl url)
{
qDebug() << "_onOpenBrowser_";

View file

@ -88,6 +88,7 @@ public:
Q_INVOKABLE void getUserStream(QString uid);
Q_INVOKABLE void getFollowers(QString uid);
Q_INVOKABLE void getFollowing(QString uid);
Q_INVOKABLE int postLength(QString text);
public slots:
void onRequestReady(QByteArray data);

View file

@ -106,11 +106,13 @@ QString ApplicationUI::appversion()
return appinfo.version();
}
void ApplicationUI::copyText(QByteArray text)
void ApplicationUI::copyText(QString text)
{
bb::system::Clipboard clipboard;
clipboard.clear();
clipboard.insert("text/plain", text);
QByteArray textstr;
textstr.append(text.toUtf8());
clipboard.insert("text/plain", textstr);
}
void ApplicationUI::onInvoke(const bb::system::InvokeRequest& request)

View file

@ -47,7 +47,7 @@ public:
Q_INVOKABLE QVariant setting(const QString &key);
Q_INVOKABLE void setSetting(const QString &key, const QString &value);
Q_INVOKABLE QString appversion();
Q_INVOKABLE void copyText(QByteArray text);
Q_INVOKABLE void copyText(QString text);
Q_INVOKABLE void showImage(const QString &filename);
Q_SIGNALS:

View file

@ -25,17 +25,17 @@
<context>
<name>NewPostSheet</name>
<message>
<location filename="../assets/NewPostSheet.qml" line="36"/>
<location filename="../assets/NewPostSheet.qml" line="37"/>
<source>Send</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/NewPostSheet.qml" line="45"/>
<location filename="../assets/NewPostSheet.qml" line="46"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/NewPostSheet.qml" line="51"/>
<location filename="../assets/NewPostSheet.qml" line="52"/>
<source>New Post</source>
<translation type="unfinished"></translation>
</message>
@ -233,22 +233,22 @@
<context>
<name>StreamTab</name>
<message>
<location filename="../assets/StreamTab.qml" line="182"/>
<location filename="../assets/StreamTab.qml" line="185"/>
<source>New Post</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/StreamTab.qml" line="196"/>
<location filename="../assets/StreamTab.qml" line="199"/>
<source>To Top</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/StreamTab.qml" line="224"/>
<location filename="../assets/StreamTab.qml" line="227"/>
<source>To Bottom</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/StreamTab.qml" line="211"/>
<location filename="../assets/StreamTab.qml" line="214"/>
<source>Reload</source>
<translation type="unfinished"></translation>
</message>
@ -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>