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 >
Wrap
Text File
|
2003-11-06
|
4KB
|
135 lines
head 1.3;
access;
symbols;
locks; strict;
comment @# @;
1.3
date 2003.11.06.08.15.57; author bule; state Exp;
branches;
next 1.2;
1.2
date 2003.10.18.00.33.41; author bule; state Exp;
branches;
next 1.1;
1.1
date 2003.10.17.00.39.36; author bule; state Exp;
branches;
next ;
desc
@@
1.3
log
@*** empty log message ***
@
text
@<!--
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Project Name: Bahasa Indonesia Dictionary
// Directory: bahasa/web
// File Name: bahasa.js
// Author(s): John L. Whiteman
// Created: June 23, 2003
// Modified: October 16, 2003
// Description: This file contains various javascript routines used
// throughout the website.
//
// Copyright (c) 2003 John L. Whiteman
//
// Permission is herby granted, free of charge, to any person obtaining a
// copy of this software, data, and associated documentation files
// (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
// ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHERE IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//This function checks if string token appears to be a valid e-mail
//address. It's does a pretty good job, but it's not perfect.
//Returns false if not valid otherwise true if valid.
//////////////////////////////////////////////////////////////////////////////
function is_email(token) {
var regexp = /^\w+([\.-]?\w+)*@@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
if (regexp.test(token)) return(true);
return(false);
}
//////////////////////////////////////////////////////////////////////////////
//This function checks if string token contains only white spaces or null.
//Returns false if not whitespace otherwise returns true if whitespace.
//////////////////////////////////////////////////////////////////////////////
function is_white_space(stoken) {
if (stoken == null) return(true);
if (stoken == '') return(true);
if (stoken == "") return(true);
return(false);
}
//////////////////////////////////////////////////////////////////////////////
//This function replaces both leading and trailing whitespaces from the
//given token and returns the trimmed token to the caller.
//////////////////////////////////////////////////////////////////////////////
function trim(stoken) {
if (is_white_space(stoken)) {
return(stoken);
}
stoken = stoken.replace(/^\s*/, "");
stoken = stoken.replace(/\s*$/, "");
return(stoken);
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// -->
@
1.2
log
@*** empty log message ***
@
text
@a51 1
@
1.1
log
@*** empty log message ***
@
text
@d1 82
@