Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* see: [[User:לערי ריינהארט/common.js]] *//* <span dir="ltr" >[[commons:user:{{PAGENAME}}|commons:]], [[meta:user:{{PAGENAME}}|meta:]], [[b:user:{{PAGENAME}}|b:]], [[n:user:{{PAGENAME}}|n:]], [[q:user:{{PAGENAME}}|q:]], [[s:user:{{PAGENAME}}|s:]], [[wikt:user:{{PAGENAME}}|wikt:]], [[<!-- w: -->user:{{PAGENAME}}|w:]]</span><br /> *//* Work-around for [[bugzilla:01229]] *//* <div dir="ltr" >'''source:''' [[w:en:Wikipedia:WikiProject User scripts/Scripts/Fix diff width]]<br />This script adds scroll bars to wide diffs such as [http://en.wikipedia.org/w/index.php?title=Wikipedia%3ACopyright_problems%2F2005_December_30&diff=33247878&oldid=33247265]. It replaces the table-based diff layout with a CSS-based layout where the column width is always exactly 50%. Known to work in [[w:en:Firefox|Firefox]], [[w:en:Konqueror|Konqueror]], [[w:en:Opera (web browser)|Opera]] and at least some versions of [[w:en:Internet Explorer|Internet Explorer]]. This script is a workaround for [[bugzilla:01229|Bug 01229]]. If you have any problems with this script, please [[w:en:User talk:Ilmari Karonen|let me know]]. */// <pre><nowiki>// inline style sheet to keep this whole thing self-contained:document.write('<style type="text/css">'+' .xdiff { width: 100%; background: white; }'+' .xdiff-row { width: 100%; margin: 0 0 3px 0; overflow: hidden; }'+' .xdiff-col { width: 49%; margin: 0; float: left; clear: none; position: relative; }'+' .xdiff-sign, .xdiff-outer, .xdiff-inner { display: block; margin: 0; }'+' .xdiff-sign { position: absolute; top: 0; left: 0; width: 2em; text-align: center; }'+' .xdiff-outer { padding: 0 0 0 2em; }'+' .xdiff-inner { overflow: auto; overflow-y: visible; width: 100%; }'+' .xdiff-inner.diff-addedline { font-size: 85%; background: #cfc; }'+' .xdiff-inner.diff-deletedline { font-size: 85%; background: #ffa; }'+' .xdiff-inner.diff-context { font-size: 85%; background: #eee; }'+(!document.recalc?'':// IE kluge:' * html .xdiff-inner { padding-bottom: expression(this.scrollWidth > this.offsetWidth ? "16px" : 0); }'+' * html .xdiff-sign { top: expression((this.parentNode.clientHeight - this.offsetHeight)/2 + "px"); }')+'<'+'/style>');if(false)addOnloadHook(function(){// OBSOLETE!!!vardiffSigns=newArray();varfixDiffWidth=function(){vartables=document.getElementsByTagName('table');for(vari=0;i<tables.length;i++){if(tables[i].className!='diff')continue;varrows=tables[i].getElementsByTagName('tr');vardiffDiv=document.createElement('div');diffDiv.className='xdiff';for(varj=0;j<rows.length;j++){varrowDiv=document.createElement('div');rowDiv.className='xdiff-row';varcolDiv=null;varcols=rows[j].getElementsByTagName('td');for(vark=0;k<cols.length;k++){if(!colDiv){colDiv=document.createElement('div');colDiv.className='xdiff-col';rowDiv.appendChild(colDiv);}if(cols[k].getAttribute('colspan')==2||cols[k].className.substring(0,5)=='diff-'){// use spans instead of divs so that an eventual non-js solution will look nice in lynx!varouterSpan=document.createElement('span');varinnerSpan=document.createElement('span');outerSpan.className='xdiff-outer';innerSpan.className='xdiff-inner '+cols[k].className;innerSpan.style.textAlign=cols[k].getAttribute('align');for(varnode=cols[k].firstChild;node;node=node.nextSibling)innerSpan.appendChild(node.cloneNode(true));innerSpan.appendChild(document.createTextNode(String.fromCharCode(0xa0)));// add nbspouterSpan.appendChild(innerSpan);colDiv.appendChild(outerSpan);colDiv=null;// start new column}elseif(cols[k].firstChild&&(cols[k].firstChild.nextSibling||cols[k].firstChild.nodeType!=3||cols[k].firstChild.nodeValue.match(/\S/))){// use spans instead of divs so that an eventual non-js solution will look nice in lynx!varsignSpan=document.createElement('span');signSpan.className='xdiff-sign';if(!signSpan.style.setExpression)diffSigns[diffSigns.length]=signSpan;for(varnode=cols[k].firstChild;node;node=node.nextSibling)signSpan.appendChild(node.cloneNode(true));colDiv.appendChild(signSpan);}}diffDiv.appendChild(rowDiv);}tables[i].parentNode.replaceChild(diffDiv,tables[i]);}};// finally, a kluge to vertically center the +/- signsvarcenterDiffSigns=function(){for(vari=0;i<diffSigns.length;i++){varparentHeight;if(!(parentHeight=diffSigns[i].parentNode))continue;if(!(parentHeight=parentHeight.clientHeight))continue;diffSigns[i].style.top=((parentHeight-diffSigns[i].offsetHeight)/2)+"px";}};fixDiffWidth();if(diffSigns.length){hookEvent('resize',centerDiffSigns);setTimeout(centerDiffSigns,250);}});// </nowiki></pre></div>