diff --git a/.gitignore b/.gitignore index b87be8a..07938ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -build/ -Tentia.xcodeproj/project.xcworkspace/xcuserdata/jeena.xcuserdatad/UserInterfaceState.xcuserstate +Mac/build/ +Mac/Tentia.xcodeproj/project.xcworkspace/xcuserdata/jeena.xcuserdatad/UserInterfaceState.xcuserstate dsa_priv.pem diff --git a/Mac/Tentia.xcodeproj/project.xcworkspace/xcuserdata/jeena.xcuserdatad/UserInterfaceState.xcuserstate b/Mac/Tentia.xcodeproj/project.xcworkspace/xcuserdata/jeena.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index ad1b909..0000000 Binary files a/Mac/Tentia.xcodeproj/project.xcworkspace/xcuserdata/jeena.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/WebKit/scripts/controller/Mentions.js b/WebKit/scripts/controller/Mentions.js index b44fe50..af86c6c 100644 --- a/WebKit/scripts/controller/Mentions.js +++ b/WebKit/scripts/controller/Mentions.js @@ -9,10 +9,12 @@ function(HostApp, Timeline) { function Mentions() { this.is_not_init = false; - this.action = "mentions"; this.unread_mentions = 0; Timeline.call(this); + + this.action = "mentions"; + this.body.className = this.action; } Mentions.prototype = Object.create(Timeline.prototype); @@ -21,16 +23,16 @@ function(HostApp, Timeline) { Timeline.prototype.newStatus.call(this, status); - if(this.action == "mentions" && this.is_not_init) { + if(this.is_not_init) { this.unread_mentions += status.length; HostApp.unreadMentions(this.unread_mentions); } this.is_not_init = true; - } Mentions.prototype.getNewData = function(add_to_search) { + add_to_search = add_to_search || {}; if (!add_to_search["mentioned_entity"]) { diff --git a/WebKit/scripts/helper/Core.js b/WebKit/scripts/helper/Core.js index 4d3cf82..c5f3eef 100644 --- a/WebKit/scripts/helper/Core.js +++ b/WebKit/scripts/helper/Core.js @@ -2,10 +2,11 @@ define([ "jquery", "helper/Paths", "lib/URI", + "helper/HostApp", "lib/vendor/jquery.plugins" ], -function(jQuery, Paths, URI) { +function(jQuery, Paths, URI, HostApp) { function Core() { @@ -122,13 +123,15 @@ function(jQuery, Paths, URI) { template.reply_to.onclick = function() { + var mentions = []; for (var i = 0; i < status.mentions.length; i++) { var mention = status.mentions[i]; if(mention.entity != HostApp.stringForKey("entity")) mentions.push(mention); } - this.replyTo(status.entity, status.id, mentions); + + _this.replyTo(status.entity, status.id, mentions); return false; } @@ -344,13 +347,14 @@ function(jQuery, Paths, URI) { return text.replace(hash, "$1$2$3"); } - Core.prototype.replyTo = function(entity, status_id, mentions) { + Core.prototype.replyTo = function(entity, status_id, mentions) { var string = "^" + entity.replace("https://", "") + " "; for (var i = 0; i < mentions.length; i++) { var e = mentions[i].entity.replace("https://", ""); if(string.indexOf(e) == -1) string += "^" + e + " "; } - controller.openNewMessageWindowInReplyTo_statusId_withString_(entity, status_id, string); + debug("a") + HostApp.openNewMessageWidow(entity, status_id, string); } return Core; diff --git a/WebKit/scripts/helper/HostApp.js b/WebKit/scripts/helper/HostApp.js index a5c864b..0403b72 100644 --- a/WebKit/scripts/helper/HostApp.js +++ b/WebKit/scripts/helper/HostApp.js @@ -3,6 +3,7 @@ define(function() { var HostApp = {}; HostApp.setStringForKey = function(string, key) { + if (OS_TYPE == "mac") { controller.setString_forKey_(string, key); } else { @@ -11,6 +12,7 @@ define(function() { } HostApp.stringForKey = function(key) { + if (OS_TYPE == "mac") { return controller.stringForKey_(key); } else { @@ -19,6 +21,7 @@ define(function() { } HostApp.openURL = function(url) { + if (OS_TYPE == "mac") { controller.openURL_(url); } else { @@ -27,10 +30,12 @@ define(function() { } HostApp.loggedIn = function() { + controller.loggedIn(); } HostApp.logout = function() { + if (OS_TYPE == "mac") { controller.logout_(self); } else { @@ -39,6 +44,7 @@ define(function() { } HostApp.unreadMentions = function(i) { + if (OS_TYPE == "mac") { controller.unreadMentions_(i); } else { @@ -46,6 +52,15 @@ define(function() { } } + HostApp.openNewMessageWidow = function(entity, status_id, string) { + + if (OS_TYPE == "mac") { + controller.openNewMessageWindowInReplyTo_statusId_withString_(entity, status_id, string); + } else { + controller.openNewMessageWindowInReplyTostatusIdwithString(entity, status_id, string); + } + } + return HostApp; }); \ No newline at end of file