Merge branch 'master' of github.com:r888888888/danbooru

This commit is contained in:
Toks
2015-10-04 16:57:57 -04:00
9 changed files with 70 additions and 21 deletions

View File

@@ -42,6 +42,9 @@
delay: 500,
minLength: 2,
autoFocus: true,
focus: function() {
return false;
},
select: function(event, ui) {
var before_caret_text = this.value.substring(0, this.selectionStart).replace(/\S+$/, ui.item.value + " ");
var after_caret_text = this.value.substring(this.selectionStart);

View File

@@ -155,6 +155,10 @@ a.blacklisted-active {
}
}
.ui-state-focus.ui-state-focus a.tag-type-0 {
color: white;
}
.category-1 a, a.tag-type-1, .ui-state-focus a.tag-type-1 {
color: #A00;

View File

@@ -33,17 +33,25 @@ class DText
end
def self.parse_inline(str, options = {})
puts str
str.gsub!(/&/, "&")
str.gsub!(/</, "&lt;")
str.gsub!(/>/, "&gt;")
str.gsub!(/(?:^| )@\S+/) do |name|
if name =~ /([:;,.!?\)\]<>])$/
name.chop!
ch = $1
else
ch = ""
end
'<a href="/users?name=' + u(CGI.unescapeHTML(name[1..-1])) + '">' + name + '</a>' + ch
end
str.gsub!(/\n/m, "<br>") unless options[:ignore_newlines]
str.gsub!(/\[b\](.+?)\[\/b\]/i, '<strong>\1</strong>')
str.gsub!(/\[i\](.+?)\[\/i\]/i, '<em>\1</em>')
str.gsub!(/\[s\](.+?)\[\/s\]/i, '<s>\1</s>')
str.gsub!(/\[u\](.+?)\[\/u\]/i, '<u>\1</u>')
str.gsub!(/\[tn\](.+?)\[\/tn\]/i, '<p class="tn">\1</p>')
str.gsub!(/@\w+/) {|name| '<a href="/users?name=' + u(CGI.unescapeHTML(name[1..-1])) + '">' + name + '</a>'}
str = parse_links(str)
str = parse_aliased_wiki_links(str)