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
/
fil798FA6A2B65C8B96B39124393AB813B9
< prev
next >
Wrap
Text File
|
2010-07-12
|
3KB
|
108 lines
var gFinalHeight = 50;
var gSlideIncrement = 1;
var gSlideTime = 10;
var gOpenTime = 3500;
var gCloseTimeout = null;
var gStrBundle = null;
var gYaDefence = Components.classes["@yandex.ru/yasearch;1"]
.getService(Components.interfaces.nsIYaSearch)
.wrappedJSObject
.yaDefence;
function prefillAlertInfo() {
var protectedDiff = gYaDefence._getProtectedDiff();
if (protectedDiff.protectedHost)
document.getElementById("hostProtectedLabel").value = protectedDiff.protectedHost;
if (protectedDiff.currentHost)
document.getElementById("hostCurrentLabel").value = protectedDiff.currentHost;
if (window.arguments[1] == true) { // changed again
document.getElementById("homePageChangeHelpText").innerHTML = gStrBundle.getString("homePageChangeHelpText");
document.getElementById("alertBox").setAttribute("class", "changedAgain");
}
}
function onAlertLoad() {
gStrBundle = document.getElementById("yasearch-string-bundle-defence");
prefillAlertInfo();
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 setHomePageAndExit(aAcceptCurrent) {
var protectEnabled = document.getElementById("protectEnabledCheckbox").checked;
gYaDefence.homepageAlertCallback(aAcceptCurrent, protectEnabled);
window.close();
}
function onAlertClick(aEvent) {
switch (aEvent.target.id) {
case "mailtoSupportLink":
let target = aEvent.originalTarget;
let targetHref = target.getAttribute("href");
Components.classes["@yandex.ru/yasearch;1"]
.getService(Components.interfaces.nsIYaSearch)
.wrappedJSObject
.loadURI(targetHref, "new-tab");
window.close();
break;
case "closeButton":
window.close();
break;
case "showMore":
var currHeight = window.outerHeight;
document.getElementById("changesHelp").setAttribute("moreHelpShowed", "true");
setTimeout(function() {
sizeToContent();
var contentDim = document.getElementById("alertBox").boxObject;
window.innerWidth = contentDim.width;
gFinalHeight = window.outerHeight - 2;
window.outerHeight = currHeight;
animateAlert();
}, 0);
break;
}
}
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);
}
}