From a7564f10a91d648e23d0c501ee55dd48a55f9873 Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Tue, 15 Jan 2013 18:13:38 +0100 Subject: [PATCH 1/6] fixed problem with ^usernames --- WebKit/scripts/helper/Core.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WebKit/scripts/helper/Core.js b/WebKit/scripts/helper/Core.js index 980c3d5..4a79d10 100644 --- a/WebKit/scripts/helper/Core.js +++ b/WebKit/scripts/helper/Core.js @@ -644,7 +644,9 @@ function(jQuery, Paths, URI, HostApp, Cache) { var text = node.innerHTML; var mentions_in_text = []; - var res = text.match(/(\^[\w:/]+\.[\w:/.]+(?:[\w]))/ig); + + var res = text.match(/(\^[\w:/.]+(?:[\w]))/ig); + if (res) { for (var i = 0; i < res.length; i++) { var name = res[i]; From 2d64d1385a7aaf8c3a35332ef7cc80645b415722 Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Tue, 15 Jan 2013 19:02:21 +0100 Subject: [PATCH 2/6] fixed #123 --- Mac/English.lproj/MainMenu.xib | 51 ++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/Mac/English.lproj/MainMenu.xib b/Mac/English.lproj/MainMenu.xib index 241ecc7..6b2f0c2 100644 --- a/Mac/English.lproj/MainMenu.xib +++ b/Mac/English.lproj/MainMenu.xib @@ -236,7 +236,7 @@ Open Profile ... - p + O 1048576 2147483647 @@ -838,7 +838,7 @@ - + 256 YES @@ -886,7 +886,6 @@ {397, 581} - {{0, 0}, {2560, 1418}} @@ -907,7 +906,7 @@ - + 256 YES @@ -953,7 +952,6 @@ {376, 581} - {{0, 0}, {2560, 1418}} @@ -971,7 +969,7 @@ - + 256 YES @@ -1010,7 +1008,6 @@ {376, 581} - {{0, 0}, {2560, 1418}} @@ -1028,7 +1025,7 @@ - + 256 YES @@ -1067,7 +1064,6 @@ {376, 581} - {{0, 0}, {2560, 1418}} @@ -1211,7 +1207,6 @@ {{391, 46}, {75, 32}} - _NS:9 YES @@ -1320,7 +1315,6 @@ {{285, 13}, {74, 32}} - _NS:9 YES @@ -3129,7 +3123,11 @@ clearCache: login: logout: + openNewMessageWindow: + sendTweet: + showConversationForPostId:andEntity: showProfile: + showProfileForEntity: YES @@ -3137,6 +3135,10 @@ id id id + id + NSString + id + NSString @@ -3146,7 +3148,11 @@ clearCache: login: logout: + openNewMessageWindow: + sendTweet: + showConversationForPostId:andEntity: showProfile: + showProfileForEntity: YES @@ -3162,10 +3168,26 @@ logout: id + + openNewMessageWindow: + id + + + sendTweet: + id + + + showConversationForPostId:andEntity: + NSString + showProfile: id + + showProfileForEntity: + NSString + @@ -3181,6 +3203,7 @@ logoLayer mentionsView mentionsViewWindow + openProfileWindow profileView profileViewWindow showProfileTextField @@ -3199,6 +3222,7 @@ NSImageView WebView NSWindow + NSPanel WebView NSWindow NSTextField @@ -3220,6 +3244,7 @@ logoLayer mentionsView mentionsViewWindow + openProfileWindow profileView profileViewWindow showProfileTextField @@ -3265,6 +3290,10 @@ mentionsViewWindow NSWindow + + openProfileWindow + NSPanel + profileView WebView From 18d4c79faeea3c54296ba7ec7c2405c503eae40c Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Tue, 15 Jan 2013 19:06:12 +0100 Subject: [PATCH 3/6] fixed #109 --- WebKit/scripts/helper/Core.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WebKit/scripts/helper/Core.js b/WebKit/scripts/helper/Core.js index 4a79d10..21632c5 100644 --- a/WebKit/scripts/helper/Core.js +++ b/WebKit/scripts/helper/Core.js @@ -673,11 +673,12 @@ function(jQuery, Paths, URI, HostApp, Cache) { (function(mention) { // need this closure var profile = function(profile) { + var basic = profile["https://tent.io/types/info/basic/v0.1.0"]; - if (profile && basic) { + if (profile) { var name = mention.text; - if (basic.name) { + if (basic && basic.name) { name = basic.name; } From 800ec65d8fc27beb85f3d10bfb06ce480dde8e96 Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Wed, 16 Jan 2013 01:01:07 +0100 Subject: [PATCH 4/6] changed open profile to cmd U fixed #123 --- Mac/English.lproj/MainMenu.xib | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Mac/English.lproj/MainMenu.xib b/Mac/English.lproj/MainMenu.xib index 6b2f0c2..fc40ddf 100644 --- a/Mac/English.lproj/MainMenu.xib +++ b/Mac/English.lproj/MainMenu.xib @@ -236,7 +236,7 @@ Open Profile ... - O + u 1048576 2147483647 @@ -906,7 +906,7 @@ - + 256 YES @@ -936,6 +936,7 @@ {376, 581} + @@ -952,6 +953,8 @@ {376, 581} + + {{0, 0}, {2560, 1418}} From 084cc90321fd63bd58f8c24dd253285a69a5202f Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Wed, 16 Jan 2013 01:02:54 +0100 Subject: [PATCH 5/6] added original status to li so it can be used later --- WebKit/scripts/helper/Core.js | 1 + 1 file changed, 1 insertion(+) diff --git a/WebKit/scripts/helper/Core.js b/WebKit/scripts/helper/Core.js index 21632c5..96a481a 100644 --- a/WebKit/scripts/helper/Core.js +++ b/WebKit/scripts/helper/Core.js @@ -150,6 +150,7 @@ function(jQuery, Paths, URI, HostApp, Cache) { var template = this.getTemplate(); template.item.id = "post-" + (typeof status.__repost != "undefined" ? status.__repost.id : status.id); + template.item.status = status; if (HostApp.stringForKey("entity") == status.entity && typeof status.__repost == "undefined") { template.remove.onclick = function() { From 2d1293389f8110502625acae8c020b8e4fbc2c90 Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Wed, 16 Jan 2013 01:03:55 +0100 Subject: [PATCH 6/6] force reauthentication to be able to send global cursor data --- Mac/Controller.m | 7 ++--- WebKit/scripts/controller/Mentions.js | 37 +++++++++++++++++++++++++-- WebKit/scripts/controller/Oauth.js | 3 ++- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/Mac/Controller.m b/Mac/Controller.m index bfc694b..328d220 100644 --- a/Mac/Controller.m +++ b/Mac/Controller.m @@ -60,11 +60,11 @@ accessToken = [[AccessToken alloc] init]; BOOL forceLogin = NO; - if (![accessToken stringForKey:@"version-0.5.2-new-login"]) { + if (![accessToken stringForKey:@"version-0.6.0-new-login"]) { [self logout:self]; forceLogin = YES; [accessToken setString:nil forKey:@"entity"]; - [accessToken setString:@"yes" forKey:@"version-0.5.2-new-login"]; + [accessToken setString:@"yes" forKey:@"version-0.6.0-new-login"]; } if (forceLogin || ![accessToken stringForKey:@"user_access_token"] || ![accessToken secret]) { @@ -479,7 +479,8 @@ { if ([notification object] == mentionsViewWindow) { - [self unreadMentions:0]; + //[self unreadMentions:0]; + [mentionsView stringByEvaluatingJavaScriptFromString:@"tentia_instance.setAllMentionsRead();"]; } } diff --git a/WebKit/scripts/controller/Mentions.js b/WebKit/scripts/controller/Mentions.js index 3b0a18f..0dfc746 100644 --- a/WebKit/scripts/controller/Mentions.js +++ b/WebKit/scripts/controller/Mentions.js @@ -1,9 +1,11 @@ define([ "helper/HostApp", - "controller/Timeline" + "controller/Timeline", + "lib/URI", + "helper/Paths" ], -function(HostApp, Timeline) { +function(HostApp, Timeline, URI, Paths) { function Mentions() { @@ -63,6 +65,37 @@ function(HostApp, Timeline) { } } + Mentions.prototype.setAllMentionsRead = function() { + this.unread_mentions = 0; + HostApp.unreadMentions(this.unread_mentions); + this.updateLatestMentionRead(); + } + + Mentions.prototype.updateLatestMentionRead = function() { + var status = this.body.firstChild.status; + + if (status && status.type == "https://tent.io/types/post/status/v0.1.0") { + + var url = URI(Paths.mkApiRootPath("/profile/" + encodeURIComponent("https://tent.io/types/info/cursor/v0.1.0"))); + var body = { + "https://tent.io/types/info/cursor/v0.1.0": { + "mentions": { + "https://tent.io/types/post/status/v0.1.0": { + "post_id": status.id, + "post_entity": status.entity + } + } + } + } + + var callback = function(resp) { + //debug(resp) + } + + Paths.getURL(url.toString(), "PUT", callback, JSON.stringify(body)); + } + } + return Mentions; diff --git a/WebKit/scripts/controller/Oauth.js b/WebKit/scripts/controller/Oauth.js index 96f2cf4..1506ea1 100644 --- a/WebKit/scripts/controller/Oauth.js +++ b/WebKit/scripts/controller/Oauth.js @@ -104,7 +104,8 @@ function(HostApp, Paths, Hmac) { + "&redirect_uri=" + this.app_info["redirect_uris"][0] + "&scope=" + Object.keys(this.app_info["scopes"]).join(",") + "&state=" + this.state - + "&tent_post_types=all"; + + "&tent_post_types=all" + + "&tent_profile_info_types=all"; HostApp.openAuthorizationURL(this.apiRoot() + auth); }