home *** CD-ROM | disk | FTP | other *** search
/ ftp.ee.pdx.edu / 2014.02.ftp.ee.pdx.edu.tar / ftp.ee.pdx.edu / oss / cvs-2004 / bahasa / web / bahasa.js,v < prev    next >
Text File  |  2003-11-06  |  4KB  |  135 lines

  1. head    1.3;
  2. access;
  3. symbols;
  4. locks; strict;
  5. comment    @# @;
  6.  
  7.  
  8. 1.3
  9. date    2003.11.06.08.15.57;    author bule;    state Exp;
  10. branches;
  11. next    1.2;
  12.  
  13. 1.2
  14. date    2003.10.18.00.33.41;    author bule;    state Exp;
  15. branches;
  16. next    1.1;
  17.  
  18. 1.1
  19. date    2003.10.17.00.39.36;    author bule;    state Exp;
  20. branches;
  21. next    ;
  22.  
  23.  
  24. desc
  25. @@
  26.  
  27.  
  28. 1.3
  29. log
  30. @*** empty log message ***
  31. @
  32. text
  33. @<!--
  34. //////////////////////////////////////////////////////////////////////////////
  35. //////////////////////////////////////////////////////////////////////////////
  36. // Project Name: Bahasa Indonesia Dictionary
  37. // Directory:    bahasa/web
  38. // File Name:    bahasa.js  
  39. // Author(s):    John L. Whiteman
  40. // Created:      June 23, 2003
  41. // Modified:     October 16, 2003
  42. // Description:  This file contains various javascript routines used 
  43. //               throughout the website.
  44. //
  45. // Copyright (c) 2003 John L. Whiteman
  46. //
  47. // Permission is herby granted, free of charge, to any person obtaining a
  48. // copy of this software, data, and associated documentation files
  49. // (the "Software"), to deal in the Software without restriction,
  50. // including without limitation the rights to use, copy, modify, merge,
  51. // publish, distribute, sublicense, and/or sell copies of Software, and to
  52. // permit persons to whom the Software is furnished to do so, subject to
  53. // the following conditions:
  54. //
  55. // The above copyright notice and this permission notice shall be
  56. // included in all copies or substantial portions of the Software.
  57. //
  58. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  59. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  60. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  61. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
  62. // ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHERE IN AN ACTION OF CONTRACT,
  63. // TORT OR OTHERWISE, ARISING IN THE SOFTWARE.
  64. //////////////////////////////////////////////////////////////////////////////
  65. //////////////////////////////////////////////////////////////////////////////
  66.  
  67. //////////////////////////////////////////////////////////////////////////////
  68. //This function checks if string token appears to be a valid e-mail 
  69. //address.  It's does a pretty good job, but it's not perfect.
  70. //Returns false if not valid otherwise true if valid.
  71. //////////////////////////////////////////////////////////////////////////////
  72. function is_email(token) {
  73.  
  74.     var regexp = /^\w+([\.-]?\w+)*@@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
  75.  
  76.     if (regexp.test(token)) return(true);
  77.  
  78.     return(false);
  79. }
  80. //////////////////////////////////////////////////////////////////////////////
  81. //This function checks if string token contains only white spaces or null.
  82. //Returns false if not whitespace otherwise returns true if whitespace.
  83. //////////////////////////////////////////////////////////////////////////////
  84. function is_white_space(stoken) {
  85.  
  86.     if (stoken == null) return(true);
  87.  
  88.     if (stoken == '') return(true);
  89.  
  90.     if (stoken == "") return(true);
  91.  
  92.     return(false);
  93. }
  94. //////////////////////////////////////////////////////////////////////////////
  95. //This function replaces both leading and trailing whitespaces from the 
  96. //given token and returns the trimmed token to the caller.
  97. //////////////////////////////////////////////////////////////////////////////
  98. function trim(stoken) {
  99.  
  100.     if (is_white_space(stoken)) {
  101.  
  102.         return(stoken);
  103.     }
  104.  
  105.     stoken = stoken.replace(/^\s*/, "");
  106.  
  107.     stoken = stoken.replace(/\s*$/, "");
  108.  
  109.     return(stoken);
  110. }
  111. //////////////////////////////////////////////////////////////////////////////
  112. //////////////////////////////////////////////////////////////////////////////
  113. // -->
  114. @
  115.  
  116.  
  117. 1.2
  118. log
  119. @*** empty log message ***
  120. @
  121. text
  122. @a51 1
  123.  
  124. @
  125.  
  126.  
  127. 1.1
  128. log
  129. @*** empty log message ***
  130. @
  131. text
  132. @d1 82
  133. @
  134.  
  135.