refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-25 01:20:44 +02:00
parent 0a2bf75f2b
commit a4e3068557
20 changed files with 194 additions and 194 deletions
+15 -15
View File
@@ -118,9 +118,9 @@ function create_frames()
btn:SetText('Real Time Mode')
btn:SetScript('OnClick', function()
this:SetChecked(not this:GetChecked())
_g.this = first_page_input
_G.this = first_page_input
first_page_input:GetScript('OnTextChanged')()
_g.this = last_page_input
_G.this = last_page_input
last_page_input:GetScript('OnTextChanged')()
end)
public.real_time_button = btn
@@ -149,7 +149,7 @@ function create_frames()
btn:SetScript('OnClick', function()
if this:GetChecked() then
this:SetChecked(false)
_g.aux_auto_buy_filter = nil
_G.aux_auto_buy_filter = nil
this.prettified = nil
auto_buy_validator = nil
else
@@ -313,7 +313,7 @@ function create_frames()
btn:SetScript('OnClick', function()
local filters = filter_util.queries(search_box:GetText())
if filters then
tinsert(_g.aux_favorite_searches, 1, {
tinsert(_G.aux_favorite_searches, 1, {
filter_string = search_box:GetText(),
prettified = join(map(filters, function(filter) return filter.prettified end), ';'),
})
@@ -345,7 +345,7 @@ function create_frames()
end
do
local editbox = gui.editbox(frame.filter)
editbox.complete_item = completion.complete(function() return _g.aux_auctionable_items end)
editbox.complete_item = completion.complete(function() return _G.aux_auctionable_items end)
editbox:SetPoint('TOPLEFT', 14, -FILTER_SPACING)
editbox:SetWidth(260)
editbox.char = function()
@@ -499,7 +499,7 @@ function create_frames()
dropdown:SetScript('OnShow', function()
UIDropDownMenu_Initialize(this, initialize_filter_dropdown)
end)
_g[dropdown:GetName()..'Text']:Hide()
_G[dropdown:GetName()..'Text']:Hide()
local label = gui.label(dropdown, gui.font_size.medium)
label:SetPoint('RIGHT', dropdown, 'LEFT', -15, 0)
label:SetText('Post Filter')
@@ -623,16 +623,16 @@ function create_frames()
add_filter(data.search.filter_string)
elseif button == 'LeftButton' and IsControlKeyDown() then
if st == favorite_searches_listing and data.index > 1 then
local temp = _g.aux_favorite_searches[data.index - 1]
_g.aux_favorite_searches[data.index - 1] = data.search
_g.aux_favorite_searches[data.index] = temp
local temp = _G.aux_favorite_searches[data.index - 1]
_G.aux_favorite_searches[data.index - 1] = data.search
_G.aux_favorite_searches[data.index] = temp
update_search_listings()
end
elseif button == 'RightButton' and IsControlKeyDown() then
if st == favorite_searches_listing and data.index < getn(_g.aux_favorite_searches) then
local temp = _g.aux_favorite_searches[data.index + 1]
_g.aux_favorite_searches[data.index + 1] = data.search
_g.aux_favorite_searches[data.index] = temp
if st == favorite_searches_listing and data.index < getn(_G.aux_favorite_searches) then
local temp = _G.aux_favorite_searches[data.index + 1]
_G.aux_favorite_searches[data.index + 1] = data.search
_G.aux_favorite_searches[data.index] = temp
update_search_listings()
end
elseif button == 'LeftButton' then
@@ -640,9 +640,9 @@ function create_frames()
execute()
elseif button == 'RightButton' then
if st == recent_searches_listing then
tinsert(_g.aux_favorite_searches, 1, data.search)
tinsert(_G.aux_favorite_searches, 1, data.search)
elseif st == favorite_searches_listing then
tremove(_g.aux_favorite_searches, data.index)
tremove(_G.aux_favorite_searches, data.index)
end
update_search_listings()
end