1
var c_cache=[],dle_poll_voted=[],file_uploaders=[];function reload(){var e=(new Date).getTime();document.getElementById("dle-captcha").innerHTML='<img src="'+dle_root+"engine/modules/antibot/antibot.php?rndval="+e+'" width="160" height="80" alt="" />'}
2
function dle_change_sort(e,t){var o=document.getElementById("news_set_sort");return o.dlenewssortby.value=e,o.dledirection.value=t,o.submit(),!1}
3
function doPoll(e,t){var o=document.getElementById("dlepollform_"+t),n=o.status.value,i="";if(1!=dle_poll_voted[t]){if("results"!=e&&1!=n){for(var d=0;d<o.elements.length;d++){var a=o.elements[d];if("radio"==a.type&&1==a.checked){i=a.value;break}
4
"checkbox"==a.type&&1==a.checked&&(i=i+a.value+" ")}
5
if("vote"==e&&""==i)return;dle_poll_voted[t]=1}
6
else n=1,o.status.value=1;1==n&&"vote"==e&&(n=0,o.status.value=0,e="list"),ShowLoading(""),$.post(dle_root+"engine/ajax/controller.php?mod=poll",{news_id:t,action:e,answer:i,dle_skin:dle_skin,user_hash:dle_login_hash}
7
,function(e){HideLoading(""),$("#dle-poll-list-"+t).fadeOut(500,function(){$(this).html(e),$(this).fadeIn(500)}
8
)}
9
)}
10
}
11
function IPMenu(e,t,o,n){var i=[];return i[0]='<a href="https://www.nic.ru/whois/?searchWord='+e+'" target="_blank">'+t+"</a>",i[1]='<a href="'+dle_root+dle_admin+"?mod=iptools&ip="+e+'" target="_blank">'+o+"</a>",i[2]='<a href="'+dle_root+dle_admin+"?mod=blockip&ip="+e+'" target="_blank">'+n+"</a>",i}
12
function ajax_save_for_edit(e,t){var o={}
13
;return"2"==quick_wysiwyg&&tinyMCE.triggerSave(),$.each($("#ajaxnews"+e).serializeArray(),function(e,t){o[t.name]=t.value}
14
),o.id=e,o.field=t,o.action="save",o.user_hash=dle_login_hash,ShowLoading(""),$.post(dle_root+"engine/ajax/controller.php?mod=editnews",o,function(e){HideLoading(""),"ok"!=e?DLEalert(e,dle_info):($("#dlepopup-news-edit").dialog("close"),DLEconfirm(dle_save_ok,dle_confirm,function(){location.reload(!0)}
15
))}
16
),!1}
17
function ajax_prep_for_edit(i,d){for(var e=0,t=c_cache.length;e<t;e++)e in c_cache&&(!c_cache[e]&&""==c_cache[e]||ajax_cancel_comm_edit(e));return ShowLoading(""),$.get(dle_root+"engine/ajax/controller.php?mod=editnews",{id:i,field:d,action:"edit"}
18
,function(e){HideLoading("");var o="none";$("#modal-overlay").remove(),$("body").prepend('<div id="modal-overlay" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #666666; opacity: .40; z-index: 980; display:none;"></div>'),$("#modal-overlay").fadeIn();var t={}
19
;t[dle_act_lang[3]]=function(){$(this).dialog("close")}
20
,t[dle_act_lang[4]]=function(){ajax_save_for_edit(i,d)}
21
,$("#dlepopup-news-edit").remove(),$("body").prepend("<div id='dlepopup-news-edit' class='dlepopupnewsedit' title='"+menu_short+"' style='display:none'></div>"),$("#dlepopup-news-edit").html(e);var n=.9*$(window).height(),e=.9*$(window).width();1024<e&&(e=1024),$("#dlepopup-news-edit").dialog({autoOpen:!0,width:e,height:n,buttons:t,resizable:!1,dialogClass:"modalfixed dle-popup-quickedit",dragStart:function(e,t){o=$(".modalfixed").css("box-shadow"),$(".modalfixed").css("box-shadow","none")}
22
,dragStop:function(e,t){$(".modalfixed").css("box-shadow",o)}
23
,close:function(e,t){$(this).dialog("destroy"),$("#modal-overlay").fadeOut(function(){$("#modal-overlay").remove()}
24
)}
25
}
26
),830<$(window).width()&&530<$(window).height()&&($(".modalfixed.ui-dialog").css({position:"fixed"}
27
),$("#dlepopup-news-edit").dialog("option","position",{my:"center",at:"center",of:window}
28
)),$("#dlepopup-news-edit").css({overflow:"auto"}
29
),$("#dlepopup-news-edit").css({"overflow-x":"hidden"}
30
)}
31
,"html"),!1}
32
function ajax_comm_edit(t,e){for(var o=0,n=c_cache.length;o<n;o++)o in c_cache&&""!=c_cache[o]&&ajax_cancel_comm_edit(o);return c_cache[t]&&""!=c_cache[t]||(c_cache[t]=$("#comm-id-"+t).html()),ShowLoading(""),$.get(dle_root+"engine/ajax/controller.php?mod=editcomments",{id:t,area:e,action:"edit"}
33
,function(e){HideLoading(""),$("#comm-id-"+t).html(e),setTimeout(function(){document.getElementById("comm-id-"+t).scrollIntoView({block:"center",behavior:"smooth"}
34
)}
35
,300)}
36
,"html"),!1}
37
function ajax_cancel_comm_edit(e){return""!=c_cache[e]&&$("#comm-id-"+e).html(c_cache[e]),c_cache[e]="",$('[data-commentsgallery="'+e+'"]').show(),!1}
38
function ajax_save_comm_edit(o,n){if("selected"==$("#comments-image-uploader-edit").data("files"))return $("#comments-image-uploader-edit").on("complete",function(e,t){HideLoading(""),$("#comments-image-uploader-edit").data("files","uploaded"),ajax_save_comm_edit(o,n)}
39
),$("#comments-image-uploader-edit").plupload("start"),!1;"2"==dle_wysiwyg&&tinyMCE.triggerSave();var e=$("#dleeditcomments"+o).val();return ShowLoading(""),$.post(dle_root+"engine/ajax/controller.php?mod=editcomments",{id:o,comm_txt:e,area:n,action:"save",user_hash:dle_login_hash}
40
,function(e){HideLoading(""),e.success?(c_cache[o]="",$("#comm-id-"+o).html(e.content),document.getElementById("comm-id-"+o).scrollIntoView({block:"center",behavior:"smooth"}
...
</html>