From 26a512c3522b4f59a06f5e3146df5d466373c06e Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Mon, 1 Dec 2008 01:55:50 +0000 Subject: Grouped inline form styles. No longer using gInline class in favor of specific form IDs that can be styled differently depending on which container they appear. Added gDescription class, dropped gUnderState for semantics. CSS cleanup. --- modules/tag/helpers/tag.php | 2 +- modules/tag/js/tag.js | 6 +++--- modules/user/js/user.js | 25 +++++++++++++------------ modules/user/views/login.html.php | 2 +- 4 files changed, 18 insertions(+), 17 deletions(-) (limited to 'modules') diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php index fd683bc1..595f4b08 100644 --- a/modules/tag/helpers/tag.php +++ b/modules/tag/helpers/tag.php @@ -80,7 +80,7 @@ class tag_Core { } public static function get_add_form($item_id) { - $form = new Forge(url::site("tags"), "", "post"); + $form = new Forge(url::site("tags"), "", "post", array("id" => "gAddTagForm")); $group = $form->group(_("Add Tag")); $group->input("tag_name"); $group->hidden("item_id")->value($item_id); diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js index 98643c2d..74e48998 100644 --- a/modules/tag/js/tag.js +++ b/modules/tag/js/tag.js @@ -3,14 +3,14 @@ $("document").ready(function() { }); function ajaxify_tag_form() { - $("#gTag form").ajaxForm({ + $("#gAddTagForm").ajaxForm({ complete: function(xhr, statusText) { - $("#gTag form").replaceWith(xhr.responseText); + $("#gAddTagForm").replaceWith(xhr.responseText); if (xhr.status == 201) { $.get($("#gTagCloud").attr("src"), function(data, textStatus) { $("#gTagCloud").html(data); }); - $("#gTag form").clearForm(); + $("#gAddTagForm").clearForm(); } ajaxify_tag_form(); } diff --git a/modules/user/js/user.js b/modules/user/js/user.js index c547e511..fe7adf77 100644 --- a/modules/user/js/user.js +++ b/modules/user/js/user.js @@ -4,19 +4,20 @@ */ $("document").ready(function() { - $("#gLoginLink").click(function(event){ + $("#gLoginLink").click(function(event) { var url = $("#gLoginLink a").attr("href"); $.get(url, function(data) { - $('#gLoginLink').hide(); - $("#gLoginMenu").append('
  • X
  • '); - $("#gLoginMenu li:last").addClass("gClose").show(); - $("#gLoginMenu .gClose a").click(function(){ - $("#gLoginForm").remove(); - $("#gLoginMenu .gClose").remove(); - $("#gLoginLink").show(); - $("input#gUsername").val(""); - $("input#gPassword").val(""); - }); + $('#gLoginLink').hide(); + $("#gLoginMenu").append('
  • X
  • '); + $("#gLoginMenu li:last").addClass("gClose").show(); + $("#gLoginMenu .gClose a").click(function() { + $("#gLoginForm").remove(); + $("#gLoginMenu .gClose").remove(); + $("#gLoginFormContainer").hide(); + $("#gLoginLink").show(); + $("input#gUsername").val(""); + $("input#gPassword").val(""); + }); $("#gLoginFormContainer").html(data).hide().fadeIn(); ajaxify_login_form(); }); @@ -25,7 +26,7 @@ $("document").ready(function() { }); function ajaxify_login_form() { - $("form#gLoginForm").ajaxForm({ + $("#gLoginForm").ajaxForm({ target: "#gLoginFormContainer", success: function(responseText, statusText) { if (!responseText) { diff --git a/modules/user/views/login.html.php b/modules/user/views/login.html.php index ae558dfa..452f51ca 100644 --- a/modules/user/views/login.html.php +++ b/modules/user/views/login.html.php @@ -1,5 +1,5 @@ -