From 2bb3156500c913e8a0b5e786649c760ecd596d98 Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Wed, 28 Apr 2010 01:20:53 +0200 Subject: [PATCH] changed plugin API for more functionality --- Appcast.xml | 6 +++--- Controller.h | 2 +- ReleaseNotes.html | 4 ++++ TwittiaCore.js | 7 ++----- Twittia_2-Info.plist | 4 ++-- ViewDelegate.m | 4 +++- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Appcast.xml b/Appcast.xml index 6eab790..7ecb4ab 100755 --- a/Appcast.xml +++ b/Appcast.xml @@ -6,12 +6,12 @@ Most recent changes with links to updates. en - Version 2.1.0 (Added Mentions) - 10.5.0 + Version 2.1.1 (Added Mentions) + 10.6.0 http://jeenaparadies.net/twittia/ReleaseNotes.html Sun, 25 Apr 2010 18:00:00 +0000 diff --git a/Controller.h b/Controller.h index 63d57c0..b6336d9 100644 --- a/Controller.h +++ b/Controller.h @@ -12,7 +12,7 @@ #import -@interface Controller : NSObject { +@interface Controller : NSObject { IBOutlet WebView *timelineView; IBOutlet NSWindow *timelineViewWindow; IBOutlet WebView *mentionsView; diff --git a/ReleaseNotes.html b/ReleaseNotes.html index 84ecc70..1258be6 100644 --- a/ReleaseNotes.html +++ b/ReleaseNotes.html @@ -12,6 +12,10 @@ +

Twittia 2.1.1

+

Added a notice to the timeline window how many unread mentions there are.

+

Changed the plugin API to support more functionality.

+

Twittia 2.1.0

Fixed some wrong links.

Fixed problem with closed timeline window.

diff --git a/TwittiaCore.js b/TwittiaCore.js index 818de42..5529eea 100644 --- a/TwittiaCore.js +++ b/TwittiaCore.js @@ -10,12 +10,8 @@ function Twittia(action, oauth_key, oauth_secret) { this.body = document.createElement("ol"); this.body.className = this.action; - document.getElementsByTagName("body")[0].appendChild(this.body); - - setTimeout(function() { loadPlugin(controller.pluginURL()) }, 1); } - Twittia.prototype.newStatus = function(status, supress_new_with_timeout) { if(status != null) { for(var i = status.length-1, c=0; i>=c; --i) { @@ -34,10 +30,11 @@ Twittia.prototype.newStatus = function(status, supress_new_with_timeout) { var _this = this; setTimeout(function() { _this.getNewData() }, this.timeout); } - if(this.action == "mentions") { + if(this.action == "mentions" && this.is_not_init) { this.unread_mentions += status.length; controller.unreadMentions_(this.unread_mentions); } + this.is_not_init = true; } Twittia.prototype.getItem = function(status) { diff --git a/Twittia_2-Info.plist b/Twittia_2-Info.plist index a2c6312..538a5c6 100644 --- a/Twittia_2-Info.plist +++ b/Twittia_2-Info.plist @@ -40,9 +40,9 @@ CFBundleSignature ???? CFBundleVersion - 2.1.0 + 2.1.1 CFBundleShortVersionString - 2.1.0 + 2.1.1 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSMainNibFile diff --git a/ViewDelegate.m b/ViewDelegate.m index d9b6241..67aa6ab 100644 --- a/ViewDelegate.m +++ b/ViewDelegate.m @@ -43,7 +43,9 @@ } [sender stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat: - @"setTimeout(function(){ twittia_instance = new Twittia('%@'); }, %@);", action, delay]]; + @"setTimeout(function(){ twittia_instance = new Twittia('%@'); \ + document.getElementsByTagName('body')[0].appendChild(twittia_instance.body); \ + setTimeout(function() { loadPlugin(controller.pluginURL()) }, 1); }, %@);", action, delay]]; } @end