summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-05-13 23:23:08 +0000
committerBharat Mediratta <bharat@menalto.com>2009-05-13 23:23:08 +0000
commitd3103f6c5dba11a8a82faac6efccf46ca65150a6 (patch)
tree47723213c4e8462670088cac68ea2e341142b9ff /core
parentdaebdab0c6a96b8fabc12b5bbbb438a134e4226d (diff)
Add a little JS sugar to set the album directory name to the same as
the album title.
Diffstat (limited to 'core')
-rw-r--r--core/controllers/albums.php5
-rw-r--r--core/js/albums_form_add.js5
2 files changed, 8 insertions, 2 deletions
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"));
+ });