facelift new post mentions

This commit is contained in:
jeena 2013-07-25 17:27:32 +02:00
parent 1c12e5b375
commit 096916395b
3 changed files with 12 additions and 11 deletions

View file

@ -192,7 +192,7 @@ function(APICalls, HostApp) {
var words = txt.match(/(^|\s)\^([^\s]+)/);
var replace = words[2];
var original = txt.replace("^" + replace, with_item.name);
var original = txt.replace("^" + replace, with_item.name + " ");
this.textarea.val(original);
this.mentions.push(with_item);
@ -209,11 +209,12 @@ function(APICalls, HostApp) {
for (var key in this.profiles) {
var item = this.profiles[key];
if((item.name.toLowerCase().indexOf(name.toLowerCase()) != -1) || item.entity.toLowerCase().indexOf(name.toLowerCase()) != -1) {
var li = $("<li><strong>" + item.name + "</strong> <em>" + item.entity + "</em></li>")
var li = $("<li><strong title='" + item.entity + "'>" + item.name + "</strong></li>")
li.get(0).item = item;
this.suggestions.append(li);
}
}
this.suggestions.find("li:first-child").addClass("active");
}
this.parseText(text);

View file

@ -110,11 +110,7 @@ function(HostApp, Core, APICalls, URI) {
div.appendChild(this.profile_template.following_button);
this.profile_template.mention_button.onclick = function() {
var e = _this.entity;
if (e.startsWith("https://")) {
e = e.substr(8, e.length);
}
HostApp.openNewMessageWidow(null, null, "^" + e + " ", false);
HostApp.openNewMessageWidow({entity:_this.entity});
}
div.appendChild(this.profile_template.mention_button);
this.profile_template.mention_button.innerHTML = "Mention";