diff --git a/Mac/English.lproj/MainMenu.xib b/Mac/English.lproj/MainMenu.xib index 6e9217b..a64c31f 100644 --- a/Mac/English.lproj/MainMenu.xib +++ b/Mac/English.lproj/MainMenu.xib @@ -830,7 +830,7 @@ - + 256 YES @@ -860,6 +860,7 @@ {397, 581} + @@ -867,10 +868,18 @@ 13 YES - + YES + 13WebKitJavaEnabled + 13WebKitJavaScriptCanOpenWindowsAutomatically + 13WebKitPluginsEnabled + + + YES + + + - NO @@ -878,6 +887,8 @@ {397, 581} + + {{0, 0}, {2560, 1418}} @@ -898,7 +909,7 @@ - + 256 YES @@ -928,6 +939,7 @@ {376, 581} + @@ -935,8 +947,18 @@ 12 YES - - + + YES + 12WebKitJavaEnabled + 12WebKitJavaScriptCanOpenWindowsAutomatically + 12WebKitPluginsEnabled + + + YES + + + + NO @@ -944,6 +966,8 @@ {376, 581} + + {{0, 0}, {2560, 1418}} @@ -961,7 +985,7 @@ - + 256 YES @@ -991,6 +1015,7 @@ {376, 581} + @@ -1000,6 +1025,8 @@ {376, 581} + + {{0, 0}, {2560, 1418}} @@ -1017,7 +1044,7 @@ - + 256 YES @@ -1047,6 +1074,7 @@ {376, 581} + @@ -1056,6 +1084,8 @@ {376, 581} + + {{0, 0}, {2560, 1418}} @@ -1918,7 +1948,9 @@ YES 0 - + + YES + @@ -3087,11 +3119,7 @@ clearCache: login: logout: - openNewMessageWindow: - sendPost: - showConversationForPostId:andEntity: showProfile: - showProfileForEntity: YES @@ -3099,10 +3127,6 @@ id id id - id - NSString - id - NSString @@ -3112,11 +3136,7 @@ clearCache: login: logout: - openNewMessageWindow: - sendPost: - showConversationForPostId:andEntity: showProfile: - showProfileForEntity: YES @@ -3132,26 +3152,10 @@ logout: id - - openNewMessageWindow: - id - - - sendPost: - id - - - showConversationForPostId:andEntity: - NSString - showProfile: id - - showProfileForEntity: - NSString - diff --git a/Mac/ViewDelegate.m b/Mac/ViewDelegate.m index 15b1fe9..c49b7b2 100644 --- a/Mac/ViewDelegate.m +++ b/Mac/ViewDelegate.m @@ -13,7 +13,7 @@ @synthesize timelineView, mentionsView, conversationView, profileView, oauthView; -- (void)webView:(WebView *)sender addMessageToConsole:(NSDictionary *)message;{ +- (void)webView:(WebView *)sender addMessageToConsole:(NSDictionary *)message { if (![message isKindOfClass:[NSDictionary class]]) return; @@ -51,8 +51,16 @@ } - (void)webView:(WebView *)sender decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id )listener { - [listener ignore]; - [[NSWorkspace sharedWorkspace] openURL:[request URL]]; + + NSArray *frames = [NSArray arrayWithObjects:timelineView.mainFrame, mentionsView.mainFrame, conversationView.mainFrame, oauthView.mainFrame, profileView.mainFrame, nil]; + + // If it is clicked from one of the views the open default browser + if ([frames indexOfObject:frame] != NSNotFound) { + [listener ignore]; + [[NSWorkspace sharedWorkspace] openURL:[request URL]]; + } else { // otherwies load the iframe stuff like YouTube or vimeo + [listener use]; + } } - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame { diff --git a/WebKit/css/default.css b/WebKit/css/default.css index 54c7168..25a9df3 100644 --- a/WebKit/css/default.css +++ b/WebKit/css/default.css @@ -154,10 +154,6 @@ p { box-shadow: 0 0 1px black; } -.images img.photo { - -} - .data { margin-left: 62px; } diff --git a/WebKit/scripts/helper/Core.js b/WebKit/scripts/helper/Core.js index e752533..328de69 100644 --- a/WebKit/scripts/helper/Core.js +++ b/WebKit/scripts/helper/Core.js @@ -328,14 +328,7 @@ function(jQuery, Paths, URI, HostApp, Cache) { template.geo.href = href; template.geo.style.display = ""; - var a = document.createElement("a"); - a.className = "map"; - a.href = href; - var img = document.createElement("img"); - img.src = this.mapSrc(lat, lng); - a.appendChild(img); - - template.images.appendChild(a); + this.addMap(lat, lng, template.images); } if (typeof status.__repost != "undefined") { @@ -802,7 +795,7 @@ function(jQuery, Paths, URI, HostApp, Cache) { Core.prototype.parseForMedia = function(text, images) { - var words = text.split(" "); + var words = text.split(/\s/); for (var i = 0; i < words.length; i++) { @@ -811,6 +804,7 @@ function(jQuery, Paths, URI, HostApp, Cache) { if (word.startsWith("http")) { var src = null; + var type = "img"; if (word.startsWith("http") && (word.endsWith(".jpg") || word.endsWith(".jpeg") || word.endsWith(".gif") || word.endsWith(".png"))) { @@ -819,12 +813,12 @@ function(jQuery, Paths, URI, HostApp, Cache) { } else if(word.startsWith("http://youtube.com/") || word.startsWith("http://www.youtube.com/") || word.startsWith("https://youtube.com/") || word.startsWith("https://www.youtube.com/")) { var v = Paths.getUrlVars(word)["v"]; - if (v) src = "http://img.youtube.com/vi/" + v + "/0.jpg"; + this.addYouTube(v, images); } else if (word.startsWith("http://youtu.be/") || word.startsWith("https://youtu.be/")) { var v = word.replace(/https?:\/\/youtu\.be\//, ""); - src = "http://img.youtube.com/vi/" + v + "/0.jpg"; + this.addYouTube(v, images); } else if (word.startsWith("http://twitpic.com/") || word.startsWith("https://twitpic.com/")) { @@ -850,26 +844,13 @@ function(jQuery, Paths, URI, HostApp, Cache) { } else if (word.startsWith("http://vimeo.com/") || word.startsWith("http://vimeo.com/")) { var video_id = word.replace(/https?:\/\/vimeo\.com\//, ""); - - var a = document.createElement("a"); - a.href = word; - var img = document.createElement("img"); - a.appendChild(img); - images.appendChild(a); - - $.ajax({ - type:'GET', - url: 'http://vimeo.com/api/v2/video/' + video_id + '.json', - dataType: 'json', - success: function(data) { - img.src = data[0].thumbnail_large; - } - }); + this.addVimeo(video_id, images); } if (src) { var a = document.createElement("a"); a.href = word; + a.className = type; var img = document.createElement("img"); img.src = src; a.appendChild(img); @@ -932,10 +913,29 @@ function(jQuery, Paths, URI, HostApp, Cache) { } Core.prototype.mapSrc = function(lat, lng) { - var width = $("p.message").width(); + var width = $("p.message").width(); return "http://staticmap.openstreetmap.de/staticmap.php?center=" + lat + "," + lng + "&zoom=3&size=" + width + "x75&markers=" + lat + "," + lng + ",red-pushpin"; } + Core.prototype.addMap = function(lat, lng, images) { + var a = document.createElement("a"); + a.className = "map"; + a.href = this.mapHref(lat, lng); + var img = document.createElement("img"); + img.src = this.mapSrc(lat, lng); + a.appendChild(img); + images.appendChild(a); + } + + Core.prototype.addYouTube = function(id, images) { + $(images).append(' + } + return Core;