<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-1427064072400819258.post5348054361848316436..comments</id><updated>2009-03-15T13:19:05.636+02:00</updated><category term='linux'/><category term='google groups'/><category term='apache'/><category term='firefox'/><category term='islamic'/><category term='jabber/xmpp'/><category term='tamuq'/><category term='arabic'/><category term='iphone'/><category term='android'/><category term='nokia'/><category term='javascript'/><category term='personal'/><category term='symbian'/><category term='latex'/><category term='jiggy'/><category term='Ubuntu'/><category term='HTK'/><category term='health'/><title type='text'>Comments on Hosam Hammady's blog: SELECT threads FROM GMail ORDER BY sender, subject...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.hammady.net/feeds/5348054361848316436/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1427064072400819258/5348054361848316436/comments/default'/><link rel='alternate' type='text/html' href='http://blog.hammady.net/2008/05/select-threads-from-gmail-order-by.html'/><author><name>hammady</name><uri>http://www.blogger.com/profile/17387936164476486881</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1427064072400819258.post-3756397747698994700</id><published>2009-03-15T13:19:00.000+02:00</published><updated>2009-03-15T13:19:00.000+02:00</updated><title type='text'>I finally reached this:&lt;br&gt;javascript:function toA...</title><content type='html'>I finally reached this:&lt;BR/&gt;javascript:function toArray (c) {var a, k;a = new Array;for (k=0; k &amp;lt; c.length; ++k)a[k] = c[k];return a;}function insAtTop(par,child) {if (par.childNodes.length)par.insertBefore(child, par.childNodes[0]);else par.appendChild(child);}function countCols(tab) {var nCols, i;nCols = 0;for(i = 0; nCols &amp;amp;&amp;amp; i &amp;lt; nCols; i++)nCols = tab.rows[i].cells.length;return nCols;}function makeHeaderLink(colNo, ord, regex, numeric) {var link;link = document.createElement(&amp;#39;a&amp;#39;);link.href = &amp;#39;#&amp;#39;;link.onclick = function() {var __st = window == top ? window : top;__st.sortTable(colNo, ord, regex, numeric);return false;};link.appendChild(document.createTextNode((ord&amp;gt;0)? &amp;#39;asc&amp;#39;:&amp;#39;desc&amp;#39;));return link;}function makeSortControl(header, col, title, regex, numeric) {header.appendChild(document.createTextNode(title + &amp;#39; [&amp;#39;));header.appendChild(makeHeaderLink(col, 1, regex, numeric));header.appendChild(document.createTextNode(&amp;#39;/&amp;#39;));header.appendChild(makeHeaderLink(col, -1, regex, numeric));header.appendChild(document.createTextNode(&amp;#39;]&amp;#39;));}function makeHeader(nCols) {var header, headerCell, i;header = document.createElement(&amp;#39;span&amp;#39;);/*put links in columns 2 and 4 only (sender, subject)*/makeSortControl(header, 2, &amp;#39;Sender(s)&amp;#39;);header.appendChild(document.createTextNode(&amp;#39; | &amp;#39;));makeSortControl(header, 4, &amp;#39;Subject&amp;#39;);header.appendChild(document.createTextNode(&amp;#39; | &amp;#39;));makeSortControl(header, 2, &amp;#39;Thread Activity&amp;#39;, /\(\d*\)$/, true);return header;}function getWidestTable(tables) {var maxTable = undefined;var maxWidth = -1;for (var i = 0; i= maxWidth &amp;amp;&amp;amp; table.id != &amp;#39;&amp;#39;;i++) {maxWidth = table.clientWidth;maxTable = table;}return maxTable;}function getAllTables() {g_tables = toArray(document.getElementsByTagName(&amp;#39;table&amp;#39;));var iframe = document.getElementById(&amp;#39;canvas_frame&amp;#39;);if (!iframe)return null;var iframedoc = iframe.contentDocument.document || iframe.contentWindow.document;iframetables = toArray(iframedoc.getElementsByTagName(&amp;#39;table&amp;#39;));if (iframetables.length)g_tables = g_tables.concat(iframetables);if (!g_tables.length)return null;return g_tables;}(function () {/* ---- main() ---- ENTRY POINT HERE ------------------------- */g_tables = getAllTables();if (!g_tables) {alert(&amp;quot;It seems that this script is not compatible with your gmail version (no tables), giving up!&amp;quot;);return;}inboxtable = getWidestTable(g_tables);if (inboxtable.id.length&amp;lt;4) {alert(&amp;quot;It seems that this script is not compatible with your gmail version (no inbox), giving up!&amp;quot;);return;}var control = makeHeader(countCols(inboxtable));var tableparent = inboxtable.parentNode.parentNode;while(tableparent.previousSibling.style.display == &amp;#39;none&amp;#39;)tableparent = tableparent.previousSibling;tableparent.previousSibling.appendChild(control);/*tableparent.parentNode.insertBefore(control, tableparent);*/}) ();function compareRows(a,b) {if (a.sortKey == b.sortKey)return 0;return (a.sortKey &amp;lt; b.sortKey) ? g_order : -g_order;}function compareRowsNumeric(a,b) {if (a.sortKey == b.sortKey)return 0;return ((a.sortKey + &amp;#39;&amp;#39;).match(/\d+/) - (b.sortKey + &amp;#39;&amp;#39;).match(/\d+/)) * g_order;}function sortTable(colNo, ord, regex, numeric) {var table, rows, nR, bs, i, j, temp;g_order = ord;g_colNo = colNo;g_tables = getAllTables();table = getWidestTable(g_tables);rows = new Array();nR = 0;bs = table.tBodies;for (i = 0; i &amp;lt; bs.length; ++i)for(j=0; j &amp;lt; bs[i].rows.length; ++j) {rows[nR] = bs[i].rows[j];temp = rows[nR].cells[g_colNo];if (!temp)rows[nR].sortKey = &amp;#39;&amp;#39;;else if (!regex)rows[nR].sortKey = temp.textContent.toLowerCase();else {var val = temp.textContent.toLowerCase().match(regex);rows[nR].sortKey = val ? val : &amp;#39;&amp;#39;;}++nR;}if (numeric)rows.sort(compareRowsNumeric);else rows.sort(compareRows);for (i = 0; i &amp;lt; rows.length; ++i)insAtTop(table.tBodies[0], rows[i]);}&lt;BR/&gt;&lt;BR/&gt;but its probably not working due to themes ui changes and all&lt;BR/&gt;loved the idea though</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1427064072400819258/5348054361848316436/comments/default/3756397747698994700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1427064072400819258/5348054361848316436/comments/default/3756397747698994700'/><link rel='alternate' type='text/html' href='http://blog.hammady.net/2008/05/select-threads-from-gmail-order-by.html?showComment=1237115940000#c3756397747698994700' title=''/><author><name>M@hdeTo</name><uri>http://www.blogger.com/profile/03981644999402309597</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.hammady.net/2008/05/select-threads-from-gmail-order-by.html' ref='tag:blogger.com,1999:blog-1427064072400819258.post-5348054361848316436' source='http://www.blogger.com/feeds/1427064072400819258/posts/default/5348054361848316436' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-408741211'/></entry><entry><id>tag:blogger.com,1999:blog-1427064072400819258.post-2733569453030498990</id><published>2009-03-15T13:16:00.000+02:00</published><updated>2009-03-15T13:16:00.000+02:00</updated><title type='text'>nice bookmarklet, its not working here though and ...</title><content type='html'>nice bookmarklet, its not working here though and i can't download the pretty version.&lt;BR/&gt;&lt;BR/&gt;the first problem was this for(i = 0; i nCols), the second was somewhere near the iframedoc (can't find it again though :) ).. really nice blog, really nice posts. keep it up.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1427064072400819258/5348054361848316436/comments/default/2733569453030498990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1427064072400819258/5348054361848316436/comments/default/2733569453030498990'/><link rel='alternate' type='text/html' href='http://blog.hammady.net/2008/05/select-threads-from-gmail-order-by.html?showComment=1237115760000#c2733569453030498990' title=''/><author><name>M@hdeTo</name><uri>http://www.blogger.com/profile/03981644999402309597</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.hammady.net/2008/05/select-threads-from-gmail-order-by.html' ref='tag:blogger.com,1999:blog-1427064072400819258.post-5348054361848316436' source='http://www.blogger.com/feeds/1427064072400819258/posts/default/5348054361848316436' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-408741211'/></entry></feed>
