From: Marc-Etienne V. <Mar...@al...> - 2009-03-26 17:57:37
|
ru...@us... a écrit : > Revision: 6700 > http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6700&view=rev > Author: rurban > Date: 2009-03-25 09:56:20 +0000 (Wed, 25 Mar 2009) > > Log Message: > ----------- > add _jsFlipAll again as a bigger page is faster than a 2nd file request > > Modified Paths: > -------------- > trunk/lib/PageList.php > > > + //Warning: This is quite fragile. It depends solely on a private variable > + // in ->_addColumn() > + if (!empty($this->_columns_seen['checkbox'])) { > + $table->pushContent($this->_jsFlipAll()); > + } > + > + function _jsFlipAll() { > + return JavaScript(" > +function flipAll(formObj) { > + var isFirstSet = -1; > + for (var i=0; i < formObj.length; i++) { > + fldObj = formObj.elements[i]; > + if ((fldObj.type == 'checkbox') && (fldObj.name.substring(0,2) == 'p[')) { > + if (isFirstSet == -1) > + isFirstSet = (fldObj.checked) ? true : false; > + fldObj.checked = (isFirstSet) ? false : true; > + } > + } > +}"); > + } > + Hello Reini, I see you have reverted some of my contributions. I will try to explain why I did them. In that case, you are creating invalid XHTML code, and this in not acceptable for us. You create a script *inside* a table which is invalid. Best regards, Marc-Etienne -- Marc-Etienne Vargenau Alcatel-Lucent France, Route de Villejust, 91620 NOZAY, FRANCE +33 (0)1 30 77 28 33, Mar...@al... |