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

@ -466,8 +466,12 @@ p.noresult {
#new_post_container div { box-sizing: border-box; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; background: white; color: white; padding: 2px; }
#new_post_container div span { background: #D8DFEA; }
#suggestions { position: absolute; left: 0; bottom: 0; }
#suggestions .active { color: red; }
#status_bar { height: 1em; }
#suggestions { width: 100%; position: absolute; left: 0; bottom: 0; background: #efefef; list-style-type: none; padding: 0; margin: 0; border-top: 1px solid #ccc; }
#suggestions li { border-top: 1px solid #fefefe; border-bottom: #c9c9c9; padding: 0 0.5em; }
#suggestions strong { font-weight: normal; color: #555; }
#suggestions .active { background: #dedede; }
#suggestions .active strong { color: black; }
#status_bar { height: 1em; border-top: 1px solid #ccc; }
#status_bar p { float: right; margin: 0; padding: 0; }
#status_bar span { display: inline-block; margin: 4px 5px 0 5px; }
#status_bar span { display: inline-block; margin: 4px 5px 0 5px; }

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";