<!--

var FqqOe=true;
var XdaYW=null;
var VIskC=null;
var EDFKZ=null;
var KIhAu=null;
var NqJGV=null;
var khsMi=null;
var vaJqj=null;
var Iqeln=null;
var bGZwu=null;
var AqLea=null;
function rvYXx(SPNnN){
return SPNnN.split(' ').join('_');
}
$(window).ready(function(){
bYlkl();
});
function RAmdk(){
return '?page=blog';
}
function QrXEF(WMoxf){
VIskC.removeClass('blog-message');
VIskC.addClass('blog-error');
VIskC.html(WMoxf);
}
function Ksidm(BcUuC){
VIskC.removeClass('blog-error');
VIskC.addClass('blog-message');
VIskC.html(BcUuC);
}
function gadTt(YDtea){
EDFKZ.css('visibility',YDtea?'visible':'hidden');
}
function rULZj(kfrJV){
kfrJV.token=_parseUri(window.location.href).queryKey.token;
return kfrJV;
}
function bYlkl(){
_parseUri.options.strictMode=true;
XdaYW=$('.blog-comments-contain');
VIskC=$('.blog-status');
EDFKZ=$('.blog-loading');
KIhAu=$('.blog-reload');
NqJGV=$('.blog-delete');
khsMi=$('.blog-select-all');
vaJqj=$('.blog-select-none');
Iqeln=$('.blog-invert-selection');
bGZwu=$('.blog-filter-text');
AqLea=$('.blog-delete-selection');
var HDNOl=$('.admin-logout');
var RZsXY=_parseUri(window.location.href).queryKey.list_id;
HDNOl.each(function(){
var CArrW=window.location.href;
var index=CArrW.indexOf('wa-admin');
CArrW=CArrW.substring(0,index-1);
$(this).html('<a href="{0}" target="_blank">{0}</a>'.format(CArrW));
});
KIhAu.each(function(){
$(this).click(function(){NkxQL(true);});
});
NqJGV.each(function(){
$(this).click(function(){jBDMZ();});
});
khsMi.each(function(){
$(this).click(function(){TOFLI();});
});
vaJqj.each(function(){
$(this).click(function(){uXDQr();});
});
Iqeln.each(function(){
$(this).click(function(){HSQXa();});
});
bGZwu.each(function(){
$(this).everyTime(250,function(){NkxQL();});
});
AqLea.each(function(){
$(this).click(function(){jBDMZ();});
});
if(KIhAu.length>0){
AUCXX(null,RZsXY);
}
if(isMSIE_lower_than_ie8()){
alert('The Web Administration require a HTML5/CSS3 browser and IE >= 8.');
}
}
function ZkwgK(RZsXY){
var erfda=rvYXx('blog-comments-{0}'.format(RZsXY));
var vmZmg=$('.{0} tbody'.format(erfda));
if(vmZmg[ 0 ]!=undefined){
return vmZmg;
}
var buttons=
'<input type="checkbox" class="blog-check" />'
;
XdaYW.append(('<table class="{0}">'+'<thead>'+'<tr>'+'<th colspan="4">Blog "{1}" {2}</th>'+'</tr>'+'</thead>'+'<tbody>'+'</tbody>'+'</table>').format(erfda,RZsXY,buttons));
vmZmg=$('.{0}'.format(erfda));
vmZmg.find('.blog-check').click(function(){IXgrc(this.checked,RZsXY);});
return $('.{0} tbody'.format(erfda));
}
function HoWpF(VaLsY,mctcs){
if(VaLsY){
XdaYW.children().remove();
}
for(var RZsXY in mctcs){
var dUKPH=mctcs[ RZsXY ];
var vmZmg=ZkwgK(RZsXY);
var SEHhk=0;
for(var lcHUA in dUKPH){
var lUpcq=dUKPH[ lcHUA ];
var GQHAV=rvYXx('{0}_{1}'.format(lUpcq.ID_ARTICLE,lUpcq.ID_COMMENT));
var trClass=SEHhk%2==0?'d0':'d1';
lUpcq.EMAIL=_HTMLEntities(lUpcq.EMAIL);
if(!FqqOe){
lUpcq.EMAIL='';
}
else{
if(lUpcq.EMAIL=='http://'){
lUpcq.EMAIL='';
}
if(lUpcq.EMAIL.length>0){
var sMRPm=lUpcq.EMAIL;
var RNmpc=lUpcq.EMAIL;
if((lUpcq.EMAIL.indexOf('@')>0)&&(lUpcq.EMAIL.indexOf('mailto:')<0)){
RNmpc="mailto:"+lUpcq.EMAIL;
sMRPm=lUpcq.EMAIL;
}
lUpcq.EMAIL='<a href="{0}" target="_blank">{1}</a>'.format(RNmpc,sMRPm);
}
}
vmZmg.append(('<tr class="{0}" id="{1}">'+'<td style="width: 125px;">{2}</td>'+'<td style="width: 120px;">{3}</td>'+'<td style="width: 610px;">{4}</td>'+'<td style="width: 15px;"><input type="checkbox" name="{1}" value="{5}" class="blog-comment-check" /></td>'+'</tr>').format(trClass,GQHAV,_HTMLEntities(lUpcq.AUTHOR),lUpcq.CREATED,_HTMLEntities(lUpcq.COMMENT),lUpcq.ID_COMMENT));
SEHhk++;
}
}
}
function xahFn(NQSBl){
var vnPrn=_toJSON(NQSBl);
if(vnPrn.error!=undefined){
QrXEF(vnPrn.error);
}
if(vnPrn.success){
HoWpF(true,vnPrn.json.blogs);
}
else{
HoWpF(true,null);
}
}
function AUCXX(RZsXY,hEJSv){
var kfrJV={action:'list'};
if(RZsXY!=undefined){
kfrJV.id=RZsXY;
}
if(hEJSv!=undefined){
kfrJV.filter=hEJSv;
if($.trim(bGZwu.val())!=$.trim(hEJSv)){
bGZwu.val(hEJSv);
}
}
gadTt(true);
$.ajax({
url:RAmdk(),data:rULZj(kfrJV),
success:function(NQSBl){
xahFn(NQSBl);
gadTt(false);
},error:function(FSsHj,hQTfa,QdLXR){
QrXEF('Cannot get blogs');
gadTt(false);
}
});
}
function NkxQL(forceReload){
var JowVc=bGZwu;
var bJOps=JowVc.data('oldValue');
var cJTZU=$.trim(JowVc.val());
if(bJOps!=cJTZU||forceReload==true){
JowVc.data('oldValue',cJTZU);
if(cJTZU.length>0){
Ksidm('Filtered on \''+cJTZU+'\'');
}
else{
Ksidm('');
}
AUCXX(null,cJTZU);
}
}
function TOFLI(RZsXY){
var eFTaV=RZsXY==undefined?XdaYW.find('input:[type=checkbox][class=blog-comment-check]'):ZkwgK(RZsXY).find('input:[type=checkbox][class=blog-comment-check]');
for(var GQHAV in eFTaV){
var kfllN=eFTaV[ GQHAV ];
kfllN.checked=true;
}
}
function uXDQr(RZsXY){
var eFTaV=RZsXY==undefined?XdaYW.find('input:[type=checkbox][class=blog-comment-check]'):ZkwgK(RZsXY).find('input:[type=checkbox][class=blog-comment-check]');
for(var GQHAV in eFTaV){
var kfllN=eFTaV[ GQHAV ];
kfllN.checked=false;
}
}
function HSQXa(RZsXY){
var eFTaV=RZsXY==undefined?XdaYW.find('input:[type=checkbox][class=blog-comment-check]'):ZkwgK(RZsXY).find('input:[type=checkbox][class=blog-comment-check]');
for(var GQHAV in eFTaV){
var kfllN=eFTaV[ GQHAV ];
kfllN.checked=!kfllN.checked;
}
}
function IXgrc(checked,RZsXY){
if(checked==undefined){
return;
}
var eFTaV=RZsXY==undefined?XdaYW.find('input:[type=checkbox][class=blog-comment-check]'):ZkwgK(RZsXY).find('input:[type=checkbox][class=blog-comment-check]');
for(var GQHAV in eFTaV){
var kfllN=eFTaV[ GQHAV ];
kfllN.checked=checked;
}
}
function XGojj(NQSBl,CNHvp,eFTaV){
var vnPrn=_toJSON(NQSBl);
var wxXge=new Array();
if(vnPrn.error!=undefined){
QrXEF(vnPrn.error);
}
if(vnPrn.success){
for(var SEHhk=0;SEHhk<eFTaV.length;SEHhk++){
var kfllN=eFTaV[ SEHhk ];
var RZsXY=kfllN.name;
var FnvAs=kfllN.parentNode.parentNode;
var AHxro=FnvAs.parentNode;
RZsXY=RZsXY.substring(0,RZsXY.lastIndexOf('_'));
AHxro.removeChild(FnvAs);
if($(wxXge).index(RZsXY)==-1){
wxXge.push(RZsXY);
}
}
for(var SEHhk=0;SEHhk<wxXge.length;SEHhk++){
var vmZmg=ZkwgK(wxXge[ SEHhk ])[ 0 ].parentNode;
var hhMHw=vmZmg!=undefined?$(vmZmg).find('tbody')[ 0 ].childNodes.length:-1;
if(vmZmg!=undefined&&hhMHw==0){
var AHxro=vmZmg.parentNode;
AHxro.removeChild(vmZmg);
}
}
}
else{
QrXEF('Cannot delete comments: '+CNHvp.join(', ')+' - '+vnPrn.error);
}
}
function jBDMZ(RZsXY){
var eFTaV=RZsXY==undefined?XdaYW.find('input:checked:[type=checkbox][class=blog-comment-check]'):ZkwgK(RZsXY).find('input:checked:[type=checkbox][class=blog-comment-check]');
var CNHvp=new Array();
if(eFTaV.length==0){
return;
}
if(!confirm('Delete {0} comments ?'.format(eFTaV.length))){
return;
}
for(var SEHhk=0;SEHhk<eFTaV.length;SEHhk++){
var kfllN=eFTaV[ SEHhk ];
CNHvp.push(kfllN.value);
}
var kfrJV={action:'delete'};
kfrJV.id=CNHvp.join(',');
gadTt(true);
$.ajax({
url:RAmdk(),data:rULZj(kfrJV),
success:function(NQSBl){
XGojj(NQSBl,CNHvp,eFTaV);
gadTt(false);
},error:function(FSsHj,hQTfa,QdLXR){
QrXEF('Cannot delete comments: '+CNHvp.join(', ')+' - '+hQTfa+' - '+QdLXR);
gadTt(false);
}
});
}

-->
