diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-11-26 23:23:15 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-11-26 23:23:15 +0100 |
commit | c123fa86b02f7e9ecd7d474a03359628b444bd1d (patch) | |
tree | caf4f49f1dbd55a4daef1737e34d1f45c2e1733d /modules/luci-base | |
parent | ce04adb38392c07420c30e67b1bb010ee1e0145f (diff) | |
parent | cbf45fe563ab2ded120a5d5184e8c7207aa9b995 (diff) |
Merge pull request #534 from yousong/add-luci-proto-pppossh
Add luci proto pppossh
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/cbi.js | 25 | ||||
-rw-r--r-- | modules/luci-base/luasrc/http/protocol.lua | 2 | ||||
-rw-r--r-- | modules/luci-base/luasrc/view/cbi/dynlist.htm | 4 |
3 files changed, 21 insertions, 10 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 5e31bf209..02c54ad3e 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -545,7 +545,7 @@ function cbi_browser_init(id, respath, url, defpath) cbi_bind(btn, 'click', cbi_browser_btnclick); } -function cbi_dynlist_init(name, respath, datatype, optional, choices) +function cbi_dynlist_init(name, respath, datatype, optional, url, defpath, choices) { var input0 = document.getElementsByName(name)[0]; var prefix = input0.name; @@ -606,6 +606,11 @@ function cbi_dynlist_init(name, respath, datatype, optional, choices) parent.appendChild(t); parent.appendChild(b); + if (datatype == 'file') + { + cbi_browser_init(t.id, respath, url, defpath); + } + parent.appendChild(document.createElement('br')); if (datatype) @@ -616,13 +621,13 @@ function cbi_dynlist_init(name, respath, datatype, optional, choices) if (choices) { cbi_combobox_init(t.id, choices[0], '', choices[1]); - t.nextSibling.index = i; + b.index = i; - cbi_bind(t.nextSibling, 'keydown', cbi_dynlist_keydown); - cbi_bind(t.nextSibling, 'keypress', cbi_dynlist_keypress); + cbi_bind(b, 'keydown', cbi_dynlist_keydown); + cbi_bind(b, 'keypress', cbi_dynlist_keypress); if (i == focus || -i == focus) - t.nextSibling.focus(); + b.focus(); } else { @@ -758,20 +763,24 @@ function cbi_dynlist_init(name, respath, datatype, optional, choices) ev = ev ? ev : window.event; var se = ev.target ? ev.target : ev.srcElement; + var input = se.previousSibling; + while (input && input.name != name) { + input = input.previousSibling; + } if (se.src.indexOf('remove') > -1) { - se.previousSibling.value = ''; + input.value = ''; cbi_dynlist_keydown({ - target: se.previousSibling, + target: input, keyCode: 8 }); } else { cbi_dynlist_keydown({ - target: se.previousSibling, + target: input, keyCode: 13 }); } diff --git a/modules/luci-base/luasrc/http/protocol.lua b/modules/luci-base/luasrc/http/protocol.lua index 859272679..0cb62aeec 100644 --- a/modules/luci-base/luasrc/http/protocol.lua +++ b/modules/luci-base/luasrc/http/protocol.lua @@ -72,7 +72,7 @@ function urlencode( str ) if type(str) == "string" then str = str:gsub( - "([^a-zA-Z0-9$_%-%.!*'(),])", + "([^a-zA-Z0-9$_%-%.%~])", __chrenc ) end diff --git a/modules/luci-base/luasrc/view/cbi/dynlist.htm b/modules/luci-base/luasrc/view/cbi/dynlist.htm index fd626a4ec..e936c0c39 100644 --- a/modules/luci-base/luasrc/view/cbi/dynlist.htm +++ b/modules/luci-base/luasrc/view/cbi/dynlist.htm @@ -15,7 +15,9 @@ <script type="text/javascript"> cbi_dynlist_init( '<%=cbid%>', '<%=resource%>', '<%=self.datatype%>', - <%=tostring(self.optional or self.rmempty)%> + <%=tostring(self.optional or self.rmempty)%>, + '<%=url('admin/filebrowser')%>', + '<%=self.default_path and self.default_path%>' <%- if #self.keylist > 0 then -%>, [{ <%- for i, k in ipairs(self.keylist) do -%> <%-=string.format("%q", k) .. ":" .. string.format("%q", self.vallist[i])-%> |