summaryrefslogtreecommitdiff
path: root/lib/gallery.form.js
diff options
context:
space:
mode:
authorChad Kieffer <ckieffer@gmail.com>2009-10-18 10:32:08 -0600
committerChad Kieffer <ckieffer@gmail.com>2009-10-18 10:32:08 -0600
commitc9ccc2461880de141c37c3c7a7df3b26530ce806 (patch)
treea719cc2ba974e8a020c07a92a8a7de24fb31c0f4 /lib/gallery.form.js
parent08a22f4a39a1dad4b63f1303aa9cb3e758a784f3 (diff)
Moved the short_form init function to gallery.common and made it jQuery plugin. Dropped gallery.form.js. Applied short forms to server_add and tag admin pages. Added tag.css to admin views. Added .g-wide {}.
Diffstat (limited to 'lib/gallery.form.js')
-rw-r--r--lib/gallery.form.js34
1 files changed, 0 insertions, 34 deletions
diff --git a/lib/gallery.form.js b/lib/gallery.form.js
deleted file mode 100644
index 77ce3b7d..00000000
--- a/lib/gallery.form.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Initialize a short form. Short forms may contain only one text input.
- *
- * @param form_id string The form's CSS id
- */
-function short_form_init(form_id) {
- var form = $(form_id);
- var label = form.find("label:first");
- var input = form.find("input[type=text]:first");
- var button = form.find("input[type=submit]");
-
- // Set the input value equal to label text
- if (input.val() == "") {
- input.val(label.html());
- button.enable(false);
- }
-
- // Attach event listeners to the input
- input.bind("focus", function(e) {
- // Empty input value if it equals it's label
- if ($(this).val() == label.html()) {
- $(this).val("");
- }
- button.enable(true);
- });
-
- input.bind("blur", function(e){
- // Reset the input value if it's empty
- if ($(this).val() == "") {
- $(this).val(label.html());
- button.enable(false);
- }
- });
-}