home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2011 November
/
CHIP_2011_11.iso
/
Programy
/
Narzedzia
/
AIMP2
/
aimp_2.61.583.exe
/
$TEMP
/
YandexPackSetup.msi
/
filA14A8CEC279B699CDA9F67EEA3DAA025
< prev
next >
Wrap
Text File
|
2010-07-12
|
3KB
|
109 lines
var gFinalHeight = 50;
var gSlideIncrement = 1;
var gSlideTime = 10;
var gOpenTime = 3500;
var gAlertCookie = "";
var gAlertListener = null;
var gMouseOver = false;
var gCloseTimeout = null;
function prefillAlertInfo() {
document.getElementById("alertTitleLabel").textContent = window.arguments[1];
document.getElementById("alertTextLabel").textContent = window.arguments[2].shift();
var mailMsg = window.arguments[2].shift();
if (mailMsg) {
document.getElementById("alertTextMailFrom").setAttribute("value", mailMsg[0]);
document.getElementById("alertTextMailSubject").setAttribute("value", mailMsg[1]);
document.getElementById("alertGrid").setAttribute("hidden", "false");
}
gAlertCookie = window.arguments[3];
gAlertListener = window.arguments[4];
}
function onAlertLoad() {
sizeToContent();
var contentDim = document.getElementById("alertBox").boxObject;
window.innerWidth = contentDim.width;
gFinalHeight = window.outerHeight - 2;
gSlideIncrement = Math.max(1, parseInt(gFinalHeight / 40, 10));
window.outerHeight = 1;
_moveAlert();
setTimeout(animateAlert, gSlideTime);
}
function _moveAlert() {
window.moveTo(screen.availLeft + screen.availWidth - window.outerWidth,
screen.availTop + screen.availHeight - window.outerHeight);
var opacityValue = Math.min(.99, Math.max(.25, window.outerHeight/gFinalHeight));
document.getElementById("alertBox").style.opacity = opacityValue;
}
function animateAlert() {
if (window.outerHeight < gFinalHeight) {
window.outerHeight += Math.min(gSlideIncrement, gFinalHeight - window.outerHeight);
_moveAlert();
setTimeout(animateAlert, gSlideTime);
}
else if (!gMouseOver)
gCloseTimeout = setTimeout(closeAlert, gOpenTime);
}
function closeAlert() {
if (gMouseOver)
return;
if (window.outerHeight > gSlideIncrement) {
window.outerHeight -= gSlideIncrement;
_moveAlert();
setTimeout(closeAlert, gSlideTime);
} else {
closeWindow();
}
}
function onAlertClick(aEvent) {
if (aEvent.button == 2 || aEvent.target.id == "closeButton") {
closeWindow();
} else if (gAlertCookie.type == "mail" || gAlertCookie.type == "feeds") {
let action = gAlertCookie.type == "mail" ? 1040 : 1120;
Components.classes["@yandex.ru/yasearch;1"]
.getService(Components.interfaces.nsIYaSearch)
.wrappedJSObject
.loadConditionalURI(gAlertCookie.mfdDomain || gAlertCookie.type, "tab", {action:action});
closeWindow();
}
return true;
}
function closeWindow() {
if (gAlertListener)
gAlertListener.observe(null, "alertfinished", gAlertCookie);
window.close();
}
function onMouseOver(aEvent) {
gMouseOver = true;
if (gCloseTimeout)
clearTimeout(gCloseTimeout);
}
function onMouseOut(aEvent) {
gMouseOver = false;
gOpenTime = 1000;
animateAlert();
}