Files
gallery3/themes/default/js/user.js
T
Bharat Mediratta ae7839ffaa Revise the user login code.
* Remove user registration link and popup from the theme; this
  shouldn't be done in a popup. Use ajaxform to simplify the way
  that we load the login popup.

* Create form.html.php, this is a template for Forge based forms.

* Move user validation rules into User_Model and let forms
  populate the rules into their forms as useful.

* Undo r18688's changes regarding the REST code.  We should never
  accept a null resource, this breaks the REST abstraction.

* Change login and user controllers to use Forge which lets us delete
  login.html.php and user.html.php since those now are generated by
  the theme-owned form template
2008-11-15 06:23:09 +00:00

30 lines
638 B
JavaScript

function show_login(url) {
$("#gLoginLink").hide();
$("#gLoginClose").show();
$.get(url, function(data) {
$("#gLoginFormContainer").html(data);
ajaxify_login_form();
});
}
function ajaxify_login_form() {
$("form#gLogin").ajaxForm({
target: "#gLoginFormContainer",
success: function(responseText, statusText) {
if (!responseText) {
window.location.reload();
} else {
ajaxify_login_form();
}
},
});
}
function close_login() {
$("#gLogin").remove();
$("#gLoginClose").hide();
$("#gLoginLink").show();
$("input#gUsername").val("");
$("input#gPassword").val("");
}