huge filter tab improvements

This commit is contained in:
Manuel Simon Hirsig
2016-08-09 18:02:27 +02:00
parent aefa2efdfc
commit f3cd6b1345
6 changed files with 141 additions and 107 deletions
+4 -46
View File
@@ -531,48 +531,6 @@ function public.query_string(components)
return prettified.get()
end
function private.data_link(id, str)
return '|H'..id..'|h'..str..'|h'
end
function public.indented_post_query_string(components)
local no_line_break
local stack = {}
local str = ''
for i, component in components do
if no_line_break then
str = str..' '
elseif i > 1 then
str = str..'</p><p>'
for _=1,getn(stack) do
str = str..aux.gui.inline_color.content.backdrop..'----'..FONT_COLOR_CODE_CLOSE
end
end
no_line_break = component[1] == 'operator' and component[2] == 'not'
local component_text
if component[1] == 'operator' then
component_text = aux.auction_listing.COLORS.YELLOW..component[2]..(component[2] ~= 'not' and tonumber(component[3]) or '')..FONT_COLOR_CODE_CLOSE
tinsert(stack, component[3])
elseif component[1] == 'filter' then
component_text = aux.auction_listing.COLORS.YELLOW..component[2]..FONT_COLOR_CODE_CLOSE
if component[3] then
str = str..': '..aux.auction_listing.COLORS.ORANGE..component[3]..FONT_COLOR_CODE_CLOSE
end
while getn(stack) > 0 and stack[getn(stack)] do
local top = tremove(stack)
if tonumber(top) and top > 1 then
tinsert(stack, top - 1)
break
end
end
end
str = str..m.data_link(i, component_text)
end
return '<html><body><p>'..str..'</p></body></html>'
end
function private.prettified_query_string(components)
local prettified = m.query_builder()
@@ -588,7 +546,7 @@ function private.prettified_query_string(components)
if blizzard_filters.name and not blizzard_filters.exact then
if m.unquote(blizzard_filters.name) == '' then
prettified.prepend(aux.auction_listing.COLORS.RED..'No Filter'..FONT_COLOR_CODE_CLOSE)
prettified.prepend(aux.auction_listing.colors.RED..'No Filter'..FONT_COLOR_CODE_CLOSE)
else
prettified.prepend(aux.gui.inline_color.label.enabled..m.unquote(blizzard_filters.name)..FONT_COLOR_CODE_CLOSE)
end
@@ -596,13 +554,13 @@ function private.prettified_query_string(components)
for _, component in components.post do
if component[1] == 'operator' then
prettified.append(aux.auction_listing.COLORS.YELLOW..component[2]..(component[2] ~= 'not' and tonumber(component[3]) or '')..FONT_COLOR_CODE_CLOSE)
prettified.append(aux.auction_listing.colors.YELLOW..component[2]..(component[2] ~= 'not' and tonumber(component[3]) or '')..FONT_COLOR_CODE_CLOSE)
elseif component[1] == 'filter' then
if component[2] ~= 'tooltip' then
prettified.append(aux.auction_listing.COLORS.YELLOW..component[2]..FONT_COLOR_CODE_CLOSE)
prettified.append(aux.auction_listing.colors.YELLOW..component[2]..FONT_COLOR_CODE_CLOSE)
end
if component[3] then
prettified.append(aux.auction_listing.COLORS.ORANGE..component[3]..FONT_COLOR_CODE_CLOSE)
prettified.append(aux.auction_listing.colors.ORANGE..component[3]..FONT_COLOR_CODE_CLOSE)
end
end
end