Unsupported scripts and control panel web app for a hosting company
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

script.js 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. function validateLoginForm () {
  2. var error = false;
  3. document.getElementById('username').className = 'inflat';
  4. document.getElementById('usernamevalid').innerHTML = '';
  5. document.getElementById('password').className = 'inflat';
  6. document.getElementById('passwordvalid').innerHTML = '';
  7. if (document.forms.login.password.value.length < 4) {
  8. error = true;
  9. document.getElementById('password').className = 'inflaterr';
  10. document.getElementById('passwordvalid').innerHTML = 'Passwords must be at least four characters long.';
  11. document.getElementById('password').focus();
  12. }
  13. if (document.forms.login.username.value.length < 2) {
  14. error = true;
  15. document.getElementById('username').className = 'inflaterr';
  16. document.getElementById('usernamevalid').innerHTML = 'Usernames must be at least two characters long.';
  17. document.getElementById('username').focus();
  18. }
  19. return (error == false);
  20. }
  21. function validateSubdomainForm () {
  22. var error = false;
  23. document.getElementById('subdomain').className = 'inflat';
  24. document.getElementById('subdomainerr').innerHTML = '';
  25. if (document.forms.submd.subdomain.value.length == 0) {
  26. error = true;
  27. document.getElementById('subdomain').className = 'inflaterr';
  28. document.getElementById('subdomainerr').innerHTML = 'You must enter a subdomain';
  29. document.getElementById('subdomain').focus();
  30. }
  31. var valid = /^[a-z][a-z0-9\-]*$/i;
  32. if (!valid.test(document.forms.submd.subdomain.value)) {
  33. error = true;
  34. document.getElementById('subdomain').className = 'inflaterr';
  35. document.getElementById('subdomainerr').innerHTML = 'Invalid subdomain.';
  36. document.getElementById('subdomain').focus();
  37. }
  38. return (error == false);
  39. }
  40. function validateDomainForm () {
  41. var error = false;
  42. document.getElementById('domain').className = 'inflat';
  43. document.getElementById('domainerr').innerHTML = '';
  44. if (document.forms.md.domain.value.length == 0) {
  45. error = true;
  46. document.getElementById('domain').className = 'inflaterr';
  47. document.getElementById('domainerr').innerHTML = 'You must enter a domain';
  48. document.getElementById('domain').focus();
  49. }
  50. var valid = /^[a-z][a-z0-9\-\.]*\.[a-z]{2,}$/i
  51. if (!valid.test(document.forms.md.domain.value)) {
  52. error = true;
  53. document.getElementById('domain').className = 'inflaterr';
  54. document.getElementById('domainerr').innerHTML = 'Invalid domain.';
  55. document.getElementById('domain').focus();
  56. }
  57. return (error == false);
  58. }
  59. function validateTicketForm () {
  60. var error = false;
  61. document.getElementById('body').className = 'inflat';
  62. document.getElementById('messagevalid').innerHTML = '';
  63. document.getElementById('subject').className = 'inflat';
  64. document.getElementById('subjectvalid').innerHTML = '';
  65. if (document.forms.ticket.body.value.length < 10) {
  66. error = true;
  67. document.getElementById('body').className = 'inflaterr';
  68. document.getElementById('messagevalid').innerHTML = 'Please enter a complete description of the problem.';
  69. document.getElementById('body').focus();
  70. }
  71. if (document.forms.ticket.subject.value.length < 5) {
  72. error = true;
  73. document.getElementById('subject').className = 'inflaterr';
  74. document.getElementById('subjectvalid').innerHTML = 'Please enter a complete subject.';
  75. document.getElementById('subject').focus();
  76. }
  77. return (error == false);
  78. }
  79. //
  80. // getPageSize()
  81. // Returns array with page width, height and window width, height
  82. // Core code from - quirksmode.org
  83. // Edit for Firefox by pHaez
  84. //
  85. function getPageSize(){
  86. var xScroll, yScroll;
  87. if (window.innerHeight && window.scrollMaxY) {
  88. xScroll = document.body.scrollWidth;
  89. yScroll = window.innerHeight + window.scrollMaxY;
  90. } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
  91. xScroll = document.body.scrollWidth;
  92. yScroll = document.body.scrollHeight;
  93. } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
  94. xScroll = document.body.offsetWidth;
  95. yScroll = document.body.offsetHeight;
  96. }
  97. var windowWidth, windowHeight;
  98. if (self.innerHeight) { // all except Explorer
  99. windowWidth = self.innerWidth;
  100. windowHeight = self.innerHeight;
  101. } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
  102. windowWidth = document.documentElement.clientWidth;
  103. windowHeight = document.documentElement.clientHeight;
  104. } else if (document.body) { // other Explorers
  105. windowWidth = document.body.clientWidth;
  106. windowHeight = document.body.clientHeight;
  107. }
  108. // for small pages with total height less then height of the viewport
  109. if(yScroll < windowHeight){
  110. pageHeight = windowHeight;
  111. } else {
  112. pageHeight = yScroll;
  113. }
  114. // for small pages with total width less then width of the viewport
  115. if(xScroll < windowWidth){
  116. pageWidth = windowWidth;
  117. } else {
  118. pageWidth = xScroll;
  119. }
  120. arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
  121. return arrayPageSize;
  122. }