diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-03-05 06:35:26 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-03-05 06:35:26 +0000 |
commit | 1db9f295fa3e98a1f1472d2a8eda881333db5a43 (patch) | |
tree | e6688cff377c1dcf4cd9a38127347f6319d874da /libs/web/htdocs | |
parent | 32aec7a4f3f1aaabd8cff223346db560ddacb387 (diff) |
libs/web: repair and modernize FileBrowser widget, patches by Kevin Locke <klocke@digitalenginesoftware.com> (#207)
Diffstat (limited to 'libs/web/htdocs')
-rw-r--r-- | libs/web/htdocs/luci-static/resources/cbi.js | 18 | ||||
-rw-r--r-- | libs/web/htdocs/luci-static/resources/cbi/file.gif | bin | 0 -> 371 bytes | |||
-rw-r--r-- | libs/web/htdocs/luci-static/resources/cbi/folder.gif | bin | 0 -> 698 bytes |
3 files changed, 18 insertions, 0 deletions
diff --git a/libs/web/htdocs/luci-static/resources/cbi.js b/libs/web/htdocs/luci-static/resources/cbi.js index 2bcfb8c3df..be0a5a8d70 100644 --- a/libs/web/htdocs/luci-static/resources/cbi.js +++ b/libs/web/htdocs/luci-static/resources/cbi.js @@ -402,6 +402,23 @@ function cbi_filebrowser(id, url, defpath) { browser.focus(); } +function cbi_browser_init(id, respath, url, defpath) +{ + function cbi_browser_btnclick(e) { + cbi_filebrowser(id, url, defpath); + return false; + } + + var field = document.getElementById(id); + + var btn = document.createElement('img'); + btn.className = 'cbi-image-button'; + btn.src = respath + '/cbi/folder.gif'; + field.parentNode.insertBefore(btn, field.nextSibling); + + cbi_bind(btn, 'click', cbi_browser_btnclick); +} + function cbi_dynlist_init(name, respath) { function cbi_dynlist_renumber(e) @@ -587,6 +604,7 @@ function cbi_dynlist_init(name, respath) for( var i = 0; i < inputs.length; i++ ) { var btn = document.createElement('img'); + btn.className = 'cbi-image-button'; btn.src = respath + ( (i+1) < inputs.length ? '/cbi/remove.gif' : '/cbi/add.gif' ); diff --git a/libs/web/htdocs/luci-static/resources/cbi/file.gif b/libs/web/htdocs/luci-static/resources/cbi/file.gif Binary files differnew file mode 100644 index 0000000000..3b1217dd65 --- /dev/null +++ b/libs/web/htdocs/luci-static/resources/cbi/file.gif diff --git a/libs/web/htdocs/luci-static/resources/cbi/folder.gif b/libs/web/htdocs/luci-static/resources/cbi/folder.gif Binary files differnew file mode 100644 index 0000000000..22b583bb59 --- /dev/null +++ b/libs/web/htdocs/luci-static/resources/cbi/folder.gif |