From d632ef3e50252d388c272cacd29e8cc6e4949cec Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 17 Feb 2013 00:23:50 -0500 Subject: Fix up autocomplete for admin_server_add - found and fixed some bugs in gallery_autocomplete when "multiple" isn't set. Fixed some harmless syntax issues that js2-mode helpfully pointed out. --- modules/server_add/controllers/admin_server_add.php | 6 +++--- modules/server_add/views/admin_server_add.html.php | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'modules/server_add') diff --git a/modules/server_add/controllers/admin_server_add.php b/modules/server_add/controllers/admin_server_add.php index ba2b9b3f..4e522702 100644 --- a/modules/server_add/controllers/admin_server_add.php +++ b/modules/server_add/controllers/admin_server_add.php @@ -73,14 +73,14 @@ class Admin_Server_Add_Controller extends Admin_Controller { public function autocomplete() { $directories = array(); - $path_prefix = Input::instance()->get("q"); + $path_prefix = Input::instance()->get("term"); foreach (glob("{$path_prefix}*") as $file) { if (is_dir($file) && !is_link($file)) { - $directories[] = html::clean($file); + $directories[] = (string)html::clean($file); } } - ajax::response(implode("\n", $directories)); + ajax::response(json_encode($directories)); } private function _get_admin_form() { diff --git a/modules/server_add/views/admin_server_add.html.php b/modules/server_add/views/admin_server_add.html.php index f59e327f..b2421c7c 100644 --- a/modules/server_add/views/admin_server_add.html.php +++ b/modules/server_add/views/admin_server_add.html.php @@ -6,10 +6,7 @@ $("document").ready(function() { $("#g-path").gallery_autocomplete( "".replace("__ARGS__", "admin/server_add/autocomplete"), - { - max: 256, - loadingClass: "g-loading-small", - }); + {multiple: true}); }); -- cgit v1.2.3 From 62335da79177414094cc143c41901a7c0605b5d1 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Tue, 26 Feb 2013 13:07:00 +0100 Subject: Follow-on from autocomplete updates. (9345dde83e1f092a9309c45282dc21e3fd408875, d632ef3e50252d388c272cacd29e8cc6e4949cec) - gallery module: added loading-small.gif (so all themes have it by default) - gallery module: added css for .ui-autocomplete-loading (copied from .g-loading-small in wind, but without !important so other themes can override it) - gallery module: updated upgrader.html.php to use new image (removes theme dependence) - wind theme: removed outdated css for .ac_loading (not used in v3.0.5, either) - server_add module: removed multiple argument from autocomplete (doesn't work well with it) --- modules/gallery/css/gallery.css | 4 ++++ modules/gallery/images/loading-small.gif | Bin 0 -> 673 bytes modules/gallery/views/upgrader.html.php | 2 +- modules/server_add/views/admin_server_add.html.php | 2 +- themes/wind/css/screen.css | 6 ------ 5 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 modules/gallery/images/loading-small.gif (limited to 'modules/server_add') diff --git a/modules/gallery/css/gallery.css b/modules/gallery/css/gallery.css index 73b8ab4e..323c2e83 100644 --- a/modules/gallery/css/gallery.css +++ b/modules/gallery/css/gallery.css @@ -164,6 +164,10 @@ text-align: left; } +.ui-autocomplete-loading { + background: #e8e8e8 url('../images/loading-small.gif') no-repeat center center; +} + /** ******************************************************************* * 2) Admin **********************************************************************/ diff --git a/modules/gallery/images/loading-small.gif b/modules/gallery/images/loading-small.gif new file mode 100644 index 00000000..d0bce154 Binary files /dev/null and b/modules/gallery/images/loading-small.gif differ diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index 4c611f7e..2e485c08 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -17,7 +17,7 @@