This commit is contained in:
jeena 2013-04-09 18:42:11 +02:00
parent c229916bad
commit 3e6e0fa124
2 changed files with 17 additions and 12 deletions

View file

@ -23,7 +23,7 @@ function(HostApp, Core, Paths, URI) {
this.form.className = this.action; this.form.className = this.action;
this.input = document.createElement("input"); this.input = document.createElement("input");
this.input.type = "search"; this.input.type = "search";
this.input.placeholder = "Search ..."; this.input.placeholder = "Search";
this.form.appendChild(this.input); this.form.appendChild(this.input);
var _this = this; var _this = this;

View file

@ -287,12 +287,7 @@ function(jQuery, Paths, URI, HostApp, Cache) {
} }
template.message.innerHTML = this.replaceURLWithHTMLLinks(text, entities, template.message); template.message.innerHTML = this.replaceURLWithHTMLLinks(text, entities, template.message);
this.afterChangingTextinMessageHTML(template.message)
// adding show search on click hash
$(template.message).find("a.hash").click(function(e) {
bungloo.search.searchFor("#" + e.target.innerHTML);
return false;
});
if (status.type == "https://tent.io/types/post/photo/v0.1.0") { if (status.type == "https://tent.io/types/post/photo/v0.1.0") {
@ -717,12 +712,8 @@ function(jQuery, Paths, URI, HostApp, Cache) {
+ "</a>" + "</a>"
); );
// adding show profile on click
node.innerHTML = new_text; node.innerHTML = new_text;
$(node).find("a.name").click(function(e) { _this.afterChangingTextinMessageHTML(node);
HostApp.showProfileForEntity(e.target.title);
return false;
});
// adding comma between names when there is only // adding comma between names when there is only
// a space in between. // a space in between.
@ -1000,6 +991,20 @@ function(jQuery, Paths, URI, HostApp, Cache) {
$(images).append('<iframe class="soundcloud" src="https://w.soundcloud.com/player/?url=' + url + '" width="100%" height="166" scrolling="no" frameborder="no"></iframe>'); $(images).append('<iframe class="soundcloud" src="https://w.soundcloud.com/player/?url=' + url + '" width="100%" height="166" scrolling="no" frameborder="no"></iframe>');
} }
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; return Core;