jspro-cvs Mailing List for jsPro (Page 3)
Brought to you by:
wigleys
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(51) |
Oct
(21) |
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(4) |
Feb
(15) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <gat...@us...> - 2003-09-22 04:53:29
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv26819
Modified Files:
browser.js
Log Message:
QA: small correction
Index: browser.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/browser.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** browser.js 17 Sep 2003 08:50:57 -0000 1.1
--- browser.js 22 Sep 2003 04:53:26 -0000 1.2
***************
*** 146,150 ****
if (!(oExpires instanceof Date)) {
! throw vError = new TypeMismatchException('Browser.setCookie', 'Date()', typeof oExpires);
}
--- 146,150 ----
if (!(oExpires instanceof Date)) {
! throw vError = new TypeMismatchException('Browser.setCookie', 'Date', typeof oExpires);
}
|
|
From: <gat...@us...> - 2003-09-22 04:41:13
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv24889
Modified Files:
error.js
Log Message:
new exception - IllegalValueException(sMethodName, sVariableName, vExpectedVal, vActualVal)
Index: error.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/error.js,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** error.js 14 Sep 2003 09:37:53 -0000 1.14
--- error.js 22 Sep 2003 04:41:10 -0000 1.15
***************
*** 134,137 ****
--- 134,162 ----
/**
+ * Creates an object that is a subclass of Error for handling IllegalValue
+ * exceptions.
+ *
+ * @author Randolph Fielding
+ * @version 1.0, 09/22/03
+ * @interface <code>new IllegalValueException(sMethodName,
+ * sVariableName, vExpectedVal, vActualVal)</code>
+ * @param sMethodName the name of the method where the exception was thrown
+ * @param sVariableName the name of the variable containing the illegal value
+ * @param vExpectedVal the value expected in the variable containing the
+ * illegal value
+ * @param vActualVal the value currently in the variable containing the
+ * illegal value
+ */
+ function IllegalValueException(sMethodName, sVariableName, vExpectedVal, vActualVal) {
+
+ this.name = 'IllegalValueException';
+ this.message = sMethodName + ' has encountered an illegal value in variable ' + sVariableName + '.'
+ this.debug = 'Expected a value of ' + vExpectedVal.toString() + ', but contains a value of ' + vActualVal.toString() + '.'
+ }
+
+ IllegalValueException.prototype = new Error();
+
+
+ /**
* Creates an object that is a subclass of Error for handling
* MethodNotAvailable exceptions.
|
|
From: <gat...@us...> - 2003-09-22 03:28:26
|
Update of /cvsroot/jspro/jsPro/debug
In directory sc8-pr-cvs1:/tmp/cvs-serv15119/debug
Modified Files:
debug.js
Log Message:
QA: i screwed up the first time on this update...updated certain TypeMismatchExceptions to test for and display the correct datatype ('integer' instead of 'number')
Index: debug.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/debug/debug.js,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** debug.js 22 Sep 2003 03:21:35 -0000 1.4
--- debug.js 22 Sep 2003 03:28:22 -0000 1.5
***************
*** 118,123 ****
}
! if ((typeof iMessageType != 'number') || (parseInt(iMessageType.toString()) != iMessageType)) {
! throw vError = new TypeMismatchException('Debug.print', 'positive integer', typeof iMessageType);
}
--- 118,123 ----
}
! if ((typeof iMessageType != 'number') || (iMessageType.toString().indexOf('.') != -1)) {
! throw vError = new TypeMismatchException('Debug.print', 'integer', typeof iMessageType);
}
|
|
From: <gat...@us...> - 2003-09-22 03:21:40
|
Update of /cvsroot/jspro/jsPro/debug
In directory sc8-pr-cvs1:/tmp/cvs-serv14209/debug
Modified Files:
debug.js
Log Message:
QA: updated certain TypeMismatchExceptions to display correct datatype being tested for ('positive integer' instead of 'number')
Index: debug.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/debug/debug.js,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** debug.js 6 Sep 2003 01:48:01 -0000 1.3
--- debug.js 22 Sep 2003 03:21:35 -0000 1.4
***************
*** 119,123 ****
if ((typeof iMessageType != 'number') || (parseInt(iMessageType.toString()) != iMessageType)) {
! throw vError = new TypeMismatchException('Debug.print', 'number', typeof iMessageType);
}
--- 119,123 ----
if ((typeof iMessageType != 'number') || (parseInt(iMessageType.toString()) != iMessageType)) {
! throw vError = new TypeMismatchException('Debug.print', 'positive integer', typeof iMessageType);
}
|
|
From: <gat...@us...> - 2003-09-22 03:17:38
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv13671
Modified Files:
validator.js
Log Message:
QA: updated comments; made validation methods generic so that the validation methods can be passed any datatype and still return the correct boolean value
Index: validator.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/validator.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** validator.js 19 Sep 2003 15:44:21 -0000 1.1
--- validator.js 22 Sep 2003 03:17:34 -0000 1.2
***************
*** 20,23 ****
--- 20,24 ----
* +-------------------------------------------------------------------------+
* | Authors: Stuart Wigley <stu...@ya...> |
+ * | Randolph Fielding <gat...@ci...> |
* +-------------------------------------------------------------------------+
* $Id$
***************
*** 36,53 ****
/**
! * Test if the supplied value is a blank string or a string made up of
! * whitespaces, tabs or newline characters
*
! * @summary is a blank string
* @author Stuart Wigley
! * @version 1.0, 09/19/03
! * @interface <code>Validator.isBlankString(sValue)</code>
! * @param sValue the value to test against
! * @return true or false
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
- * @throws TypeMismatchException
*/
! Validator.prototype.isBlankString = function(sValue) {
try {
--- 37,59 ----
/**
! * Determine if the specified value is an empty string or a string composed of
! * only whitespace characters.
*
! * @summary is blank string?
* @author Stuart Wigley
! * @author Randolph Fielding
! * @version 1.1, 09/21/03
! * @interface <code>Validator.isBlankString(vValue)</code>
! * @param vValue a value of any datatype
! * @return <code>true</code> if <code>vValue</code> is a string
! * and is either empty or composed of only whitespace
! * characters
! * @return <code>false</code> if <code>vValue</code> is either
! * not a string or is not an empty string and not a
! * string composed of only whitespace characters
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
*/
! Validator.prototype.isBlankString = function(vValue) {
try {
***************
*** 60,69 ****
}
! if (typeof sValue != 'string') {
! throw vError = new TypeMismatchException('Validator.isBlankString', 'string', typeof sValue);
! }
!
! var bIsBlankString = (sValue.match(/[\w]/g)) ? false : true;
!
}
catch (vError) {
--- 66,70 ----
}
! var bIsBlankString = (typeof vValue != 'string') ? false : (vValue.match(/\S/g)) ? false : true;
}
catch (vError) {
***************
*** 81,97 ****
/**
! * Test if the supplied value is a single digit in the range 0 to 9
*
! * @summary is a single digit
* @author Stuart Wigley
! * @version 1.0, 09/19/03
! * @interface <code>Validator.isDigit(iValue)</code>
! * @param iValue the value to test against
! * @return true or false
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
- * @throws TypeMismatchException
*/
! Validator.prototype.isDigit = function(iValue) {
try {
--- 82,101 ----
/**
! * Determine if the specified value is a single digit.
*
! * @summary is single digit?
* @author Stuart Wigley
! * @author Randolph Fielding
! * @version 1.1, 09/21/03
! * @interface <code>Validator.isDigit(vValue)</code>
! * @param vValue a value of any datatype
! * @return <code>true</code> if <code>vValue</code> is a number
! * and a single digit
! * @return <code>false</code> if <code>vValue</code> is either
! * not a number or is not a single digit
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
*/
! Validator.prototype.isDigit = function(vValue) {
try {
***************
*** 104,113 ****
}
! if (typeof iValue != 'number') {
! throw vError = new TypeMismatchException('Validator.isDigit', 'number', typeof iValue);
! }
!
! var bIsDigit = ((iValue < 10) && iValue.toString().length == 1) ? true : false;
!
}
catch (vError) {
--- 108,112 ----
}
! var bIsDigit = (typeof vValue != 'number') ? false : ((vValue > 9) || (vValue.toString().length != 1)) ? false : true;
}
catch (vError) {
***************
*** 125,141 ****
/**
! * Test if the supplied value is an integer
*
! * @summary is an integer
* @author Stuart Wigley
! * @version 1.0, 09/19/03
! * @interface <code>Validator.isInteger(iValue)</code>
! * @param iValue the value to test against
! * @return true or false
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
- * @throws TypeMismatchException
*/
! Validator.prototype.isInteger = function(iValue) {
try {
--- 124,143 ----
/**
! * Determine if the specified value is an integer.
*
! * @summary is integer?
* @author Stuart Wigley
! * @author Randolph Fielding
! * @version 1.1, 09/21/03
! * @interface <code>Validator.isInteger(vValue)</code>
! * @param vValue a value of any datatype
! * @return <code>true</code> if <code>vValue</code> is a number
! * and an integer
! * @return <code>false</code> if <code>vValue</code> is either
! * not a number or is not an integer
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
*/
! Validator.prototype.isInteger = function(vValue) {
try {
***************
*** 148,157 ****
}
! if (typeof iValue != 'number') {
! throw vError = new TypeMismatchException('Validator.isInteger', 'number', typeof iValue);
! }
!
! var bIsInteger = (iValue.toString().indexOf('.') == -1) ? true : false;
!
}
catch (vError) {
--- 150,154 ----
}
! var bIsInteger = (typeof vValue != 'number') ? false : (vValue.toString().indexOf('.') != -1) ? false : true;
}
catch (vError) {
|
|
From: <gat...@us...> - 2003-09-21 22:26:16
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv30463
Modified Files:
string.js
Log Message:
QA: new functions modified for more in-depth error trapping, consistency, and corrections
Index: string.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/string.js,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** string.js 19 Sep 2003 15:46:59 -0000 1.19
--- string.js 21 Sep 2003 22:26:10 -0000 1.20
***************
*** 73,85 ****
/**
! * Concatenate the string representation of <code>vValue</code> to the end of
! * the current string
*
* @summary concatenate
* @author Stuart Wigley
! * @version 1.0, 09/19/03
* @interface <code>String.cat(vValue)</code>
! * @param vValue value to be concatenated to end of string
! * @return concatenated string
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
--- 73,86 ----
/**
! * Concatenate the string representation of the specified value to the end of
! * this string.
*
* @summary concatenate
* @author Stuart Wigley
! * @author Randolph Fielding
! * @version 1.1, 09/20/03
* @interface <code>String.cat(vValue)</code>
! * @param vValue the value to be concatenated to the end of this string
! * @return a concatenated string
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
***************
*** 96,102 ****
}
! var sValue = arguments[0].toString();
! var sCatString = this + sValue;
!
}
catch (vError) {
--- 97,101 ----
}
! var sCatString = this + vValue.toString();
}
catch (vError) {
***************
*** 114,123 ****
/**
! * Replaces all Unix, Windows and Macintosh newline characters, tabs and
! * repeated spaces with a single space character.
*
! * @summary compress to spaces
* @author Stuart Wigley
! * @version 1.0, 09/19/03
* @interface <code>String.compress()</code>
* @return a modified string
--- 113,123 ----
/**
! * Replaces all UNIX, Windows and Macintosh newline characters, tabs and
! * repeated spaces in this string with single spaces.
*
! * @summary compress whitespace to single spaces
* @author Stuart Wigley
! * @author Randolph Fielding
! * @version 1.1, 09/21/03
* @interface <code>String.compress()</code>
* @return a modified string
***************
*** 131,137 ****
var vError = null;
var iNumArguments = arguments.length;
- var iDocType = 1;
! if (iNumArguments != 0) {
throw vError = new IllegalArgumentException('String.compress', 0, iNumArguments);
}
--- 131,136 ----
var vError = null;
var iNumArguments = arguments.length;
! if (iNumArguments > 0) {
throw vError = new IllegalArgumentException('String.compress', 0, iNumArguments);
}
***************
*** 324,341 ****
/**
! * Inserts a string into another string at the specified position
*
! * @summary insert a string
* @author Stuart Wigley
! * @version 1.0, 09/19/03
! * @interface <code>String.insert(sInsert)</code>
! * @interface <code>String.insert(sInsert, iStart)</code>
! * @param sInsert the string to be inserted
! * @param iStart the position where the insert should begin
* @return a modified string
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
*/
! String.prototype.insert = function() {
try {
--- 323,345 ----
/**
! * Inserts the string representation of the specified value at the beginning
! * of this string or at a given position within this string (if the optional
! * start argument is specified).
*
! * @summary insert one string into another
* @author Stuart Wigley
! * @author Randolph Fielding
! * @version 1.1, 09/21/03
! * @interface <code>String.insert(vValue)</code>
! * @interface <code>String.insert(vValue, iStart)</code>
! * @param vValue the value to be inserted into this string
! * @param iStart the index of the character to start at (optional)
* @return a modified string
* @return <code>null</code> if an exception is encountered
+ * @throws ArrayIndexOutOfBoundsException
* @throws IllegalArgumentException
+ * @throws TypeMismatchException
*/
! String.prototype.insert = function(vValue) {
try {
***************
*** 343,375 ****
var vError = null;
var iNumArguments = arguments.length;
- var sInsert = '';
var iStart = 0;
- var iLength = this.length;
! if (iNumArguments == 1) {
! sInsert = arguments[0];
} else if (iNumArguments == 2) {
- sInsert = arguments[0];
iStart = arguments[1];
- } else {
- throw vError = new IllegalArgumentException('String.insert', '1 or 2', iNumArguments);
}
- if (typeof sInsert != 'string') {
- throw vError = new TypeMismatchException('String.insert', 'string', typeof sInsert);
- }
if ((typeof iStart != 'number') || (parseInt(iStart.toString()) != iStart)) {
throw vError = new TypeMismatchException('String.insert', 'number', typeof iStart);
}
var sModifiedString = '';
! for (var i = 0; i < iLength; i++) {
if (i == iStart) {
! sModifiedString += sInsert;
}
sModifiedString += this.charAt(i);
}
-
}
catch (vError) {
--- 347,376 ----
var vError = null;
var iNumArguments = arguments.length;
var iStart = 0;
! if ((iNumArguments < 1) || (iNumArguments > 2)) {
! throw vError = new IllegalArgumentException('String.insert', '1 or 2', iNumArguments);
} else if (iNumArguments == 2) {
iStart = arguments[1];
}
if ((typeof iStart != 'number') || (parseInt(iStart.toString()) != iStart)) {
throw vError = new TypeMismatchException('String.insert', 'number', typeof iStart);
}
+ var iStringLength = this.length;
+
+ if ((iStart < 0) || (iStart >= iStringLength)) {
+ throw vError = new ArrayIndexOutOfBoundsException('String.insert', iStart, iStringLength);
+ }
+
var sModifiedString = '';
! for (var i = 0; i < iStringLength; i++) {
if (i == iStart) {
! sModifiedString += vValue.toString();
}
sModifiedString += this.charAt(i);
}
}
catch (vError) {
***************
*** 624,628 ****
/**
! * Replaces all Unix, Windows and Macintosh newline characters in this string
* with either HTML <BR> elements or XHTML <br /> elements.
*
--- 625,629 ----
/**
! * Replaces all UNIX, Windows and Macintosh newline characters in this string
* with either HTML <BR> elements or XHTML <br /> elements.
*
***************
*** 680,697 ****
/**
! * Overlays a string over another string at the specified position
*
! * @summary overlay a string
* @author Stuart Wigley
! * @version 1.0, 09/19/03
! * @interface <code>String.overlay(sInsert)</code>
! * @interface <code>String.overlay(sInsert, iStart)</code>
! * @param sOverlay the string to be overlayed
! * @param iStart the position where the overlay should begin
* @return a modified string
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
*/
! String.prototype.overlay = function() {
try {
--- 681,703 ----
/**
! * Overlays the string representation of the specified value over the beginning
! * of this string or over a later portion of this string (if the optional start
! * argument is specified).
*
! * @summary overlay one string over another
* @author Stuart Wigley
! * @author Randolph Fielding
! * @version 1.1, 09/21/03
! * @interface <code>String.overlay(vValue)</code>
! * @interface <code>String.overlay(vValue, iStart)</code>
! * @param vValue the value to be overlayed over this string
! * @param iStart the index of the character to start at (optional)
* @return a modified string
* @return <code>null</code> if an exception is encountered
+ * @throws ArrayIndexOutOfBoundsException
* @throws IllegalArgumentException
+ * @throws TypeMismatchException
*/
! String.prototype.overlay = function(vValue) {
try {
***************
*** 699,732 ****
var vError = null;
var iNumArguments = arguments.length;
- var sOverlay = '';
var iStart = 0;
- var iLength = this.length;
! if (iNumArguments == 1) {
! sOverlay = arguments[0];
} else if (iNumArguments == 2) {
- sOverlay = arguments[0];
iStart = arguments[1];
- } else {
- throw vError = new IllegalArgumentException('String.overlay', '1 or 2', iNumArguments);
}
- if (typeof sOverlay != 'string') {
- throw vError = new TypeMismatchException('String.insert', 'string', typeof sOverlay);
- }
if ((typeof iStart != 'number') || (parseInt(iStart.toString()) != iStart)) {
! throw vError = new TypeMismatchException('String.insert', 'number', typeof iStart);
}
var sModifiedString = '';
! for (var i = 0; i < iLength; i++) {
if (i == iStart) {
! sModifiedString += sOverlay;
! i += sOverlay.length;
}
sModifiedString += this.charAt(i);
}
-
}
catch (vError) {
--- 705,739 ----
var vError = null;
var iNumArguments = arguments.length;
var iStart = 0;
! if ((iNumArguments < 1) || (iNumArguments > 2)) {
! throw vError = new IllegalArgumentException('String.overlay', '1 or 2', iNumArguments);
} else if (iNumArguments == 2) {
iStart = arguments[1];
}
if ((typeof iStart != 'number') || (parseInt(iStart.toString()) != iStart)) {
! throw vError = new TypeMismatchException('String.overlay', 'number', typeof iStart);
! }
!
! var iStringLength = this.length;
!
! if ((iStart < 0) || (iStart >= iStringLength)) {
! throw vError = new ArrayIndexOutOfBoundsException('String.overlay', iStart, iStringLength);
}
var sModifiedString = '';
! for (var i = 0; i < iStringLength; i++) {
if (i == iStart) {
! var sValue = vValue.toString();
! sModifiedString += sValue;
! i += sValue.length;
! if (i >= iStringLength) {
! break;
! }
}
sModifiedString += this.charAt(i);
}
}
catch (vError) {
***************
*** 821,838 ****
/**
! * Removes all characters from the string or a subset of characters (if the
! * optional start and end arguments are specified)
*
! * @summary delete characters
* @author Stuart Wigley
! * @version 1.0, 09/19/03
* @interface <code>String.remove()</code>
* @interface <code>String.remove(iStart)</code>
! * @interface <code>String.remove(iStart, iEnd)</code>
! * @param iStart the string position to start at (optional)
! * @param iEnd the string position to end at (optional)
! * @return the modified string
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
*/
String.prototype.remove = function() {
--- 828,849 ----
/**
! * Removes all characters from this string or a subset of characters from this
! * string (if the optional start and length arguments are specified).
*
! * @summary remove characters
* @author Stuart Wigley
! * @author Randolph Fielding
! * @version 1.1, 09/21/03
* @interface <code>String.remove()</code>
* @interface <code>String.remove(iStart)</code>
! * @interface <code>String.remove(iStart, iLength)</code>
! * @param iStart the index of the character to start at (optional)
! * @param iLength the number of characters to remove beginning at
! * <code>iStart</code> (optional)
! * @return a modified string
* @return <code>null</code> if an exception is encountered
+ * @throws ArrayIndexOutOfBoundsException
* @throws IllegalArgumentException
+ * @throws TypeMismatchException
*/
String.prototype.remove = function() {
***************
*** 841,847 ****
var vError = null;
var iNumArguments = arguments.length;
var iStart = 0;
! var iEnd = this.length + 1;
if (iNumArguments > 2) {
--- 852,859 ----
var vError = null;
+ var iStringLength = this.length;
var iNumArguments = arguments.length;
var iStart = 0;
! var iLength = iStringLength;
if (iNumArguments > 2) {
***************
*** 849,855 ****
} else if (iNumArguments == 2) {
iStart = arguments[0];
! iEnd = arguments[1];
} else if (iNumArguments == 1) {
iStart = arguments[0];
}
--- 861,868 ----
} else if (iNumArguments == 2) {
iStart = arguments[0];
! iLength = arguments[1];
} else if (iNumArguments == 1) {
iStart = arguments[0];
+ iLength -= iStart;
}
***************
*** 858,868 ****
}
! if ((typeof iEnd != 'number') || (parseInt(iEnd.toString()) != iEnd)) {
! throw vError = new TypeMismatchException('String.remove', 'number', typeof iEnd);
}
! var sSubString = this.slice(iStart, iEnd);
! var oRegExp = new RegExp(sSubString);
! var sDeleted = this.replace(oRegExp, '');
}
catch (vError) {
--- 871,893 ----
}
! if ((typeof iLength != 'number') || (parseInt(iLength.toString()) != iLength)) {
! throw vError = new TypeMismatchException('String.remove', 'number', typeof iLength);
}
! var iEnd = iStart + iLength;
!
! if (iStart < 0) {
! throw vError = new ArrayIndexOutOfBoundsException('String.remove', iStart, iStringLength);
! }
!
! if (iLength <= 0) {
! throw vError = new ArrayIndexOutOfBoundsException('String.remove', iLength, iStringLength);
! }
!
! if (iEnd > iStringLength) {
! throw vError = new ArrayIndexOutOfBoundsException('String.remove', iEnd, iStringLength);
! }
!
! var sModifiedString = this.replace(new RegExp(this.slice(iStart, iEnd)), '');
}
catch (vError) {
***************
*** 874,878 ****
finally {
! return vError ? null : sDeleted;
}
}
--- 899,903 ----
finally {
! return vError ? null : sModifiedString;
}
}
***************
*** 928,939 ****
/**
! * Repeats this string a specified number of times.
*
* @summary repeat characters
* @author Stuart Wigley
* @author Randolph Fielding
! * @version 1.1, 08/04/03
! * @interface <code>String.repeat(iMultiplier)</code>
! * @param iMultiplier the number of times to repeat this string
* @return a new string
* @return <code>null</code> if an exception is encountered
--- 953,966 ----
/**
! * Repeats each character in this string, in succession, a specified number of
! * times.
*
* @summary repeat characters
* @author Stuart Wigley
* @author Randolph Fielding
! * @version 1.1, 09/21/03
! * @interface <code>String.repeatChars(iMultiplier)</code>
! * @param iMultiplier the number of times to repeat each character in this
! * string
* @return a new string
* @return <code>null</code> if an exception is encountered
***************
*** 956,963 ****
}
var sRepeatedString = '';
- var iLength = this.length;
! for (var i = 0; i < iLength; i++) {
for (var j = 0; j < iMultiplier; j++) {
sRepeatedString += this.charAt(i);
--- 983,990 ----
}
+ var iStringLength = this.length;
var sRepeatedString = '';
! for (var i = 0; i < iStringLength; i++) {
for (var j = 0; j < iMultiplier; j++) {
sRepeatedString += this.charAt(i);
***************
*** 1242,1250 ****
/**
! * Swap every second character in the string
*
* @summary swap characters
* @author Stuart Wigley
! * @version 1.0, 09/19/03
* @interface <code>String.swap()</code>
* @return a modified string
--- 1269,1279 ----
/**
! * Swaps every second character in this string with the character immediately
! * preceding it.
*
* @summary swap characters
* @author Stuart Wigley
! * @author Randolph Fielding
! * @version 1.1, 09/21/03
* @interface <code>String.swap()</code>
* @return a modified string
***************
*** 1263,1271 ****
}
var sModifiedString = '';
- var iLength = this.length;
! for (var i = 0; i < iLength; i += 2) {
! sModifiedString += this.charAt(i + 1);
sModifiedString += this.charAt(i);
}
--- 1292,1302 ----
}
+ var iStringLength = this.length;
var sModifiedString = '';
! for (var i = 0; i < iStringLength; i += 2) {
! if ((i + 1) < iStringLength) {
! sModifiedString += this.charAt(i + 1);
! }
sModifiedString += this.charAt(i);
}
***************
*** 1341,1361 ****
/**
! * Truncate a string to the specified length. If specified the final three
! * characters are replaced with an ellipsis.
*
* @summary truncate
* @author Stuart Wigley
! * @version 1.0, 09/03/03
* @interface <code>String.truncate(iLength)</code>
! * @interface <code>String.truncate(iEllipsis)</code>
! * @param iLength the position at which truncation should occur
! * @param iEllipsis replace the final three characters with an ellipsis.
! * (yes: 1; no: 0; default: 0) (optional)
* @return a modified string
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
* @throws TypeMismatchException
*/
! String.prototype.truncate = function() {
try {
--- 1372,1399 ----
/**
! * Truncates this string to the specified length. If specified, the final three
! * characters of the truncated string are replaced with an ellipsis.
*
* @summary truncate
* @author Stuart Wigley
! * @author Randolph Fielding
! * @version 1.1, 09/21/03
* @interface <code>String.truncate(iLength)</code>
! * @interface <code>String.truncate(iLength, bUseEllipsis)</code>
! * @param iLength the index of the character to truncate at
! * @param bUseEllipsis a boolean value representing whether the final three
! * characters should be replaced with an ellipsis or not
! * (optional)
! * @return the original string if (1) <code>iLength</code> is
! * greater than or equal to the length of the original
! * string or (2) <code>iLength <= 3</code> and
! * <code>bUseEllipsis = true</code>
* @return a modified string
* @return <code>null</code> if an exception is encountered
+ * @throws ArrayIndexOutOfBoundsException
* @throws IllegalArgumentException
* @throws TypeMismatchException
*/
! String.prototype.truncate = function(iLength) {
try {
***************
*** 1363,1376 ****
var vError = null;
var iNumArguments = arguments.length;
! var iLength = this.length;
! var iEllipsis = 0;
! if (iNumArguments == 1) {
! iLength = arguments[0];
! } else if (iNumArguments == 2) {
! iLength = arguments[0];
! iEllipsis = arguments[1];
! } else {
throw vError = new IllegalArgumentException('String.truncate', '1 or 2', iNumArguments);
}
--- 1401,1410 ----
var vError = null;
var iNumArguments = arguments.length;
! var bUseEllipsis = false;
! if ((iNumArguments < 1) || (iNumArguments > 2)) {
throw vError = new IllegalArgumentException('String.truncate', '1 or 2', iNumArguments);
+ } else if (iNumArguments == 2) {
+ bUseEllipsis = arguments[1];
}
***************
*** 1379,1389 ****
}
var sTruncatedString = '';
! for (var i = 0; i < iLength; i++) {
! if ((iEllipsis == 1) && (iLength - i < 4)) {
! sTruncatedString += '.';
! } else {
! sTruncatedString += this.charAt(i);
}
}
--- 1413,1433 ----
}
+ if (typeof bUseEllipsis != 'boolean') {
+ throw vError = new TypeMismatchException('String.truncate', 'boolean', typeof bUseEllipsis);
+ }
+
+ var iStringLength = this.length;
+
+ if (iLength < 0) {
+ throw vError = new ArrayIndexOutOfBoundsException('String.truncate', iLength, iStringLength);
+ }
+
var sTruncatedString = '';
! if ((iLength >= iStringLength) || (bUseEllipsis && (iLength <= 3))) {
! sTruncatedString = this;
! } else {
! for (var i = 0; i < iLength; i++) {
! sTruncatedString += (bUseEllipsis && ((iLength - i) <= 3)) ? '.' : this.charAt(i);
}
}
|
|
From: <gat...@us...> - 2003-09-20 20:30:00
|
Update of /cvsroot/jspro/jsPro/docs
In directory sc8-pr-cvs1:/tmp/cvs-serv11877/docs
Modified Files:
string.html
Log Message:
QA: spacing
Index: string.html
===================================================================
RCS file: /cvsroot/jspro/jsPro/docs/string.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** string.html 19 Sep 2003 15:43:07 -0000 1.4
--- string.html 20 Sep 2003 20:29:56 -0000 1.5
***************
*** 81,86 ****
<tr>
<td>String.insert()</td>
! <td><input id="insert1" name="input" type="text" size="5" />
! <input id="insert2" name="input" type="text" size="5" /></td>
<td><input id="insert" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
<td><input id="insertResult" name="output" type="text" size="30" readonly="readonly" /></td>
--- 81,88 ----
<tr>
<td>String.insert()</td>
! <td>
! <input id="insert1" name="input" type="text" size="5" />
! <input id="insert2" name="input" type="text" size="5" />
! </td>
<td><input id="insert" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
<td><input id="insertResult" name="output" type="text" size="30" readonly="readonly" /></td>
***************
*** 121,126 ****
<tr>
<td>String.overlay()</td>
! <td><input id="overlay1" name="input" type="text" size="5" />
! <input id="overlay2" name="input" type="text" size="5" /></td>
<td><input id="overlay" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
<td><input id="overlayResult" name="output" type="text" size="30" readonly="readonly" /></td>
--- 123,130 ----
<tr>
<td>String.overlay()</td>
! <td>
! <input id="overlay1" name="input" type="text" size="5" />
! <input id="overlay2" name="input" type="text" size="5" />
! </td>
<td><input id="overlay" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
<td><input id="overlayResult" name="output" type="text" size="30" readonly="readonly" /></td>
***************
*** 128,134 ****
<tr>
<td>String.pad()</td>
! <td><input id="pad1" name="input" type="text" size="5" />
! <input id="pad2" name="input" type="text" size="5" />
! <input id="pad3" name="input" type="text" size="5" /></td>
<td><input id="pad" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
<td><input id="padResult" name="output" type="text" size="30" readonly="readonly" /></td>
--- 132,140 ----
<tr>
<td>String.pad()</td>
! <td>
! <input id="pad1" name="input" type="text" size="5" />
! <input id="pad2" name="input" type="text" size="5" />
! <input id="pad3" name="input" type="text" size="5" />
! </td>
<td><input id="pad" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
<td><input id="padResult" name="output" type="text" size="30" readonly="readonly" /></td>
***************
*** 136,141 ****
<tr>
<td>String.remove()</td>
! <td><input id="remove1" name="input" type="text" size="5" />
! <input id="remove2" name="input" type="text" size="5" /></td>
<td><input id="remove" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
<td><input id="removeResult" name="output" type="text" size="30" readonly="readonly" /></td>
--- 142,149 ----
<tr>
<td>String.remove()</td>
! <td>
! <input id="remove1" name="input" type="text" size="5" />
! <input id="remove2" name="input" type="text" size="5" />
! </td>
<td><input id="remove" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
<td><input id="removeResult" name="output" type="text" size="30" readonly="readonly" /></td>
***************
*** 197,202 ****
<tr>
<td>String.truncate()</td>
! <td><input id="truncate1" name="input" type="text" size="5" />
! <input id="truncate2" name="input" type="text" size="5" /></td>
<td><input id="truncate" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
<td><input id="truncateResult" name="output" type="text" size="30" readonly="readonly" /></td>
--- 205,212 ----
<tr>
<td>String.truncate()</td>
! <td>
! <input id="truncate1" name="input" type="text" size="5" />
! <input id="truncate2" name="input" type="text" size="5" />
! </td>
<td><input id="truncate" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
<td><input id="truncateResult" name="output" type="text" size="30" readonly="readonly" /></td>
|
|
From: <gat...@us...> - 2003-09-20 20:18:11
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv9849
Modified Files:
CHANGES
Log Message:
QA: slightly updated format to increase readability of information between releases; moved one R3 comment from Additions section to Changes section
Index: CHANGES
===================================================================
RCS file: /cvsroot/jspro/jsPro/CHANGES,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** CHANGES 19 Sep 2003 15:44:43 -0000 1.16
--- CHANGES 20 Sep 2003 20:18:08 -0000 1.17
***************
*** 1,5 ****
! -------------------------------------------------------------------------------
! Whats new in R3?
! -------------------------------------------------------------------------------
Additions:
--- 1,6 ----
! ===============================================================================
! Whats new in R3? (Not Yet Released)
! ===============================================================================
!
Additions:
***************
*** 8,12 ****
- Array.averageDev()
- Array.changeKeyCase()
- - renamed Array.stdev() to Array.standardDev()
browser.js:
--- 9,12 ----
***************
*** 56,61 ****
--- 56,66 ----
-------------------------------------------------------------------------------
+
Changes:
+ array.js:
+
+ - renamed Array.stdev() to Array.standardDev()
+
error.js:
***************
*** 63,69 ****
of the current window or to the new debug window
! -------------------------------------------------------------------------------
! Whats new in R2?
! -------------------------------------------------------------------------------
Additions:
--- 68,75 ----
of the current window or to the new debug window
! ===============================================================================
! Whats new in R2? (Released 25 Aug 2003)
! ===============================================================================
!
Additions:
***************
*** 150,154 ****
--- 156,162 ----
- String.lpad()
- String.rpad()
+
-------------------------------------------------------------------------------
+
Changes:
***************
*** 244,246 ****
wrapping strings without splitting words; made method compatible
with Constants()
! -------------------------------------------------------------------------------
\ No newline at end of file
--- 252,255 ----
wrapping strings without splitting words; made method compatible
with Constants()
!
! ===============================================================================
\ No newline at end of file
|
|
From: <gat...@us...> - 2003-09-20 20:01:18
|
Update of /cvsroot/jspro/jsPro/docs
In directory sc8-pr-cvs1:/tmp/cvs-serv6634/docs
Modified Files:
array.html
Log Message:
QA: spacing
Index: array.html
===================================================================
RCS file: /cvsroot/jspro/jsPro/docs/array.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** array.html 19 Sep 2003 15:43:07 -0000 1.5
--- array.html 20 Sep 2003 20:01:15 -0000 1.6
***************
*** 47,52 ****
<tr>
<td>Array.averageDev()</td>
! <td><input id="averageDev1" name="input" type="text" size="5" />
! <input id="averageDev2" name="input" type="text" size="5" /></td>
<td><input id="averageDev" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, 'aSample')" /></td>
<td><input id="averageDevResult" name="output" type="text" size="30" readonly="readonly" /></td>
--- 47,54 ----
<tr>
<td>Array.averageDev()</td>
! <td>
! <input id="averageDev1" name="input" type="text" size="5" />
! <input id="averageDev2" name="input" type="text" size="5" />
! </td>
<td><input id="averageDev" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, 'aSample')" /></td>
<td><input id="averageDevResult" name="output" type="text" size="30" readonly="readonly" /></td>
|
|
From: <gat...@us...> - 2003-09-20 19:55:49
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv5780
Modified Files:
array.js
Log Message:
QA: minor modifications and corrections
Index: array.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/array.js,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** array.js 19 Sep 2003 15:44:21 -0000 1.26
--- array.js 20 Sep 2003 19:55:44 -0000 1.27
***************
*** 33,37 ****
* @summary average deviation
* @author Stuart Wigley
! * @version 1.0, 19/08/03
* @interface <code>Array.averageDev()</code>
* @interface <code>Array.averageDev(iStart)</code>
--- 33,37 ----
* @summary average deviation
* @author Stuart Wigley
! * @version 1.0, 09/19/03
* @interface <code>Array.averageDev()</code>
* @interface <code>Array.averageDev(iStart)</code>
***************
*** 97,104 ****
}
- var aAbsValues = new Array();
- var iCount = 0;
- var faverageDev = null;
-
var fMean = this.mean(iStart, iEnd);
--- 97,100 ----
***************
*** 107,119 ****
}
for (var i = iStart; i < iEnd; i++) {
if (typeof this[i] == 'number') {
! aAbsValues[iCount] = (Math.abs(this[i] - fMean));
iCount++;
}
}
! var faverageDev = aAbsValues.mean();
}
catch (vError) {
--- 103,121 ----
}
+ var aAbsoluteDevs = new Array();
+ var iCount = 0;
+
for (var i = iStart; i < iEnd; i++) {
if (typeof this[i] == 'number') {
! aAbsoluteDevs[iCount] = Math.abs(this[i] - fMean);
iCount++;
}
}
! var fAverageDev = aAbsoluteDevs.mean();
+ if (!fAverageDev) {
+ throw vError = new UnknownException('Array.averageDev');
+ }
}
catch (vError) {
***************
*** 125,129 ****
finally {
! return vError ? null : faverageDev;
}
}
--- 127,131 ----
finally {
! return vError ? null : fAverageDev;
}
}
***************
*** 368,378 ****
var fMean = this.mean(iStart, iLength);
! var fstandardDev = this.standardDev(iStart, iLength);
! if (!fMean || !fstandardDev) {
throw vError = new UnknownException('Array.covar');
}
! var fCovar = fstandardDev / fMean;
}
catch (vError) {
--- 370,380 ----
var fMean = this.mean(iStart, iLength);
! var fStandardDev = this.standardDev(iStart, iLength);
! if (!fMean || !fStandardDev) {
throw vError = new UnknownException('Array.covar');
}
! var fCovar = fStandardDev / fMean;
}
catch (vError) {
***************
*** 1096,1100 ****
}
! var fstandardDev = Math.sqrt(fVariance);
}
catch (vError) {
--- 1098,1102 ----
}
! var fStandardDev = Math.sqrt(fVariance);
}
catch (vError) {
***************
*** 1106,1110 ****
finally {
! return vError ? null : fstandardDev;
}
}
--- 1108,1112 ----
finally {
! return vError ? null : fStandardDev;
}
}
|
|
From: <wi...@us...> - 2003-09-19 20:24:25
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv9968
Modified Files:
string.js array.js
Added Files:
validator.js
Log Message:
various new methods - see CHANGES for details
--- NEW FILE: validator.js ---
/**
* +-------------------------------------------------------------------------+
* | jsPro - Validator |
* +-------------------------------------------------------------------------+
* | Copyright (C) 2001-2003 Stuart Wigley |
* +-------------------------------------------------------------------------+
* | This library is free software; you can redistribute it and/or modify it |
* | under the terms of the GNU Lesser General Public License as published by|
* | the Free Software Foundation; either version 2.1 of the License, or (at |
* | your option) any later version. |
* | |
* | This library is distributed in the hope that it will be useful, but |
* | WITHOUT ANY WARRANTY; without even the implied warranty of |
* | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser |
* | General Public License for more details. |
* | |
* | You should have received a copy of the GNU Lesser General Public License|
* | along with this library; if not, write to the Free Software Foundation, |
* | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* +-------------------------------------------------------------------------+
* | Authors: Stuart Wigley <stu...@ya...> |
* +-------------------------------------------------------------------------+
* $Id: validator.js,v 1.1 2003/09/19 15:44:21 wigleys Exp $
*/
/**
* Creates an object that provides methods for performing boolean validations.
*
* @author Stuart Wigley
* @version 1.0, 09/19/03
* @interface <code>new Validator()</code>
*/
function Validator() { }
/**
* Test if the supplied value is a blank string or a string made up of
* whitespaces, tabs or newline characters
*
* @summary is a blank string
* @author Stuart Wigley
* @version 1.0, 09/19/03
* @interface <code>Validator.isBlankString(sValue)</code>
* @param sValue the value to test against
* @return true or false
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
* @throws TypeMismatchException
*/
Validator.prototype.isBlankString = function(sValue) {
try {
var vError = null;
var iNumArguments = arguments.length;
if (iNumArguments != 1) {
throw vError = new IllegalArgumentException('Validator.isBlankString', 1, iNumArguments);
}
if (typeof sValue != 'string') {
throw vError = new TypeMismatchException('Validator.isBlankString', 'string', typeof sValue);
}
var bIsBlankString = (sValue.match(/[\w]/g)) ? false : true;
}
catch (vError) {
if (vError instanceof Error) {
vError.handleError();
}
}
finally {
return vError ? null : bIsBlankString;
}
}
/**
* Test if the supplied value is a single digit in the range 0 to 9
*
* @summary is a single digit
* @author Stuart Wigley
* @version 1.0, 09/19/03
* @interface <code>Validator.isDigit(iValue)</code>
* @param iValue the value to test against
* @return true or false
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
* @throws TypeMismatchException
*/
Validator.prototype.isDigit = function(iValue) {
try {
var vError = null;
var iNumArguments = arguments.length;
if (iNumArguments != 1) {
throw vError = new IllegalArgumentException('Validator.isDigit', 1, iNumArguments);
}
if (typeof iValue != 'number') {
throw vError = new TypeMismatchException('Validator.isDigit', 'number', typeof iValue);
}
var bIsDigit = ((iValue < 10) && iValue.toString().length == 1) ? true : false;
}
catch (vError) {
if (vError instanceof Error) {
vError.handleError();
}
}
finally {
return vError ? null : bIsDigit;
}
}
/**
* Test if the supplied value is an integer
*
* @summary is an integer
* @author Stuart Wigley
* @version 1.0, 09/19/03
* @interface <code>Validator.isInteger(iValue)</code>
* @param iValue the value to test against
* @return true or false
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
* @throws TypeMismatchException
*/
Validator.prototype.isInteger = function(iValue) {
try {
var vError = null;
var iNumArguments = arguments.length;
if (iNumArguments != 1) {
throw vError = new IllegalArgumentException('Validator.isInteger', 1, iNumArguments);
}
if (typeof iValue != 'number') {
throw vError = new TypeMismatchException('Validator.isInteger', 'number', typeof iValue);
}
var bIsInteger = (iValue.toString().indexOf('.') == -1) ? true : false;
}
catch (vError) {
if (vError instanceof Error) {
vError.handleError();
}
}
finally {
return vError ? null : bIsInteger;
}
}
Index: string.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/string.js,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** string.js 15 Sep 2003 01:51:03 -0000 1.17
--- string.js 19 Sep 2003 15:44:21 -0000 1.18
***************
*** 30,34 ****
* quotes), and reverse solidi (backslashes) in this string with backslashes.
*
! * @summary escape vertain characters with backslashes
* @author Stuart Wigley
* @author Randolph Fielding
--- 30,34 ----
* quotes), and reverse solidi (backslashes) in this string with backslashes.
*
! * @summary escape certain characters with backslashes
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 73,76 ****
--- 73,156 ----
/**
+ * Concatenate the string representation of <code>vValue</code> to the end of
+ * the current string
+ *
+ * @summary count occurrence of characters
+ * @author Stuart Wigley
+ * @version 1.0, 09/19/03
+ * @interface <code>String.cat(vValue)</code>
+ * @param vValue value to be concatenated to end of string
+ * @return concatenated string
+ * @return <code>null</code> if an exception is encountered
+ * @throws IllegalArgumentException
+ */
+ String.prototype.cat = function(vValue) {
+
+ try {
+
+ var vError = null;
+ var iNumArguments = arguments.length;
+
+ if (iNumArguments != 1) {
+ throw vError = new IllegalArgumentException('String.cat', 1, iNumArguments);
+ }
+
+ var sValue = arguments[0].toString();
+ var sCatString = this + sValue;
+
+ }
+ catch (vError) {
+
+ if (vError instanceof Error) {
+ vError.handleError();
+ }
+ }
+ finally {
+
+ return vError ? null : sCatString;
+ }
+ }
+
+
+ /**
+ * Replaces all Unix, Windows and Macintosh newline characters, tabs and
+ * repeated spaces with a single space character.
+ *
+ * @summary compress to spaces
+ * @author Stuart Wigley
+ * @version 1.0, 09/19/03
+ * @interface <code>String.compress()</code>
+ * @return a modified string
+ * @return <code>null</code> if an exception is encountered
+ * @throws IllegalArgumentException
+ */
+ String.prototype.compress = function() {
+
+ try {
+
+ var vError = null;
+ var iNumArguments = arguments.length;
+ var iDocType = 1;
+
+ if (iNumArguments != 0) {
+ throw vError = new IllegalArgumentException('String.compress', 0, iNumArguments);
+ }
+
+ var sModifiedString = this.replace(/(\r\n)|(\r)|(\n)|(\t)|(\s+)/g, ' ');
+ }
+ catch (vError) {
+
+ if (vError instanceof Error) {
+ vError.handleError();
+ }
+ }
+ finally {
+
+ return vError ? null : sModifiedString;
+ }
+ }
+
+
+ /**
* Returns an associative array keyed on the characters of this string. Each
* member of the associative array contains an integer value representing the
***************
*** 244,247 ****
--- 324,390 ----
/**
+ * Inserts a string into another string at the specified position
+ *
+ * @summary insert a string
+ * @author Stuart Wigley
+ * @version 1.0, 09/19/03
+ * @interface <code>String.insert(sInsert)</code>
+ * @interface <code>String.insert(sInsert, iStart)</code>
+ * @param sInsert the string to be inserted
+ * @param iStart the position where the insert should begin
+ * @return a modified string
+ * @return <code>null</code> if an exception is encountered
+ * @throws IllegalArgumentException
+ */
+ String.prototype.insert = function() {
+
+ try {
+
+ var vError = null;
+ var iNumArguments = arguments.length;
+ var sInsert = '';
+ var iStart = 0;
+ var iLength = this.length;
+
+ if (iNumArguments == 1) {
+ sInsert = arguments[0];
+ } else if (iNumArguments == 2) {
+ sInsert = arguments[0];
+ iStart = arguments[1];
+ } else {
+ throw vError = new IllegalArgumentException('String.insert', '1 or 2', iNumArguments);
+ }
+
+ if (typeof sInsert != 'string') {
+ throw vError = new TypeMismatchException('String.insert', 'string', typeof sInsert);
+ }
+ if ((typeof iStart != 'number') || (parseInt(iStart.toString()) != iStart)) {
+ throw vError = new TypeMismatchException('String.insert', 'number', typeof iStart);
+ }
+
+ var sModifiedString = '';
+
+ for (var i = 0; i < iLength; i++) {
+ if (i == iStart) {
+ sModifiedString += sInsert;
+ }
+ sModifiedString += this.charAt(i);
+ }
+
+ }
+ catch (vError) {
+
+ if (vError instanceof Error) {
+ vError.handleError();
+ }
+ }
+ finally {
+
+ return vError ? null : sModifiedString;
+ }
+ }
+
+
+ /**
* Tests this string with a regular expression for standard email address
* compliance.
***************
*** 537,540 ****
--- 680,747 ----
/**
+ * Overlays a string over another string at the specified position
+ *
+ * @summary overlay a string
+ * @author Stuart Wigley
+ * @version 1.0, 09/19/03
+ * @interface <code>String.overlay(sInsert)</code>
+ * @interface <code>String.overlay(sInsert, iStart)</code>
+ * @param sOverlay the string to be overlayed
+ * @param iStart the position where the overlay should begin
+ * @return a modified string
+ * @return <code>null</code> if an exception is encountered
+ * @throws IllegalArgumentException
+ */
+ String.prototype.overlay = function() {
+
+ try {
+
+ var vError = null;
+ var iNumArguments = arguments.length;
+ var sOverlay = '';
+ var iStart = 0;
+ var iLength = this.length;
+
+ if (iNumArguments == 1) {
+ sOverlay = arguments[0];
+ } else if (iNumArguments == 2) {
+ sOverlay = arguments[0];
+ iStart = arguments[1];
+ } else {
+ throw vError = new IllegalArgumentException('String.overlay', '1 or 2', iNumArguments);
+ }
+
+ if (typeof sOverlay != 'string') {
+ throw vError = new TypeMismatchException('String.insert', 'string', typeof sOverlay);
+ }
+ if ((typeof iStart != 'number') || (parseInt(iStart.toString()) != iStart)) {
+ throw vError = new TypeMismatchException('String.insert', 'number', typeof iStart);
+ }
+
+ var sModifiedString = '';
+
+ for (var i = 0; i < iLength; i++) {
+ if (i == iStart) {
+ sModifiedString += sOverlay;
+ i += sOverlay.length;
+ }
+ sModifiedString += this.charAt(i);
+ }
+
+ }
+ catch (vError) {
+
+ if (vError instanceof Error) {
+ vError.handleError();
+ }
+ }
+ finally {
+
+ return vError ? null : sModifiedString;
+ }
+ }
+
+
+ /**
* Pads either both sides, the left side, or the right side of this string
* with another string for a specified number of times.
***************
*** 614,617 ****
--- 821,883 ----
/**
+ * Removes all characters from the string or a subset of characters (if the
+ * optional start and end arguments are specified)
+ *
+ * @summary delete characters
+ * @author Stuart Wigley
+ * @version 1.0, 09/19/03
+ * @interface <code>String.remove()</code>
+ * @interface <code>String.remove(iStart)</code>
+ * @interface <code>String.remove(iStart, iEnd)</code>
+ * @param iStart the string position to start at (optional)
+ * @param iEnd the string position to end at (optional)
+ * @return the modified string
+ * @return <code>null</code> if an exception is encountered
+ * @throws IllegalArgumentException
+ */
+ String.prototype.remove = function() {
+
+ try {
+
+ var vError = null;
+ var iNumArguments = arguments.length;
+ var iStart = 0;
+ var iEnd = this.length + 1;
+
+ if (iNumArguments > 2) {
+ throw vError = new IllegalArgumentException('String.remove', '0, 1 or 2', iNumArguments);
+ } else if (iNumArguments == 2) {
+ iStart = arguments[0];
+ iEnd = arguments[1];
+ } else if (iNumArguments == 1) {
+ iStart = arguments[0];
+ }
+
+ if ((typeof iStart != 'number') || (parseInt(iStart.toString()) != iStart)) {
+ throw vError = new TypeMismatchException('String.remove', 'number', typeof iStart);
+ }
+
+ if ((typeof iEnd != 'number') || (parseInt(iEnd.toString()) != iEnd)) {
+ throw vError = new TypeMismatchException('String.remove', 'number', typeof iEnd);
+ }
+
+ var sSubString = this.slice(iStart, iEnd);
+ var oRegExp = new RegExp(sSubString);
+ var sDeleted = this.replace(oRegExp, '');
+ }
+ catch (vError) {
+
+ if (vError instanceof Error) {
+ vError.handleError();
+ }
+ }
+ finally {
+
+ return vError ? null : sDeleted;
+ }
+ }
+
+
+ /**
* Repeats this string a specified number of times.
*
***************
*** 662,665 ****
--- 928,982 ----
/**
+ * Repeats this string a specified number of times.
+ *
+ * @summary repeat
+ * @author Stuart Wigley
+ * @author Randolph Fielding
+ * @version 1.1, 08/04/03
+ * @interface <code>String.repeat(iMultiplier)</code>
+ * @param iMultiplier the number of times to repeat this string
+ * @return a new string
+ * @return <code>null</code> if an exception is encountered
+ * @throws IllegalArgumentException
+ * @throws TypeMismatchException
+ */
+ String.prototype.repeatChars = function(iMultiplier) {
+
+ try {
+
+ var vError = null;
+ var iNumArguments = arguments.length;
+
+ if (iNumArguments != 1) {
+ throw vError = new IllegalArgumentException('String.repeatChars', 1, iNumArguments);
+ }
+
+ if ((typeof iMultiplier != 'number') || (parseInt(iMultiplier.toString()) != iMultiplier)) {
+ throw vError = new TypeMismatchException('String.repeatChars', 'number', typeof iMultiplier);
+ }
+
+ var sRepeatedString = '';
+ var iLength = this.length;
+
+ for (var i = 0; i < iLength; i++) {
+ for (var j = 0; j < iMultiplier; j++) {
+ sRepeatedString += this.charAt(i);
+ }
+ }
+ }
+ catch (vError) {
+
+ if (vError instanceof Error) {
+ vError.handleError();
+ }
+ }
+ finally {
+
+ return vError ? null : sRepeatedString;
+ }
+ }
+
+
+ /**
* Reverses the order of all characters within this string or a subset of
* characters within this string (if the optional start and length arguments
***************
*** 925,928 ****
--- 1242,1288 ----
/**
+ * Swap every second character in the string
+ *
+ * @summary swap characters
+ * @author Stuart Wigley
+ * @version 1.0, 09/19/03
+ * @interface <code>String.swap()</code>
+ * @return a modified string
+ * @return <code>null</code> if an exception is encountered
+ * @throws IllegalArgumentException
+ */
+ String.prototype.swap = function() {
+
+ try {
+
+ var vError = null;
+ var iNumArguments = arguments.length;
+
+ if (iNumArguments > 0) {
+ throw vError = new IllegalArgumentException('String.swap', 0, iNumArguments);
+ }
+
+ var sModifiedString = '';
+ var iLength = this.length;
+
+ for (var i = 0; i < iLength; i += 2) {
+ sModifiedString += this.charAt(i + 1);
+ sModifiedString += this.charAt(i);
+ }
+ }
+ catch (vError) {
+
+ if (vError instanceof Error) {
+ vError.handleError();
+ }
+ }
+ finally {
+
+ return vError ? null : sModifiedString;
+ }
+ }
+
+
+ /**
* Trims whitespace characters from either both sides, the left side, or the
* right side of this string.
***************
*** 976,979 ****
--- 1336,1401 ----
return vError ? null : sTrimmedString;
+ }
+ }
+
+
+ /**
+ * Truncate a string to the specified length. If specified the final three
+ * characters are replaced with an ellipsis.
+ *
+ * @summary truncate
+ * @author Stuart Wigley
+ * @version 1.0, 09/03/03
+ * @interface <code>String.truncate(iLength)</code>
+ * @interface <code>String.truncate(iEllipsis)</code>
+ * @param iLength the position at which truncation should occur
+ * @param iEllipsis replace the final three characters with an ellipsis.
+ * (yes: 1; no: 0; default: 0) (optional)
+ * @return a modified string
+ * @return <code>null</code> if an exception is encountered
+ * @throws IllegalArgumentException
+ * @throws TypeMismatchException
+ */
+ String.prototype.truncate = function() {
+
+ try {
+
+ var vError = null;
+ var iNumArguments = arguments.length;
+ var iLength = this.length;
+ var iEllipsis = 0;
+
+ if (iNumArguments == 1) {
+ iLength = arguments[0];
+ } else if (iNumArguments == 2) {
+ iLength = arguments[0];
+ iEllipsis = arguments[1];
+ } else {
+ throw vError = new IllegalArgumentException('String.truncate', '1 or 2', iNumArguments);
+ }
+
+ if ((typeof iLength != 'number') || (parseInt(iLength.toString()) != iLength)) {
+ throw vError = new TypeMismatchException('String.truncate', 'number', typeof iLength);
+ }
+
+ var sTruncatedString = '';
+
+ for (var i = 0; i < iLength; i++) {
+ if ((iEllipsis == 1) && (iLength - i < 4)) {
+ sTruncatedString += '.';
+ } else {
+ sTruncatedString += this.charAt(i);
+ }
+ }
+ }
+ catch (vError) {
+
+ if (vError instanceof Error) {
+ vError.handleError();
+ }
+ }
+ finally {
+
+ return vError ? null : sTruncatedString;
}
}
Index: array.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/array.js,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** array.js 17 Sep 2003 08:43:30 -0000 1.25
--- array.js 19 Sep 2003 15:44:21 -0000 1.26
***************
*** 27,30 ****
--- 27,134 ----
/**
+ * Calculates and returns the average deviation of all array members or of a
+ * subset of array members (if the optional start and length arguments are
+ * specified).
+ *
+ * @summary average deviation
+ * @author Stuart Wigley
+ * @version 1.0, 19/08/03
+ * @interface <code>Array.averageDev()</code>
+ * @interface <code>Array.averageDev(iStart)</code>
+ * @interface <code>Array.averageDev(iStart, iLength)</code>
+ * @requires <code>Array.mean(iStart, iLength)</code>
+ * @param iStart the index of the array member to start at (optional)
+ * @param iLength the number of array members to evaluate beginning at
+ * <code>iStart</code> (optional)
+ * @return the average deviation of all array members or of a
+ * subset of array members
+ * @return <code>null</code> if an exception is encountered
+ * @throws ArrayIndexOutOfBoundsException
+ * @throws IllegalArgumentException
+ * @throws MethodNotAvailableException
+ * @throws TypeMismatchException
+ * @throws UnknownException
+ * @see <code>Array.mean()</code>
+ */
+ Array.prototype.averageDev = function() {
+
+ try {
+
+ var vError = null;
+ var iArrayLength = this.length;
+ var iNumArguments = arguments.length;
+ var iStart = 0;
+ var iLength = iArrayLength;
+
+ if (!('mean' in this)) {
+ throw vError = new MethodNotAvailableException('Array.averageDev', 'Array.mean');
+ }
+
+ if (iNumArguments > 2) {
+ throw vError = new IllegalArgumentException('Array.averageDev', '0, 1 or 2', iNumArguments);
+ } else if (iNumArguments == 2) {
+ iStart = arguments[0];
+ iLength = arguments[1];
+ } else if (iNumArguments == 1) {
+ iStart = arguments[0];
+ iLength -= iStart;
+ }
+
+ if ((typeof iStart != 'number') || (parseInt(iStart.toString()) != iStart)) {
+ throw vError = new TypeMismatchException('Array.averageDev', 'number', typeof iStart);
+ }
+
+ if ((typeof iLength != 'number') || (parseInt(iLength.toString()) != iLength)) {
+ throw vError = new TypeMismatchException('Array.averageDev', 'number', typeof iLength);
+ }
+
+ var iEnd = iStart + iLength;
+
+ if (iStart < 0) {
+ throw vError = new ArrayIndexOutOfBoundsException('Array.averageDev', iStart, iArrayLength);
+ }
+
+ if (iLength <= 0) {
+ throw vError = new ArrayIndexOutOfBoundsException('Array.averageDev', iLength, iArrayLength);
+ }
+
+ if (iEnd > iArrayLength) {
+ throw vError = new ArrayIndexOutOfBoundsException('Array.averageDev', iEnd, iArrayLength);
+ }
+
+ var aAbsValues = new Array();
+ var iCount = 0;
+ var faverageDev = null;
+
+ var fMean = this.mean(iStart, iEnd);
+
+ if (!fMean) {
+ throw vError = new UnknownException('Array.averageDev');
+ }
+
+ for (var i = iStart; i < iEnd; i++) {
+ if (typeof this[i] == 'number') {
+ aAbsValues[iCount] = (Math.abs(this[i] - fMean));
+ iCount++;
+ }
+ }
+
+ var faverageDev = aAbsValues.mean();
+
+ }
+ catch (vError) {
+
+ if (vError instanceof Error) {
+ vError.handleError();
+ }
+ }
+ finally {
+
+ return vError ? null : faverageDev;
+ }
+ }
+
+
+ /**
* Changes the case of all array keys to lowercase or uppercase.
*
***************
*** 198,202 ****
* @interface <code>Array.covar(iStart, iLength)</code>
* @requires <code>Array.mean(iStart, iLength)</code>
! * @requires <code>Array.stdev(iStart, iLength)</code>
* @param iStart the index of the array member to start at (optional)
* @param iLength the number of array members to evaluate beginning at
--- 302,306 ----
* @interface <code>Array.covar(iStart, iLength)</code>
* @requires <code>Array.mean(iStart, iLength)</code>
! * @requires <code>Array.standardDev(iStart, iLength)</code>
* @param iStart the index of the array member to start at (optional)
* @param iLength the number of array members to evaluate beginning at
***************
*** 211,215 ****
* @throws UnknownException
* @see <code>Array.mean()</code>
! * @see <code>Array.stdev()</code>
*/
Array.prototype.covar = function() {
--- 315,319 ----
* @throws UnknownException
* @see <code>Array.mean()</code>
! * @see <code>Array.standardDev()</code>
*/
Array.prototype.covar = function() {
***************
*** 227,232 ****
}
! if (!('stdev' in this)) {
! throw vError = new MethodNotAvailableException('Array.covar', 'Array.stdev');
}
--- 331,336 ----
}
! if (!('standardDev' in this)) {
! throw vError = new MethodNotAvailableException('Array.covar', 'Array.standardDev');
}
***************
*** 264,274 ****
var fMean = this.mean(iStart, iLength);
! var fStDev = this.stdev(iStart, iLength);
! if (!fMean || !fStDev) {
throw vError = new UnknownException('Array.covar');
}
! var fCovar = fStDev / fMean;
}
catch (vError) {
--- 368,378 ----
var fMean = this.mean(iStart, iLength);
! var fstandardDev = this.standardDev(iStart, iLength);
! if (!fMean || !fstandardDev) {
throw vError = new UnknownException('Array.covar');
}
! var fCovar = fstandardDev / fMean;
}
catch (vError) {
***************
*** 923,929 ****
* @author Randolph Fielding
* @version 1.4, 08/08/03
! * @interface <code>Array.stdev()</code>
! * @interface <code>Array.stdev(iStart)</code>
! * @interface <code>Array.stdev(iStart, iLength)</code>
* @requires <code>Array.variance(iStart, iLength)</code>
* @param iStart the index of the array member to start at (optional)
--- 1027,1033 ----
* @author Randolph Fielding
* @version 1.4, 08/08/03
! * @interface <code>Array.standardDev()</code>
! * @interface <code>Array.standardDev(iStart)</code>
! * @interface <code>Array.standardDev(iStart, iLength)</code>
* @requires <code>Array.variance(iStart, iLength)</code>
* @param iStart the index of the array member to start at (optional)
***************
*** 940,944 ****
* @see <code>Array.variance()</code>
*/
! Array.prototype.stdev = function() {
try {
--- 1044,1048 ----
* @see <code>Array.variance()</code>
*/
! Array.prototype.standardDev = function() {
try {
***************
*** 951,959 ****
if (!('variance' in this)) {
! throw vError = new MethodNotAvailableException('Array.stdev', 'Array.variance');
}
if (iNumArguments > 2) {
! throw vError = new IllegalArgumentException('Array.stdev', '0, 1 or 2', iNumArguments);
} else if (iNumArguments == 2) {
iStart = arguments[0];
--- 1055,1063 ----
if (!('variance' in this)) {
! throw vError = new MethodNotAvailableException('Array.standardDev', 'Array.variance');
}
if (iNumArguments > 2) {
! throw vError = new IllegalArgumentException('Array.standardDev', '0, 1 or 2', iNumArguments);
} else if (iNumArguments == 2) {
iStart = arguments[0];
***************
*** 965,973 ****
if ((typeof iStart != 'number') || (parseInt(iStart.toString()) != iStart)) {
! throw vError = new TypeMismatchException('Array.stdev', 'number', typeof iStart);
}
if ((typeof iLength != 'number') || (parseInt(iLength.toString()) != iLength)) {
! throw vError = new TypeMismatchException('Array.stdev', 'number', typeof iLength);
}
--- 1069,1077 ----
if ((typeof iStart != 'number') || (parseInt(iStart.toString()) != iStart)) {
! throw vError = new TypeMismatchException('Array.standardDev', 'number', typeof iStart);
}
if ((typeof iLength != 'number') || (parseInt(iLength.toString()) != iLength)) {
! throw vError = new TypeMismatchException('Array.standardDev', 'number', typeof iLength);
}
***************
*** 975,987 ****
if (iStart < 0) {
! throw vError = new ArrayIndexOutOfBoundsException('Array.stdev', iStart, iArrayLength);
}
if (iLength <= 0) {
! throw vError = new ArrayIndexOutOfBoundsException('Array.stdev', iLength, iArrayLength);
}
if (iEnd > iArrayLength) {
! throw vError = new ArrayIndexOutOfBoundsException('Array.stdev', iEnd, iArrayLength);
}
--- 1079,1091 ----
if (iStart < 0) {
! throw vError = new ArrayIndexOutOfBoundsException('Array.standardDev', iStart, iArrayLength);
}
if (iLength <= 0) {
! throw vError = new ArrayIndexOutOfBoundsException('Array.standardDev', iLength, iArrayLength);
}
if (iEnd > iArrayLength) {
! throw vError = new ArrayIndexOutOfBoundsException('Array.standardDev', iEnd, iArrayLength);
}
***************
*** 989,996 ****
if (!fVariance) {
! throw vError = new UnknownException('Array.stdev');
}
! var fStDev = Math.sqrt(fVariance);
}
catch (vError) {
--- 1093,1100 ----
if (!fVariance) {
! throw vError = new UnknownException('Array.standardDev');
}
! var fstandardDev = Math.sqrt(fVariance);
}
catch (vError) {
***************
*** 1002,1006 ****
finally {
! return vError ? null : fStDev;
}
}
--- 1106,1110 ----
finally {
! return vError ? null : fstandardDev;
}
}
|
|
From: <wi...@us...> - 2003-09-19 20:11:57
|
Update of /cvsroot/jspro/jsPro/docs In directory sc8-pr-cvs1:/tmp/cvs-serv9713 Added Files: validator.html Log Message: test page for Validator() --- NEW FILE: validator.html --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!-- * +-------------------------------------------------------------------------+ * | jsPro - Validator Test Page | * +-------------------------------------------------------------------------+ * | Copyright (C) 2001-2003 Stuart Wigley | * +-------------------------------------------------------------------------+ * | This library is free software; you can redistribute it and/or modify it | * | under the terms of the GNU Lesser General Public License as published by| * | the Free Software Foundation; either version 2.1 of the License, or (at | * | your option) any later version. | * | | * | This library is distributed in the hope that it will be useful, but | * | WITHOUT ANY WARRANTY; without even the implied warranty of | * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser | * | General Public License for more details. | * | | * | You should have received a copy of the GNU Lesser General Public License| * | along with this library; if not, write to the Free Software Foundation, | * | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | * +-------------------------------------------------------------------------+ * | Authors: Stuart Wigley <stu...@ya...> | * +-------------------------------------------------------------------------+ * $Id: validator.html,v 1.1 2003/09/19 15:42:46 wigleys Exp $ --> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title>jsPro - Validator</title> <script type="text/javascript" src="../error.js"></script> <script type="text/javascript" src="../debug/debug.js"></script> <script type="text/javascript" src="../validator.js"></script> <script type="text/javascript" src="test.js"></script> <script type="text/javascript"> var oTest = new Test(); var oDebug = new Debug(); var oValidator = new Validator(); </script> </head> <body> <table> <tbody> <tr> <td>Validator.isBlankString()</td> <td><input id="isBlankString1" name="input" type="text" size="5" /></td> <td><input id="isBlankString" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, 'oValidator')" /></td> <td><input id="isBlankStringResult" name="output" type="text" size="30" readonly="readonly" /></td> </tr> <tr> <td>Validator.isDigit()</td> <td><input id="isDigit1" name="input" type="text" size="5" /></td> <td><input id="isDigit" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, 'oValidator')" /></td> <td><input id="isDigitResult" name="output" type="text" size="30" readonly="readonly" /></td> </tr> <tr> <td>Validator.isInteger()</td> <td><input id="isInteger1" name="input" type="text" size="5" /></td> <td><input id="isInteger" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, 'oValidator')" /></td> <td><input id="isIntegerResult" name="output" type="text" size="30" readonly="readonly" /></td> </tr> </tbody> </table> </body> </html> |
|
From: <wi...@us...> - 2003-09-19 19:57:57
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv10038
Modified Files:
README CHANGES
Log Message:
updated to reflect latest changes
Index: README
===================================================================
RCS file: /cvsroot/jspro/jsPro/README,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** README 12 Sep 2003 14:30:41 -0000 1.21
--- README 19 Sep 2003 15:44:43 -0000 1.22
***************
*** 26,51 ****
array.js
-------------------------------------------------------------------------------
! Array.prototype.changeKeyCase(): change key case
! Array.prototype.chunk(): split into chunks
! Array.prototype.count(): count occurrence of values
! Array.prototype.covar(): coefficient of variation
! Array.prototype.fill(): fill
! Array.prototype.max(): maximum value
! Array.prototype.mean(): mean
! Array.prototype.median(): median
! Array.prototype.min(): minimum value
! Array.prototype.product(): product
! Array.prototype.range(): range
! Array.prototype.stdev(): standard deviation
! Array.prototype.sum(): sum
! Array.prototype.swap(): swap two members
! Array.prototype.variance(): unbiased variance
chemica.js
-------------------------------------------------------------------------------
! Chemica.prototype.getAtomicNo(): get Atomic Number
! Chemica.prototype.getAtomicWt(): get Atomic Weight
! Chemica.prototype.getName(): get Name
! Chemica.prototype.getSymbol(): get Symbol
constants.js
--- 26,57 ----
array.js
-------------------------------------------------------------------------------
! 1. Array.prototype.averageDev(): average deviation
! 2. Array.prototype.changeKeyCase(): change key case
! 3. Array.prototype.chunk(): split into chunks
! 4. Array.prototype.count(): count occurrence of values
! 5. Array.prototype.covar(): coefficient of variation
! 6. Array.prototype.fill(): fill
! 7. Array.prototype.max(): maximum value
! 8. Array.prototype.mean(): mean
! 9. Array.prototype.median(): median
! 10. Array.prototype.min(): minimum value
! 11. Array.prototype.product(): product
! 12. Array.prototype.range(): range
! 13. Array.prototype.standardDev(): standard deviation
! 14. Array.prototype.sum(): sum
! 15. Array.prototype.swap(): swap two members
! 16. Array.prototype.variance(): unbiased variance
!
! browser.js
! -------------------------------------------------------------------------------
! 17. Browser.prototype.getCookie(): retrieve value of cookie(s)
! 18. Browser.prototype.setCookie(): create cookie
chemica.js
-------------------------------------------------------------------------------
! 19. Chemica.prototype.getAtomicNo(): get Atomic Number
! 20. Chemica.prototype.getAtomicWt(): get Atomic Weight
! 21. Chemica.prototype.getName(): get Chemical Name
! 22. Chemica.prototype.getSymbol(): get Chemical Symbol
constants.js
***************
*** 54,85 ****
date.js
-------------------------------------------------------------------------------
! Date.prototype.formatDate(): format a date
! Date.prototype.getDayOfYear(): day of year
! Date.prototype.getDaysInMonth(): days in month
! Date.prototype.getGMTOffset(): GMT Offset
! Date.prototype.getLong12Hours(): two digit hour (01-12)
! Date.prototype.getLong24Hours(): two digit hour (00-23)
! Date.prototype.getLongDate(): two digit day of month (01-31)
! Date.prototype.getLongDayName(): Day name
! Date.prototype.getLongMinutes(): two digit minute (00-59)
! Date.prototype.getLongMonth(): two digit month (01-12)
! Date.prototype.getLongMonthName(): month name
! Date.prototype.getLongSeconds(): two digit seconds (00-59)
! Date.prototype.getMeridiem(): meridiem
! Date.prototype.getOrdinalSuffix(): english ordinal suffix
! Date.prototype.getRFC822Date(): RFC 822 date
! Date.prototype.getShort12Hours(): one/two digit hour (1-12)
! Date.prototype.getShort24Hours(): one/two digit hour (0-23)
! Date.prototype.getShortDayName(): short day name
! Date.prototype.getShortMonth(): one/two digit month (1-12)
! Date.prototype.getShortMonthName(): short month name
! Date.prototype.getShortYear(): two digit year (00-99)
! Date.prototype.getSwatchTime(): Swatch internet time
! Date.prototype.getTimeSeconds(): seconds since UNIX epoch
! Date.prototype.getTimezone(): not implemented
! Date.prototype.getTimezoneOffsetSeconds(): timezone offset in seconds
! Date.prototype.getWeekOfYear(): week of year
! Date.prototype.isDaylightSavingsTime(): not implemented
! Date.prototype.isLeapYear(): is leap year?
elements.js
--- 60,91 ----
date.js
-------------------------------------------------------------------------------
! 23. Date.prototype.formatDate(): format date
! 24. Date.prototype.getDayOfYear(): day of year
! 25. Date.prototype.getDaysInMonth(): days in month
! 26. Date.prototype.getGMTOffset(): GMT offset
! 27. Date.prototype.getLong12Hours(): 12-hour two-digit hour (01-12)
! 28. Date.prototype.getLong24Hours(): 24-hour two-digit hour (00-23)
! 29. Date.prototype.getLongDate(): two-digit day of month (01-31)
! 30. Date.prototype.getLongDayName(): day name
! 31. Date.prototype.getLongMinutes(): two-digit minutes (00-59)
! 32. Date.prototype.getLongMonth(): two-digit month (01-12)
! 33. Date.prototype.getLongMonthName(): month name
! 34. Date.prototype.getLongSeconds(): two-digit seconds (00-59)
! 35. Date.prototype.getMeridiem(): meridiem
! 36. Date.prototype.getOrdinalSuffix(): English ordinal suffix
! 37. Date.prototype.getRFC822Date(): RFC 822 date
! 38. Date.prototype.getShort12Hours(): 12-hour one-/two-digit hour (1-12)
! 39. Date.prototype.getShort24Hours(): 24-hour one-/two-digit hour (0-23)
! 40. Date.prototype.getShortDayName(): short day name
! 41. Date.prototype.getShortMonth(): one-/two-digit month (1-12)
! 42. Date.prototype.getShortMonthName(): short month name
! 43. Date.prototype.getShortYear(): two-digit year (00-99)
! 44. Date.prototype.getSwatchTime(): Swatch Internet Time
! 45. Date.prototype.getTimeSeconds(): seconds since UNIX epoch
! 46. Date.prototype.getTimezone(): not implemented
! 47. Date.prototype.getTimezoneOffsetSeconds(): timezone offset in seconds
! 48. Date.prototype.getWeekOfYear(): week of year
! 49. Date.prototype.isDaylightSavingsTime(): not implemented
! 50. Date.prototype.isLeapYear(): is leap year?
elements.js
***************
*** 88,183 ****
error.js
-------------------------------------------------------------------------------
! Error.prototype.handleError():
math.js
-------------------------------------------------------------------------------
! Math.acosh(): inverse hyperbolic cosine
! Math.acot(): inverse cotangent
! Math.acoth(): inverse hyperbolic cotangent
! Math.acsc(): inverse cosecant
! Math.acsch(): inverse hyperbolic cosecant
! Math.asec(): inverse secant
! Math.asech(): inverse hyperbolic secant
! Math.asinh(): inverse hyperbolic sine
! Math.atanh(): inverse hyperbolic tangent
! Math.baseConvert(): convert base
! Math.bin2dec(): binary to decimal conversion
! Math.bin2hex(): binary to hexadecimal conversion
! Math.bin2oct(): binary to octal conversion
! Math.cosh(): hyperbolic cosine
! Math.cot(): cotangent
! Math.coth(): hyperbolic cotangent
! Math.cov(): coversine
! Math.csc(): cosecant
! Math.csch(): hyperbolic cosecant
! Math.dec2bin(): decimal to binary conversion
! Math.dec2hex(): decimal to hexadecimal conversion
! Math.dec2oct(): decimal to octal conversion
! Math.deg2grad(): degree to gradian conversion
! Math.deg2rad(): degree to radian conversion
! Math.expm1(): exp(x) - 1
! Math.exsec(): exsecant
! Math.fibonacci(): fibonacci sequence
! Math.fmod(): floating point modulus
! Math.gd(): gudermannian function
! Math.grad2deg(): gradian to degree conversion
! Math.grad2rad(): gradian to radian conversion
! Math.hav(): haversine
! Math.hex2bin(): hexadecimal to binary conversion
! Math.hex2dec(): hexadecimal to decimal converison
! Math.hex2oct(): hexadecimal to octal conversion
! Math.hypot(): hypotenuse
! Math.isEven(): is even?
! Math.isOdd(): is odd?
! Math.isPrime(): is prime?
! Math.log10(): base-10 logarithm
! Math.log2(): base-2 logarithm
! Math.log1p(): log(1 + x)
! Math.luhn(): luhn formula
! Math.oct2bin(): octal to binary conversion
! Math.oct2dec(): octal to decimal conversion
! Math.oct2hex(): octal to hexadecimal conversion
! Math.pi(): calculate pi
! Math.rad2deg(): radian to degree conversion
! Math.rad2grad(): radian to gradian conversion
! Math.sec(): secant
! Math.sech(): hyperbolic secant
! Math.sigmoid(): sigmoid function
! Math.sign(): sign
! Math.sinc(): sinc function
! Math.sinh(): hyperbolic sine
! Math.sq(): square
! Math.tanc(): tanc function
! Math.tanh(): hyperbolic tangent
! Math.vers(): versine
point.js
-------------------------------------------------------------------------------
! Point.prototype.distance(): distance between two points
string.js
-------------------------------------------------------------------------------
! String.prototype.addSlashes(): escape vertain characters with backslashes
! String.prototype.count(): count occurence of characters
! String.prototype.htmlEntities(): encode xhtml entities
! String.prototype.htmlSpecialChars(): encode subset of html special characters
! String.prototype.isEmailAddress(): is email address?
! String.prototype.levenshtein(): levenshtein distance
! String.prototype.lpad(): pad left side
! String.prototype.ltrim(): trim left side
! String.prototype.nl2br(): newline to <br> conversion
! String.prototype.pad(): pad
! String.prototype.repeat(): repeat
! String.prototype.reverse(): reverse
! String.prototype.rot13(): rotate 13 encoding
! String.prototype.rpad(): pad right side
! String.prototype.rtrim(): trim right side
! String.prototype.trim(): trim
! String.prototype.ucFirst(): uppercase first character
! String.prototype.ucWords(): uppercase words
! String.prototype.wordWrap(): word wrap
! This file was generated automatically: Fri Sep 12 15:32:03 2003
--- 94,203 ----
error.js
-------------------------------------------------------------------------------
! 51. Error.prototype.handleError(): handles thrown exceptions
math.js
-------------------------------------------------------------------------------
! 52. Math.acosh(): inverse hyperbolic cosine
! 53. Math.acot(): inverse cotangent
! 54. Math.acoth(): inverse hyperbolic cotangent
! 55. Math.acsc(): inverse cosecant
! 56. Math.acsch(): inverse hyperbolic cosecant
! 57. Math.asec(): inverse secant
! 58. Math.asech(): inverse hyperbolic secant
! 59. Math.asinh(): inverse hyperbolic sine
! 60. Math.atanh(): inverse hyperbolic tangent
! 61. Math.baseConvert(): convert base
! 62. Math.bin2dec(): binary to decimal conversion
! 63. Math.bin2hex(): binary to hexadecimal conversion
! 64. Math.bin2oct(): binary to octal conversion
! 65. Math.cosh(): hyperbolic cosine
! 66. Math.cot(): cotangent
! 67. Math.coth(): hyperbolic cotangent
! 68. Math.cov(): coversine
! 69. Math.csc(): cosecant
! 70. Math.csch(): hyperbolic cosecant
! 71. Math.dec2bin(): decimal to binary conversion
! 72. Math.dec2hex(): decimal to hexadecimal conversion
! 73. Math.dec2oct(): decimal to octal conversion
! 74. Math.deg2grad(): degree to gradian conversion
! 75. Math.deg2rad(): degree to radian conversion
! 76. Math.expm1(): exp(x) - 1
! 77. Math.exsec(): exsecant
! 78. Math.fibonacci(): Fibonacci sequence
! 79. Math.fmod(): floating-point remainder
! 80. Math.gd(): Gudermannian function
! 81. Math.grad2deg(): gradian to degree conversion
! 82. Math.grad2rad(): gradian to radian conversion
! 83. Math.hav(): haversine
! 84. Math.hex2bin(): hexadecimal to binary conversion
! 85. Math.hex2dec(): hexadecimal to decimal conversion
! 86. Math.hex2oct(): hexadecimal to octal conversion
! 87. Math.hypot(): hypotenuse
! 88. Math.isEven(): is even?
! 89. Math.isOdd(): is odd?
! 90. Math.isPrime(): is prime?
! 91. Math.log10(): base-10 logarithm
! 92. Math.log2(): base-2 logarithm
! 93. Math.log1p(): log(1 + x)
! 94. Math.luhn(): LUHN formula
! 95. Math.oct2bin(): octal to binary conversion
! 96. Math.oct2dec(): octal to decimal conversion
! 97. Math.oct2hex(): octal to hexadecimal conversion
! 98. Math.pi(): calculate pi
! 99. Math.rad2deg(): radian to degree conversion
! 100. Math.rad2grad(): radian to gradian conversion
! 101. Math.sec(): secant
! 102. Math.sech(): hyperbolic secant
! 103. Math.sigmoid(): sigmoid function
! 104. Math.sign(): sign
! 105. Math.sinc(): sinc function
! 106. Math.sinh(): hyperbolic sine
! 107. Math.sq(): square
! 108. Math.tanc(): tanc function
! 109. Math.tanh(): hyperbolic tangent
! 110. Math.vers(): versine
point.js
-------------------------------------------------------------------------------
! 111. Point.prototype.distance(): distance between two points
string.js
-------------------------------------------------------------------------------
! 112. String.prototype.addSlashes(): escape certain characters with backslashes
! 113. String.prototype.cat(): count occurrence of characters
! 114. String.prototype.compress(): compress to spaces
! 115. String.prototype.count(): count occurrence of characters
! 116. String.prototype.htmlEntities(): encode XHTML 1.0 entities
! 117. String.prototype.htmlSpecialChars(): encode subset of HTML special characters
! 118. String.prototype.insert(): insert a string
! 119. String.prototype.isEmailAddress(): is email address?
! 120. String.prototype.levenshtein(): Levenshtein distance
! 121. String.prototype.lpad(): pad left side
! 122. String.prototype.ltrim(): trim left side
! 123. String.prototype.nl2br(): newline to <br> conversion
! 124. String.prototype.overlay(): overlay a string
! 125. String.prototype.pad(): pad
! 126. String.prototype.remove(): delete characters
! 127. String.prototype.repeat(): repeat
! 128. String.prototype.repeatChars(): repeat
! 129. String.prototype.reverse(): reverse
! 130. String.prototype.rot13(): rotate 13 encoding
! 131. String.prototype.rpad(): pad right side
! 132. String.prototype.rtrim(): trim right side
! 133. String.prototype.swap(): swap characters
! 134. String.prototype.trim(): trim
! 135. String.prototype.truncate(): truncate
! 136. String.prototype.ucFirst(): uppercase first character
! 137. String.prototype.ucWords(): uppercase words
! 138. String.prototype.wordWrap(): word wrap
+ validator.js
+ -------------------------------------------------------------------------------
+ 139. Validator.prototype.isBlankString(): is a blank string
+ 140. Validator.prototype.isDigit(): is a single digit
+ 141. Validator.prototype.isInteger(): is an integer
!
! This file was generated automatically: Fri Sep 19 16:45:36 2003
Index: CHANGES
===================================================================
RCS file: /cvsroot/jspro/jsPro/CHANGES,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** CHANGES 17 Sep 2003 08:50:57 -0000 1.15
--- CHANGES 19 Sep 2003 15:44:43 -0000 1.16
***************
*** 6,10 ****
--- 6,12 ----
array.js:
+ - Array.averageDev()
- Array.changeKeyCase()
+ - renamed Array.stdev() to Array.standardDev()
browser.js:
***************
*** 36,39 ****
--- 38,57 ----
- Math.fmod()
- Math.pi()
+
+ string.js:
+
+ - String.cat()
+ - String.compress()
+ - String.insert()
+ - String.overlay()
+ - String.remove()
+ - String.swap()
+ - String.repeatChars()
+ - String.truncate()
+
+ validator.js:
+
+ - new Validator() class that provides methods for boolean testing of
+ values
-------------------------------------------------------------------------------
|
|
From: <wi...@us...> - 2003-09-19 19:55:26
|
Update of /cvsroot/jspro/jsPro/docs
In directory sc8-pr-cvs1:/tmp/cvs-serv9792
Modified Files:
string.html array.html
Log Message:
updated test pages for new methods
Index: string.html
===================================================================
RCS file: /cvsroot/jspro/jsPro/docs/string.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** string.html 14 Sep 2003 08:21:29 -0000 1.3
--- string.html 19 Sep 2003 15:43:07 -0000 1.4
***************
*** 50,53 ****
--- 50,65 ----
</tr>
<tr>
+ <td>String.cat()</td>
+ <td><input id="cat1" name="input" type="text" size="5" /></td>
+ <td><input id="cat" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
+ <td><input id="catResult" name="output" type="text" size="30" readonly="readonly" /></td>
+ </tr>
+ <tr>
+ <td>String.compress()</td>
+ <td> </td>
+ <td><input id="compress" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
+ <td><input id="compressResult" name="output" type="text" size="30" readonly="readonly" /></td>
+ </tr>
+ <tr>
<td>String.count()</td>
<td> </td>
***************
*** 68,71 ****
--- 80,90 ----
</tr>
<tr>
+ <td>String.insert()</td>
+ <td><input id="insert1" name="input" type="text" size="5" />
+ <input id="insert2" name="input" type="text" size="5" /></td>
+ <td><input id="insert" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
+ <td><input id="insertResult" name="output" type="text" size="30" readonly="readonly" /></td>
+ </tr>
+ <tr>
<td>String.isEmailAddress()</td>
<td> </td>
***************
*** 101,114 ****
</tr>
<tr>
<td>String.pad()</td>
! <td>
! <input id="pad1" name="input" type="text" size="5" />
! <input id="pad2" name="input" type="text" size="5" />
! <input id="pad3" name="input" type="text" size="5" />
! </td>
<td><input id="pad" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
<td><input id="padResult" name="output" type="text" size="30" readonly="readonly" /></td>
</tr>
<tr>
<td>String.repeat()</td>
<td><input id="repeat1" name="input" type="text" size="5" /></td>
--- 120,145 ----
</tr>
<tr>
+ <td>String.overlay()</td>
+ <td><input id="overlay1" name="input" type="text" size="5" />
+ <input id="overlay2" name="input" type="text" size="5" /></td>
+ <td><input id="overlay" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
+ <td><input id="overlayResult" name="output" type="text" size="30" readonly="readonly" /></td>
+ </tr>
+ <tr>
<td>String.pad()</td>
! <td><input id="pad1" name="input" type="text" size="5" />
! <input id="pad2" name="input" type="text" size="5" />
! <input id="pad3" name="input" type="text" size="5" /></td>
<td><input id="pad" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
<td><input id="padResult" name="output" type="text" size="30" readonly="readonly" /></td>
</tr>
<tr>
+ <td>String.remove()</td>
+ <td><input id="remove1" name="input" type="text" size="5" />
+ <input id="remove2" name="input" type="text" size="5" /></td>
+ <td><input id="remove" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
+ <td><input id="removeResult" name="output" type="text" size="30" readonly="readonly" /></td>
+ </tr>
+ <tr>
<td>String.repeat()</td>
<td><input id="repeat1" name="input" type="text" size="5" /></td>
***************
*** 117,120 ****
--- 148,157 ----
</tr>
<tr>
+ <td>String.repeatChars()</td>
+ <td><input id="repeatChars1" name="input" type="text" size="5" /></td>
+ <td><input id="repeatChars" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
+ <td><input id="repeatCharsResult" name="output" type="text" size="30" readonly="readonly" /></td>
+ </tr>
+ <tr>
<td>String.reverse()</td>
<td>
***************
*** 147,154 ****
--- 184,204 ----
</tr>
<tr>
+ <td>String.swap()</td>
+ <td> </td>
+ <td><input id="swap" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
+ <td><input id="swapResult" name="output" type="text" size="30" readonly="readonly" /></td>
+ </tr>
+ <tr>
<td>String.trim()</td>
<td><input id="trim1" name="input" type="text" size="5" /></td>
<td><input id="trim" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
<td><input id="trimResult" name="output" type="text" size="30" readonly="readonly" /></td>
+ </tr>
+ <tr>
+ <td>String.truncate()</td>
+ <td><input id="truncate1" name="input" type="text" size="5" />
+ <input id="truncate2" name="input" type="text" size="5" /></td>
+ <td><input id="truncate" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, '\'' + document.getElementById('inputString').value + '\'')" /></td>
+ <td><input id="truncateResult" name="output" type="text" size="30" readonly="readonly" /></td>
</tr>
<tr>
Index: array.html
===================================================================
RCS file: /cvsroot/jspro/jsPro/docs/array.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** array.html 14 Sep 2003 08:05:37 -0000 1.4
--- array.html 19 Sep 2003 15:43:07 -0000 1.5
***************
*** 46,49 ****
--- 46,56 ----
</tr>
<tr>
+ <td>Array.averageDev()</td>
+ <td><input id="averageDev1" name="input" type="text" size="5" />
+ <input id="averageDev2" name="input" type="text" size="5" /></td>
+ <td><input id="averageDev" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, 'aSample')" /></td>
+ <td><input id="averageDevResult" name="output" type="text" size="30" readonly="readonly" /></td>
+ </tr>
+ <tr>
<td>Array.changeKeyCase()</td>
<td><input id="changeKeyCase1" name="input" type="text" size="5" /></td>
***************
*** 137,147 ****
</tr>
<tr>
! <td>Array.stdev()</td>
<td>
! <input id="stdev1" name="input" type="text" size="5" />
! <input id="stdev2" name="input" type="text" size="5" />
</td>
! <td><input id="stdev" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, 'aSample')" /></td>
! <td><input id="stdevResult" name="output" type="text" size="30" readonly="readonly" /></td>
</tr>
<tr>
--- 144,154 ----
</tr>
<tr>
! <td>Array.standardDev()</td>
<td>
! <input id="standardDev1" name="input" type="text" size="5" />
! <input id="standardDev2" name="input" type="text" size="5" />
</td>
! <td><input id="standardDev" type="button" value="Calculate >" onclick="oTest.evaluateMethod(this, 'aSample')" /></td>
! <td><input id="standardDevResult" name="output" type="text" size="30" readonly="readonly" /></td>
</tr>
<tr>
|
|
From: <wi...@us...> - 2003-09-19 19:36:18
|
Update of /cvsroot/jspro/jsPro In directory sc8-pr-cvs1:/tmp/cvs-serv10565 Modified Files: string.js README Log Message: fixed a couple of typos Index: string.js =================================================================== RCS file: /cvsroot/jspro/jsPro/string.js,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** string.js 19 Sep 2003 15:44:21 -0000 1.18 --- string.js 19 Sep 2003 15:46:59 -0000 1.19 *************** *** 76,80 **** * the current string * ! * @summary count occurrence of characters * @author Stuart Wigley * @version 1.0, 09/19/03 --- 76,80 ---- * the current string * ! * @summary concatenate * @author Stuart Wigley * @version 1.0, 09/19/03 *************** *** 930,934 **** * Repeats this string a specified number of times. * ! * @summary repeat * @author Stuart Wigley * @author Randolph Fielding --- 930,934 ---- * Repeats this string a specified number of times. * ! * @summary repeat characters * @author Stuart Wigley * @author Randolph Fielding Index: README =================================================================== RCS file: /cvsroot/jspro/jsPro/README,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** README 19 Sep 2003 15:44:43 -0000 1.22 --- README 19 Sep 2003 15:47:00 -0000 1.23 *************** *** 165,169 **** ------------------------------------------------------------------------------- 112. String.prototype.addSlashes(): escape certain characters with backslashes ! 113. String.prototype.cat(): count occurrence of characters 114. String.prototype.compress(): compress to spaces 115. String.prototype.count(): count occurrence of characters --- 165,169 ---- ------------------------------------------------------------------------------- 112. String.prototype.addSlashes(): escape certain characters with backslashes ! 113. String.prototype.cat(): concatenate 114. String.prototype.compress(): compress to spaces 115. String.prototype.count(): count occurrence of characters *************** *** 180,184 **** 126. String.prototype.remove(): delete characters 127. String.prototype.repeat(): repeat ! 128. String.prototype.repeatChars(): repeat 129. String.prototype.reverse(): reverse 130. String.prototype.rot13(): rotate 13 encoding --- 180,184 ---- 126. String.prototype.remove(): delete characters 127. String.prototype.repeat(): repeat ! 128. String.prototype.repeatChars(): repeat characters 129. String.prototype.reverse(): reverse 130. String.prototype.rot13(): rotate 13 encoding *************** *** 200,203 **** ! This file was generated automatically: Fri Sep 19 16:45:36 2003 --- 200,203 ---- ! This file was generated automatically: Fri Sep 19 16:48:38 2003 |
|
From: <gat...@us...> - 2003-09-17 08:51:01
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv28239
Modified Files:
CHANGES
Added Files:
browser.js
Log Message:
new Browser() class
--- NEW FILE: browser.js ---
/**
* +-------------------------------------------------------------------------+
* | jsPro - Browser |
* +-------------------------------------------------------------------------+
* | Copyright (C) 2001-2003 Stuart Wigley |
* +-------------------------------------------------------------------------+
* | This library is free software; you can redistribute it and/or modify it |
* | under the terms of the GNU Lesser General Public License as published by|
* | the Free Software Foundation; either version 2.1 of the License, or (at |
* | your option) any later version. |
* | |
* | This library is distributed in the hope that it will be useful, but |
* | WITHOUT ANY WARRANTY; without even the implied warranty of |
* | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser |
* | General Public License for more details. |
* | |
* | You should have received a copy of the GNU Lesser General Public License|
* | along with this library; if not, write to the Free Software Foundation, |
* | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* +-------------------------------------------------------------------------+
* | Authors: Randolph Fielding <gat...@ci...> |
* +-------------------------------------------------------------------------+
* $Id: browser.js,v 1.1 2003/09/17 08:50:57 gator4life Exp $
*/
/**
* Creates an object that provides methods for setting, retrieving, or
* manipulating information within the current browser environment.
*
* @author Randolph Fielding
* @version 1.0, 09/15/03
* @interface <code>new Browser()</code>
*/
function Browser() { }
/**
* Retrieves the value of all cookies or of a single cookie with the specified
* name.
*
* @summary retrieve value of cookie(s)
* @author Randolph Fielding
* @version 1.0, 09/16/03
* @interface <code>Browser.getCookie()</code>
* @interface <code>Browser.getCookie(sName)</code>
* @param sName the name of a single cookie (optional)
* @return the value of all cookies or of a single cookie with
* the specified name (if the cookie with the specified
* name exists)
* @return <code>undefined</code> if the cookie with the
* specified name does not exist
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
* @throws TypeMismatchException
*/
Browser.prototype.getCookie = function() {
try {
var vError = null;
var iNumArguments = arguments.length;
var sName = '';
if (iNumArguments > 1) {
throw vError = new IllegalArgumentException('Browser.getCookie', '0 or 1', iNumArguments);
} else if (iNumArguments == 1) {
sName = arguments[0];
}
if (typeof sName != 'string') {
throw vError = new TypeMismatchException('Browser.getCookie', 'string', typeof sName);
}
var sValue = undefined;
var sCookies = document.cookie;
if (sName == '') {
sValue = unescape(sCookies);
} else {
var aCookies = sCookies.split('; ');
var iNumCookies = aCookies.length;
for (var i = 0; i < iNumCookies; i++) {
var aCookie = aCookies[i].split('=');
if (unescape(aCookie[0]) == unescape(sName)) {
sValue = unescape(aCookie[1]);
}
}
}
}
catch (vError) {
if (vError instanceof Error) {
vError.handleError();
}
}
finally {
return vError ? null : sValue;
}
}
/**
* Creates a cookie with the specified name, value, expiration date, domain,
* path, and secure-access flag, and then returns the updated value of all
* cookies.
*
* @summary create cookie
* @author Randolph Fielding
* @version 1.0, 09/16/03
* @interface <code>Browser.setCookie(sName, vValue, oExpires,
* sDomain, sPath, bSecure)</code>
* @param sName the name of the cookie
* @param vValue the value of the cookie
* @param oExpires a Date() object representing the expiration date of
* the cookie; set to <code>null</code> to default to the
* end of the current browsing session
* @param sDomain the domain in which information within the cookie may
* be accessed; set to <code>null</code> to default to
* the current domain
* @param sPath the path in which information within the cookie may be
* accessed; set to <code>null</code> to default to the
* current path
* @param bSecure a boolean value representing whether the cookie must
* be accessed from within a secure environment or not
* @return the updated value of all cookies
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
* @throws TypeMismatchException
*/
Browser.prototype.setCookie = function(sName, vValue, oExpires, sDomain, sPath, bSecure) {
try {
var vError = null;
var iNumArguments = arguments.length;
if (iNumArguments != 6) {
throw vError = new IllegalArgumentException('Browser.setCookie', 6, iNumArguments);
}
if (typeof sName != 'string') {
throw vError = new TypeMismatchException('Browser.setCookie', 'string', typeof sName);
}
if (!(oExpires instanceof Date)) {
throw vError = new TypeMismatchException('Browser.setCookie', 'Date()', typeof oExpires);
}
if (typeof sDomain != 'string') {
throw vError = new TypeMismatchException('Browser.setCookie', 'string', typeof sDomain);
}
if (typeof sPath != 'string') {
throw vError = new TypeMismatchException('Browser.setCookie', 'string', typeof sPath);
}
if (typeof bSecure != 'boolean') {
throw vError = new TypeMismatchException('Browser.setCookie', 'boolean', typeof bSecure);
}
var sCookie = escape(sName) + '=' + escape(vValue.toString());
sCookie += (oExpires) ? '; expires=' + oExpires.toGMTString() : '';
sCookie += (sDomain) ? '; domain=' + sDomain : '';
sCookie += (sPath) ? '; path=' + sPath : '';
sCookie += (bSecure) ? '; secure' : '';
document.cookie = sCookie;
var sUpdatedCookie = unescape(document.cookie);
}
catch (vError) {
if (vError instanceof Error) {
vError.handleError();
}
}
finally {
return vError ? null : sUpdatedCookie;
}
}
Index: CHANGES
===================================================================
RCS file: /cvsroot/jspro/jsPro/CHANGES,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** CHANGES 15 Sep 2003 02:17:19 -0000 1.14
--- CHANGES 17 Sep 2003 08:50:57 -0000 1.15
***************
*** 8,11 ****
--- 8,16 ----
- Array.changeKeyCase()
+ browser.js:
+
+ - new Browser() class that provides methods for setting, retrieving, or
+ manipulating information within the current browser environment
+
constants.js:
|
|
From: <gat...@us...> - 2003-09-17 08:43:34
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv27294
Modified Files:
array.js
Log Message:
QA: removed an unneeded variable from Array.changeKeyCase()
Index: array.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/array.js,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** array.js 15 Sep 2003 03:26:23 -0000 1.24
--- array.js 17 Sep 2003 08:43:30 -0000 1.25
***************
*** 46,50 ****
var vError = null;
- var iArrayLength = this.length;
var iNumArguments = arguments.length;
--- 46,49 ----
|
|
From: <gat...@us...> - 2003-09-15 05:07:12
|
Update of /cvsroot/jspro/jsPro/docs
In directory sc8-pr-cvs1:/tmp/cvs-serv18694/docs
Modified Files:
test.js
Log Message:
QA: spacing consistency
Index: test.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/docs/test.js,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** test.js 20 Aug 2003 09:43:11 -0000 1.5
--- test.js 15 Sep 2003 05:07:09 -0000 1.6
***************
*** 29,35 ****
* Creates an object that provides methods for testing all jsPro libraries.
*
! * @author Stuart Wigley
! * @version 1.0, 07/24/03
! * @interface <code>new Test()</code>
*/
function Test() { }
--- 29,35 ----
* Creates an object that provides methods for testing all jsPro libraries.
*
! * @author Stuart Wigley
! * @version 1.0, 07/24/03
! * @interface <code>new Test()</code>
*/
function Test() { }
***************
*** 40,53 ****
* the structure and ids of HTML elements in the jsPro HTML test files.
*
! * @author Stuart Wigley
! * @author Randolph Fielding
! * @version 1.1, 08/20/03
! * @interface <code>Test.evaluateMethod(oButton, sClass)</code>
! * @param oButton the HTML input-button element that is clicked
! * @param sClass the name of the jsPro class instance being tested
! * @return the result of attempting to evaluate a jsPro method
! * @return <code>null</code> if an exception is encountered
! * @throws IllegalArgumentException
! * @throws TypeMismatchException
*/
Test.prototype.evaluateMethod = function(oButton, sClass) {
--- 40,53 ----
* the structure and ids of HTML elements in the jsPro HTML test files.
*
! * @author Stuart Wigley
! * @author Randolph Fielding
! * @version 1.1, 08/20/03
! * @interface <code>Test.evaluateMethod(oButton, sClass)</code>
! * @param oButton the HTML input-button element that is clicked
! * @param sClass the name of the jsPro class instance being tested
! * @return the result of attempting to evaluate a jsPro method
! * @return <code>null</code> if an exception is encountered
! * @throws IllegalArgumentException
! * @throws TypeMismatchException
*/
Test.prototype.evaluateMethod = function(oButton, sClass) {
|
|
From: <gat...@us...> - 2003-09-15 03:26:28
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv2660
Modified Files:
array.js
Log Message:
QA: Array.prototype.changeKeyCase()
Index: array.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/array.js,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** array.js 12 Sep 2003 14:22:08 -0000 1.23
--- array.js 15 Sep 2003 03:26:23 -0000 1.24
***************
*** 27,39 ****
/**
! * Changes the case of array keys to upper or lowercase
*
* @summary change key case
* @author Stuart Wigley
! * @version 1.0, 09/12/03
* @interface <code>Array.changeKeyCase(iCase)</code>
! * @param iCase an integer representing the case (lowercase: 0;
! * uppercase: 1;)
! * @return an array with keys changed to upper or lowercase
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
--- 27,40 ----
/**
! * Changes the case of all array keys to lowercase or uppercase.
*
* @summary change key case
* @author Stuart Wigley
! * @author Randolph Fielding
! * @version 1.1, 09/14/03
* @interface <code>Array.changeKeyCase(iCase)</code>
! * @param iCase an integer representing the case to change array keys
! * to (lowercase: 0; uppercase: 1)
! * @return an array with keys changed to lowercase or uppercase
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
***************
*** 58,65 ****
for (var sKey in this) {
if (this.hasOwnProperty(sKey)) {
-
var sKeyCase = (iCase == 1) ? sKey.toUpperCase() : sKey.toLowerCase();
if (sKeyCase != sKey) {
-
this[sKeyCase] = this[sKey];
delete this[sKey];
--- 59,64 ----
|
|
From: <gat...@us...> - 2003-09-15 02:17:22
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv23534
Modified Files:
CHANGES
Log Message:
added lines for new constants
Index: CHANGES
===================================================================
RCS file: /cvsroot/jspro/jsPro/CHANGES,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** CHANGES 12 Sep 2003 14:23:02 -0000 1.13
--- CHANGES 15 Sep 2003 02:17:19 -0000 1.14
***************
*** 10,15 ****
constants.js:
! - Constants.DEBUGTYPE_INFO
- Constants.DEBUGTYPE_ERROR
debug/debug.js:
--- 10,21 ----
constants.js:
! - Constants.CHARCASE_LOWER
! - Constants.CHARCASE_UPPER
- Constants.DEBUGTYPE_ERROR
+ - Constants.DEBUGTYPE_INFO
+ - Constants.PIFORMULA_EULER
+ - Constants.PIFORMULA_HERMANN
+ - Constants.PIFORMULA_HUTTON
+ - Constants.PIFORMULA_MACHIN
debug/debug.js:
|
|
From: <gat...@us...> - 2003-09-15 02:16:43
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv23390
Modified Files:
constants.js
Log Message:
added constants for character case for use with Array.changeKeyCase(); updated constants for two-term, Machin-like formulas for pi
Index: constants.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/constants.js,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** constants.js 15 Sep 2003 01:52:16 -0000 1.7
--- constants.js 15 Sep 2003 02:16:39 -0000 1.8
***************
*** 34,37 ****
--- 34,41 ----
function Constants() {
+ // character case constants
+ this.CHARCASE_LOWER = 0;
+ this.CHARCASE_UPPER = 1;
+
// debug window message type constants
this.DEBUGTYPE_INFO = 0;
***************
*** 45,53 ****
this.DOCTYPE_MACTEXT = 4;
! // two-term, Machin-like formula constants
! this.FORMULA_MACHIN = 0;
! this.FORMULA_EULER = 1;
! this.FORMULA_HERMANN = 2;
! this.FORMULA_HUTTON = 3;
// side constants
--- 49,57 ----
this.DOCTYPE_MACTEXT = 4;
! // two-term, Machin-like formulas for pi constants
! this.PIFORMULA_MACHIN = 0;
! this.PIFORMULA_EULER = 1;
! this.PIFORMULA_HERMANN = 2;
! this.PIFORMULA_HUTTON = 3;
// side constants
|
|
From: <gat...@us...> - 2003-09-15 01:53:26
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv19066
Modified Files:
math.js
Log Message:
added support for constants within Math.pi() and did some small amount of QA
Index: math.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/math.js,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** math.js 12 Sep 2003 14:20:37 -0000 1.21
--- math.js 15 Sep 2003 01:53:22 -0000 1.22
***************
*** 1208,1212 ****
* Calculates and returns the xth term of the Fibonacci sequence.
*
! * @summary fibonacci sequence
* @author Stuart Wigley
* @author Randolph Fielding
--- 1208,1212 ----
* Calculates and returns the xth term of the Fibonacci sequence.
*
! * @summary Fibonacci sequence
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 1254,1258 ****
* by another number.
*
! * @summary floating point modulus
* @author Stuart Wigley
* @version 1.0, 09/03/03
--- 1254,1258 ----
* by another number.
*
! * @summary floating-point remainder
* @author Stuart Wigley
* @version 1.0, 09/03/03
***************
*** 1305,1309 ****
* space using the Gudermannian function.
*
! * @summary gudermannian function
* @author Stuart Wigley
* @author Randolph Fielding
--- 1305,1309 ----
* space using the Gudermannian function.
*
! * @summary Gudermannian function
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 1525,1529 ****
* Converts a hexadecimal number into its decimal equivalent.
*
! * @summary hexadecimal to decimal converison
* @author Stuart Wigley
* @author Randolph Fielding
--- 1525,1529 ----
* Converts a hexadecimal number into its decimal equivalent.
*
! * @summary hexadecimal to decimal conversion
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 1945,1949 ****
* Determines if a number is valid according to the LUHN formula.
*
! * @summary luhn formula
* @author Stuart Wigley
* @author Randolph Fielding
--- 1945,1949 ----
* Determines if a number is valid according to the LUHN formula.
*
! * @summary LUHN formula
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 2137,2159 ****
/**
! * Calculates pi using the four two-term Machin-like formulas. The default is
! * Machin's Formula. The choice of formula can be specified by setting the
! * <code>sFormula</code> argument as follows:
! *
! * 'e' Euler's Machin-like Formula
! * 'h' Hermann's Formula
! * 'm' Machin's Formula
! * 'u' Hutton's Formula
*
* @summary calculate pi
* @author Stuart Wigley
! * @version 1.0, 09/12/03
* @interface <code>Math.pi()</code>
! * @interface <code>Math.pi(sFormula)</code>
! * @param sFormula a string representing the choice of formula
* @return pi
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
- * @throws MethodNotAvailableException
* @throws TypeMismatchException
*/
--- 2137,2155 ----
/**
! * Calculates pi using one of the four two-term, Machin-like formulas.
*
* @summary calculate pi
* @author Stuart Wigley
! * @author Randolph Fielding
! * @version 1.1, 09/14/03
* @interface <code>Math.pi()</code>
! * @interface <code>Math.pi(iFormula)</code>
! * @param iFormula an integer representing the two-term, Machin-like
! * formula to use for calculating pi (Machin's formula: 0;
! * Euler's Machin-like formula: 1; Hermann's formula: 2;
! * Hutton's formula: 3) (optional)
* @return pi
* @return <code>null</code> if an exception is encountered
* @throws IllegalArgumentException
* @throws TypeMismatchException
*/
***************
*** 2164,2192 ****
var vError = null;
var iNumArguments = arguments.length;
! var sFormula
! if (iNumArguments == 0) {
! sFormula = 's'
! } else if (iNumArguments == 1) {
! sFormula = arguments[0];
! } else {
throw vError = new IllegalArgumentException('Math.pi', '0 or 1', iNumArguments);
}
! if (typeof sFormula != 'string') {
! throw vError = new TypeMismatchException('Math.pi', 'string', typeof sFormula);
}
! var fPi;
!
! switch (sFormula) {
!
! case 'e' : fPi = 4 * (Math.atan(1/2) + Math.atan(1/3)); break;
! case 'h' : fPi = 4 * ((2 * Math.atan(1/2)) - Math.atan(1/7)); break;
! case 'u' : fPi = 4 * ((2 * Math.atan(1/3)) + Math.atan(1/7)); break;
! case 'm' :
! default : fPi = 4 * ((4 * Math.atan(1/5)) - Math.atan(1/239)); break;
}
-
}
catch (vError) {
--- 2160,2182 ----
var vError = null;
var iNumArguments = arguments.length;
! var iFormula = 0;
! if (iNumArguments > 1) {
throw vError = new IllegalArgumentException('Math.pi', '0 or 1', iNumArguments);
+ } else if (iNumArguments == 1) {
+ iFormula = arguments[0];
}
! if ((typeof iFormula != 'number') || (parseInt(iFormula.toString()) != iFormula)) {
! throw vError = new TypeMismatchException('Math.pi', 'number', typeof iFormula);
}
! switch (iFormula) {
! case 1 : var fPi = 4 * (Math.atan(1 / 2) + Math.atan(1 / 3)); break;
! case 2 : var fPi = 4 * ((2 * Math.atan(1 / 2)) - Math.atan(1 / 7)); break;
! case 3 : var fPi = 4 * ((2 * Math.atan(1 / 3)) + Math.atan(1 / 7)); break;
! case 0 :
! default : var fPi = 4 * ((4 * Math.atan(1 / 5)) - Math.atan(1 / 239)); break;
}
}
catch (vError) {
|
|
From: <gat...@us...> - 2003-09-15 01:52:20
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv18932
Modified Files:
constants.js
Log Message:
added constants for two-term, Machin-like formulas for use with Math.pi()
Index: constants.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/constants.js,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** constants.js 6 Sep 2003 01:48:41 -0000 1.6
--- constants.js 15 Sep 2003 01:52:16 -0000 1.7
***************
*** 29,33 ****
*
* @author Randolph Fielding
! * @version 1.1, 08/15/03
* @interface <code>new Constants()</code>
*/
--- 29,33 ----
*
* @author Randolph Fielding
! * @version 1.2, 09/14/03
* @interface <code>new Constants()</code>
*/
***************
*** 44,47 ****
--- 44,53 ----
this.DOCTYPE_UNIXTEXT = 3;
this.DOCTYPE_MACTEXT = 4;
+
+ // two-term, Machin-like formula constants
+ this.FORMULA_MACHIN = 0;
+ this.FORMULA_EULER = 1;
+ this.FORMULA_HERMANN = 2;
+ this.FORMULA_HUTTON = 3;
// side constants
|
|
From: <gat...@us...> - 2003-09-15 01:51:07
|
Update of /cvsroot/jspro/jsPro In directory sc8-pr-cvs1:/tmp/cvs-serv18739 Modified Files: string.js Log Message: QA: updated some comments for constants Index: string.js =================================================================== RCS file: /cvsroot/jspro/jsPro/string.js,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** string.js 14 Sep 2003 09:37:53 -0000 1.16 --- string.js 15 Sep 2003 01:51:03 -0000 1.17 *************** *** 551,555 **** * (optional) * @param iSide an integer representing the side(s) of the string to ! * pad (both: 0; left: -1; right: 1) (optional) * @return a modified string * @return <code>null</code> if an exception is encountered --- 551,555 ---- * (optional) * @param iSide an integer representing the side(s) of the string to ! * pad (left: -1; both: 0; right: 1) (optional) * @return a modified string * @return <code>null</code> if an exception is encountered *************** *** 935,939 **** * @interface <code>String.trim(iSide)</code> * @param iSide an integer representing the side(s) of the string to ! * trim whitespace from (both: 0; left: -1; right: 1) * (optional) * @return a modified string --- 935,939 ---- * @interface <code>String.trim(iSide)</code> * @param iSide an integer representing the side(s) of the string to ! * trim whitespace from (left: -1; both: 0; right: 1) * (optional) * @return a modified string *************** *** 1095,1099 **** * @param iDocType an integer representing the document type that * end-of-line terminators conform to (HTML: 0; XHTML: 1; ! * WIN_TEXT: 2; UNIX_TEXT: 3; MAC_TEXT: 4) (optional) * @param bSplitWords designates whether words should be split during the * wrap (optional) --- 1095,1100 ---- * @param iDocType an integer representing the document type that * end-of-line terminators conform to (HTML: 0; XHTML: 1; ! * Windows text: 2; UNIX text: 3; Macintosh text: 4) ! * (optional) * @param bSplitWords designates whether words should be split during the * wrap (optional) |
|
From: <gat...@us...> - 2003-09-14 09:37:57
|
Update of /cvsroot/jspro/jsPro
In directory sc8-pr-cvs1:/tmp/cvs-serv6813
Modified Files:
chemica.js date.js error.js string.js
Log Message:
QA: modified some @summary tags; going to start using QA: prefix for commits that contain QA-related changes
Index: chemica.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/chemica.js,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** chemica.js 11 Sep 2003 13:34:35 -0000 1.7
--- chemica.js 14 Sep 2003 09:37:52 -0000 1.8
***************
*** 77,81 ****
* Returns the Chemical Name of this chemical element.
*
! * @summary get Name
* @author Stuart Wigley
* @author Randolph Fielding
--- 77,81 ----
* Returns the Chemical Name of this chemical element.
*
! * @summary get Chemical Name
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 95,99 ****
* Returns the Chemical Symbol of this chemical element.
*
! * @summary get Symbol
* @author Stuart Wigley
* @author Randolph Fielding
--- 95,99 ----
* Returns the Chemical Symbol of this chemical element.
*
! * @summary get Chemical Symbol
* @author Stuart Wigley
* @author Randolph Fielding
Index: date.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/date.js,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** date.js 12 Sep 2003 14:23:02 -0000 1.6
--- date.js 14 Sep 2003 09:37:52 -0000 1.7
***************
*** 66,70 ****
* Z - Greenwich Mean Time (GMT) offset in seconds ('-43200' to '43200')
*
! * @summary format a date
* @author Stuart Wigley
* @author Randolph Fielding
--- 66,70 ----
* Z - Greenwich Mean Time (GMT) offset in seconds ('-43200' to '43200')
*
! * @summary format date
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 482,486 ****
* four digits representing hours (HH) and minutes (MM).
*
! * @summary GMT Offset
* @author Stuart Wigley
* @author Randolph Fielding
--- 482,486 ----
* four digits representing hours (HH) and minutes (MM).
*
! * @summary GMT offset
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 531,535 ****
* inclusive.
*
! * @summary two digit hour (01-12)
* @author Stuart Wigley
* @author Randolph Fielding
--- 531,535 ----
* inclusive.
*
! * @summary 12-hour two-digit hour (01-12)
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 578,582 ****
* inclusive.
*
! * @summary two digit hour (00-23)
* @author Stuart Wigley
* @author Randolph Fielding
--- 578,582 ----
* inclusive.
*
! * @summary 24-hour two-digit hour (00-23)
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 623,627 ****
* '01' and '31', inclusive.
*
! * @summary two digit day of month (01-31)
* @author Stuart Wigley
* @author Randolph Fielding
--- 623,627 ----
* '01' and '31', inclusive.
*
! * @summary two-digit day of month (01-31)
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 667,671 ****
* Returns the day name for this date (e.g. 'Monday', 'Tuesday', etc.).
*
! * @summary Day name
* @author Stuart Wigley
* @author Randolph Fielding
--- 667,671 ----
* Returns the day name for this date (e.g. 'Monday', 'Tuesday', etc.).
*
! * @summary day name
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 707,711 ****
* '59', inclusive.
*
! * @summary two digit minute (00-59)
* @author Stuart Wigley
* @author Randolph Fielding
--- 707,711 ----
* '59', inclusive.
*
! * @summary two-digit minutes (00-59)
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 752,756 ****
* '12', inclusive.
*
! * @summary two digit month (01-12)
* @author Stuart Wigley
* @author Randolph Fielding
--- 752,756 ----
* '12', inclusive.
*
! * @summary two-digit month (01-12)
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 836,840 ****
* '59', inclusive.
*
! * @summary two digit seconds (00-59)
* @author Stuart Wigley
* @author Randolph Fielding
--- 836,840 ----
* '59', inclusive.
*
! * @summary two-digit seconds (00-59)
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 920,924 ****
* date (i.e. 'st', 'nd', 'rd' or 'th').
*
! * @summary english ordinal suffix
* @author Stuart Wigley
* @author Randolph Fielding
--- 920,924 ----
* date (i.e. 'st', 'nd', 'rd' or 'th').
*
! * @summary English ordinal suffix
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 1058,1062 ****
* and '12', inclusive.
*
! * @summary one/two digit hour (1-12)
* @author Stuart Wigley
* @author Randolph Fielding
--- 1058,1062 ----
* and '12', inclusive.
*
! * @summary 12-hour one-/two-digit hour (1-12)
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 1099,1103 ****
* and '23', inclusive.
*
! * @summary one/two digit hour (0-23)
* @author Stuart Wigley
* @author Randolph Fielding
--- 1099,1103 ----
* and '23', inclusive.
*
! * @summary 24-hour one-/two-digit hour (0-23)
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 1191,1195 ****
* and '12', inclusive.
*
! * @summary one/two digit month (1-12)
* @author Stuart Wigley
* @author Randolph Fielding
--- 1191,1195 ----
* and '12', inclusive.
*
! * @summary one-/two-digit month (1-12)
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 1283,1287 ****
* inclusive.
*
! * @summary two digit year (00-99)
* @author Stuart Wigley
* @author Randolph Fielding
--- 1283,1287 ----
* inclusive.
*
! * @summary two-digit year (00-99)
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 1324,1328 ****
* information.
*
! * @summary Swatch internet time
* @author Stuart Wigley
* @author Randolph Fielding
--- 1324,1328 ----
* information.
*
! * @summary Swatch Internet Time
* @author Stuart Wigley
* @author Randolph Fielding
Index: error.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/error.js,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** error.js 14 Sep 2003 09:16:28 -0000 1.13
--- error.js 14 Sep 2003 09:37:53 -0000 1.14
***************
*** 48,52 ****
* <code>var jsProDebugWindow = oDebug</code>.
*
! * @summary handles exceptions that are thrown
* @author Stuart Wigley
* @author Randolph Fielding
--- 48,52 ----
* <code>var jsProDebugWindow = oDebug</code>.
*
! * @summary handles thrown exceptions
* @author Stuart Wigley
* @author Randolph Fielding
Index: string.js
===================================================================
RCS file: /cvsroot/jspro/jsPro/string.js,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** string.js 14 Sep 2003 09:01:21 -0000 1.15
--- string.js 14 Sep 2003 09:37:53 -0000 1.16
***************
*** 123,127 ****
* Entity References.
*
! * @summary encode xhtml entities
* @author Stuart Wigley
* @author Randolph Fielding
--- 123,127 ----
* Entity References.
*
! * @summary encode XHTML 1.0 entities
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 196,200 ****
* 4.01 Special Characters Set with their Character Entity References.
*
! * @summary encode subset of html special characters
* @author Stuart Wigley
* @author Randolph Fielding
--- 196,200 ----
* 4.01 Special Characters Set with their Character Entity References.
*
! * @summary encode subset of HTML special characters
* @author Stuart Wigley
* @author Randolph Fielding
***************
*** 292,296 ****
* convert a source string into a target string.
*
! * @summary levenshtein distance
* @author Stuart Wigley
* @author Randolph Fielding
--- 292,296 ----
* convert a source string into a target string.
*
! * @summary Levenshtein distance
* @author Stuart Wigley
* @author Randolph Fielding
|