fixed (OS X) so you can log in and out without restarting, added Add photo
This commit is contained in:
parent
be1d72cd6a
commit
e5704ddda7
11 changed files with 133 additions and 50 deletions
|
@ -14,6 +14,8 @@ class Tentia:
|
||||||
self.preferences = Windows.Preferences(self)
|
self.preferences = Windows.Preferences(self)
|
||||||
self.preferences.show()
|
self.preferences.show()
|
||||||
|
|
||||||
|
self.oauth_implementation = Windows.Oauth(self)
|
||||||
|
|
||||||
if self.controller.stringForKey("user_access_token") != "":
|
if self.controller.stringForKey("user_access_token") != "":
|
||||||
self.authentification_succeded()
|
self.authentification_succeded()
|
||||||
|
|
||||||
|
@ -27,7 +29,7 @@ class Tentia:
|
||||||
|
|
||||||
def login_with_entity(self, entity):
|
def login_with_entity(self, entity):
|
||||||
self.controller.setStringForKey(entity, "entity")
|
self.controller.setStringForKey(entity, "entity")
|
||||||
self.oauth_implementation = Windows.Oauth(self)
|
self.oauth_implementation.login()
|
||||||
|
|
||||||
def authentification_succeded(self):
|
def authentification_succeded(self):
|
||||||
self.preferences.hide()
|
self.preferences.hide()
|
||||||
|
|
|
@ -35,7 +35,6 @@ class Preferences:
|
||||||
|
|
||||||
# text field
|
# text field
|
||||||
self.text_field = QtGui.QLineEdit(self.window)
|
self.text_field = QtGui.QLineEdit(self.window)
|
||||||
# self.text_field.setText("http://jeena.net")
|
|
||||||
self.text_field.setPlaceholderText("https://example.tent.is")
|
self.text_field.setPlaceholderText("https://example.tent.is")
|
||||||
self.text_field.setGeometry(194, 84, 262, 22)
|
self.text_field.setGeometry(194, 84, 262, 22)
|
||||||
self.window.connect(self.text_field, QtCore.SIGNAL('returnPressed()'), self.on_login_button_clicked)
|
self.window.connect(self.text_field, QtCore.SIGNAL('returnPressed()'), self.on_login_button_clicked)
|
||||||
|
@ -177,6 +176,10 @@ class Oauth:
|
||||||
script = "function HostAppGo() { start('oauth'); }"
|
script = "function HostAppGo() { start('oauth'); }"
|
||||||
self.core.page().mainFrame().evaluateJavaScript(script)
|
self.core.page().mainFrame().evaluateJavaScript(script)
|
||||||
|
|
||||||
|
def login(self):
|
||||||
|
script = "tentia_instance.authenticate();"
|
||||||
|
self.core.page().mainFrame().evaluateJavaScript(script)
|
||||||
|
|
||||||
def handle_authentication(self, url):
|
def handle_authentication(self, url):
|
||||||
self.auth_view = Helper.WebViewCreator(self.app)
|
self.auth_view = Helper.WebViewCreator(self.app)
|
||||||
self.auth_view.setWindowTitle("Authentication")
|
self.auth_view.setWindowTitle("Authentication")
|
||||||
|
@ -207,7 +210,8 @@ class Oauth:
|
||||||
self.core.page().mainFrame().evaluateJavaScript(script)
|
self.core.page().mainFrame().evaluateJavaScript(script)
|
||||||
|
|
||||||
def hide(self):
|
def hide(self):
|
||||||
self.auth_view.hide()
|
if hasattr(self, "auth_view"):
|
||||||
|
self.auth_view.hide()
|
||||||
|
|
||||||
|
|
||||||
class Login(QtGui.QDialog):
|
class Login(QtGui.QDialog):
|
||||||
|
|
|
@ -53,11 +53,11 @@
|
||||||
forEventClass:kInternetEventClass
|
forEventClass:kInternetEventClass
|
||||||
andEventID:kAEGetURL];
|
andEventID:kAEGetURL];
|
||||||
|
|
||||||
|
|
||||||
viewDelegate = [[ViewDelegate alloc] init];
|
viewDelegate = [[ViewDelegate alloc] init];
|
||||||
|
|
||||||
|
|
||||||
accessToken = [[AccessToken alloc] init];
|
accessToken = [[AccessToken alloc] init];
|
||||||
|
|
||||||
|
|
||||||
//[accessToken setString:nil forKey:@"user_access_token"];
|
//[accessToken setString:nil forKey:@"user_access_token"];
|
||||||
if (![accessToken stringForKey:@"version-0.2.0-new-login"]) {
|
if (![accessToken stringForKey:@"version-0.2.0-new-login"]) {
|
||||||
[self logout:self];
|
[self logout:self];
|
||||||
|
@ -74,6 +74,7 @@
|
||||||
[timelineViewWindow performClose:self];
|
[timelineViewWindow performClose:self];
|
||||||
[mentionsViewWindow performClose:self];
|
[mentionsViewWindow performClose:self];
|
||||||
[self.loginViewWindow makeKeyAndOrderFront:self];
|
[self.loginViewWindow makeKeyAndOrderFront:self];
|
||||||
|
[self initOauth];
|
||||||
} else {
|
} else {
|
||||||
[timelineViewWindow makeKeyAndOrderFront:self];
|
[timelineViewWindow makeKeyAndOrderFront:self];
|
||||||
[self initWebViews];
|
[self initWebViews];
|
||||||
|
@ -104,15 +105,17 @@
|
||||||
//[oauthView stringByEvaluatingJavaScriptFromString:@"function HostAppGo() { start('oauth'); };"];
|
//[oauthView stringByEvaluatingJavaScriptFromString:@"function HostAppGo() { start('oauth'); };"];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
[oauthView stringByEvaluatingJavaScriptFromString:@"start('oauth');"];
|
//[oauthView stringByEvaluatingJavaScriptFromString:@"start('oauth');"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)initWebViews
|
- (void)initWebViews
|
||||||
{
|
{
|
||||||
|
|
||||||
if (YES) //viewDelegate.timelineView != timelineView)
|
if (viewDelegate.timelineView != timelineView)
|
||||||
{
|
{
|
||||||
|
[self initOauth];
|
||||||
|
|
||||||
NSString *localStoragePath = @"~/Library/Application Support/Tentia";
|
NSString *localStoragePath = @"~/Library/Application Support/Tentia";
|
||||||
|
|
||||||
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Webkit/"];
|
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Webkit/"];
|
||||||
|
@ -409,7 +412,7 @@
|
||||||
{
|
{
|
||||||
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]];
|
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]];
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
- (void)storeAccessToken:(NSString *)_accessToken secret:(NSString *)secret userId:(NSString *)userId andScreenName:(NSString *)screenName
|
- (void)storeAccessToken:(NSString *)_accessToken secret:(NSString *)secret userId:(NSString *)userId andScreenName:(NSString *)screenName
|
||||||
{
|
{
|
||||||
self.accessToken.accessToken = _accessToken;
|
self.accessToken.accessToken = _accessToken;
|
||||||
|
@ -419,12 +422,14 @@
|
||||||
[timelineViewWindow makeKeyAndOrderFront:self];
|
[timelineViewWindow makeKeyAndOrderFront:self];
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"authentificationSucceded" object:nil];
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"authentificationSucceded" object:nil];
|
||||||
}
|
}*/
|
||||||
|
|
||||||
- (void)loggedIn
|
- (void)loggedIn
|
||||||
{
|
{
|
||||||
|
[loginActivityIndicator stopAnimation:self];
|
||||||
|
[self initWebViews];
|
||||||
|
[loginViewWindow performClose:self];
|
||||||
[timelineViewWindow makeKeyAndOrderFront:self];
|
[timelineViewWindow makeKeyAndOrderFront:self];
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"authentificationSucceded" object:nil];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)login:(id)sender
|
- (IBAction)login:(id)sender
|
||||||
|
@ -432,32 +437,22 @@
|
||||||
if ([[loginEntityTextField stringValue] length] > 0) {
|
if ([[loginEntityTextField stringValue] length] > 0) {
|
||||||
[[loginEntityTextField window] makeFirstResponder:nil];
|
[[loginEntityTextField window] makeFirstResponder:nil];
|
||||||
[loginActivityIndicator startAnimation:self];
|
[loginActivityIndicator startAnimation:self];
|
||||||
[self initOauth];
|
[oauthView stringByEvaluatingJavaScriptFromString:@"tentia_instance.authenticate();"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)logout:(id)sender
|
- (IBAction)logout:(id)sender
|
||||||
{
|
{
|
||||||
|
[oauthView stringByEvaluatingJavaScriptFromString:@"tentia_instance.logout();"];
|
||||||
|
|
||||||
[timelineViewWindow performClose:self];
|
[timelineViewWindow performClose:self];
|
||||||
[mentionsViewWindow performClose:self];
|
[mentionsViewWindow performClose:self];
|
||||||
|
[conversationViewWindow performClose:self];
|
||||||
|
[profileViewWindow performClose:self];
|
||||||
[self.loginViewWindow makeKeyAndOrderFront:self];
|
[self.loginViewWindow makeKeyAndOrderFront:self];
|
||||||
|
|
||||||
[timelineView stringByEvaluatingJavaScriptFromString:@"tentia_instance.logout();"];
|
[timelineView stringByEvaluatingJavaScriptFromString:@"tentia_instance.logout();"];
|
||||||
[mentionsView stringByEvaluatingJavaScriptFromString:@"tentia_instance.logout();"];
|
[mentionsView stringByEvaluatingJavaScriptFromString:@"tentia_instance.logout();"];
|
||||||
if (oauthView) {
|
|
||||||
[oauthView stringByEvaluatingJavaScriptFromString:@"tentia_instance.logout();"];
|
|
||||||
}
|
|
||||||
|
|
||||||
[accessToken setString:nil forKey:@"app_mac_key"];
|
|
||||||
[accessToken setString:nil forKey:@"app_mac_key_id"];
|
|
||||||
[accessToken setString:nil forKey:@"app_id"];
|
|
||||||
[accessToken setString:nil forKey:@"app_mac_algorithm"];
|
|
||||||
[accessToken setString:nil forKey:@"user_access_token"];
|
|
||||||
[accessToken setString:nil forKey:@"user_mac_key"];
|
|
||||||
[accessToken setString:nil forKey:@"user_mac_algorithm"];
|
|
||||||
[accessToken setString:nil forKey:@"user_token_type"];
|
|
||||||
[accessToken setString:nil forKey:@"api_root"];
|
|
||||||
[accessToken setString:nil forKey:@"entity"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mentions window has been visible
|
// Mentions window has been visible
|
||||||
|
|
|
@ -859,7 +859,6 @@
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrameSize">{397, 581}</string>
|
<string key="NSFrameSize">{397, 581}</string>
|
||||||
<reference key="NSSuperview" ref="332867700"/>
|
<reference key="NSSuperview" ref="332867700"/>
|
||||||
<reference key="NSWindow"/>
|
|
||||||
<reference key="NSNextKeyView"/>
|
<reference key="NSNextKeyView"/>
|
||||||
<string key="FrameName"/>
|
<string key="FrameName"/>
|
||||||
<string key="GroupName"/>
|
<string key="GroupName"/>
|
||||||
|
@ -879,7 +878,6 @@
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrameSize">{397, 581}</string>
|
<string key="NSFrameSize">{397, 581}</string>
|
||||||
<reference key="NSSuperview"/>
|
<reference key="NSSuperview"/>
|
||||||
<reference key="NSWindow"/>
|
|
||||||
<reference key="NSNextKeyView" ref="690752143"/>
|
<reference key="NSNextKeyView" ref="690752143"/>
|
||||||
</object>
|
</object>
|
||||||
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
|
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
|
||||||
|
@ -930,7 +928,6 @@
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrameSize">{376, 581}</string>
|
<string key="NSFrameSize">{376, 581}</string>
|
||||||
<reference key="NSSuperview" ref="438898709"/>
|
<reference key="NSSuperview" ref="438898709"/>
|
||||||
<reference key="NSWindow"/>
|
|
||||||
<reference key="NSNextKeyView"/>
|
<reference key="NSNextKeyView"/>
|
||||||
<string key="FrameName"/>
|
<string key="FrameName"/>
|
||||||
<string key="GroupName"/>
|
<string key="GroupName"/>
|
||||||
|
@ -948,7 +945,6 @@
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrameSize">{376, 581}</string>
|
<string key="NSFrameSize">{376, 581}</string>
|
||||||
<reference key="NSSuperview"/>
|
<reference key="NSSuperview"/>
|
||||||
<reference key="NSWindow"/>
|
|
||||||
<reference key="NSNextKeyView" ref="126069112"/>
|
<reference key="NSNextKeyView" ref="126069112"/>
|
||||||
</object>
|
</object>
|
||||||
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
|
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
|
||||||
|
@ -996,7 +992,6 @@
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrameSize">{376, 581}</string>
|
<string key="NSFrameSize">{376, 581}</string>
|
||||||
<reference key="NSSuperview" ref="469460548"/>
|
<reference key="NSSuperview" ref="469460548"/>
|
||||||
<reference key="NSWindow"/>
|
|
||||||
<reference key="NSNextKeyView"/>
|
<reference key="NSNextKeyView"/>
|
||||||
<string key="FrameName"/>
|
<string key="FrameName"/>
|
||||||
<string key="GroupName"/>
|
<string key="GroupName"/>
|
||||||
|
@ -1007,7 +1002,6 @@
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrameSize">{376, 581}</string>
|
<string key="NSFrameSize">{376, 581}</string>
|
||||||
<reference key="NSSuperview"/>
|
<reference key="NSSuperview"/>
|
||||||
<reference key="NSWindow"/>
|
|
||||||
<reference key="NSNextKeyView" ref="352293288"/>
|
<reference key="NSNextKeyView" ref="352293288"/>
|
||||||
</object>
|
</object>
|
||||||
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
|
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
|
||||||
|
@ -1055,7 +1049,6 @@
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrameSize">{376, 581}</string>
|
<string key="NSFrameSize">{376, 581}</string>
|
||||||
<reference key="NSSuperview" ref="352860314"/>
|
<reference key="NSSuperview" ref="352860314"/>
|
||||||
<reference key="NSWindow"/>
|
|
||||||
<reference key="NSNextKeyView"/>
|
<reference key="NSNextKeyView"/>
|
||||||
<string key="FrameName"/>
|
<string key="FrameName"/>
|
||||||
<string key="GroupName"/>
|
<string key="GroupName"/>
|
||||||
|
@ -1066,7 +1059,6 @@
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrameSize">{376, 581}</string>
|
<string key="NSFrameSize">{376, 581}</string>
|
||||||
<reference key="NSSuperview"/>
|
<reference key="NSSuperview"/>
|
||||||
<reference key="NSWindow"/>
|
|
||||||
<reference key="NSNextKeyView" ref="106985301"/>
|
<reference key="NSNextKeyView" ref="106985301"/>
|
||||||
</object>
|
</object>
|
||||||
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
|
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
|
||||||
|
@ -1084,7 +1076,7 @@
|
||||||
<nil key="NSViewClass"/>
|
<nil key="NSViewClass"/>
|
||||||
<nil key="NSUserInterfaceItemIdentifier"/>
|
<nil key="NSUserInterfaceItemIdentifier"/>
|
||||||
<object class="NSView" key="NSWindowView" id="503676418">
|
<object class="NSView" key="NSWindowView" id="503676418">
|
||||||
<nil key="NSNextResponder"/>
|
<reference key="NSNextResponder"/>
|
||||||
<int key="NSvFlags">256</int>
|
<int key="NSvFlags">256</int>
|
||||||
<object class="NSMutableArray" key="NSSubviews">
|
<object class="NSMutableArray" key="NSSubviews">
|
||||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
@ -1105,6 +1097,7 @@
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrame">{{20, 20}, {146, 146}}</string>
|
<string key="NSFrame">{{20, 20}, {146, 146}}</string>
|
||||||
<reference key="NSSuperview" ref="503676418"/>
|
<reference key="NSSuperview" ref="503676418"/>
|
||||||
|
<reference key="NSWindow"/>
|
||||||
<reference key="NSNextKeyView" ref="215157023"/>
|
<reference key="NSNextKeyView" ref="215157023"/>
|
||||||
<bool key="NSEnabled">YES</bool>
|
<bool key="NSEnabled">YES</bool>
|
||||||
<object class="NSImageCell" key="NSCell" id="266676500">
|
<object class="NSImageCell" key="NSCell" id="266676500">
|
||||||
|
@ -1127,6 +1120,7 @@
|
||||||
<int key="NSvFlags">268</int>
|
<int key="NSvFlags">268</int>
|
||||||
<string key="NSFrame">{{194, 82}, {266, 22}}</string>
|
<string key="NSFrame">{{194, 82}, {266, 22}}</string>
|
||||||
<reference key="NSSuperview" ref="503676418"/>
|
<reference key="NSSuperview" ref="503676418"/>
|
||||||
|
<reference key="NSWindow"/>
|
||||||
<reference key="NSNextKeyView" ref="1063247419"/>
|
<reference key="NSNextKeyView" ref="1063247419"/>
|
||||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||||
<bool key="NSEnabled">YES</bool>
|
<bool key="NSEnabled">YES</bool>
|
||||||
|
@ -1173,6 +1167,7 @@
|
||||||
<int key="NSvFlags">268</int>
|
<int key="NSvFlags">268</int>
|
||||||
<string key="NSFrame">{{191, 112}, {163, 17}}</string>
|
<string key="NSFrame">{{191, 112}, {163, 17}}</string>
|
||||||
<reference key="NSSuperview" ref="503676418"/>
|
<reference key="NSSuperview" ref="503676418"/>
|
||||||
|
<reference key="NSWindow"/>
|
||||||
<reference key="NSNextKeyView" ref="643973685"/>
|
<reference key="NSNextKeyView" ref="643973685"/>
|
||||||
<string key="NSReuseIdentifierKey">_NS:1535</string>
|
<string key="NSReuseIdentifierKey">_NS:1535</string>
|
||||||
<bool key="NSEnabled">YES</bool>
|
<bool key="NSEnabled">YES</bool>
|
||||||
|
@ -1206,6 +1201,7 @@
|
||||||
<int key="NSvFlags">268</int>
|
<int key="NSvFlags">268</int>
|
||||||
<string key="NSFrame">{{391, 46}, {75, 32}}</string>
|
<string key="NSFrame">{{391, 46}, {75, 32}}</string>
|
||||||
<reference key="NSSuperview" ref="503676418"/>
|
<reference key="NSSuperview" ref="503676418"/>
|
||||||
|
<reference key="NSWindow"/>
|
||||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||||
<bool key="NSEnabled">YES</bool>
|
<bool key="NSEnabled">YES</bool>
|
||||||
<object class="NSButtonCell" key="NSCell" id="54847478">
|
<object class="NSButtonCell" key="NSCell" id="54847478">
|
||||||
|
@ -1229,6 +1225,7 @@
|
||||||
<int key="NSvFlags">268</int>
|
<int key="NSvFlags">268</int>
|
||||||
<string key="NSFrame">{{373, 55}, {16, 16}}</string>
|
<string key="NSFrame">{{373, 55}, {16, 16}}</string>
|
||||||
<reference key="NSSuperview" ref="503676418"/>
|
<reference key="NSSuperview" ref="503676418"/>
|
||||||
|
<reference key="NSWindow"/>
|
||||||
<reference key="NSNextKeyView" ref="251531186"/>
|
<reference key="NSNextKeyView" ref="251531186"/>
|
||||||
<string key="NSReuseIdentifierKey">_NS:945</string>
|
<string key="NSReuseIdentifierKey">_NS:945</string>
|
||||||
<int key="NSpiFlags">28938</int>
|
<int key="NSpiFlags">28938</int>
|
||||||
|
@ -1236,6 +1233,8 @@
|
||||||
</object>
|
</object>
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrameSize">{480, 186}</string>
|
<string key="NSFrameSize">{480, 186}</string>
|
||||||
|
<reference key="NSSuperview"/>
|
||||||
|
<reference key="NSWindow"/>
|
||||||
<reference key="NSNextKeyView" ref="433812480"/>
|
<reference key="NSNextKeyView" ref="433812480"/>
|
||||||
<string key="NSReuseIdentifierKey">_NS:20</string>
|
<string key="NSReuseIdentifierKey">_NS:20</string>
|
||||||
</object>
|
</object>
|
||||||
|
@ -1651,14 +1650,6 @@
|
||||||
</object>
|
</object>
|
||||||
<int key="connectionID">606</int>
|
<int key="connectionID">606</int>
|
||||||
</object>
|
</object>
|
||||||
<object class="IBConnectionRecord">
|
|
||||||
<object class="IBActionConnection" key="connection">
|
|
||||||
<string key="label">login:</string>
|
|
||||||
<reference key="source" ref="408500656"/>
|
|
||||||
<reference key="destination" ref="643973685"/>
|
|
||||||
</object>
|
|
||||||
<int key="connectionID">609</int>
|
|
||||||
</object>
|
|
||||||
<object class="IBConnectionRecord">
|
<object class="IBConnectionRecord">
|
||||||
<object class="IBActionConnection" key="connection">
|
<object class="IBActionConnection" key="connection">
|
||||||
<string key="label">logout:</string>
|
<string key="label">logout:</string>
|
||||||
|
@ -1731,6 +1722,14 @@
|
||||||
</object>
|
</object>
|
||||||
<int key="connectionID">665</int>
|
<int key="connectionID">665</int>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="IBConnectionRecord">
|
||||||
|
<object class="IBActionConnection" key="connection">
|
||||||
|
<string key="label">login:</string>
|
||||||
|
<reference key="source" ref="408500656"/>
|
||||||
|
<reference key="destination" ref="643973685"/>
|
||||||
|
</object>
|
||||||
|
<int key="connectionID">666</int>
|
||||||
|
</object>
|
||||||
<object class="IBConnectionRecord">
|
<object class="IBConnectionRecord">
|
||||||
<object class="IBActionConnection" key="connection">
|
<object class="IBActionConnection" key="connection">
|
||||||
<string key="label">makeKeyAndOrderFront:</string>
|
<string key="label">makeKeyAndOrderFront:</string>
|
||||||
|
@ -2883,7 +2882,7 @@
|
||||||
<reference key="dict.values" ref="0"/>
|
<reference key="dict.values" ref="0"/>
|
||||||
</object>
|
</object>
|
||||||
<nil key="sourceID"/>
|
<nil key="sourceID"/>
|
||||||
<int key="maxID">665</int>
|
<int key="maxID">666</int>
|
||||||
</object>
|
</object>
|
||||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||||
|
@ -2898,12 +2897,18 @@
|
||||||
<string>clearCache:</string>
|
<string>clearCache:</string>
|
||||||
<string>login:</string>
|
<string>login:</string>
|
||||||
<string>logout:</string>
|
<string>logout:</string>
|
||||||
|
<string>openNewMessageWindow:</string>
|
||||||
|
<string>sendTweet:</string>
|
||||||
|
<string>showConversationForPostId:andEntity:</string>
|
||||||
</object>
|
</object>
|
||||||
<object class="NSArray" key="dict.values">
|
<object class="NSArray" key="dict.values">
|
||||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
<string>id</string>
|
<string>id</string>
|
||||||
<string>id</string>
|
<string>id</string>
|
||||||
<string>id</string>
|
<string>id</string>
|
||||||
|
<string>id</string>
|
||||||
|
<string>id</string>
|
||||||
|
<string>NSString</string>
|
||||||
</object>
|
</object>
|
||||||
</object>
|
</object>
|
||||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||||
|
@ -2913,6 +2918,9 @@
|
||||||
<string>clearCache:</string>
|
<string>clearCache:</string>
|
||||||
<string>login:</string>
|
<string>login:</string>
|
||||||
<string>logout:</string>
|
<string>logout:</string>
|
||||||
|
<string>openNewMessageWindow:</string>
|
||||||
|
<string>sendTweet:</string>
|
||||||
|
<string>showConversationForPostId:andEntity:</string>
|
||||||
</object>
|
</object>
|
||||||
<object class="NSArray" key="dict.values">
|
<object class="NSArray" key="dict.values">
|
||||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
@ -2928,6 +2936,18 @@
|
||||||
<string key="name">logout:</string>
|
<string key="name">logout:</string>
|
||||||
<string key="candidateClassName">id</string>
|
<string key="candidateClassName">id</string>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="IBActionInfo">
|
||||||
|
<string key="name">openNewMessageWindow:</string>
|
||||||
|
<string key="candidateClassName">id</string>
|
||||||
|
</object>
|
||||||
|
<object class="IBActionInfo">
|
||||||
|
<string key="name">sendTweet:</string>
|
||||||
|
<string key="candidateClassName">id</string>
|
||||||
|
</object>
|
||||||
|
<object class="IBActionInfo">
|
||||||
|
<string key="name">showConversationForPostId:andEntity:</string>
|
||||||
|
<string key="candidateClassName">NSString</string>
|
||||||
|
</object>
|
||||||
</object>
|
</object>
|
||||||
</object>
|
</object>
|
||||||
<object class="NSMutableDictionary" key="outlets">
|
<object class="NSMutableDictionary" key="outlets">
|
||||||
|
|
|
@ -164,6 +164,7 @@
|
||||||
<string key="NSFrame">{{258, 2}, {38, 16}}</string>
|
<string key="NSFrame">{{258, 2}, {38, 16}}</string>
|
||||||
<reference key="NSSuperview" ref="568628114"/>
|
<reference key="NSSuperview" ref="568628114"/>
|
||||||
<reference key="NSWindow"/>
|
<reference key="NSWindow"/>
|
||||||
|
<reference key="NSNextKeyView"/>
|
||||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||||
<bool key="NSEnabled">YES</bool>
|
<bool key="NSEnabled">YES</bool>
|
||||||
<object class="NSButtonCell" key="NSCell" id="978913593">
|
<object class="NSButtonCell" key="NSCell" id="978913593">
|
||||||
|
@ -241,15 +242,23 @@
|
||||||
<string key="NSTitle">Add current location</string>
|
<string key="NSTitle">Add current location</string>
|
||||||
<string key="NSKeyEquiv"/>
|
<string key="NSKeyEquiv"/>
|
||||||
<int key="NSMnemonicLoc">2147483647</int>
|
<int key="NSMnemonicLoc">2147483647</int>
|
||||||
<object class="NSCustomResource" key="NSOnImage">
|
<object class="NSCustomResource" key="NSOnImage" id="214786272">
|
||||||
<string key="NSClassName">NSImage</string>
|
<string key="NSClassName">NSImage</string>
|
||||||
<string key="NSResourceName">NSMenuCheckmark</string>
|
<string key="NSResourceName">NSMenuCheckmark</string>
|
||||||
</object>
|
</object>
|
||||||
<object class="NSCustomResource" key="NSMixedImage">
|
<object class="NSCustomResource" key="NSMixedImage" id="781262773">
|
||||||
<string key="NSClassName">NSImage</string>
|
<string key="NSClassName">NSImage</string>
|
||||||
<string key="NSResourceName">NSMenuMixedState</string>
|
<string key="NSResourceName">NSMenuMixedState</string>
|
||||||
</object>
|
</object>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="NSMenuItem" id="923327489">
|
||||||
|
<reference key="NSMenu" ref="723763594"/>
|
||||||
|
<string key="NSTitle">Add photo</string>
|
||||||
|
<string key="NSKeyEquiv"/>
|
||||||
|
<int key="NSMnemonicLoc">2147483647</int>
|
||||||
|
<reference key="NSOnImage" ref="214786272"/>
|
||||||
|
<reference key="NSMixedImage" ref="781262773"/>
|
||||||
|
</object>
|
||||||
</object>
|
</object>
|
||||||
</object>
|
</object>
|
||||||
<object class="NSButton" id="108971841">
|
<object class="NSButton" id="108971841">
|
||||||
|
@ -422,6 +431,14 @@ A</bytes>
|
||||||
</object>
|
</object>
|
||||||
<int key="connectionID">100080</int>
|
<int key="connectionID">100080</int>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="IBConnectionRecord">
|
||||||
|
<object class="IBActionConnection" key="connection">
|
||||||
|
<string key="label">addImage:</string>
|
||||||
|
<reference key="source" ref="512844837"/>
|
||||||
|
<reference key="destination" ref="923327489"/>
|
||||||
|
</object>
|
||||||
|
<int key="connectionID">100083</int>
|
||||||
|
</object>
|
||||||
<object class="IBConnectionRecord">
|
<object class="IBConnectionRecord">
|
||||||
<object class="IBOutletConnection" key="connection">
|
<object class="IBOutletConnection" key="connection">
|
||||||
<string key="label">delegate</string>
|
<string key="label">delegate</string>
|
||||||
|
@ -539,6 +556,7 @@ A</bytes>
|
||||||
<object class="NSMutableArray" key="children">
|
<object class="NSMutableArray" key="children">
|
||||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
<reference ref="921309347"/>
|
<reference ref="921309347"/>
|
||||||
|
<reference ref="923327489"/>
|
||||||
</object>
|
</object>
|
||||||
<reference key="parent" ref="0"/>
|
<reference key="parent" ref="0"/>
|
||||||
</object>
|
</object>
|
||||||
|
@ -589,6 +607,11 @@ A</bytes>
|
||||||
<reference key="object" ref="28505796"/>
|
<reference key="object" ref="28505796"/>
|
||||||
<reference key="parent" ref="908286488"/>
|
<reference key="parent" ref="908286488"/>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="IBObjectRecord">
|
||||||
|
<int key="objectID">100081</int>
|
||||||
|
<reference key="object" ref="923327489"/>
|
||||||
|
<reference key="parent" ref="723763594"/>
|
||||||
|
</object>
|
||||||
</object>
|
</object>
|
||||||
</object>
|
</object>
|
||||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||||
|
@ -612,6 +635,7 @@ A</bytes>
|
||||||
<string>100066.IBPluginDependency</string>
|
<string>100066.IBPluginDependency</string>
|
||||||
<string>100074.IBPluginDependency</string>
|
<string>100074.IBPluginDependency</string>
|
||||||
<string>100075.IBPluginDependency</string>
|
<string>100075.IBPluginDependency</string>
|
||||||
|
<string>100081.IBPluginDependency</string>
|
||||||
<string>5.IBPluginDependency</string>
|
<string>5.IBPluginDependency</string>
|
||||||
<string>5.IBWindowTemplateEditedContentRect</string>
|
<string>5.IBWindowTemplateEditedContentRect</string>
|
||||||
<string>6.IBPluginDependency</string>
|
<string>6.IBPluginDependency</string>
|
||||||
|
@ -636,6 +660,7 @@ A</bytes>
|
||||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
<string>{{127, 736}, {299, 113}}</string>
|
<string>{{127, 736}, {299, 113}}</string>
|
||||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
</object>
|
</object>
|
||||||
|
@ -652,7 +677,7 @@ A</bytes>
|
||||||
<reference key="dict.values" ref="0"/>
|
<reference key="dict.values" ref="0"/>
|
||||||
</object>
|
</object>
|
||||||
<nil key="sourceID"/>
|
<nil key="sourceID"/>
|
||||||
<int key="maxID">100080</int>
|
<int key="maxID">100083</int>
|
||||||
</object>
|
</object>
|
||||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||||
|
|
|
@ -14,6 +14,8 @@ function(HostApp, Core, Paths, URI) {
|
||||||
|
|
||||||
this.action = "conversation";
|
this.action = "conversation";
|
||||||
|
|
||||||
|
document.body.innerHTML = "";
|
||||||
|
|
||||||
this.body = document.createElement("ol");
|
this.body = document.createElement("ol");
|
||||||
this.body.className = this.action;
|
this.body.className = this.action;
|
||||||
document.body.appendChild(this.body);
|
document.body.appendChild(this.body);
|
||||||
|
|
|
@ -9,7 +9,7 @@ function(HostApp, Paths, Hmac) {
|
||||||
function Oauth() {
|
function Oauth() {
|
||||||
this.app_info = {
|
this.app_info = {
|
||||||
"id": null,
|
"id": null,
|
||||||
"name": "Tentia",
|
"name": "Tentia on " + HostApp.osType(),
|
||||||
"description": "A small TentStatus client.",
|
"description": "A small TentStatus client.",
|
||||||
"url": "http://jabs.nu/Tentia/",
|
"url": "http://jabs.nu/Tentia/",
|
||||||
"icon": "http://jabs.nu/Tentia/icon.png",
|
"icon": "http://jabs.nu/Tentia/icon.png",
|
||||||
|
@ -32,6 +32,10 @@ function(HostApp, Paths, Hmac) {
|
||||||
this.state = null;
|
this.state = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Oauth.prototype.isAuthenticated = function() {
|
||||||
|
return HostApp.stringForKey("user_access_token") != null;
|
||||||
|
}
|
||||||
|
|
||||||
Oauth.prototype.authenticate = function() {
|
Oauth.prototype.authenticate = function() {
|
||||||
|
|
||||||
var entity = HostApp.stringForKey("entity");
|
var entity = HostApp.stringForKey("entity");
|
||||||
|
@ -153,7 +157,28 @@ function(HostApp, Paths, Hmac) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Oauth.prototype.logout = function() {
|
Oauth.prototype.logout = function() {
|
||||||
return false;
|
|
||||||
|
var url = Paths.mkApiRootPath("/apps/" + HostApp.stringForKey("app_id"));
|
||||||
|
var http_method = "DELETE";
|
||||||
|
var auth_header = Hmac.makeAuthHeader(
|
||||||
|
url,
|
||||||
|
http_method,
|
||||||
|
HostApp.stringForKey("app_mac_key"),
|
||||||
|
HostApp.stringForKey("app_mac_key_id")
|
||||||
|
);
|
||||||
|
|
||||||
|
Paths.getURL(url, http_method, function(resp) {
|
||||||
|
HostApp.setStringForKey(null, "app_mac_key");
|
||||||
|
HostApp.setStringForKey(null, "app_mac_key_id");
|
||||||
|
HostApp.setStringForKey(null, "app_id");
|
||||||
|
HostApp.setStringForKey(null, "app_mac_algorithm");
|
||||||
|
HostApp.setStringForKey(null, "user_access_token");
|
||||||
|
HostApp.setStringForKey(null, "user_mac_key");
|
||||||
|
HostApp.setStringForKey(null, "user_mac_algorithm");
|
||||||
|
HostApp.setStringForKey(null, "user_token_type");
|
||||||
|
HostApp.setStringForKey(null, "api_root");
|
||||||
|
HostApp.setStringForKey(null, "entity");
|
||||||
|
}, null, auth_header);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@ function(HostApp, Core, Paths, URI) {
|
||||||
|
|
||||||
this.action = "profile";
|
this.action = "profile";
|
||||||
|
|
||||||
|
document.body.innerHTML = "";
|
||||||
|
|
||||||
this.initProfileTemplate();
|
this.initProfileTemplate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,6 +148,11 @@ function(Core, Paths, HostApp, URI) {
|
||||||
Core.prototype.repost.call(this, id, entity, callback);
|
Core.prototype.repost.call(this, id, entity, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timeline.prototype.logout = function() {
|
||||||
|
clearInterval(this.reloadIntervall);
|
||||||
|
Core.prototype.logout.call(this);
|
||||||
|
}
|
||||||
|
|
||||||
return Timeline;
|
return Timeline;
|
||||||
|
|
||||||
});
|
});
|
|
@ -117,6 +117,10 @@ define(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HostApp.osType = function() {
|
||||||
|
return OS_TYPE == "mac" ? "OS X" : "Linux";
|
||||||
|
}
|
||||||
|
|
||||||
return HostApp;
|
return HostApp;
|
||||||
|
|
||||||
});
|
});
|
|
@ -11,7 +11,6 @@ function start(view) {
|
||||||
require(["controller/Oauth"], function(Oauth) {
|
require(["controller/Oauth"], function(Oauth) {
|
||||||
|
|
||||||
tentia_instance = new Oauth();
|
tentia_instance = new Oauth();
|
||||||
tentia_instance.authenticate();
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Reference in a new issue