From 3e6e0fa124a0a8ac8c9bbbd67165903f6ce00fb5 Mon Sep 17 00:00:00 2001 From: jeena Date: Tue, 9 Apr 2013 18:42:11 +0200 Subject: [PATCH] fixed #216 --- WebKit/scripts/controller/Search.js | 2 +- WebKit/scripts/helper/Core.js | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/WebKit/scripts/controller/Search.js b/WebKit/scripts/controller/Search.js index 62b19a5..a8e23b6 100644 --- a/WebKit/scripts/controller/Search.js +++ b/WebKit/scripts/controller/Search.js @@ -23,7 +23,7 @@ function(HostApp, Core, Paths, URI) { this.form.className = this.action; this.input = document.createElement("input"); this.input.type = "search"; - this.input.placeholder = "Search ..."; + this.input.placeholder = "Search"; this.form.appendChild(this.input); var _this = this; diff --git a/WebKit/scripts/helper/Core.js b/WebKit/scripts/helper/Core.js index 101c125..6d987ab 100644 --- a/WebKit/scripts/helper/Core.js +++ b/WebKit/scripts/helper/Core.js @@ -287,12 +287,7 @@ function(jQuery, Paths, URI, HostApp, Cache) { } template.message.innerHTML = this.replaceURLWithHTMLLinks(text, entities, template.message); - - // adding show search on click hash - $(template.message).find("a.hash").click(function(e) { - bungloo.search.searchFor("#" + e.target.innerHTML); - return false; - }); + this.afterChangingTextinMessageHTML(template.message) if (status.type == "https://tent.io/types/post/photo/v0.1.0") { @@ -717,12 +712,8 @@ function(jQuery, Paths, URI, HostApp, Cache) { + "" ); - // adding show profile on click node.innerHTML = new_text; - $(node).find("a.name").click(function(e) { - HostApp.showProfileForEntity(e.target.title); - return false; - }); + _this.afterChangingTextinMessageHTML(node); // adding comma between names when there is only // a space in between. @@ -1000,6 +991,20 @@ function(jQuery, Paths, URI, HostApp, Cache) { $(images).append(''); } + Core.prototype.afterChangingTextinMessageHTML = function(message_node) { + // adding show search on click hash + $(message_node).find("a.hash").click(function(e) { + bungloo.search.searchFor(e.target.innerHTML); + return false; + }); + + // adding show profile on click + $(message_node).find("a.name").click(function(e) { + HostApp.showProfileForEntity(e.target.title); + return false; + }); + } + return Core;