function showChartTooltip(x, y, contents) { $('<div id="charttooltip">' + Math.round(contents) + ' ms</div>').css({ position: 'absolute',
'z-index': '150',
display: 'none',
top: 595 - (y / 4000 * 595) - 50,
left: x / 20 * 600,
'font-size': '9px',
border: '1px solid #bfbfbf',
padding: '2px',
'background-color': '#ffffff',
opacity: 1,
color: '#262626',
padding: '1px'
}).appendTo("#thecake").fadeIn(200)
}
function whosReq(t, m) {
$.messager.alert(t, m, 'info')
}
function changeServer(k, u, i) {
l = document.getElementById("serverLabel").getElementsByTagName("span");
l[1].innerHTML = k + " (" + i + u + ")";
document.cookie = "aktReader=" + k;
$('#selReader').window('close');
initTabs = new Array();
$(aktuellerTab).datagrid('reload', {
'query': ''
})
}
function autoRefresh(id) {
window.clearInterval(theRefresh);
theRefresh = window.setInterval(function() {
$(id).datagrid('reload')
}, rZeit * 1000)
}
function entitlements(n) {
$("#entdone").hide();
$("#entload").show();
$('#entitlements').window({
title: "Entitlements: " + n
});
$('#entitlements').dialog('open');
$('#entdone').load('ajax.php?type=html&re=' + n, function() {
$("#entload").hide();
$("#entdone").show()
})
}
function formatInterval(val, row) {
var sek = String(val);
var h = Math.floor(sek / 3600 % 24);
var m = Math.floor(sek / 60 % 60);
var s = Math.floor(sek % 60);
if (h == 1) return '<span class="reader_error">' + h + ' ' + langIntervals.hour + '</span>';
if (h > 1) return '<span class="reader_error">' + h + ' ' + langIntervals.hours + '</span>';
if (m == 1) return '<span class="reader_unknown">' + m + ' ' + langIntervals.min + '</span>';
if (m > 1) return '<span class="reader_unknown">' + m + ' ' + langIntervals.min + '</span>';
if (s == 1) return '<span class="reader_ok">' + s + ' ' + langIntervals.sec + '</span>';
if (s > 1) return '<span class="reader_ok">' + s + ' ' + langIntervals.secs + '</span>';
if (s == 0) return '<span style="font-style:italic" class="reader_ok">' + langIntervals.request + '</span>'
}
function formatDateTime(val, row) {
var theDate = new Date();
theDate.setTime(val * 1000);
return theDate.format(zeitSchema)
}
function formatDate(val, row) {
if (typeof val === "undefined" || val == "") return "";
var theDate = new Date(val);
var q = new Date();
var m = q.getMonth() + 1;
var d = q.getDate();
var y = q.getFullYear();
var heute = new Date(y + "-" + m + "-" + d);
timeClass = "reader_ok";
if (heute.toDateString() == theDate.toDateString()) {
timeClass = "reader_unknown"
} else if (heute > theDate) {
timeClass = "reader_error"
}
return "<span class=\"" + timeClass + "\">" + theDate.format(zeitSchema) + "</span>"
}
function cakeIt(dats, usr) {
usedTitel = derTitel;
var daten = dats.split(',');
usedTitel = usedTitel.replace(/{ecms}/, daten.length);
usedTitel = usedTitel.replace(/{usr}/, usr);
$('#thecake').window({
title: usedTitel
});
$('#thecake').window('open');
var data = [];
for (var i = 0; i < daten.length; i++) {
var num = parseInt(daten[i]);
data[i] = {
label: "ECM " + (i + 1) + "<br>" + num + "ms",
data: num
}
}
var d1 = [];
for (var i = 0; i < daten.length; i++) {
var num = parseInt(daten[i]);
d1.push([(i + 1), num])
}
var plot = $.plot($("#cakegraph"), [{
data: d1
}], {
series: {
lines: {
show: true
},
points: {
show: true
}
},
grid: {
hoverable: true
},
yaxis: {
tickDecimals: 0,
min: 0,
max: 4000,
autoscaleMargin: null
},
xaxis: {
tickDecimals: 0,
min: 1,
max: 20,
autoscaleMargin: null
}
});
$("#cakegraph").bind("plothover", function(event, pos, item) {
$("#x").text(pos.x.toFixed(2));
$("#y").text(pos.y.toFixed(2));
if (item) {
$("#charttooltip").remove();
var x = item.datapoint[0].toFixed(2),
y = item.datapoint[1].toFixed(2);
showChartTooltip(x, y, y)
} else {
$("#charttooltip").remove()
}
})
}
function mydatagrid(dasPrompt) {
nativid[aktuellerTab] = aktuellerTab.replace(/#/, "");
if (aktuellerTab == "#dgg" || aktuellerTab == "#dgl") {
$(aktuellerTab).datagrid({
remoteSort: false,
onLoadSuccess: function(target, rows) {
$.ajax({
type: "GET",
url: "ajax.php?type=html&rev",
success: function(result) {
$('.icon-oscam').html(result)
}
})
}
})
} else {
$(aktuellerTab).datagrid({
remoteSort: false,
view: detailview,
detailFormatter: function(index, row) {
return '<div id="ddv-' + nativid[aktuellerTab] + index + '" style="padding:5px 0"></div>'
},
onCollapseRow: function() {
autoRefresh(aktuellerTab)
},
onLoadSuccess: function(target, rows) {
$.ajax({
type: "GET",
url: "ajax.php?type=html&rev",
success: function(result) {
$('.icon-oscam').html(result)
}
})
},
onExpandRow: function(index, row) {
window.clearInterval(theRefresh);
var iName = row.identname.replace(/(<.*?>)/ig, "");
$('#ddv-' + nativid[aktuellerTab] + index).panel({
border: false,
cache: false,
href: 'ajax.php?type=html&' + nativid[aktuellerTab] + '=' + encodeURIComponent(iName),
onLoad: function(href) {
$(aktuellerTab).datagrid('fixDetailRowHeight', index)
}
});
$(aktuellerTab).datagrid('fixDetailRowHeight', index)
}
})
}
var pager = $(aktuellerTab).datagrid('getPager');
pager.pagination({
onBeforeRefresh: function() {
$(aktuellerTab).datagrid('reload', {
'query': ''
})
},
buttons: [{
iconCls: 'icon-search',
handler: function() {
$('#d2').window('open');
$('#ss').searchbox({
width: '150px',
value: '',
searcher: function(value) {
$(aktuellerTab).datagrid('reload', {
'query': value
});
$('#d2').window('close');
$('body').css('overflow', 'auto')
},
prompt: ''
})
}
}, {
iconCls: 'icon-stats',
handler: function() {
$('body').css('overflow', 'hidden');
$('#cw_stats').window({
title: eval("statTitles." + nativid[aktuellerTab])
});
$('#cw_stats').window('open');
$('#entdone_cw').load('ajax.php?type=html&srv=' + nativid[aktuellerTab], function() {
$('#entload_cw').fadeOut("fast", function() {
$('#entdone_cw').fadeIn("fast")
})
})
}
}, {
text: loadingVersion,
iconCls: 'icon-oscam',
handler: function() {
$.ajax({
type: "GET",
url: "ajax.php?type=html&rev&st",
success: function(result) {
$.messager.alert('OSCam Version', result, 'info')
}
})
}
}, ]
})
}
$(document).keyup(function(e) {
if (e.keyCode == 27) {
$(document).find('*[modal]').each(function(index) {
$(this).window("close")
})
}
});
$(function() {
try {
cF = document.forms["ff"].fullscreen
} catch (e) {
$(document).find('*[modal]').each(function(index) {
$(this).appear(function() {
pos = $(this).offset();
if (pos.top < 15) {
$(this).window({
top: 15,
closed: false
});
$('html, body').animate({
scrollTop: 0
}, 'slow');
$('body').css("overflow", "auto")
}
})
});
headText = $(".head").text();
if (headText.indexOf(unescape("paramite")) == -1 || headText.indexOf(unescape("Streamboard")) == -1) {
$.messager.alert(unescape('Unofficial Version detected'), unescape('It seems that you are using a hacked version. OScamInfoPHP is written by <a href="mailto:paramite@gmx.net">paramite</a><br><br>The official versions are in the following boards:<br><ul><li><a href="http://streamboard.gmc.to/wbb2/thread.php?threadid=32717">Streamboard</a></li><li><a href="http://www.onestep.cc/wbb2/thread.php?postid=65051">OneStep.cc</a></li><li><a href="http://www.spinnes-board.de/vb/showthread.php?147658-OScam-Info-in-PHP-1.0-Stable">Spinnes Board</a></li><li><a href="http://www.oscam.to/wbb3/index.php?page=Thread&threadID=10496">OScam Board</a></li></ul> '), 'error')
}
}
});