A tumblelog CMS built on AJAX, PHP and MySQL.

tools.js 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. $("#div-process").css({display:"none"});
  28. /*$("#login").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. var source = $('source');
  49. if(source.selectedIndex != 0){
  50. $('import_as').style.display="none";
  51. $('url_label').firstChild.nodeValue = source[source.selectedIndex].firstChild.nodeValue + username;
  52. }else{
  53. $('import_as').style.display="block";
  54. $('url_label').firstChild.nodeValue = feed_url;
  55. }
  56. }