cvs: pear /HTML_Progress2 ChangeLog Progress2.php

From: Date: Fri, 12 Jan 2007 17:12:55 +0000
Subject: cvs: pear /HTML_Progress2 ChangeLog Progress2.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-44206@lists.php.net to get a copy of this message
farell Fri Jan 12 17:12:55 2007 UTC Modified files: /pear/HTML_Progress2 ChangeLog Progress2.php Log: - Default progress bar identifier (without prefix "tfrm") cannot be numeric (xhtml compliant) - Improve Javascript function setProgress() which does not need anymore the third parameter. http://cvs.php.net/viewvc.cgi/pear/HTML_Progress2/ChangeLog?r1=1.21&r2=1.22&diff_format=u Index: pear/HTML_Progress2/ChangeLog diff -u pear/HTML_Progress2/ChangeLog:1.21 pear/HTML_Progress2/ChangeLog:1.22 --- pear/HTML_Progress2/ChangeLog:1.21 Fri Jan 12 16:13:15 2007 +++ pear/HTML_Progress2/ChangeLog Fri Jan 12 17:12:54 2007 @@ -6,6 +6,8 @@ style should be apply only by cell classname attribute - a progress bar widget (div) is now identified only by {see HTML_Progress2::getIdent()} rather than "tfrm" + {HTML_Progress2::getIdent()} + - Default progress bar identifier (without prefix "tfrm") cannot be numeric (xhtml compliant) + - Improve Javascript function setProgress() which does not need anymore the third parameter. 2007-01-03 Laurent Laville <pear@laurent-laville.org> http://cvs.php.net/viewvc.cgi/pear/HTML_Progress2/Progress2.php?r1=1.34&r2=1.35&diff_format=u Index: pear/HTML_Progress2/Progress2.php diff -u pear/HTML_Progress2/Progress2.php:1.34 pear/HTML_Progress2/Progress2.php:1.35 --- pear/HTML_Progress2/Progress2.php:1.34 Fri Jan 12 16:13:15 2007 +++ pear/HTML_Progress2/Progress2.php Fri Jan 12 17:12:54 2007 @@ -15,7 +15,7 @@ * @author Laurent Laville <pear@laurent-laville.org> * @copyright 2005-2007 The PHP Group * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @version CVS: $Id: Progress2.php,v 1.34 2007/01/12 16:13:15 farell Exp $ + * @version CVS: $Id: Progress2.php,v 1.35 2007/01/12 17:12:54 farell Exp $ * @link http://pear.php.net/package/HTML_Progress2 * @since File available since Release 2.0.0RC1 */ @@ -2115,15 +2115,19 @@ $js = <<< JS -function setProgress(pIdent, pValue, pDeterminate, pCellCount) +function setProgress(pIdent, pValue, pDeterminate) { + var name = 'pbar' + pIdent; + var pbar = document.getElementById(name); + var cells = pbar.getElementsByTagName('div'); + if (pValue == pDeterminate) { - for (var i = 0; i < pCellCount; i++) { + for (var i = 0; i < cells.length; i++) { showCell(i, pIdent, 'I'); } } if ((pDeterminate > 0) && (pValue > 0)) { - var i = (pValue - 1) % pCellCount; + var i = (pValue - 1) % cells.length; showCell(i, pIdent, 'A'); } else { for (var i = pValue - 1; i >= 0; i--) { @@ -3083,7 +3087,7 @@ function setIdent($ident = null) { if (is_null($ident)) { - $this->ident = substr(md5(microtime()), 0, 6); + $this->ident = 'PB' . substr(md5(microtime()), 0, 6); } else { $this->ident = $ident; } @@ -3226,7 +3230,7 @@ $bar .= '<script type="text/javascript">' . 'setProgress' . '("' . $this->ident . '",' - . intval($progress) . ',' . $determinate . ',' . $this->cellCount + . intval($progress) . ',' . $determinate . ');' . '</script>';

« previous php.pear.cvs (#44206) next »