refactoring
This commit is contained in:
@@ -53,7 +53,7 @@ function LOAD()
|
||||
create_frames()
|
||||
subtab = SAVED
|
||||
update_auto_buy_filter()
|
||||
new_search ''
|
||||
new_search('')
|
||||
current_search.placeholder = true
|
||||
end
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ function public.formatted_post_filter(components)
|
||||
elseif i > 1 then
|
||||
str = str..'</p><p>'
|
||||
for _=1,getn(stack) do
|
||||
str = str..color.content.background '----'
|
||||
str = str..color.content.background('----')
|
||||
end
|
||||
end
|
||||
no_line_break = component[1] == 'operator' and component[2] == 'not'
|
||||
@@ -269,7 +269,7 @@ function add_post_filter()
|
||||
if components and getn(components.blizzard) == 0 and getn(components.post) == 1 then
|
||||
add_component(components.post[1])
|
||||
update_filter_display()
|
||||
filter_parameter_input:SetText ''
|
||||
filter_parameter_input:SetText('')
|
||||
filter_input:HighlightText()
|
||||
filter_input:SetFocus()
|
||||
elseif error then
|
||||
|
||||
+12
-12
@@ -246,7 +246,7 @@ function create_frames()
|
||||
btn:SetPoint('BOTTOMLEFT', aux_frame.content, 'TOPLEFT', 10, 8)
|
||||
btn:SetWidth(243)
|
||||
btn:SetHeight(22)
|
||||
btn:SetText 'Search Results'
|
||||
btn:SetText('Search Results')
|
||||
btn:SetScript('OnClick', function() subtab = RESULTS end)
|
||||
search_results_button = btn
|
||||
end
|
||||
@@ -255,7 +255,7 @@ function create_frames()
|
||||
btn:SetPoint('TOPLEFT', search_results_button, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(243)
|
||||
btn:SetHeight(22)
|
||||
btn:SetText 'Saved Searches'
|
||||
btn:SetText('Saved Searches')
|
||||
btn:SetScript('OnClick', function() subtab = SAVED end)
|
||||
saved_searches_button = btn
|
||||
end
|
||||
@@ -264,7 +264,7 @@ function create_frames()
|
||||
btn:SetPoint('TOPLEFT', saved_searches_button, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(243)
|
||||
btn:SetHeight(22)
|
||||
btn:SetText 'Filter Builder'
|
||||
btn:SetText('Filter Builder')
|
||||
btn:SetScript('OnClick', function() subtab = FILTER end)
|
||||
new_filter_button = btn
|
||||
end
|
||||
@@ -280,7 +280,7 @@ function create_frames()
|
||||
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(80)
|
||||
btn:SetHeight(24)
|
||||
btn:SetText 'Bid'
|
||||
btn:SetText('Bid')
|
||||
btn:Disable()
|
||||
bid_button = btn
|
||||
end
|
||||
@@ -289,7 +289,7 @@ function create_frames()
|
||||
btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(80)
|
||||
btn:SetHeight(24)
|
||||
btn:SetText 'Buyout'
|
||||
btn:SetText('Buyout')
|
||||
btn:Disable()
|
||||
buyout_button = btn
|
||||
end
|
||||
@@ -298,7 +298,7 @@ function create_frames()
|
||||
btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(80)
|
||||
btn:SetHeight(24)
|
||||
btn:SetText 'Clear'
|
||||
btn:SetText('Clear')
|
||||
btn:SetScript('OnClick', function()
|
||||
while tremove(current_search.records) do end
|
||||
current_search.table:SetDatabase()
|
||||
@@ -309,7 +309,7 @@ function create_frames()
|
||||
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(80)
|
||||
btn:SetHeight(24)
|
||||
btn:SetText 'Favorite'
|
||||
btn:SetText('Favorite')
|
||||
btn:SetScript('OnClick', function()
|
||||
local filters = filter_util.queries(search_box:GetText())
|
||||
if filters then
|
||||
@@ -325,7 +325,7 @@ function create_frames()
|
||||
local btn1 = gui.button(frame.filter, 16)
|
||||
btn1:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
||||
gui.set_size(btn1, 80, 24)
|
||||
btn1:SetText 'Search'
|
||||
btn1:SetText('Search')
|
||||
btn1:SetScript('OnClick', function()
|
||||
export_query_string()
|
||||
execute()
|
||||
@@ -334,13 +334,13 @@ function create_frames()
|
||||
local btn2 = gui.button(frame.filter, 16)
|
||||
btn2:SetPoint('LEFT', btn1, 'RIGHT', 5, 0)
|
||||
gui.set_size(btn2, 80, 24)
|
||||
btn2:SetText 'Export'
|
||||
btn2:SetText('Export')
|
||||
btn2:SetScript('OnClick', export_query_string)
|
||||
|
||||
local btn3 = gui.button(frame.filter, 16)
|
||||
btn3:SetPoint('LEFT', btn2, 'RIGHT', 5, 0)
|
||||
gui.set_size(btn3, 80, 24)
|
||||
btn3:SetText 'Import'
|
||||
btn3:SetText('Import')
|
||||
btn3:SetScript('OnClick', import_query_string)
|
||||
end
|
||||
do
|
||||
@@ -367,7 +367,7 @@ function create_frames()
|
||||
editbox.enter = L(editbox.ClearFocus, editbox)
|
||||
local label = gui.label(editbox, gui.font_size.small)
|
||||
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
|
||||
label:SetText 'Name'
|
||||
label:SetText('Name')
|
||||
name_input = editbox
|
||||
end
|
||||
do
|
||||
@@ -401,7 +401,7 @@ function create_frames()
|
||||
end
|
||||
local label = gui.label(editbox, gui.font_size.small)
|
||||
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
|
||||
label:SetText 'Level Range'
|
||||
label:SetText('Level Range')
|
||||
min_level_input = editbox
|
||||
end
|
||||
do
|
||||
|
||||
@@ -67,7 +67,7 @@ do
|
||||
|
||||
search.status_bar = status_bars[getn(searches)]
|
||||
search.status_bar:update_status(100, 100)
|
||||
search.status_bar:set_text ''
|
||||
search.status_bar:set_text('')
|
||||
|
||||
search.table = tables[getn(searches)]
|
||||
search.table:SetSort(1, 2, 3, 4, 5, 6, 7, 8, 9)
|
||||
@@ -192,7 +192,7 @@ function start_real_time_scan(query, search, continuation)
|
||||
end
|
||||
|
||||
if getn(new_records) > 1000 then
|
||||
StaticPopup_Show 'AUX_SEARCH_TABLE_FULL'
|
||||
StaticPopup_Show('AUX_SEARCH_TABLE_FULL')
|
||||
else
|
||||
search.records = new_records
|
||||
search.table:SetDatabase(search.records)
|
||||
@@ -204,7 +204,7 @@ function start_real_time_scan(query, search, continuation)
|
||||
end,
|
||||
on_abort = function()
|
||||
search.status_bar:update_status(100, 100)
|
||||
search.status_bar:set_text 'Scan paused'
|
||||
search.status_bar:set_text('Scan paused')
|
||||
|
||||
search.continuation = next_page or not ignore_page and query.blizzard_query.first_page or true
|
||||
|
||||
@@ -244,9 +244,9 @@ function start_search(queries, continuation)
|
||||
on_scan_start = function()
|
||||
search.status_bar:update_status(0,0)
|
||||
if continuation then
|
||||
search.status_bar:set_text 'Resuming scan...'
|
||||
search.status_bar:set_text('Resuming scan...')
|
||||
else
|
||||
search.status_bar:set_text 'Scanning auctions...'
|
||||
search.status_bar:set_text('Scanning auctions...')
|
||||
end
|
||||
end,
|
||||
on_page_loaded = function(_, total_scan_pages)
|
||||
@@ -272,13 +272,13 @@ function start_search(queries, continuation)
|
||||
elseif getn(search.records) < 1000 then
|
||||
tinsert(search.records, auction_record)
|
||||
if getn(search.records) == 1000 then
|
||||
StaticPopup_Show 'AUX_SEARCH_TABLE_FULL'
|
||||
StaticPopup_Show('AUX_SEARCH_TABLE_FULL')
|
||||
end
|
||||
end
|
||||
end,
|
||||
on_complete = function()
|
||||
search.status_bar:update_status(100, 100)
|
||||
search.status_bar:set_text 'Scan complete'
|
||||
search.status_bar:set_text('Scan complete')
|
||||
|
||||
if current_search == search and frame.results:IsVisible() and getn(search.records) == 0 then
|
||||
subtab = SAVED
|
||||
@@ -289,7 +289,7 @@ function start_search(queries, continuation)
|
||||
end,
|
||||
on_abort = function()
|
||||
search.status_bar:update_status(100, 100)
|
||||
search.status_bar:set_text 'Scan paused'
|
||||
search.status_bar:set_text('Scan paused')
|
||||
|
||||
if current_query then
|
||||
search.continuation = {current_query, current_page + 1}
|
||||
|
||||
Reference in New Issue
Block a user