From d3103f6c5dba11a8a82faac6efccf46ca65150a6 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 13 May 2009 23:23:08 +0000 Subject: Add a little JS sugar to set the album directory name to the same as the album title. --- core/controllers/albums.php | 5 +++-- core/js/albums_form_add.js | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 core/js/albums_form_add.js (limited to 'core') diff --git a/core/controllers/albums.php b/core/controllers/albums.php index 3ab50028..adf9a282 100644 --- a/core/controllers/albums.php +++ b/core/controllers/albums.php @@ -112,7 +112,7 @@ class Albums_Controller extends Items_Controller { } else { print json_encode( array("result" => "error", - "form" => $form->__toString())); + "form" => $form->__toString() . html::script("core/js/albums_form_add.js"))); } } @@ -189,7 +189,8 @@ class Albums_Controller extends Items_Controller { switch ($this->input->get("type")) { case "album": - print album::get_add_form($album); + print album::get_add_form($album) . + html::script("core/js/albums_form_add.js"); break; case "photo": diff --git a/core/js/albums_form_add.js b/core/js/albums_form_add.js new file mode 100644 index 00000000..5516a468 --- /dev/null +++ b/core/js/albums_form_add.js @@ -0,0 +1,5 @@ +$("#gAddAlbumForm input[name=title]").keyup( + function() { + $("#gAddAlbumForm input[name=name]").attr( + "value", $("#gAddAlbumForm input[name=title]").attr("value")); + }); -- cgit v1.2.3