Pluggable SortTable

By Jeremy Dunck Last update Nov 10, 2005 — Installed 1,012 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 7 posts, 6 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
Frank Ralf Scriptwright

I did it! You can find a modified version of the script here: http://userscripts.org/scripts/show/5387

 
Frank Ralf Scriptwright

Some quick comments:
1) The function definitions in the script got mangeled up and need fixing.
2) No need to prefix with unsafeWindow.
3) You can't use onclick with GM but have to use addEventListener like so:

elmLinks = cell.getElementsByTagName("a")
elmLinks[0].addEventListener('click',function(event){
var lnk = event.target
var sp = lnk.getAttribute('spalte')
ts_resortTable(lnk, sp)
},false)

I will post a fixed version of the script soon.

Frank

 
Jim Wilson Scriptwright

To make this work with the latest GM (FF 1.5), you must:

* Find and replace all instances of "ts_" with "unsafeWindow.ts_" EXCEPT in line 55 where that appears as part of an innerHTML declaration.
* Find and replace al instance of "getParent" with "unsafeWindow.getParent"

After that, it works great!

 
Stephan Sokolow Scriptwright

I've hacked up a version that works with Firefox 1.5 (the main problem you missed was that you can't use onclick= in Firefox 1.5 userscripts) and I'll make it available as soon as I clean up the code. The script's guts look a little crude to me in their present form.

Oh, and I fixed the problem with it trashing Google. I set a 5 row minimum table size limit.

 
Henri Bource... Scriptwright

Doesn't work for me (firefox 1.5), I've got this message in the javascript console: "ts_makeSortable is not defined".

I've tried to add "unsafeWindow." prefix before each call to the ts_something functions but tha t did not fix the problem (not surprisingly).

 
Dave_is_sexy User

sounds like the best one on here, but where the table cells contain links, this stops them working

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel