This Google group cut long lines, that's way it's doesn't work, this
is the new Function:
function alert(message,callback){
window.d=document.createElement('div');
d.style.position='absolute';
d.id='alert';
d.style.minWidth='50px'
d.style.maxWidth='450px'
d.innerHTML='<div style="white-space:' +
'nowrap;border:2px solid #00d;background' +
'-color:#ddd;"><div style=color:white;padding:' +
'3px;background-color:#00d;>Alert ' + document.location +
'</div><div style=padding:5px;>' +
message.replace(/\n/,'<br>') +'</div>' + '<div align=right>' +
'<button id=alert_ok onclick="javascript:document' +
'.body.removeChild(document.getElementById ' +
'(\'alert\'))">OK</button></div></div>';
document.body.appendChild(d);
if(callback) document.getElementById('alert_ok').
addEventListener ('click',callback);
d.style.top='0px'
d.style.top=document.body.scrollTop+
(document.documentElement.clientHeight/2-d.offsetHeight/2) + 'px';
d.style.left=(document.body.scrollLeft+
(document.documentElement.clientWidth/2-d.offsetWidth/2)) + 'px';
}
alert('x',function () {alert('ok')})
--
You received this message because you are subscribed to the Google Groups
"Chromium-extensions" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/chromium-extensions?hl=en.