A tumblelog CMS built on AJAX, PHP and MySQL.

tools.js 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. }
  56. $(function(){
  57. // Fancy tooltip
  58. var t = '';
  59. $(".help").hover(function(e){
  60. t = $(this).attr('title');
  61. $(this).removeAttr('title').animate({opacity:1.0},500,function(){
  62. if($("#context_help").get().length < 1){
  63. $('.box:last').append('<div id="context_help"></div>');
  64. }
  65. $('#context_help').hide().html(t).css({left:e.pageX, top:e.pageY + 20}).fadeIn('slow');
  66. });
  67. },function(){
  68. $(this).stop().attr('title',t);
  69. $('#context_help').fadeOut('fast', function(){$(this).css({left:0, top:0})});
  70. });
  71. });