User talk:Alex Smotrov/histcomb.js

Documentation edit

Script improves readability of history pages:

  • Consequent edits by the same user are folded together
  • Size is replaced with difference (like in watchlist/recent changes)
  • "Talk", "contribs" and "undo" are shortened to one letter
  • Your edits are marked with light green background
  • Link «Contributors» under heading goes to useful toolserver tool ( example).


Example:

  • (cur) (last) o o 14:50, 19 June 2007   User1 (Talk | contribs) (2,250 bytes) (Question thanks) (undo)
  • (cur) (last) o o 14:07, 19 June 2007   Inattentive (Talk | contribs) (2,184 bytes) (Question no, like this) (undo)
  • (cur) (last) o o 14:06, 19 June 2007   Inattentive (Talk | contribs) (2,182 bytes) (Question oops) (undo)
  • (cur) (last) o o 14:05, 19 June 2007   Inattentive (Talk | contribs) (2,185 bytes) (Question re) (undo)
  • (cur) (last) o o 14:00, 19 June 2007   User1 (Talk | contribs) (2,131 bytes) (Question) (undo)

becomes

  • (cur) (last) o o 14:50, 19 June 2007   User1 (t | c) (+66) (Question thanks) (×)
  • (cur) (last) o o 14:07, 19 June 2007   Inattentive (t | c) (+23) [3] (×)
  • (cur) (last) o o 14:00, 19 June 2007   User1 (t | c) (+108) (Question) (×)



Demo without installation: go to any history page, copy this to browser address field and press Enter:
javascript:function addOnloadHook(f){f()};importScript('User:Alex_Smotrov/histcomb.js');void 0


Static installation: importScript('User:Alex Smotrov/histcomb.js')your monobook.js


Dynamic installation
script is loaded only after you click on a new link Improve… (after  Compare selected versions  )

if (mw.config.get('wgAction') == 'history') //add a link to call histComb.js
$(function(){
 var pagehis = document.getElementById('pagehistory');
 if (!pagehis) return;
 var lnk = document.createElement('a');
 lnk.style.marginLeft = '10px';
 lnk.href = '#';
 lnk.appendChild(document.createTextNode('Improve…'));
 lnk.onclick=function(){this.parentNode.removeChild(this);importScript('User:Alex_Smotrov/histcomb.js')}
 pagehis.parentNode.insertBefore(lnk, pagehis);
})

your monobook.js


Optional parameters (listed with default values)

window.histCombLeaveComment = false //if true, keep summary on the last folded edit
window.histCombNoCollapse = true //if true, do not collapse edits on load
window.histCombMyBg = '#F0FFF0' //background on your edits (light green)
window.histCombTalk = 't' //string to replace 'Talk'
window.histCombContrib = 'c' //string to replace 'contribs'
window.histCombUndo = '×' //string to replace 'undo'

Script tested in IE 6/7, Opera 9, Firefox 1.5/2, Safari 3

Also see logPage.js script.

Discussion edit

wishes (in Russian) edit

Недурно, но есть вопросы и замечания:

  1. Нельзя ли сделать фон потемнее? Я вижу настройку задания цвета, но сам я цвет подобрать не могу, не дизайнер.
  2. где теперь можно узнать текущий размер страницы, если все размеры стали относительными? Причём, иногда хочется видеть размер и для промежуточных версий (чтобы можно было сравнить с размером после или до правок).

Спасибо. -- AVBtalk 16:52, 28 July 2008 (UTC)Reply

Please move this section to ru:User talk:Alex Smotrov/histcomb.js. #1: no. #2: I recommend "dynamic installation", but even after the script was executed, revision sizes can be found in tooltips (hover your mouse over the differences). —AlexSm 21:46, 28 July 2008 (UTC)Reply

IE bugs edit

I've got a couple of interesting bugs in this script for you: first, when multiple edits are rolled together, the links to the users' page, etc. stop working, and you have to expand the edits. Second, if you select the diff at the very bottom of a history page, and then select the diff right above it, the radio button for the bottom diff jumps out to the left. Just thought I'd give you a heads up! —Dinoguy1000 21:28, 8 February 2008 (UTC)Reply

Thank you for letting me know. Please also specify your browser version and the exact link, because I could not reproduce the 1st bug. The second one seem to happen in IE6/IE7 on any row which is just below a "collapsed" row. I have know idea why it happens, but will try to fix it when I have some time / AlexSm 23:21, 8 February 2008 (UTC)Reply
You're welcome. The first bug happened on IE7, although I can't remember the exact link or even page. I'll try to find another example for you, though. —Dinoguy1000 17:18, 9 February 2008 (UTC)Reply
All right, this is on IE6 SP1, on this page's history page, at the bottom, you made two consecutive edits. Passing the cursor over any of the links in the unexpanded entry results in an I-bar, rather than a hand. In addition, expanding your edits results in the radio button jumping out to the left (you don't have to change the radio button selection for this to happen), and the links on the first of the two entries still aren't clickable, though the links for the second entry are. —Dinoguy1000 17:27, 9 February 2008 (UTC)Reply
I still don't know why IE behaves this way, but it seems that finally I was able to fix both bugs (it was the same bug actually). P.S. Do not just say "bottom" because the number of entries on history page depends on preferences :) —AlexSm 17:51, 21 February 2008 (UTC)Reply
Alright, I'll try to be more specific in the future... ;) In any case, you fixed one bug only to have another rear its ugly head... Unless it's another side of the same bug. This is under IE7, look at the bottom collapsed row of this page's history (yes, there's that ugly word 'bottom' again... =P ), you'll notice that the content of the whole row has been shifted to the right about two character's width, and the "cur" link is not present. The spacing problem remains in this specific row even after expanding the row and regardless of how the radio buttons have been selected, though the "cur" link returns on expanding. I'm not sure if the same thing happens on history pages without collapsed edits in the bottom row, nor do I know about the new behavior under IE6. —Dinoguy1000 19:56, 21 February 2008 (UTC)Reply
This was simply my mistake, not IE-related, fixed. The script was supposed to hide the (last) link (that's easier than replacing it with text) . —AlexSm 20:23, 21 February 2008 (UTC)Reply
All right, that got it. —Dinoguy1000 20:33, 21 February 2008 (UTC)Reply

No longer working for me edit

It doesn't work any longer for me. I have tested this in both Firefox and IE. I'm guessing the Wikipedia people probably changed something that broke your script. Can you fix it? And please let me know if you need further info from me in order to work this out.-Lilac Soul (talk contribs count) I'm watching this page so just reply to me right here! 11:14, 4 August 2008 (UTC)Reply

Something indeed got broken, but not in my script. You could open Firefox "Error Console" (in Tools menu) and find the line "Uncaught exception ..." which mentions User:Superm401/Compare link.js. So all you need to do is comment out this line in your monobook.js ( // importScript('User:Superm401/Compare link.js');) and then my script will start working again. —AlexSm 14:55, 4 August 2008 (UTC)Reply
Oops, sorry, you're absolutely right! -Lilac Soul (talk contribs count) 17:41, 4 August 2008 (UTC)Reply

Error: tOld is null edit

Hello!

I was using the script at pt.wb and I got the following at error console:

Error: tOld is null
Source File: http://pt.wikibooks.org/w/index.php?title=MediaWiki:Gadget-ajaxPreview.js&action=raw&ctype=text/javascript&urid=239az2
Line: 18
  tOld.style.clear = 'none'

Do you know if I did something wrong? Is there a bug? Helder 13:48, 26 September 2009 (UTC)

I think your question is about b:pt:MediaWiki:Gadget-ajaxPreview.js which incorrectly has "Origem: [[en:w:User:Alex Smotrov/histcomb.js]]" line on top. I cannot reproduce this error, so please report it on the talk page of user:js/ajaxPreview with additional details: your browser, which page it happens on and whether you're using Beta interface. — AlexSm 15:08, 26 September 2009 (UTC)Reply
Oh I'm sorry... I didn't notice the help text was wrong... ignore me... =S
Have a nice weekend! ;-) Helder 18:09, 26 September 2009 (UTC)

doneOnloadHook and addOnloadHook edit

This scripts causes the following warnings in the console:

  • Use of "doneOnloadHook" is deprecated. Use jQuery instead.
  • Use of "addOnloadHook" is deprecated. Use jQuery instead.

Helder.wiki 14:36, 19 May 2014 (UTC)Reply

Fixed. Helder 15:06, 29 July 2014 (UTC)Reply

Added option to customize the undo replace text edit

Not sure why this wasn't in there along with talk and contribs! Personally, I replace thanks as well (and rollback and block)... ~ Amory (utc) 15:49, 24 March 2018 (UTC)Reply