cleanup + disabled autocomplete for form selectboxes
This commit is contained in:
parent
257b9f56e1
commit
70e03b2b71
2 changed files with 8 additions and 6 deletions
|
|
@ -18,14 +18,17 @@ function pluginInput(opt)
|
||||||
local key = opt.key:gsub("^app.opts.","")
|
local key = opt.key:gsub("^app.opts.","")
|
||||||
local value = EscapeHtml( app.opts[ key ] )
|
local value = EscapeHtml( app.opts[ key ] )
|
||||||
if type(opt.values) == 'table' then
|
if type(opt.values) == 'table' then
|
||||||
html = html .. util.template('<select name="${key}" value="${value}">\n', {
|
html = html .. util.template('<select name="${key}" autocomplete="off">\n', {
|
||||||
key = opt.key,
|
key = opt.key,
|
||||||
value = value
|
value = value
|
||||||
})
|
})
|
||||||
foreach( opt.values, function(k,v)
|
foreach( opt.values, function(k,v)
|
||||||
html = html .. util.template('<option value="${k}">${v}</option>\n',{
|
local selected = ''
|
||||||
|
if value == k then selected = 'selected="selected"' end
|
||||||
|
html = html .. util.template('<option value="${k}" ${selected}>${v}</option>\n',{
|
||||||
k=k,
|
k=k,
|
||||||
v=v
|
v=v,
|
||||||
|
selected=selected
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
html = html .. "</select>\n"
|
html = html .. "</select>\n"
|
||||||
|
|
@ -85,11 +88,11 @@ function saveData()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
if saveconfig then
|
if saveconfig then
|
||||||
app.set('app.opts', app.opts )
|
|
||||||
data.notification = '<div class="notification">updated</div>'
|
data.notification = '<div class="notification">updated</div>'
|
||||||
else
|
else
|
||||||
data.notification = '<div class="notification">no changes detected</div>'
|
data.notification = '<div class="notification">no changes detected</div>'
|
||||||
end
|
end
|
||||||
|
print(app.opts.plugin_global_homepage)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ end}
|
||||||
function addPortal(id,x,v,url,i,z,thumb,rotation,scale)
|
function addPortal(id,x,v,url,i,z,thumb,rotation,scale)
|
||||||
print('\t<object js_id="' .. id .. '_' .. i .. '" pos="' .. x .. ' 0 ' .. z .. '" rotation="' .. rotation .. '">')
|
print('\t<object js_id="' .. id .. '_' .. i .. '" pos="' .. x .. ' 0 ' .. z .. '" rotation="' .. rotation .. '">')
|
||||||
print('\t <link url="' .. url .. '" ' .. thumb .. ' title_col="0.4 0.37 0.4" pos="0 0 0.001" draw_glow="true" scale="3 3 0.1" />')
|
print('\t <link url="' .. url .. '" ' .. thumb .. ' title_col="0.4 0.37 0.4" pos="0 0 0.001" draw_glow="true" scale="3 3 0.1" />')
|
||||||
print('\t <link url="' .. url .. '" shader_id="xrforgeportal" pos="0 0 0.003" draw_glow="false" scale="3 3 0.1" />')
|
|
||||||
print('\t <text text="' .. v.title .. '" pos="0 3.4 0" col="1 1 1" font_scale="false" scale="' .. scale .. '" />')
|
print('\t <text text="' .. v.title .. '" pos="0 3.4 0" col="1 1 1" font_scale="false" scale="' .. scale .. '" />')
|
||||||
print('\t</object>')
|
print('\t</object>')
|
||||||
end
|
end
|
||||||
|
|
@ -58,7 +57,7 @@ end}
|
||||||
local center = -((#items*width)/1.3) + (i*width)
|
local center = -((#items*width)/1.3) + (i*width)
|
||||||
local url = v.url
|
local url = v.url
|
||||||
local thumb = ' shader_id="defaultportal"'
|
local thumb = ' shader_id="defaultportal"'
|
||||||
if v.thumbnail then
|
if #v.thumbnail > 0 then
|
||||||
thumb = ' thumb_id="img' .. i .. '" '
|
thumb = ' thumb_id="img' .. i .. '" '
|
||||||
end
|
end
|
||||||
if v.dir then url = url .. "/" end
|
if v.dir then url = url .. "/" end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue