Gebruiker:Ivory/common.js
Opmerking: nadat u de wijzigingen hebt gepubliceerd is het wellicht nodig uw browsercache te legen.
- Firefox / Safari: houd Shift ingedrukt terwijl u op Vernieuwen klikt of druk op Ctrl-F5 of Ctrl-R (⌘-Shift-R op een Mac)
- Google Chrome: druk op Ctrl-Shift-R (⌘-Shift-R op een Mac)
- Internet Explorer / Edge: houd Ctrl ingedrukt terwijl u op Vernieuwen klikt of druk op Ctrl-F5
- Opera: druk op Ctrl-F5.
function hoogtelijn(){
var a = document.getElementById( 'wpTextbox1' ),
o = document.createElement( 'div' ), s = o.style;
o.title = 'Tekstveld uitrekken';
s.width = a.style.width = '100%';
s.height = s.lineHeight = s.fontSize = '3px';
s.border = '1px outset white';
s.background = '#d4d0c8';
s.cursor = 's-resize';
o.ondblclick = function(){ a.style.height = a.offsetHeight + 100; };
o.onmouseover = function(){ this.style.background = '#e4e0d8'; };
o.onmouseout = function(){ this.style.background = '#d4d0c8'; };
o.onmousedown = function( e ) { e = e || window.event || {};
if( (e.srcElement||e.target).tagName.toLowerCase()==='div' ) {
var b = typeof e.clientY==='number',
h = a.offsetHeight - (b ? e.clientY : e.y);
document.onselectstart = function(){ return false; };
document.onmousemove = function( e ){ e = e || window.event || {};
a.style.height = Math.max( h + ( b ? e.clientY : e.y ), 20 ) + 'px';
};
document.onmouseup = function(){
document.onselectstart = document.onmouseup = document.onmousemove = null;
};
}
};
a.parentNode.insertBefore( o, a.nextSibling );
}
function wrapknop(){
var p = document.getElementById( 'wpDiff' );
if ( !p ){ return; }
var o = document.createElement( 'input' ), s = o.style;
o.type = 'button';
o.value = 'Wrap';
o.id = 'wrapbutton';
s.margin = '0 2px';
s.background = '#e4e0d8';
s.borderStyle = 'inset';
o.accessKey = 'w';
o.title = 'Regelafbreking omschakelen [' + tooltipAccessKeyPrefix + 'w]';
addHandler( o, 'click', togglewrap );
p.parentNode.insertBefore( o, p.nextSibling );
s = document.getElementById( 'wpWatchthis' ); if( s ){ s.accessKey = ''; }
return o;
}
function togglewrap(){
var a = document.getElementById( 'wpTextbox1' ), b = a.wrap==='off';
a.wrap = b ? 'soft' : 'off';
a.style.whiteSpace = b ? '' : 'pre';
a.style.overflowX = b ? '' : 'auto';
document.getElementById( 'wrapbutton' ).style.borderStyle = b ? 'inset' : 'outset';
a.style.height = a.offsetHeight + 1 + 'px'; // ivm IE bug
a.style.height = a.offsetHeight - 1 + 'px';
a.focus();
}
if (wgAction == 'edit' || wgAction == 'submit') {
addOnloadHook( hoogtelijn );
addOnloadHook( wrapknop );
}