A tumblelog CMS built on AJAX, PHP and MySQL.

tools.js 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. function validateFrmAddUser() {
  2. if ($("#login").value == "") {
  3. alert("The username field cannot be left blank.");
  4. document.frm_add.login.select();
  5. return false;
  6. }
  7. if ($("#password").val() == "") {
  8. alert("The password field cannot be left blank.");
  9. document.frm_add.password.select();
  10. return false;
  11. }
  12. if ($("#password").val() != $("#repass").val()) {
  13. alert("The password must match,\nplease verify them.");
  14. document.frm_add.password.focus();
  15. return false;
  16. }
  17. return true;
  18. }
  19. function verifyExistingUser() {
  20. $("#div-process").css({display:"block"});
  21. $("#target").css({display:"block"});
  22. $.ajax({
  23. url: "ajax.php?action=verify&login="+$("#login").val(),
  24. cache: false,
  25. success: function(html){
  26. $("#target").html(html);
  27. $("#target").css({display:"block"});
  28. $("#div-process").css({display:"none"});
  29. }
  30. });
  31. return false;
  32. }
  33. function exit(el, path) {
  34. el=document.getElementById(el);
  35. $(el).css({display:"block"});
  36. $(el).html("Processing request...");
  37. $.ajax({
  38. url: path,
  39. cache: false,
  40. success: function(html){
  41. $(el).html(html);
  42. window.location='../login.php';
  43. }
  44. });
  45. return false;
  46. }
  47. function selectFeedType(feed_url,username){
  48. if( $('#source').val() != 'Rss'){
  49. $('#import_as').hide();
  50. $('#url_label').text($('#source').val() + username) ;
  51. }else{
  52. $('#import_as').show();
  53. $('#url_label').text(feed_url);
  54. }
  55. }