Wikipedia talk:WikiProject User scripts/Scripts/Fix diff width

message: I tried doing this a while ago with just css but it didn't work very well. — Omegatron 02:17, 12 January 2006 (UTC)
thread_title:  Beautiful! 

message: if (document.URL.indexOf("&diff=",30)>0) addOnloadHook(function (){
  var diffT = document.getElementById("bodyContent"),
  diffTable = diffT.getElementsByTagName("table")[0];
  var diffT = diffTable.getElementsByTagName("tr")[0].getElementsByTagName("td"),
  diffo = diffT[0], diffn = diffT[1],
  diff_width = (diffo.clientWidth < diffn.clientWidth)? diffn.clientWidth: diffo.clientWidth;
  diffTable.setAttribute("width", diff_width*2);
 });
This alternativ code fixes only the table-width. What do you think? --Olliminatore 17:00, 27 April 2006 (UTC)
replies: text: How does it work? — Omegatron 17:10, 27 April 2006 (UTC)
replies: text: It does give (after the diff-page is loaded) the both columns again real 50%, but with a maximum of the other. ps: test example  here —Olliminatore 17:40, 27 April 2006 (UTC)
thread_title:  Just another code 

message: Perhaps someone might also experience trouble through using the script on a Win98-System (with Firefox). If a diff produces very many table-rows, like this example with 741 rows, it will use up system-resources down to zero, making a reset necessary. Not being any good with JavaScript, my patch isn't very elegant, simply limiting diffs to 200 (until I have some experience in every day wathchlist use). A good idea would be a version which switches to normal diff-mode if a table threatens to get too large, perhaps asking the user which option they want, etc. ;)
-- ParaDox 15:49, 21 May 2006 (UTC)
replies: text: I've added some output to the browser status-line in the script to give feedback to the user about "size of xdiffs" etc.-- ParaDox 08:40, 22 May 2006 (UTC)

text: The script can indeed be slow for large diffs.  Any optimizations would be welcome, but the proper solution, of course, would be to roll this thing into the MediaWiki code so that we don't need to do it in JavaScript.  I'll try to submit a patch to do that one of these days, as soon as I find that round tuit I've been looking for...  —Ilmari Karonen (talk) 20:53, 22 May 2006 (UTC)
replies: text: Since my RowsMax-Patch with a limit of 200 rows, I no longer have any problems, and through observation have found out, that critically low system-resource levels are no longer reached, no matter how many diff-rows occur. The limit of 200 also has the pleasant effect, that the browser no longer hangs too long with large diffs. -- ParaDox 10:58, 23 May 2006 (UTC)
thread_title:  RowsMax-Patch (not only for Win98-Systems) 

message: I added this rule to my CSS:
.diff-context, .diff-deletedline, .diff-addedline { overflow: auto; display: block; }
I can see no substantial screwiness with the way it displays, and it loads instantly. —Simetrical (talk • contribs) 01:31, 13 June 2006 (UTC)
replies: text: Hmm.  Works nicely in Firefox 1.5, not at all on Konqueror 3.3.2.  Haven't tested other browsers yet.  —Ilmari Karonen (talk) 14:51, 13 June 2006 (UTC)

text: More testing: Works on Opera 8.52, no effect on Internet Explorer 5.00.  —Ilmari Karonen (talk) 15:01, 13 June 2006 (UTC)
thread_title:  Very simple CSS fix? 

message: Should we alert those still including it in their *.js that it's no longer needed and indeed is buggy? (I removed it after I saw that it was messing up diff display in my FF2 once Brion's changes went live.) Also, one might want to further deprecate it by removing the link from the Wikiproject - I doubt many powerusers interested in adding scripts will be using browsers old enough that Brion's fix doesn't work for them. --Gwern  (contribs) 23:59 16 May 2007 (GMT)
:Well, they certainly shouldn't be, since Brion's version basically does on the server side what this one does on the client side — the browser support should be pretty similar.  If anything, the client-side implementation may require a newer browser.  The script does have some tweaks that we might want to eventually incorporate into the server-side solutions, particularly involving IE6 compatibility, but it is indeed pretty much obsolete.  It might be best to [ look for any userspace copies] of this script and simply disable them (by, say, prepending if (false) to the addOnloadHook() line).  —Ilmari Karonen (talk) 04:55, 17 May 2007 (UTC)
replies: text: ...which I just did — there weren't really all that many.  I left Steel359's version alone, since it was already wrapped in a conditional.  Incidentally, a lot of the pages returned by that query only contained the CSS-injection part, but not the actual body of the script.  Presumably these were all copied from a single source, perhaps User:Xy7/monobook.js.  —Ilmari Karonen (talk) 05:32, 17 May 2007 (UTC)
thread_title:  Now that it's obsolete...