changed plugin API for more functionality

This commit is contained in:
Jeena Paradies 2010-04-28 01:20:53 +02:00
parent 9ba76d7bc7
commit 2bb3156500
6 changed files with 15 additions and 12 deletions

View file

@ -6,12 +6,12 @@
<description>Most recent changes with links to updates.</description> <description>Most recent changes with links to updates.</description>
<language>en</language> <language>en</language>
<item> <item>
<title>Version 2.1.0 (Added Mentions)</title> <title>Version 2.1.1 (Added Mentions)</title>
<sparkle:minimumSystemVersion>10.5.0</sparkle:minimumSystemVersion> <sparkle:minimumSystemVersion>10.6.0</sparkle:minimumSystemVersion>
<sparkle:releaseNotesLink>http://jeenaparadies.net/twittia/ReleaseNotes.html</sparkle:releaseNotesLink> <sparkle:releaseNotesLink>http://jeenaparadies.net/twittia/ReleaseNotes.html</sparkle:releaseNotesLink>
<pubDate>Sun, 25 Apr 2010 18:00:00 +0000</pubDate> <pubDate>Sun, 25 Apr 2010 18:00:00 +0000</pubDate>
<enclosure url="http://jeenaparadies.net/twittia/Twittia.app.zip" <enclosure url="http://jeenaparadies.net/twittia/Twittia.app.zip"
sparkle:version="2.1.0" sparkle:version="2.1.1"
length="490811" length="490811"
type="application/octet-stream" type="application/octet-stream"
sparkle:dsaSignature="MC0CFBhmqxktwcqIqFM2F/blXAIfBmHhAhUAq19o2TB8v7f7nU9i+KFC3VrsWc0=" /> sparkle:dsaSignature="MC0CFBhmqxktwcqIqFM2F/blXAIfBmHhAhUAq19o2TB8v7f7nU9i+KFC3VrsWc0=" />

View file

@ -12,7 +12,7 @@
#import <Carbon/Carbon.h> #import <Carbon/Carbon.h>
@interface Controller : NSObject <NSWindowDelegate> { @interface Controller : NSObject {
IBOutlet WebView *timelineView; IBOutlet WebView *timelineView;
IBOutlet NSWindow *timelineViewWindow; IBOutlet NSWindow *timelineViewWindow;
IBOutlet WebView *mentionsView; IBOutlet WebView *mentionsView;

View file

@ -12,6 +12,10 @@
</head> </head>
<body> <body>
<h1>Twittia 2.1.1</h1>
<p>Added a notice to the timeline window how many unread mentions there are.</p>
<p>Changed the plugin API to support more functionality.</p>
<h1>Twittia 2.1.0</h1> <h1>Twittia 2.1.0</h1>
<p>Fixed some wrong links.</p> <p>Fixed some wrong links.</p>
<p>Fixed problem with closed timeline window.</p> <p>Fixed problem with closed timeline window.</p>

View file

@ -10,12 +10,8 @@ function Twittia(action, oauth_key, oauth_secret) {
this.body = document.createElement("ol"); this.body = document.createElement("ol");
this.body.className = this.action; 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) { Twittia.prototype.newStatus = function(status, supress_new_with_timeout) {
if(status != null) { if(status != null) {
for(var i = status.length-1, c=0; i>=c; --i) { 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; var _this = this;
setTimeout(function() { _this.getNewData() }, this.timeout); setTimeout(function() { _this.getNewData() }, this.timeout);
} }
if(this.action == "mentions") { if(this.action == "mentions" && this.is_not_init) {
this.unread_mentions += status.length; this.unread_mentions += status.length;
controller.unreadMentions_(this.unread_mentions); controller.unreadMentions_(this.unread_mentions);
} }
this.is_not_init = true;
} }
Twittia.prototype.getItem = function(status) { Twittia.prototype.getItem = function(status) {

View file

@ -40,9 +40,9 @@
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>2.1.0</string> <string>2.1.1</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.1.0</string> <string>2.1.1</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string> <string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSMainNibFile</key> <key>NSMainNibFile</key>

View file

@ -43,7 +43,9 @@
} }
[sender stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat: [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 @end