Return-Path: Delivered-To: apmail-incubator-jspwiki-dev-archive@minotaur.apache.org Received: (qmail 60392 invoked from network); 3 Feb 2009 21:48:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Feb 2009 21:48:47 -0000 Received: (qmail 81915 invoked by uid 500); 3 Feb 2009 21:48:47 -0000 Delivered-To: apmail-incubator-jspwiki-dev-archive@incubator.apache.org Received: (qmail 81833 invoked by uid 500); 3 Feb 2009 21:48:47 -0000 Mailing-List: contact jspwiki-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jspwiki-dev@incubator.apache.org Delivered-To: mailing list jspwiki-dev@incubator.apache.org Received: (qmail 81822 invoked by uid 99); 3 Feb 2009 21:48:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 13:48:47 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dirk.frederickx@gmail.com designates 72.14.220.153 as permitted sender) Received: from [72.14.220.153] (HELO fg-out-1718.google.com) (72.14.220.153) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 21:48:21 +0000 Received: by fg-out-1718.google.com with SMTP id d23so969713fga.26 for ; Tue, 03 Feb 2009 13:48:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=F64nP3oFW67SAe4GAHPTnXfJ0K4EWTdxYdfDyyVpkLg=; b=shPJOwEGuLYeKnO0I87XuF21kiickLfnrV5PTKuf8TJWevJl4RjgIphfUwska15sbs 3nsWAeGiXqvoHtgmUtUIcJQUTcEDX1iCbcsyeB6wHkXPl9ida3K+CG3dq+czYl97TjwC 1IfgDjks9pgm6pFwIxwmhtmJZRG9UPJQNCW9U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=PW06fG3pbrrxEltx/U1i3NJuvGGTGBwgMVazL6jgr/aY26moTtpexaLBMBpm5aMePW 4UkJT5xza9tB2b3O3UgZ8KKoxHj/DTusW8zWv0M9FAZXbdP4MvE15poMxSlLtTls2IQL wOOivXy6ByWqWaGcqII/9PQhOAabgh1X3VdnM= MIME-Version: 1.0 Received: by 10.86.4.14 with SMTP id 14mr1280813fgd.27.1233697696190; Tue, 03 Feb 2009 13:48:16 -0800 (PST) Date: Tue, 3 Feb 2009 22:48:16 +0100 Message-ID: <15cc92000902031348o7b05755dncd9190292f45596b@mail.gmail.com> Subject: Re: svn commit: r740438 - in /incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH: ChangeLog src/com/ecyrd/jspwiki/Release.java src/webdocs/scripts/jspwiki-common.js src/webdocs/templates/default/AttachmentTab.jsp src/webdocs/templates/default/InfoContent. From: Dirk Frederickx To: jspwiki-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=000e0cd29b4cf1121f04620aa04e X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd29b4cf1121f04620aa04e Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Yep. See http://www.jspwiki.org/wiki/SortableTables dirk On Tue, Feb 3, 2009 at 10:20 PM, Janne Jalkanen w= rote: > > Excellent. Could we also get this documented wherever "sortable" is > documented? It might be very useful knowledge for e.g. plugin writers. > > /Janne > > On Feb 3, 2009, at 23:00 , brushed@apache.org wrote: > > Author: brushed >> Date: Tue Feb 3 21:00:03 2009 >> New Revision: 740438 >> >> URL: http://svn.apache.org/viewvc?rev=3D740438&view=3Drev >> Log: >> 2.8.2-svn-8 >> * JSPWIKI-480, fix sorting on timestamps (modified date) in the >> Attachement and Info tab >> >> Modified: >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog >> >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Rele= ase.java >> >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/scripts/jspwik= i-common.js >> >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/defa= ult/AttachmentTab.jsp >> >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/defa= ult/InfoContent.jsp >> >> Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog >> URL: >> http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRAN= CH/ChangeLog?rev=3D740438&r1=3D740437&r2=3D740438&view=3Ddiff >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog (original) >> +++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog Tue Feb 3 >> 21:00:03 2009 >> @@ -1,3 +1,15 @@ >> +2009-02-03 Dirk Frederickx >> + >> + * 2.8.2-svn-8 >> + >> + * JSPWIKI-480, sorting on timestamps (modified date) in >> + the Attachement tab and the Info tab was not always working, >> + as timeformats are depending on the user-preferences. >> + An invisible javascript parsable timeformat attribute is now >> + added to the tables, independent of the user-preferred >> timeformat. >> + This attribute is used by the js sorting routines. >> + >> + >> 2009-02-02 Dirk Frederickx >> >> * 2.8.2-svn-7 >> >> Modified: >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Rele= ase.java >> URL: >> http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRAN= CH/src/com/ecyrd/jspwiki/Release.java?rev=3D740438&r1=3D740437&r2=3D740438&= view=3Ddiff >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Rele= ase.java >> (original) >> +++ >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Rele= ase.java >> Tue Feb 3 21:00:03 2009 >> @@ -77,7 +77,7 @@ >> *

>> * If the build identifier is empty, it is not added. >> */ >> - public static final String BUILD =3D "7"; >> + public static final String BUILD =3D "8"; >> >> /** >> * This is the generic version string you should use >> >> Modified: >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/scripts/jspwik= i-common.js >> URL: >> http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRAN= CH/src/webdocs/scripts/jspwiki-common.js?rev=3D740438&r1=3D740437&r2=3D7404= 38&view=3Ddiff >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/scripts/jspwik= i-common.js >> (original) >> +++ >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/scripts/jspwik= i-common.js >> Tue Feb 3 21:00:03 2009 >> @@ -1318,7 +1318,7 @@ >> this.DescendingTitle =3D "sort.descending".localize(); >> >> $ES('.sortable table',page).each(function(table){ >> - if( table.rows.length < 2 ) return; >> + if( table.rows.length <=3D 2 ) return; >> >> $A(table.rows[0].cells).each(function(th){ >> th=3D$(th); >> @@ -1375,42 +1375,70 @@ >> }, >> >> guessDataType: function(rows, colidx){ >> + >> var num=3Ddate=3Dip4=3Deuro=3Dkmgt=3Dtrue; >> + >> rows.each(function(r,i){ >> - var v =3D >> $getText(r.cells[colidx]).clean().toLowerCase(); >> + >> + var v =3D r.cells[colidx]; >> + v =3D v.getAttribute('sortvalue') || $getText(v)= ; >> + v =3D v.clean().toLowerCase(); >> + >> if(num) num =3D !isNaN(parseFloat(v)); >> if(date) date =3D !isNaN(Date.parse(v)); >> if(ip4) ip4 =3D >> v.test(/(?:\\d{1,3}\\.){3}\\d{1,3}/); //169.169.0.1 >> if(euro) euro =3D v.test(/^[=C2=A3$=E2=82=AC][0-9= .,]+/); >> if(kmgt) kmgt =3D >> v.test(/(?:[0-9.,]+)\s*(?:[kmgt])b/); //2 MB, 4GB, 1.2kb, 8Tb >> + >> }); >> + >> return (kmgt) ? 'kmgt': (euro) ? 'euro': (ip4) ? 'ip4': >> (date) ? 'date': (num) ? 'num': 'string'; >> + >> }, >> >> convert: function(val, datatype){ >> - switch(datatype){ >> - case "num" : return parseFloat( val.match( >> Number.REparsefloat ) ); >> - case "euro": return parseFloat( >> val.replace(/[^0-9.,]/g,'') ); >> - case "date": return new Date( Date.parse( val ) = ); >> + >> + switch( datatype ){ >> + >> + case "num" : >> + return parseFloat( val.match( >> Number.REparsefloat ) ); >> + >> + case "euro": >> + return parseFloat( >> val.replace(/[^0-9.,]/g,'') ); >> + >> + case "date": >> + return new Date( Date.parse( val ) ); >> + >> case "ip4" : >> var octet =3D val.split( "." ); >> return parseInt(octet[0]) * 1000000000 + >> parseInt(octet[1]) * 1000000 + parseInt(octet[2]) * 1000 + >> parseInt(octet[3]); >> + >> case "kmgt": >> var v =3D >> val.toString().toLowerCase().match(/([0-9.,]+)\s*([kmgt])b/); >> if(!v) return 0; >> var z=3Dv[2]; >> z =3D (z=3D=3D'm') ? 3 : (z=3D=3D'g') ? 6= : (z=3D=3D't') >> ? 9 : 0; >> return v[1].toFloat()*Math.pow(10,z); >> - default: return val.toString().toLowerCase(); >> + >> + default: >> + return val.toString().toLowerCase(); >> + >> } >> + >> }, >> >> - createCompare: function(i, datatype) { >> - return function(row1, row2) { >> - var val1 =3D Sortable.convert( >> $getText(row1.cells[i]), datatype ); >> - var val2 =3D Sortable.convert( >> $getText(row2.cells[i]), datatype ); >> + createCompare: function( i, datatype ){ >> + >> + return function( row1, row2 ){ >> >> - if(val1val2){ >> return 1 } else return 0; >> + //fixme: should cache the converted sortable >> values >> + var v1 =3D row1.cells[i], >> + v2 =3D row2.cells[i], >> + val1 =3D Sortable.convert( >> v1.getAttribute('sortvalue') || $getText(v1), datatype ), >> + val2 =3D Sortable.convert( >> v2.getAttribute('sortvalue') || $getText(v2), datatype ); >> + >> + return val1 - val2; >> + >> } >> } >> } >> >> Modified: >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/defa= ult/AttachmentTab.jsp >> URL: >> http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRAN= CH/src/webdocs/templates/default/AttachmentTab.jsp?rev=3D740438&r1=3D740437= &r2=3D740438&view=3Ddiff >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/defa= ult/AttachmentTab.jsp >> (original) >> +++ >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/defa= ult/AttachmentTab.jsp >> Tue Feb 3 21:00:03 2009 >> @@ -48,7 +48,9 @@ >> >> >> >> + >> >> + >> >> >>

>> @@ -105,7 +107,9 @@ >> >> " title=3D"> key=3D'attach.moreinfo.title'/>"> >> >> - > att.getLastModified() %>" pattern=3D"${prefs.DateFormat}" >> timeZone=3D"${prefs.TimeZone}" /> >> + > value=3D'<%=3D att.getLastModified() %>' pattern=3D'EEE, d MMM yyyy hh:m= m:ss' />"> >> + " >> pattern=3D"${prefs.DateFormat}" timeZone=3D"${prefs.TimeZone}" /> >> + >> >> >> >> >> Modified: >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/defa= ult/InfoContent.jsp >> URL: >> http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRAN= CH/src/webdocs/templates/default/InfoContent.jsp?rev=3D740438&r1=3D740437&r= 2=3D740438&view=3Ddiff >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/defa= ult/InfoContent.jsp >> (original) >> +++ >> incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/webdocs/templates/defa= ult/InfoContent.jsp >> Tue Feb 3 21:00:03 2009 >> @@ -199,7 +199,9 @@ >> >> >> >> - " >> pattern=3D"${prefs.DateFormat}" timeZone=3D"${prefs.TimeZone}" /> >> + > value=3D'<%=3D currentPage.getLastModified() %>' pattern=3D'EEE, d MMM y= yyy >> hh:mm:ss' />"> >> + = " >> pattern=3D"${prefs.DateFormat}" timeZone=3D"${prefs.TimeZone}" /> >> + >> >> >> > minFractionDigits=3D'1'/>  >> @@ -358,7 +360,9 @@ >> >> ' >> groupingUsed=3D'false' maxFractionDigits=3D'1' >> minFractionDigits=3D'1'/>  >> >> - > att.getLastModified() %>" pattern=3D"${prefs.DateFormat}" >> timeZone=3D"${prefs.TimeZone}" /> >> + > value=3D'<%=3D att.getLastModified() %>' pattern=3D'EEE, d MMM yyyy hh:m= m:ss' />"> >> + " >> pattern=3D"${prefs.DateFormat}" timeZone=3D"${prefs.TimeZone}" /> >> + >> >> <%-- >> // FIXME: This needs to be added, once we figure out what is going on. >> >> > --000e0cd29b4cf1121f04620aa04e--