Skip to content

Instantly share code, notes, and snippets.

@nodkz
Created July 9, 2015 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nodkz/ab95552a743451ec958e to your computer and use it in GitHub Desktop.
Save nodkz/ab95552a743451ec958e to your computer and use it in GitHub Desktop.
Beeline в Казахстане встраивает следующий html-код на чужие сайты для пользователей IPAD на мобильном интернете. Встраивает свою рекламу, без ведома площадок.
<div id="toolbar">
<iframe id="toolBarPcFrame" src="http://192.168.240.36:8080/ets/ToolBarPcServlet" allowtransparency="true"
background-color="transparent"
style="position: fixed; z-index: 2147483640; width: 140.4px; height: 146.4px; margin: 0px; padding: 0px; bottom: 0px; right: 0px; border: none;">
<html>
<head>
<meta name="viewport"
content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;">
<meta name="format-detection" content="telephone=no">
<style type="text/css">
@font-face {
font-family: 'DSOfficinaBook'
;
src: url('http://192.168.240.36:8080/ets/shared/DSOfficinaSerifBook.otf')
;
}
@font-face {
font-family: 'DSOfficinaBold'
;
src: url('http://192.168.240.36:8080/ets/shared/DSOfficinaSerifBold.otf')
;
}
embed {
pointer-events: none;
}
.toolbar {
float: right;
display: table;
position: fixed;
z-index: 1;
bottom: 5px;
right: 0px;
width: 980px;
height: 40px;
-webkit-transform-origin: 0 0 0;
-moz-transform-origin: 0 0 0;
transform-origin: 0 0 0;
-webkit-transform-origin: right bottom;
-moz-transform-origin: right bottom;
transform-origin: right bottom;
}
.iconBox {
height: 40px;
width: 40px;
position: absolute;
right: 0px;
top: 0px;
z-index: 3;
/*-webkit-transform: translate3d(0,0,0);*/
}
.CET {
float: right;
height: 40px;
width: auto;
z-index: 2;
margin-right: 20px;
}
.CETInfo {
background-image: -webkit-linear-gradient(top, #FFFFFF 0%, #F3F4F4 13%, #EEEEEF 83%);
background-image: -moz-linear-gradient(top, #FFFFFF 0%, #F3F4F4 13%, #EEEEEF 83%);;
border: 1px solid #D6D7D9;
height: 30px;
width: auto;
margin-top: 2px;
border-radius: 2px; /*Shadow - begin */
-moz-box-shadow: 0px 2px 3px 0px rgba(000, 000, 000, 0.3);
-webkit-box-shadow: 0px 2px 3px 0px rgba(000, 000, 000, 0.3);
box-shadow: 0px 2px 3px 0px rgba(000, 000, 000, 0.3); /*Shadow - end */
}
.controlsBox {
float: right;
height: 30px;
width: 30px;
display: table;
}
.controlsBoxInfo {
display: table-cell;
vertical-align: middle;
text-align: center;
/*-webkit-transform: translate3d(0,0,0);*/
}
.aBoxSpr {
height: 30px;
width: 1px;
float: right;
display: inline;
background-color: #D6D7D9;
}
.aBoxContainer {
height: 30px;
float: right;
width: auto;
}
.aBox {
height: 30px;
float: right;
}
/* Start of ControlsBox*/
.containerHelp {
float: right;
right: 30px;
width: 320px;
height: auto;
display: table;
position: fixed;
bottom: 45px;
/*border-top-width:1px;
border-left-width:1px;
border-top-style: solid;
border-left-style: solid;
border-top-color:
#D6D7D9 ;
border-left-color:
#D6D7D9 ;*/
-webkit-transform-origin: 0 0 0;
-moz-transform-origin: 0 0 0;
transform-origin: 0 0 0;
-webkit-transform-origin: right bottom;
-moz-transform-origin: right bottom;
transform-origin: right bottom;
background-color: #EEEEEF;
/*
border:1px solid
#D6D7D9 ;
*/
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
-moz-box-shadow: 1px -1px 1px 0px rgba(000, 000, 000, 0.2);
-webkit-box-shadow: 1px -1px 1px 0px rgba(000, 000, 000, 0.2);
box-shadow: 1px -1px 1px 0px rgba(000, 000, 000, 0.2);
}
.containerHeader {
display: table;
/* background-image: -webkit-linear-gradient(top,
#ffffff ,
#cccccc );
background-image: -moz-linear-gradient(top,
#ffffff ,
#cccccc );
*/
height: 25px;
width: 320px;
}
.continaerHeadrInfo {
display: table-cell;
vertical-align: middle;
}
.containerText {
font-family: DSOfficinaBook;
color: #666666;
float: left;
width: 230px;
margin-left: 10px;
font-size: 16px;
}
.helpTitle {
font-family: DSOfficinaBook;
color: #666666;
font-size: 15px;
}
.containerCloseInfo {
/*display:table-cell;
vertical-align:middle;*/
float: right;
height: 27px;
width: 27px;
margin-right: -13px;
margin-top: -13px;
/*-webkit-transform: translate3d(0,0,0);*/
}
.containerInfo {
/*background-color:
#EEEEEF ;*/
height: auto;
float: left;
width: 320px;
}
.containerInfoText {
float: left;
width: 300px;
margin-left: 10px; /*margin-top:3px;*/
font-family: Verdana;
font-size: 11px;
color: #4d4d4d;
}
.containerLine {
height: 1px;
width: 300px;
background-color: #F2F2F2;
}
.containerCloseConfirmation {
float: right;
right: 30px;
display: table;
position: fixed;
bottom: 45px;
background-color: #EEEEEF;
width: 280px;
height: 80px;
/* border-top-width:1px;
border-left-width:1px;
border-top-style: solid;
border-left-style: solid;
border-top-color:
#D6D7D9 ;
border-left-color:
#D6D7D9 ;*/
-webkit-transform-origin: 0 0 0;
-moz-transform-origin: 0 0 0;
transform-origin: 0 0 0;
-webkit-transform-origin: right bottom;
-moz-transform-origin: right bottom;
transform-origin: right bottom;
/*border:1px solid
#D6D7D9 ;*/
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
-moz-box-shadow: 1px -1px 1px 0px rgba(000, 000, 000, 0.2);
-webkit-box-shadow: 1px -1px 1px 0px rgba(000, 000, 000, 0.2);
box-shadow: 1px -1px 1px 0px rgba(000, 000, 000, 0.2);
}
.containerCloseConfirmationHeader {
display: table;
width: 280px;
height: 40px;
text-align: center;
}
.containerCloseConfirmationHeaderText {
display: table-cell;
vertical-align: middle;
font-family: DSOfficinaBook;
color: #000000;
font-size: 15px;
width: inherit;
text-indent: 12px;
}
.containerCloseConfirmationButtons {
width: inherit;
height: 40px;
width: 220px;
margin-left: auto;
margin-right: auto;
}
.containerCloseConfirmationButton {
float: left;
width: 100px;
height: 24px;
border-radius: 5px;
display: table;
background: #FFFFFF;
background: -moz-linear-gradient(top, #FFFFFF 0%, #EEEEEF 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #FFFFFF), color-stop(100%, #EEEEEF));
background: -webkit-linear-gradient(top, #FFFFFF 0%, #EEEEEF 100%);
background: -o-linear-gradient(top, #FFFFFF 0%, #EEEEEF 100%);
background: -ms-linear-gradient(top, #FFFFFF 0%, #EEEEEF 100%);
background: linear-gradient(top, #FFFFFF 0%, #EEEEEF 100%);
/*
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#
#FFFFFF ',endColorstr='#E94A86',GradientType=0);
*/
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border: 1px solid #D6D7D9;
}
.containerCloseConfirmationButton1 {
float: right;
width: 100px;
height: 24px;
border-radius: 5px;
display: table;
background: #FFFFFF;
background: -moz-linear-gradient(top, #FFFFFF 0%, #EEEEEF 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #FFFFFF), color-stop(100%, #EEEEEF));
background: -webkit-linear-gradient(top, #FFFFFF 0%, #EEEEEF 100%);
background: -o-linear-gradient(top, #FFFFFF 0%, #EEEEEF 100%);
background: -ms-linear-gradient(top, #FFFFFF 0%, #EEEEEF 100%);
background: linear-gradient(top, #FFFFFF 0%, #EEEEEF 100%);
/*
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#
#FFFFFF ',endColorstr='#E94A86',GradientType=0);
*/
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border: 1px solid #D6D7D9;
}
.containerCloseConfirmationButtonText {
text-align: center;
font-family: Verdana;
color: #666666;
font-size: 12px;
display: table-cell;
vertical-align: middle;
}
/* End of ControlsBox*/
/*Svg Graphics - Begin*/
.closePopupSvg {
background-image: url("data:image/svg+xml;utf8,<svg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='27px' height='27px' viewBox='0 0 27 27' enable-background='new 0 0 27 27' xml:space='preserve'><g><circle fill='%23E9E9E9' cx='13.5' cy='13.5' r='13.5'/><linearGradient id='SVGID_1_' gradientUnits='userSpaceOnUse' x1='13.5' y1='26' x2='13.5' y2='1.0005'><stop offset='0' style='stop-color:%23F2F2F2'/><stop offset='1' style='stop-color:%23FFFFFF'/></linearGradient><path fill='url(%23SVGID_1_)' d='M13.5,26C6.607,26,1,20.393,1,13.5S6.607,1,13.5,1C20.393,1,26,6.607,26,13.5S20.393,26,13.5,26z'/><linearGradient id='SVGID_2_' gradientUnits='userSpaceOnUse' x1='13.5' y1='26' x2='13.5' y2='1.0005'><stop offset='0' style='stop-color:%23F2F2F2'/><stop offset='0.0599' style='stop-color:%23F4F4F4'/><stop offset='0.4043' style='stop-color:%23FDFDFD'/><stop offset='1' style='stop-color:%23FFFFFF'/></linearGradient><path fill='url(%23SVGID_2_)' d='M13.5,1C6.607,1,1,6.607,1,13.5S6.607,26,13.5,26C20.393,26,26,20.393,26,13.5S20.393,1,13.5,1zM13.5,25C7.159,25,2,19.841,2,13.5C2,7.159,7.159,2,13.5,2C19.842,2,25,7.159,25,13.5C25,19.841,19.842,25,13.5,25z'/><g><g opacity='0.75'><polygon fill='%23FFFFFF' points='19.096,9.008 16.6,9.008 13.5,12.924 10.4,9.008 7.904,9.008 12.252,14.5 7.904,19.992 10.4,19.992 13.5,16.076 16.6,19.992 19.096,19.992 14.748,14.5 '/></g><g><polygon fill='%23999999' points='19.096,8.008 16.6,8.008 13.5,11.924 10.4,8.008 7.904,8.008 12.252,13.5 7.904,18.992 10.4,18.992 13.5,15.076 16.6,18.992 19.096,18.992 14.748,13.5 '/></g></g></g></svg>");
width: 27px;
height: 27px;
}
.iconCloseSvg {
background-image: url("data:image/svg+xml;utf8,<svg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='16px' height='16px' viewBox='0 0 16 16' enable-background='new 0 0 16 16' xml:space='preserve'><g><g opacity='0.75'><polygon fill='%23FFFFFF' points='14.522,3 12.026,3 8.926,6.916 5.825,3 3.329,3 7.678,8.492 3.329,13.984 5.825,13.984 8.926,10.068 12.026,13.984 14.522,13.984 10.174,8.492 '/></g><g><polygon points='13.522,3 11.026,3 7.926,6.916 4.825,3 2.329,3 6.678,8.492 2.329,13.984 4.825,13.984 7.926,10.068 11.026,13.984 13.522,13.984 9.174,8.492 '/></g></g></svg>");
width: 16px;
height: 16px;
margin: 0 auto;
}
.iconHelpSvg {
background-image: url("data:image/svg+xml;utf8,<svg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='16px' height='16px' viewBox='0 0 16 16' enable-background='new 0 0 16 16' xml:space='preserve'><g><g opacity='0.75'><path fill='%23FFFFFF' d='M11.978,4.847c0,0.462-0.083,0.874-0.248,1.234s-0.382,0.68-0.65,0.958 c-0.264,0.269-0.568,0.521-0.912,0.757C9.822,8.032,9.457,8.261,9.07,8.482v1.893H7.804V7.917 c0.307-0.174,0.638-0.365,0.994-0.573c0.356-0.208,0.647-0.417,0.874-0.63c0.273-0.245,0.485-0.499,0.637-0.76 c0.15-0.262,0.226-0.595,0.226-1c0-0.533-0.18-0.93-0.54-1.192C9.633,3.5,9.167,3.369,8.597,3.369 c-0.509,0-0.773,0.018-1.228,0.178c-0.455,0.161-0.612,0.245-0.876,0.41h-0.07V2.514c0.33-0.127,0.546-0.164,1.053-0.265 c0.507-0.101,0.768-0.089,1.221-0.089c1.013,0,1.814,0.247,2.401,0.739S11.978,4.041,11.978,4.847z M9.541,13.625 c0,0.575-0.466,1.041-1.041,1.041S7.458,14.2,7.458,13.625s0.466-1.041,1.042-1.041S9.541,13.05,9.541,13.625z'/> </g> <g> <path d='M10.978,4.847c0,0.462-0.083,0.874-0.248,1.234s-0.382,0.68-0.65,0.958C9.815,7.308,9.511,7.561,9.167,7.796 C8.822,8.032,8.457,8.261,8.07,8.482v1.893H6.804V7.917c0.307-0.174,0.638-0.365,0.994-0.573c0.356-0.208,0.647-0.417,0.873-0.63 c0.273-0.245,0.486-0.499,0.637-0.76c0.15-0.262,0.226-0.595,0.226-1c0-0.533-0.18-0.93-0.541-1.192S8.167,3.369,7.597,3.369 c-0.509,0-0.773,0.018-1.228,0.178c-0.455,0.161-0.612,0.245-0.876,0.41h-0.07V2.514c0.33-0.127,0.546-0.164,1.053-0.265 c0.507-0.101,0.768-0.089,1.221-0.089c1.014,0,1.814,0.247,2.401,0.739S10.978,4.041,10.978,4.847z M8.542,13.625 c0,0.575-0.466,1.041-1.042,1.041S6.458,14.2,6.458,13.625s0.466-1.041,1.042-1.041S8.542,13.05,8.542,13.625z'/> </g></g></svg>");
width: 16px;
height: 16px;
margin: 0 auto;
}
.iconMinimizeSvg {
background-image: url("data:image/svg+xml;utf8,<svg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='16px' height='16px' viewBox='0 0 16 16' enable-background='new 0 0 16 16' xml:space='preserve'><g> <g opacity='0.75'> <polygon fill='%23FFFFFF' points='6,2.084 12.963,8 6,13.916 '/> </g> <g> <polygon points='5,2.084 11.963,8 5,13.916 '/> </g></g></svg>");
width: 16px;
height: 16px;
margin: 0 auto;
}
/*Svg Graphics - End*/
</style>
<link rel="stylesheet" type="text/css"
href="http://192.168.240.36:8080/ets/scripts/themes/base/jquery.ui.all.css">
<script type="text/javascript" src="http://192.168.240.36:8080/ets/scripts/jquery-1.7.2.min.js"></script>
<script type="text/javascript"
src="http://192.168.240.36:8080/ets/scripts/jquery-ui-1.8.23.custom.min.js"></script>
<script type="text/javascript">
//status of the toolbar 0=minimize, 1=open
var TOOLBAR_STATUS = 0;
/* width/height of toolbar*/
var ToolbarWidth = 0;
var ToolbarHeight = 40;
/* Box is display */
var BOX_IS_OPEN = false;
//global variable to hold the timeout we define to hide the toolbar, it can be used if we want to reset the timeout.
var TOOLBAR_HIDE_TIMEOUT;
//global variable to hold the inactivity time for a toolbar to be hidden.
var TOOLBAR_HIDE_TIMEOUT_TIME_IN_MS = 0 /*5000*/;
/* toolbar scale */
var TOOLBAR_SCALE = 1;
/*LOCKED_CONTROLS*/
var LOCKED_CONTROLS_BOX_ID = "";
var LOCKED_SETTINGS_ID = "";
var PARENT_DOMAIN;
/* alias for jQuery */
var etsJ = jQuery.noConflict(true);
etsJ(document).ready(function () {
GetParentDomain();
GetToolbarStatus();
window.parent.postMessage('parentWidthTablet', PARENT_DOMAIN);
var newBottom = new Array();
newBottom[0] = 'changeBottom';
newBottom[1] = '0';
window.parent.postMessage(newBottom, PARENT_DOMAIN);
LoadAutoLoads('1');
/*Visited Rate*/
rateAndAddSiteToStorage(PARENT_DOMAIN);
});
var messageEventHandler = function (event) {
GetParentDomain();
if (event.origin == PARENT_DOMAIN) {
if (event.data instanceof Array) {
if (event.data[0] == 'parentWidth') {
ToolbarWidth = event.data[1];
doOnOrientationChange(event.data[2]);
}
}
}
}
window.addEventListener('message', messageEventHandler, false);
window.onresize = function (event) {
window.parent.postMessage('fixBottom', PARENT_DOMAIN);
}
etsJ(window).load(function () {
// Repositioning the iframe to the bottom of the window after the toolbar's window finished loading.
setTimeout('Reposition()', 500);
});
function Reposition() {
window.parent.postMessage('fixBottom', PARENT_DOMAIN);
}
function doOnOrientationChange(landscapeTablet) {
/*Calculte toolbar Scale*/
CalcultetoolbarScale(landscapeTablet);
// Calculate parent's height and apply it to the app boxes
window.parent.postMessage('parentHeightTablet', PARENT_DOMAIN);
switch (TOOLBAR_STATUS) {
case 0:/* in this case the toolbar in minimized */
hideCET(true);
break;
case 1:/* in this case the toolbar in open status */
displayCET(true);
break;
}
var newHeight = new Array();
//INFOBOX_IS_OPEN =true;
if (BOX_IS_OPEN == false) {
newHeight[0] = 'changeHeight';
newHeight[1] = ToolbarHeight + 6 + 'px';
}
else {
newHeight[0] = 'changeHeight';
newHeight[1] = 'fullHeightTablet2';
}
window.parent.postMessage(newHeight, PARENT_DOMAIN);
}
function CalcultetoolbarScale(landscapeTablet) {
var aBoxContainerWidth = 0;
for (var i = 0; i < etsJ('.aBox').length; i++) {
if (etsJ('#aBox' + i).length > 0) {
aBoxContainerWidth = aBoxContainerWidth + etsJ('#aBox' + i).width() + etsJ(".aBoxSpr").width();
}
}
var toolbarWidthOpen = etsJ(".iconBox").width() + etsJ("#controlsBoxCloseConfirmation").width() + etsJ("#controlsBoxHelp").width() + aBoxContainerWidth + etsJ("#minimiseIcon").width() + 25;
var toolBarWidthOrg = 980;
var toolBarHeihtOrg = 40;
var toolBarScale = ToolbarWidth / toolBarWidthOrg;
TOOLBAR_SCALE = 1;
if (landscapeTablet) {
if (ToolbarWidth != 980) {
TOOLBAR_SCALE = toolBarScale;
}
} else {
if (toolbarWidthOpen * 1.3 < 981) {
TOOLBAR_SCALE = toolBarScale * 1.3;
} else {
TOOLBAR_SCALE = toolBarScale;
}
}
var toolBarScaleText = "scale(" + TOOLBAR_SCALE + ")";
ToolbarWidth = TOOLBAR_SCALE * 980;
ToolbarHeight = TOOLBAR_SCALE * 40;
var toolbarBottomscale = 5 * TOOLBAR_SCALE;
etsJ(".toolbar").css({
"-moz-transform": toolBarScaleText,
"-webkit-transform": toolBarScaleText,
"transform": toolBarScaleText,
'bottom': toolbarBottomscale
});
var containerBoxBottomscale = 45 * TOOLBAR_SCALE;
var containerBoxRightScale = 25 * TOOLBAR_SCALE;
etsJ(".containerHelp").css({
"-moz-transform": toolBarScaleText,
"-webkit-transform": toolBarScaleText,
"transform": toolBarScaleText,
'bottom': containerBoxBottomscale,
'right': containerBoxRightScale
});
etsJ(".containerCloseConfirmation").css({
"-moz-transform": toolBarScaleText,
"-webkit-transform": toolBarScaleText,
"transform": toolBarScaleText,
'bottom': containerBoxBottomscale,
'right': containerBoxRightScale
});
}
function ToggleToolbar() {
switch (TOOLBAR_STATUS) {
case 0:/* in this case the toolbar in minimized */
displayCET(true);
break;
case 1:/* in this case the toolbar in open status */
hideCET(true);
break;
}
}
function hideCET(userClick) {
if (LOCKED_CONTROLS_BOX_ID != "") {
ToggleSelectedClassToControlsBox(LOCKED_CONTROLS_BOX_ID);
}
if (etsJ("#ContainerCloseConfirmation").is(":visible")) {
HidecontainerCloseConfirmation();
}
etsJ('#CET').hide();
etsJ(".iconBox").css('right', '-20px');
//etsJ("#CET").hide("slide", { direction: "right" }, 1000);
calculateMinimizedToolbarWidth();
TOOLBAR_STATUS = 0;
DelayedHideToolbar(-1);
if (userClick) {
ReportToolbarStaus('0');
}
/*etsJ('#CET').effect("slide", {direction: 'right',mode:'hide'}, ANIMATION_SPEED);*/
}
function calculateMinimizedToolbarWidth() {
var minimizedToolbarWidth = TOOLBAR_SCALE * etsJ(".iconBox").width();
window.parent.postMessage(minimizedToolbarWidth + 'px', PARENT_DOMAIN);
}
function displayCET(userClick) {
calculteToolbarOpenWidth();
//LoadAutoLoads('2');
etsJ(".iconBox").css('right', '0')
etsJ("#CET").show();
TOOLBAR_STATUS = 1;
DelayedHideToolbar(TOOLBAR_HIDE_TIMEOUT_TIME_IN_MS);
if (userClick) {
ReportToolbarStaus('1');
}
}
function calculteToolbarOpenWidth() {
var aBoxContainerWidth = 0;
for (var i = 0; i < etsJ('.aBox').length; i++) {
if (etsJ('#aBox' + i).length > 0) {
aBoxContainerWidth = aBoxContainerWidth + etsJ('#aBox' + i).width() + etsJ(".aBoxSpr").width();
}
}
var toolbarWidthOpen = etsJ(".iconBox").width() + etsJ("#controlsBoxCloseConfirmation").width() + etsJ("#controlsBoxHelp").width() + aBoxContainerWidth + etsJ("#minimiseIcon").width() + 25;
var newSize = new Array();
newSize[0] = 'resizeTablet2';
newSize[1] = ToolbarHeight + 6;
newSize[2] = TOOLBAR_SCALE * toolbarWidthOpen;
window.parent.postMessage(newSize, PARENT_DOMAIN);
}
function DelayedHideToolbar(secondsToDelay) {
if (secondsToDelay > 0) {
if (TOOLBAR_STATUS == 1 && !BOX_IS_OPEN) {
TOOLBAR_HIDE_TIMEOUT = setTimeout(function () {
hideCET(true);
}, secondsToDelay)
}
}
else {
if (TOOLBAR_HIDE_TIMEOUT != null) {
clearTimeout(TOOLBAR_HIDE_TIMEOUT);
}
}
}
/*GetApp - this function loads an application via Ajax:
* resultDivId: the div id whixh the ajax result will be embedded into (the app window)
* appUrl: the url of the application to be requested
* extarParams: a table of extra params to concatenated to the App url
* reportingUrl: the url of the ETS servlet responsible for generating the SDRs*/
function GetApp(resultDivId, appUrl, extraParams, reportingUrl) {
var currentTime = new Date();
var pathname = window.location.href;
var fullUrl = "";
fullUrl = appUrl;
if (extraParams != null) {
/*add all extra params*/
if (fullUrl.indexOf("?") != -1) { /*if the url already include params*/
for (var k in extraParams) {
// use hasOwnProperty to filter out keys from the Object.prototype
if (extraParams.hasOwnProperty(k)) {
/*alert('key is: ' + k + ', value is: ' + extraParams[k]);*/
fullUrl = fullUrl + "&" + k + "=" + extraParams[k];
}
}
}
else { /*if the url doesn't include any param, and now we will start adding params*/
var i = 0;
for (var k in extraParams) {
// use hasOwnProperty to filter out keys from the Object.prototype
if (extraParams.hasOwnProperty(k)) {
//alert('key is: ' + k + ', value is: ' + extraParams[k]);
if (i == 0) { /*this is the first param we are adding*/
fullUrl = fullUrl + "?" + k + "=" + extraParams[k];
}
else {
fullUrl = fullUrl + "&" + k + "=" + extraParams[k];
}
i++;
}
}
}
}
/*add timestamp, in order to have a unique request each time to prevent browser caching.*/
if (fullUrl.indexOf("?") != -1) { /*if the url already include params*/
fullUrl = fullUrl + "&tt=" + currentTime;
} else { /*else this is the only parameter*/
fullUrl = fullUrl + "?tt=" + currentTime;
}
/*do the ajax request*/
etsJ.get(fullUrl, function (data) {
/*update the div with the result of the Ajax request to the app*/
document.getElementById('ETSappResult' + resultDivId).innerHTML = data;
// To load the javascript of the specific application
if (etsJ('#ETSappResult' + resultDivId + ' script').html() != null) {
eval(etsJ('#ETSappResult' + resultDivId + ' script').html());
}
});
/*Ajax call to the reporting url*/
if (reportingUrl.indexOf("?") != -1) { /*if the url already include params*/
reportingUrl = reportingUrl + "&tt=" + currentTime;
} else { /*else this is the only parameter*/
reportingUrl = reportingUrl + "?tt=" + currentTime;
}
if (reportingUrl.indexOf("?") != -1) { /*if the url already include params*/
reportingUrl = reportingUrl + "&url=" + pathname;
} else { /*else this is the only parameter*/
reportingUrl = reportingUrl + "?url=" + pathname;
}
etsJ.get(reportingUrl);
}
function LoadAutoLoads(AutoLoadOn) {
//nothing yet, make it read the data from a TAG in the HTML and load the apps according to read data.
var autoLoadDivs = document.getElementsByName("ETSAutoLoad");
if (autoLoadDivs != null && autoLoadDivs.length > 0) {
for (var i = 0; i < autoLoadDivs.length; i++) {
var splittedAutoLoadDivs = autoLoadDivs[i].innerHTML.split('-!!-');
if (parseInt(AutoLoadOn) == parseInt(splittedAutoLoadDivs[5])) {
var exttraParamsHashmap = {};
splittedAutoLoadDivs[4] = splittedAutoLoadDivs[4].replace("{", "");
splittedAutoLoadDivs[4] = splittedAutoLoadDivs[4].replace("}", "");
var paramsArray = splittedAutoLoadDivs[4].split(",");
for (var k = 0; k < paramsArray.length; k++) {
var tmpSingleParamArray = paramsArray[k].split(":");
exttraParamsHashmap[tmpSingleParamArray[0]] = tmpSingleParamArray[1];
}
GetApp(splittedAutoLoadDivs[0], splittedAutoLoadDivs[1], exttraParamsHashmap, 'http://192.168.240.36:8080/ets/ReportingServlet?tId=' + splittedAutoLoadDivs[2] + '&aId=' + splittedAutoLoadDivs[3]);
}
}
}
}
/* report for SDR*/
function ReportToolbarStaus(command) {
// Getting the current time and url address
var currentTime = new Date();
var pathname = window.location.href;
var toolbarStatusForReporting;
if (TOOLBAR_STATUS == 1) {//toolbar open
toolbarStatusForReporting =
1
} else {//toolbar minimized
toolbarStatusForReporting =
0
}
if (command == '1') { /*open toobar*/
//etsJ.get('http://192.168.240.36:8080/ets/ControlServlet?tt=' + currentTime.getMilliseconds() + '&url=' + pathname + '&toolBarCommand=' + '1' + '&toolBarCurrentMode=' + toolbarStatusForReporting);
SetToolBarStatus(1);
} else { /*minimize toolbar*/
if (command == '0') {
//etsJ.get('http://192.168.240.36:8080/ets/ControlServlet?tt=' + currentTime.getMilliseconds() + '&url=' + pathname + '&toolBarCommand=' + '0' + '&toolBarCurrentMode=' + toolbarStatusForReporting);
SetToolBarStatus(0);
}
}
}
function Report(actionId) {
var currentTime = new Date();
var reportingUrl = 'http://192.168.240.36:8080/ets/ReportingServlet?tId=3' + '&actionId=' + actionId + '&tt=' + currentTime.getMilliseconds();
etsJ.get(reportingUrl);
}
/* end of reporting*/
/* Start of ControlsBox*/
//to keep the app button in hover state after we open an app (in other words this is the Selected state for an Controls button)
function ToggleSelectedClassToControlsBox(id) {
var controlsBoxId = '';
if (id != LOCKED_CONTROLS_BOX_ID) {
if (LOCKED_CONTROLS_BOX_ID != "") {
controlsBoxId = 'controlsBox' + LOCKED_CONTROLS_BOX_ID;
etsJ("#" + controlsBoxId).removeClass('controlsBoxSelected');
//RemoveHoverFromControlsBoxChildren(controlsBoxId);
ToggleControlsBoxContainer(LOCKED_CONTROLS_BOX_ID);
}
controlsBoxId = 'controlsBox' + id;
etsJ("#" + controlsBoxId).addClass('controlsBoxSelected');
if (id == 'Help') {
Report('8');
/*to print out help SDR*/
}
//AddHoverToControlsBoxChildren(controlsBoxId);
ToggleControlsBoxContainer(id);
LOCKED_CONTROLS_BOX_ID = id;
}
else {
controlsBoxId = 'controlsBox' + id;
etsJ("#" + controlsBoxId).removeClass('controlsBoxSelected');
//RemoveHoverFromControlsBoxChildren(controlsBoxId);
ToggleControlsBoxContainer(id);
LOCKED_CONTROLS_BOX_ID = "";
}
}
function RemoveHoverFromControlsBoxChildren(id) {
etsJ("#" + id + "Enabled").show();
etsJ("#" + id + "Selected").hide();
}
function AddHoverToControlsBoxChildren(id) {
etsJ("#" + id + "Enabled").hide();
etsJ("#" + id + "Selected").show();
}
function ToggleControlsBoxContainer(id) {
if (etsJ("#ContainerCloseConfirmation").is(":visible")) {
HidecontainerCloseConfirmation();
}
else if (etsJ("#Container" + id).is(":visible")) {
HideShowControlsBoxContainer(id);
}
else {
ShowControlsBoxContainer(id);
}
}
function ShowControlsBoxContainer(id) {
var newHeight = new Array();
newHeight[0] = 'changeHeight';
newHeight[1] = 'fullHeightTablet2';
window.parent.postMessage(newHeight, PARENT_DOMAIN);
BOX_IS_OPEN = true;
etsJ("#Container" + id).show();
DelayedHideToolbar(-1);
}
function HideShowControlsBoxContainer(id) {
var newHeight = new Array();
newHeight[0] = 'changeHeight';
newHeight[1] = ToolbarHeight + 6 + 'px';
window.parent.postMessage(newHeight, PARENT_DOMAIN);
etsJ("#Container" + id).hide();
BOX_IS_OPEN = false;
DelayedHideToolbar(TOOLBAR_HIDE_TIMEOUT_TIME_IN_MS);
}
function HidecontainerCloseConfirmation() {
etsJ("#ContainerCloseConfirmation").hide();
BOX_IS_OPEN = false;
if (LOCKED_CONTROLS_BOX_ID != "") {
var controlsBoxId = 'controlsBox' + LOCKED_CONTROLS_BOX_ID;
etsJ("#" + controlsBoxId).removeClass('controlsBoxSelected');
RemoveHoverFromControlsBoxChildren(controlsBoxId);
LOCKED_CONTROLS_BOX_ID = "";
}
var newHeight = new Array();
newHeight[0] = 'changeHeight';
newHeight[1] = ToolbarHeight + 6 + 'px';
window.parent.postMessage(newHeight, PARENT_DOMAIN);
DelayedHideToolbar(TOOLBAR_HIDE_TIMEOUT_TIME_IN_MS);
}
function CloseToolbar(mode) {
// Getting the current time and url address
var currentTime = new Date();
var pathname = window.location.href;
var toolbarStatusForReporting;
if (TOOLBAR_STATUS == 1) {//toolbar open
toolbarStatusForReporting =
1
} else {//toolbar minimized
toolbarStatusForReporting =
0
}
if (mode == 0) {//close forever
HidecontainerCloseConfirmation();
etsJ('.toolbar').hide(); //close toolbar
window.parent.postMessage('closeFrame', PARENT_DOMAIN);
// Setting that the toolbar was closed forever
etsJ.get('http://192.168.240.36:8080/ets/ControlServlet?tt=' + currentTime + '&url=' + pathname + '&toolBarCommand=' + '4' + '&toolBarCurrentMode=' + toolbarStatusForReporting).fail(function () {
alert("error");
});
} else if (mode == 1) {//close temporary
HidecontainerCloseConfirmation();
etsJ('.toolbar').hide(); //close toolbar
window.parent.postMessage('closeFrame', PARENT_DOMAIN);
// Setting that the toolbar was closed for a number of hours
etsJ.get('http://192.168.240.36:8080/ets/ControlServlet?tt=' + currentTime + '&url=' + pathname + '&toolBarCommand=' + '3' + '&toolBarCurrentMode=' + toolbarStatusForReporting);
} else if (mode == 2) {//close till midnight
// Setting that the toolbar was closed for a number of hours
var CloseRequest = etsJ.get('http://192.168.240.36:8080/ets/ControlServlet?tt=' + currentTime + '&url=' + pathname + '&toolBarCommand=' + '6' + '&toolBarCurrentMode=' + toolbarStatusForReporting);
CloseRequest.success(function (result) {
HidecontainerCloseConfirmation();
etsJ('.toolbar').hide(); //close toolbar
window.parent.postMessage('closeFrame', PARENT_DOMAIN);
});
CloseRequest.error(function (jqXHR, textStatus, errorThrown) {
HidecontainerCloseConfirmation();
etsJ('.toolbar').hide(); //close toolbar
window.parent.postMessage('closeFrame', PARENT_DOMAIN);
});
}
}
/* End of ControlsBox*/
/* drag event */
var offset = null;
var minpos = 0;
var START_DRAG = false;
var TochLeft = 0;
var DARG_LIMTED = false;
function StartT(e) {
TochLeft = 0;
START_DRAG = false;
DARG_LIMTED = false;
if (TOOLBAR_STATUS == 0) {
e.preventDefault();
window.parent.postMessage('startDragTablet', PARENT_DOMAIN);
etsJ(".toolbar").css('position', 'fixed');
var orig = e.originalEvent;
var pos = etsJ(".toolbar").position();
offset = {
y: e.touches[0].pageY,
x: e.touches[0].pageX
};
}
}
function EndT() {
if (TOOLBAR_STATUS == 0) {
if (START_DRAG || DARG_LIMTED) {
var dragPosition = new Array();
dragPosition[0] = 'stopDragTablet';
dragPosition[1] = etsJ(".toolbar").css('top');
dragPosition[2] = ToolbarHeight + 6;
window.parent.postMessage(dragPosition, PARENT_DOMAIN);
etsJ(".toolbar").css('position', 'static');
etsJ(".toolbar").css('position', 'fixed');
etsJ(".toolbar").css('top', '');
etsJ(".toolbar").css('right', '0');
START_DRAG = false;
Report('7');
/*to print out Move/Drag SDR*/
}
else {
if (TOOLBAR_STATUS == 0) {
if (TochLeft <= 0) {
displayCET(true);
}
}
else {
if (TochLeft >= 0) {
hideCET(true);
}
}
}
}
else {
hideCET(true);
}
}
function MoveT(e) {
START_DRAG = false;
if (TOOLBAR_STATUS == 0) {
e.preventDefault();
var orig = e.originalEvent;
var toolbarTop = e.touches[0].pageY - offset.y;
TochLeft = e.touches[0].pageX - offset.x;
if (TochLeft <= 0 && toolbarTop == 0) {
START_DRAG = false;
}
else if (toolbarTop > 0 && toolbarTop < etsJ(window).height() - ToolbarHeight) {
START_DRAG = true;
etsJ(".toolbar").css({
top: e.touches[0].pageY - offset.y
});
} else {
DARG_LIMTED = true
}
}
}
/*end of drag*/
/**
* Visited Rate
*
* @param url - wanted url to set rank in local storage
*/
function rateAndAddSiteToStorage(url) {
var recordPrefix = "searchAppMostVisited_";
var TLDs = ["ac", "ad", "ae", "aero", "af", "ag", "ai", "al", "am", "an", "ao", "aq", "ar", "arpa", "as", "asia", "at", "au", "aw", "ax", "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "biz", "bj", "bm", "bn", "bo", "br", "bs", "bt", "bv", "bw", "by", "bz", "ca", "cat", "cc", "cd", "cf", "cg", "ch", "ci", "ck", "cl", "cm", "cn", "co", "com", "coop", "cr", "cu", "cv", "cx", "cy", "cz", "de", "dj", "dk", "dm", "do", "dz", "ec", "edu", "ee", "eg", "er", "es", "et", "eu", "fi", "fj", "fk", "fm", "fo", "fr", "ga", "gb", "gd", "ge", "gf", "gg", "gh", "gi", "gl", "gm", "gn", "gov", "gp", "gq", "gr", "gs", "gt", "gu", "gw", "gy", "hk", "hm", "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "info", "int", "io", "iq", "ir", "is", "it", "je", "jm", "jo", "jobs", "jp", "ke", "kg", "kh", "ki", "km", "kn", "kp", "kr", "kw", "ky", "kz", "la", "lb", "lc", "li", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me", "mg", "mh", "mil", "mk", "ml", "mm", "mn", "mo", "mobi", "mp", "mq", "mr", "ms", "mt", "mu", "museum", "mv", "mw", "mx", "my", "mz", "na", "name", "nc", "ne", "net", "nf", "ng", "ni", "nl", "no", "np", "nr", "nu", "nz", "om", "org", "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pm", "pn", "pr", "pro", "ps", "pt", "pw", "py", "qa", "re", "ro", "rs", "ru", "rw", "sa", "sb", "sc", "sd", "se", "sg", "sh", "si", "sj", "sk", "sl", "sm", "sn", "so", "sr", "st", "su", "sv", "sy", "sz", "tc", "td", "tel", "tf", "tg", "th", "tj", "tk", "tl", "tm", "tn", "to", "tp", "tr", "travel", "tt", "tv", "tw", "tz", "ua", "ug", "uk", "us", "uy", "uz", "va", "vc", "ve", "vg", "vi", "vn", "vu", "wf", "ws", "xn--0zwm56d", "xn--11b5bs3a9aj6g", "xn--3e0b707e", "xn--45brj9c", "xn--80akhbyknj4f", "xn--90a3ac", "xn--9t4b11yi5a", "xn--clchc0ea0b2g2a9gcd", "xn--deba0ad", "xn--fiqs8s", "xn--fiqz9s", "xn--fpcrj9c3d", "xn--fzc2c9e2c", "xn--g6w251d", "xn--gecrj9c", "xn--h2brj9c", "xn--hgbk6aj7f53bba", "xn--hlcj6aya9esc7a", "xn--j6w193g", "xn--jxalpdlp", "xn--kgbechtv", "xn--kprw13d", "xn--kpry57d", "xn--lgbbat1ad8j", "xn--mgbaam7a8h", "xn--mgbayh7gpa", "xn--mgbbh1a71e", "xn--mgbc0a9azcg", "xn--mgberp4a5d4ar", "xn--o3cw4h", "xn--ogbpf8fl", "xn--p1ai", "xn--pgbs0dh", "xn--s9brj9c", "xn--wgbh1c", "xn--wgbl6a", "xn--xkc2al3hye2a", "xn--xkc2dl3a5ee0h", "xn--yfro4i67o", "xn--ygbi2ammx", "xn--zckzah", "xxx", "ye", "yt", "za", "zm", "zw"].join();
//console.log("url: " + url);
Storage.prototype.setObject = function (key, value) {
//console.log("updated object -> key: \"" + key + "\", value: {url: \"" + value.url + "\", rate: \"" + value.rate + "\"}");
localStorage.setItem(key, JSON.stringify(value));
return true;
};
Storage.prototype.getObject = function (key) {
return JSON.parse(localStorage.getItem(key));
};
var urlData = parseUtl(url);
var domainName = getDomain(urlData[6]);
// console.log("domainName = " + domainName);
if (localStorage[recordPrefix + domainName] == undefined) {
record = {
url: urlData[1] + urlData[6],
rate: 0
};
Storage.prototype.setObject(recordPrefix + domainName, record);
} else {
updatedObj = JSON.parse(localStorage.getItem(recordPrefix + domainName));
updatedObj.rate = (parseInt(updatedObj.rate) + 1);
Storage.prototype.setObject(recordPrefix + domainName, updatedObj);
}
function parseUtl(url) {
var matches = url.match(/^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/);
return matches;
}
function getDomain(url) {
var parts = url.split('.');
if (parts[0] === 'www' && parts[1] !== 'com') {
parts.shift();
}
var ln = parts.length
, i = ln
, minLength = parts[parts.length - 1].length
, part;
// iterate backwards
while (part = parts[--i]) {
// stop when we find a non-TLD part
if (i === 0 // 'asia.com' (last remaining must be the SLD)
|| i < ln - 2 // TLDs only span 2 levels
|| part.length < minLength // 'www.cn.com' (valid TLD as second-level domain)
|| TLDs.indexOf(part) < 0 // officialy not a TLD
) {
return part;
}
}
}
;
}
;
//rateAndAddSiteToStorage(document.URL);
/*End of Visited Rate */
/* Strorage */
function SetParamToStorage(kStorage, vStorage) {
if (typeof(Storage) !== "undefined") {
localStorage.setItem(kStorage, vStorage)
}
}
function GetParamFromStorage(kStorage) {
if (typeof(Storage) !== "undefined") {
return localStorage.getItem(kStorage);
}
}
function SetToolBarStatus(sKey) {
switch (sKey) {
case 0:
SetParamToStorage('ToolbarStatus', 'MINIMIZE');
break;
case 1:
SetParamToStorage('ToolbarStatus', 'OPEN');
break;
case 2:
SetParamToStorage('ToolbarStatus', 'HIDDEN');
break;
}
}
function GetToolbarStatus() {
TOOLBAR_STATUS = 0;
var toolbarStatusValue = GetParamFromStorage('ToolbarStatus');
if (toolbarStatusValue != null) {
switch (toolbarStatusValue) {
case 'MINIMIZE' :
TOOLBAR_STATUS = 0;
break;
case 'OPEN' :
TOOLBAR_STATUS = 1;
break;
case 'HIDDEN' :
TOOLBAR_STATUS = 2;
break;
}
}
}
//get Domain
function GetParentDomain() {
var url = document.referrer;
var arr = url.split("/");
PARENT_DOMAIN = arr[0] + "//" + arr[2];
}
</script>
</head>
<body>
<div name="containerBox" class="containerCloseConfirmation" id="ContainerCloseConfirmation"
style="display: none; -webkit-transform: scale(3.51); transform: scale(3.51); bottom: 157.95px; right: 87.75px;">
<div class="containerCloseConfirmationHeader">
<div class="containerCloseConfirmationHeaderText">
Закрыть приложение до завтра?
</div>
<div class="containerCloseInfo" onclick="ToggleSelectedClassToControlsBox('CloseConfirmation');">
<div class="closePopupSvg"></div>
</div>
</div>
<div class="containerCloseConfirmationButtons">
<div class="containerCloseConfirmationButton" onclick="CloseToolbar(2);">
<div class="containerCloseConfirmationButtonText">
Да, закрыть
</div>
</div>
<div class="containerCloseConfirmationButton1" onclick="HidecontainerCloseConfirmation()">
<div class="containerCloseConfirmationButtonText">
Отмена
</div>
</div>
</div>
</div>
<div name="containerBox" class="containerHelp" id="ContainerHelp"
style="display: none; -webkit-transform: scale(3.51); transform: scale(3.51); bottom: 157.95px; right: 87.75px;">
<div class="containerHeader">
<div class="continaerHeadrInfo">
<div class="containerText">
Помощь
</div>
</div>
<div class="containerCloseInfo" onclick="ToggleSelectedClassToControlsBox('Help');">
<div class="closePopupSvg"></div>
</div>
</div>
<div class="containerInfo">
<div class="containerInfoText">
<div class="helpTitle"><b>О программе</b></div>
Тулбар – это помощник Абонента, который обеспечивает доступ к актуальной информации о состоянии
баланса и предоставляет быстрый способ к его пополнению.<br><br>
<div class="helpTitle"><b>Как работает Тулбар</b></div>
Чтобы развернуть Тулбар нажмите на логотип, а чтобы свернуть нажмите на кнопку "&gt;".<br><br>
<div class="helpTitle"><b>Баланс</b></div>
Для проверки баланса нажмите кнопку "Обновить". Информация о балансе доступна для абонентов с
предоплатной системой и может обновляться с незначительными задержками. Для пополнения баланса
нажмите кнопку "Пополнить".<br><br>
<div class="helpTitle"><b>Поиск</b></div>
Быстрый и удобный поиск в Интернете, нажмите на поле поиска и введите интересующий запрос.<br><br>
<div class="helpTitle"><b>Закрытие</b></div>
Для закрытия Тулбара на сутки нажмите кнопку "Х". Тулбар возобновит свою работу на следующий
день.<br>
<br><br>
</div>
</div>
</div>
<div class="toolbar" id="WholeToolbar"
style="-webkit-transform: scale(3.51); transform: scale(3.51); bottom: 17.55px; position: fixed; right: 0px;">
<div class="iconBox" ontouchstart="StartT(event);" ontouchend="EndT();" ontouchmove="MoveT(event)"
style="right: -20px;">
<embed src="http://192.168.240.36:8080/ets/tablet/svg/logo.svg" type="image/svg+xml" height="40px"
width="40px">
</div>
<div id="CET" class="CET" style="display: none;">
<div class="CETInfo">
<div class="controlsBox" style="width:20px">&nbsp;&nbsp;</div>
<div class="controlsBox" id="controlsBoxCloseConfirmation" style="width: 30px;"
onclick="ToggleSelectedClassToControlsBox('CloseConfirmation')">
<div class="controlsBoxInfo">
<div class="iconCloseSvg" id="controlsBoxCloseConfirmationEnabled"></div>
</div>
</div>
<div class="aBoxSpr"></div>
<div class="controlsBox" id="controlsBoxHelp" style="width: 30px;"
onclick="ToggleSelectedClassToControlsBox('Help'); ">
<div class="controlsBoxInfo">
<div class="iconHelpSvg" id="controlsBoxHelpEnabled"></div>
</div>
</div>
<div class="aBoxSpr"></div>
<div id="aBoxContainer" class="aBoxContainer">
<div class="aBox" id="aBox0" style="width: 350px;">
<div style="width:100%;height:100%">
<div id="ETSappResult0">
<style type="text/css">
@font-face {
font-family: 'DSOfficinaBook';
src: url('http://192.168.240.36:8080/BalanceAppKartel/shared/DSOfficinaSerifBook.otf');
}
@font-face {
font-family: 'DSOfficinaBold';
src: url('http://192.168.240.36:8080/BalanceAppKartel/shared/DSOfficinaSerifBold.otf');
}
embed {
pointer-events: none;
}
.ButtonAppInfo {
display: table-cell;
vertical-align: middle;
text-align: center;
}
.PurchaseButtonApp {
float: right;
margin-top: 2px;
margin-right: 15px;
height: 26px;
width: 80;
px;
display: table;
border: 1px solid D6D7D9;
background-image: -webkit-linear-gradient(top, #FFFFFF 0%, #F4F4F4 13%, #EEEEEF 83%);
background-image: -moz-linear-gradient(top, #FFFFFF 0%, #F4F4F4 13%, #EEEEEF 83%);
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px; /*Shadow - begin */
font-family: Verdana;
font-size: 12px;
color: #4a4a4a;
}
.BalanceButtonApp {
float: right;
margin-top: 2px;
margin-right: 5px;
height: 26px;
width: auto;
display: table;
border: 1px solid D6D7D9;
background-image: -webkit-linear-gradient(top, #FFFFFF 0%, #F4F4F4 13%, #EEEEEF 83%);
background-image: -moz-linear-gradient(top, #FFFFFF 0%, #F4F4F4 13%, #EEEEEF 83%);
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px; /*Shadow - begin */
font-family: DSOfficinaBold;
font-size: 14px;
color: #181818;
}
.BalanceButtonRefresh {
float: right;
width: 16px;
height: 16px;
display: table;
margin-top: 5px;
}
.MsisdnButtonApp {
float: right;
margin-right: 5px;
height: 30px;
width: 140;
px;
display: table;
font-family: Verdana;
font-size: 14px;
color: #7a7a7a;
}
.BalanceAppInfo {
width: 80px;
text-align: center;
margin-top: 7px;
float: right;
}
/*Svg Graphics - Begin*/
.iconRefreshSvg {
background-image: url("data:image/svg+xml;utf8,<svg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='16px' height='16px' viewBox='0 0 16 16' enable-background='new 0 0 16 16' xml:space='preserve'><path d='M12.3,7.447L12.3,7.447c-0.008-0.16-0.289-0.275-0.627-0.258c-0.339,0.018-0.606,0.162-0.598,0.322l0,0 c0.043,0.209,0.066,0.426,0.066,0.646c0,1.732-1.409,3.141-3.142,3.141S4.858,9.891,4.858,8.158c0-1.67,1.309-3.039,2.954-3.135 v1.286l2.513-2.054L7.813,2.202v1.416C5.399,3.665,3.458,5.635,3.458,8.059c0,2.453,1.989,4.441,4.442,4.441 s4.441-1.988,4.441-4.441C12.342,7.852,12.327,7.646,12.3,7.447z'/></svg>");
width: 16px;
height: 16px;
/*margin: 0 auto;*/
}
/*Svg Graphics - End*/
</style>
<!-- [start] toolbar body -->
<script name="ets-anchor" type="text/javascript"
src="http://192.168.240.36:8080/ets/scripts/Anchor.js"></script>
<!-- [end] toolbar -->
<div class="PurchaseButtonApp" onclick="{
var currentTime = new Date();
var reportingUrl = 'http://192.168.240.36:8080/BalanceAppKartel/ReportingServlet?msisdn=77771230004'+'&amp;tt='+currentTime.getMilliseconds();
// getting the link for the subscriber
var GetLink = etsJ.get(reportingUrl);
window.open('https://pay.beeline.kz/rus/mobile/');
}">
<div class="ButtonAppInfo">
Пополнить
</div>
</div>
<div class="BalanceButtonApp" onclick="
{
//check cache
var appExpiryPeriod=1;
var currentTime = new Date();
var isCacheActive=false;
if (appExpiryPeriod == 0){
isCacheActive = true;//no expire time
}else if (appExpiryPeriod < 0){ //disabled
isCacheActive = false;
}else{
try{
var appStorageDate = localStorage.getItem(&quot;balanceStorageDate&quot;);
isCacheActive = (((currentTime.getTime() - appStorageDate) / 60000) <= appExpiryPeriod);
}catch(err) {}
}
if(isCacheActive){
// get value from cache
var ajaxDisplay = document.getElementById(&quot;balanceValue&quot;);
ajaxDisplay.innerHTML = localStorage.getItem(&quot;balanceValueStorage&quot;);
return;
}
var ajaxRequest; // The variable that makes Ajax possible!
try{
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
ajaxRequest = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);
} catch (e) {
try{
ajaxRequest = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
} catch (e){
// Something went wrong
alert(&quot;Your browser broke!&quot;);
return false;
}
}
}
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
var ajaxDisplay = document.getElementById(&quot;balanceValue&quot;);
ajaxDisplay.innerHTML = ajaxRequest.responseText;
try{
//save balance value and time of getting balance in cache
localStorage.setItem(&quot;balanceStorageDate&quot;,currentTime.getTime());
localStorage.setItem(&quot;balanceValueStorage&quot;,ajaxRequest.responseText);
}catch(err) {}
}
}
var date=new Date();
var timestamp=date.getTime();
var dateAsMinutes = new Date(date.getFullYear(),date.getMonth(),date.getDate(),date.getHours(),date.getMinutes());
var timestamp = dateAsMinutes.getTime();
ajaxRequest.open(&quot;GET&quot;, &quot;http://192.168.240.36:8080/BalanceAppKartel/PersonalInfoServlet?refreshOnlyBalance=true&amp;msisdn=77771230004&amp;tt=&quot;+timestamp, true);
ajaxRequest.send(null);
}">
<div class="BalanceButtonRefresh">
<div class="iconRefreshSvg"></div>
</div>
<div class="BalanceAppInfo" id="balanceValue">
</div>
</div>
<div class="MsisdnButtonApp">
<div class="ButtonAppInfo">
+7 777 123-00-04
</div>
</div>
</div>
</div>
</div>
<div style="display:none;" name="ETSAutoLoad">
0-!!-http://192.168.240.36:8080/BalanceAppKartel/PersonalInfoServlet-!!-3-!!-1-!!-{msisdn:77771230004,sourceIp:'10.113.144.187',appWidth:140}-!!-1
</div>
<div class="aBoxSpr"></div>
<div class="aBox" id="aBox1" style="width: 80px;">
<div style="width:100%;height:100%">
<div id="ETSappResult1">
<script language="JavaScript" type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
initializeElements();
});
function initializeElements() {
var searchDoc = document.getElementById('searchArea');
document.getElementById('textArea').style.width = searchDoc.offsetWidth - 29 + 'px';
}
window.onresize = function (event) {
initializeElements();
}
(function (i) {
var u = navigator.userAgent;
var e = /*@cc_on!@*/false;
var st =
setTimeout;
if (/webkit/i.test(u)) {
st(function () {
var dr = document.readyState;
if (dr == "loaded" || dr == "complete") {
i()
} else {
st(arguments.callee, 10);
}
}, 10);
}
else if ((/mozilla/i.test(u) && !/(compati)/.test(u)) || (/opera/i.test(u))) {
document.addEventListener("DOMContentLoaded", i, false);
} else if (e) {
(function () {
var t = document.createElement('doc:rdy');
try {
t.doScroll('left');
i();
t = null;
} catch (e) {
st(arguments.callee, 0);
}
})();
} else {
window.onload = i;
}
})(initializeElements);
</script>
<style type="text/css">
@font-face {
font-family: 'DSOfficinaBook';
src: url('http://192.168.240.36:8080/SearchApp/shared/DSOfficinaSerifBook.otf');
}
@font-face {
font-family: 'DSOfficinaBold';
src: url('http://192.168.240.36:8080/SearchApp/shared/DSOfficinaSerifBold.otf');
}
embed {
pointer-events: none;
}
#searchArea {
width: 90%;
height: 20px;
border: 1px solid D6D7D9;
border-radius: 10px;
overflow: hidden;
margin-left: 4%;
margin-right: 4%;
background-color: #ffffff;
-moz-box-shadow: 0px -1px 0px 0px rgba(186, 187, 190, 1);
-webkit-box-shadow: 0px -1px 0px 0px rgba(186, 187, 190, 1);
box-shadow: 0px -1px 0px 0px rgba(186, 187, 190, 1); /*Shadow - end */
}
#textArea {
float: left;
height: 100%;
}
#imageArea {
float: left;
}
#searchImage {
cursor: pointer;
margin-top: 2px;
}
#searchText {
line-height: 20px;
color: 4 a4a4a;
font-family: Verdana;
font-size: 13px;
}
/*Svg Graphics - Begin*/
.iconSearchSvg {
background-image: url("data:image/svg+xml;utf8,<svg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='16px' height='16px' viewBox='0 0 16 16' enable-background='new 0 0 16 16' xml:space='preserve'><path d='M9.762,4.187c-1.501-1.5-3.934-1.5-5.434,0s-1.5,3.933,0,5.432c1.293,1.293,3.277,1.471,4.762,0.535 c0.036,0.063,0.081,0.123,0.137,0.178l2.19,2.193c0.332,0.332,0.87,0.332,1.202,0s0.332-0.871,0-1.203l-2.192-2.191 c-0.05-0.051-0.104-0.093-0.163-0.128C11.236,7.513,11.07,5.496,9.762,4.187z M8.783,8.643C7.824,9.6,6.265,9.6,5.307,8.643 c-0.959-0.958-0.959-2.519,0-3.478c0.958-0.958,2.518-0.958,3.477,0S9.742,7.683,8.783,8.643z'/></svg>");
width: 16px;
height: 16px;
/*margin: 0 auto;*/
}
/*Svg Graphics - End*/
</style>
<div style="width: 100%; height: 100%;" onclick="
parent.location.href = 'http://www.google.com/search?q=';
">
<div style="height: 18%;"></div>
<div id="searchArea">
<div id="imageArea">
<div id="searchImage" class="iconSearchSvg"></div>
</div>
<div id="textArea"><span id="searchText">поиск</span></div>
</div>
</div>
</div>
</div>
</div>
<div style="display:none;" name="ETSAutoLoad">
1-!!-http://192.168.240.36:8080/SearchApp/TabletSearchServlet-!!-3-!!-2-!!-{msisdn:77771230004,sourceIp:'10.113.144.187',appWidth:140}-!!-1
</div>
<div class="aBoxSpr"></div>
</div>
<div class="controlsBox" id="minimiseIcon" style="width: 30px;" onclick="ToggleToolbar()">
<div class="controlsBoxInfo">
<div class="iconMinimizeSvg" id="tbMinimizeExtra"></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
</iframe>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment