uawdijnntqw1x1x1
IP : 18.217.80.65
Hostname : ns1.eurodns.top
Kernel : Linux ns1.eurodns.top 4.18.0-553.5.1.lve.1.el7h.x86_64 #1 SMP Fri Jun 14 14:24:52 UTC 2024 x86_64
Disable Function : mail,sendmail,exec,passthru,shell_exec,system,popen,curl_multi_exec,parse_ini_file,show_source,eval,open_base,symlink
OS : Linux
PATH:
/
home
/
sudancam
/
.trash
/
wp-content
/
..
/
install.1
/
.
/
..
/
related-posts-by-zemanta.1
/
static
/
js
/
edit_related_posts.js
/
/
!function(e){e.event.props.push("dataTransfer");var a=function(){e("#zem_rp_edit_related_posts").click(function(){var a,r=window._zem_rp_num_rel_posts,t=window._zem_rp_post_id,l=window._zem_rp_admin_ajax_url,i=window._zem_rp_plugin_static_base_url,s=!!window._zem_rp_erp_search,n=0,d={holder:null,wrapper:null,search_form:null,search_input:null,selected_articles_wrap:null,replace_articles_wrap:null,replace_articles_list:null,article_loader:null,article_list:{},articles_to_insert:null,footer:null,save:null},o={},c=[],p={},_=[],u=function(a){a.preventDefault(),d.holder.remove(),e("html").css("overflow","visible")},f=function(a){var i=[];e.each(o,function(){});for(var s=0;r>s;s+=1){var n=o[s];n?"own_sourcefeed"===n.type?i.push({ID:n.aid,post_url:n.url,thumbnail:n.thumbnail,post_title:n.title,post_excerpt:n.excerpt||"",post_content:"",post_date:"",picked:!!n.picked,type:n.type,pos:s}):i.push({ID:!1,pos:s,type:n.type}):i.push({ID:!1,pos:s,type:"empty"})}e.post(l,{action:"rp_update_related_posts",post_id:t,related_posts:JSON.stringify(i),_wpnonce:window._zem_rp_ajax_nonce},a)};a=function(a,r,l,i){var r=window._zem_rp_post_tags&&window._zem_rp_post_tags.join(",")||"",s=window._zem_rp_post_title||"",a=a||!1;if(r||s||!1!==a){var d={},o=1,c=function(){if(o-=1,0>=o){var a=[],r={};e.each(["external","internal"],function(t,l){d[l]&&"ok"===d[l].status&&d[l].data&&e.each(d[l].data.results,function(e,t){return r[t.url]?!0:(r[t.url]=!0,void a.push(t))})}),d.external&&"ok"===d.external.status&&(n=d.external.data.settings.num_external_slots),a?l&&a&&l(a):i&&i()}};e.ajax({url:window._zem_rp_wp_ajax_url,dataType:"json",data:{post_id:t,search:a||"",action:"zem_rp_load_articles",count:30},success:function(a){var r=[];e.each(a,function(a,t){r.push({type:"own_sourcefeed",aid:"in_"+t.id,thumbnail:e(t.img).attr("src"),title:t.title,excerpt:t.excerpt,url:t.url,target_url:t.url})}),a={status:"ok",source:"internal",data:{results:r}},d["internal"===a.source?"internal":"external"]=a,c()},error:c})}else l(!1)};var h,m=function(r,t,l){d.replace_articles_list.html(""),w.render_selector_shadows(),c=[],d.article_loader.find(".zem-no-articles").hide(),d.article_loader.find(".zem-loader").show(),d.article_loader.show();var i=n;a(t,l,function(a){a&&a.length?(d.article_loader.hide(),c=e.grep(a,function(e){return 0>window.location.href.indexOf(e.url)}),e.each(c,function(e,a){p[a.aid]?(a=p[a.aid],c[e]=a):p[a.aid]=a}),w.article_selector(),i!==n&&w.articles()):(d.article_loader.find(".zem-no-articles").show(),d.article_loader.find(".zem-loader").hide()),w.render_selector_shadows(),r&&r(!0)},function(){d.article_loader.find(".zem-no-articles").show(),d.article_loader.find(".zem-loader").hide(),w.render_selector_shadows(),r&&r(!1)})},v=function(e,a,r){e.picked=!0,e.pos=a,o[a]=e,p[e.aid]=e,w.article_li_selected(e),r&&(f(),w.article_selector())},g=function(e,a){delete o[e.pos],e.picked=!1,e.pos=-1,e.elm&&e.elm.html('<div class="droppable" /><span class="notice">Drag post here</span>').attr("draggable",!1).removeClass("external").data("aid",!1),a&&(f(),w.article_selector())},w={article_li:function(a,r){if(a.html('<div class="droppable" />'),a.data("aid",r),a.attr("draggable",!0),a.unbind("dragstart").bind("dragstart",function(e){b.drag(e,r,a)}),r.external)w.article_li_placeholder(a,r);else{var t=e('<img draggable="false" />');t.error(function(){t.unbind("error");var e=parseInt(r.aid.replace("in_"))||parseInt(30*Math.random()),e=i+"thumbs/"+e%30+".jpg";r.thumbnail=e,t.attr("src",e)}),r.thumbnail=r.thumbnail||r.thumbnail_url,t.attr("src",r.thumbnail),a.append(t),a.append('<span unselectable="on" class="title">'+r.title+"</span>");var l=e('<a class="open-article" draggable="false" target="_blank" href="'+r.target_url+'">link out</a>');l.bind("click",function(e){e.stopPropagation()}),a.append(l)}},article_li_selector:function(a,t){t.elm=a,w.article_li(a,t);var l=e('<a draggable="false" class="insert overlay" href="#"><div class="txt">insert</div></a>');l.bind("click",function(e){for(e.preventDefault(),e=e=0;r-1>e&&o[e];e+=1);o[e]||v(t,e,!0)}),a.append(l)},article_li_selected:function(a){var r=d.article_list[a.pos];a.elm=r,w.article_li(r,a);var t=e('<a draggable="false" class="remove overlay" href="#"><span class="icon"></span><span class="txt">remove</span></a>');t.bind("click",function(e){e.preventDefault(),g(a,!0)}),r.append(t)},article_selector:function(){d.replace_articles_list.html("");var a={};e.each(o,function(e,r){a[r.aid]=!0});var r=0;e.each(c,function(t,l){if(!a[l.aid]){var i=e("<li />");w.article_li_selector(i,l),d.replace_articles_list.append(i),r+=1}return r>=30?!1:void 0}),w.render_selector_shadows()},render_selector_shadows:function(){var e=d.replace_articles_list.scrollLeft(),a=d.replace_articles_list[0].scrollWidth-d.replace_articles_list.width();e>0?d.replace_articles_list.addClass("scroll-left"):d.replace_articles_list.removeClass("scroll-left"),a>e?d.replace_articles_list.addClass("scroll-right"):d.replace_articles_list.removeClass("scroll-right")},external_placeholders:function(){for(var e=0,a=_.length,e=0;n-a>e;e+=1)_.push(r-n+e);for(e=0;n>e&&e<_.length;e+=1)v({external:!0,type:"external",title:"Cross promotion"},_[e],!1)},articles:function(){w.external_placeholders(),e.each(o,function(e,a){a&&a.aid&&a.picked&&(r>e?v(a,e,!1):g(a,!1))})},all:function(){w.articles(),w.article_selector()}},b={hint_timeout:null,dragged_article:null,ie9_drag_start:function(a){1!==a.which||a.ctrlKey||a.metaKey||e(this).get(0).dragDrop&&e(this).get(0).dragDrop()},drag_hint:function(a){if(1===a.which&&!a.ctrlKey&&!a.metaKey){var a=e(this),r=b.dragged_article||a.data("aid");r&&(b.hint_timeout=setTimeout(function(){r.picked?d.wrapper.find("ul.selected li").addClass("drop-hint"):d.wrapper.find("ul.selected li:not(.external)").addClass("drop-hint"),r.picked&&d.remove_article_sign.show()},100))}},drag:function(e,a,r){e.dataTransfer.setData("text","wprp_article_"+a.aid),e.dataTransfer.setDragImage?e.dataTransfer.setDragImage(r.get(0),r.outerWidth()/2,r.outerHeight()/2):e.dataTransfer.addElement&&e.dataTransfer.addElement(r.get(0)),b.dragged_article=a,setTimeout(function(){d.wrapper.find("li .droppable").css("z-index",2)},1),b.drag_hint(e)},drop_remove:function(e){e.preventDefault();var a=b.dragged_article;b.dragged_article&&!a.external&&(g(a,!0),b.dragend(e))},drop:function(a){e(this).removeClass("drop"),a.preventDefault();var r=b.dragged_article;if(!r)return!1;var t=r.pos,l=1*e(this).data("pos");if(t===l)return!1;var i=o[l];if(!i||!(i.external&&!r.picked||i.external&&r.external)){var s=r.picked;s&&g(r,!1),i&&(g(i,!1),s&&v(i,t,!1)),v(r,l,!0),b.dragend(a)}},dragover:function(a){a.preventDefault();var a=b.dragged_article,r=e(this).data("aid");(!r||!(r.external&&!a.picked||r.external&&a.external))&&e(this).addClass("drop")},dragleave:function(a){a.preventDefault(),e(this).removeClass("drop")},dragend:function(){clearTimeout(b.hint_timeout),b.dragged_article=null,d.remove_article_sign.hide(),d.wrapper.find("li .droppable").css("z-index",-1),d.wrapper.find("ul.selected li").removeClass("drop-hint")},init:function(){d.selected_articles_wrap.delegate("li","dragover",b.dragover).delegate("li","dragleave",b.dragleave).delegate("li","drop",b.drop),d.replace_articles_wrap.bind("dragover",b.dragover).bind("dragleave",b.dragleave).bind("drop",b.drop_remove),d.wrapper.delegate("li[draggable=true]","dragstart",b.drag_hint).delegate("li[draggable=true]","dragend",b.dragend).delegate("li[draggable=true]","mousedown",b.drag_hint).delegate("li[draggable=true]","mouseup",b.dragend).delegate("li[draggable=true]","mousemove",b.ie9_drag_start)}};h={update:m,render:w.all,init:function(){b.init(),d.search_form.bind("submit",function(e){e.preventDefault(),e=d.search_input.val(),m(null,e,!0)}),d.replace_articles_list.bind("scroll",w.render_selector_shadows)}},d.holder=e('<div id="zem_rp_zem_related_posts_holder"></div>'),d.wrapper=e('<div id="zem_rp_zem_related_posts_wrap"><div class="selected-header"><h4 class="selected-title">Selected posts</h4><a href="#" class="save button">Save and Close</a></div><div class="selected-content"></div></div>'),d.holder.append(d.wrapper),d.wrapper.bind("click",function(e){e.stopPropagation()}),d.save=d.wrapper.find(".save"),d.save.bind("click",function(){return f(function(){window.location.reload()}),!1}),d.selected_articles_wrap=d.wrapper.find(".selected-content");for(var x=e('<ul class="selected" />'),z=0;r>z;z+=1){var k=e('<li><div class="droppable" /><span class="notice">Drag post here</span></li>');k.data("pos",z),d.article_list[z]=k,x.append(k)}return d.selected_articles_wrap.append(x),d.replace_articles_wrap=e('<div id="zem_rp_replace_article_wrap"><div class="remove-article-sign">Drop article here to remove it</div><div class="recommendations-header"><h4 class="recommendations-title">Recommended posts</h4>'+(s?'<form class="search" action="#"><input placeholder="search" class="search" type="text" /><input class="go button" type="submit" value="go" /></form>':'<div class="search notice">Please upgrade the plugin to use search.</div>')+'</div><div class="content"><ul></ul></div><div class="footer"><a href="http://www.zemanta.com/?ref=edit-rp" target="_blank" rel="nofollow">zemanta.com</a></div></div>'),d.wrapper.append(d.replace_articles_wrap),d.replace_articles_list=d.replace_articles_wrap.find(".content ul"),d.article_loader=e('<div class="zem-loader-wrap"><div class="zem-no-articles">No results.</div><div class="zem-loader"><div class="zem-loader-step zem-loader-step-1"></div><div class="zem-loader-step zem-loader-step-2"></div><div class="zem-loader-step zem-loader-step-3"></div></div></div>'),d.replace_articles_wrap.append(d.article_loader),d.remove_article_sign=d.replace_articles_wrap.find(".remove-article-sign"),d.search_form=d.replace_articles_wrap.find("form.search"),d.search_input=d.replace_articles_wrap.find("input.search"),d.footer=d.replace_articles_wrap.find(".footer"),d.holder.bind("click",u),e(document).keydown(function(e){27==e.keyCode&&u(e)}),e("html").css("overflow","hidden"),h.init(),(s=e(".zem_rp:first li:not(.zem_rp_special)"))&&s.each(function(a,r){if(r=e(r),"own_sourcefeed"==r.data("post-type")){var t={aid:r.data("poid").split("-")[1],url:r.find("a:first").attr("href"),title:r.find("a.zem_rp_title").text(),text_preview:"",published_datetime:"",excerpt:r.find(".wp_rp_excerpt").text(),thumbnail:r.find("img").attr("src"),picked:!0,type:r.data("post-type"),pos:r.data("position")};c.push(t),p[t.aid]=t,o[a]=t}else({promoted:!0,network:!0,external:!0})[r.data("post-type")]&&_.push(a)}),h.update(),h.render(),e("body").append(d.holder),d.replace_articles_wrap.css("width",Math.min(d.holder.width()-142,Math.max(680,110*r+130))+"PX"),!1})};!function r(t,l){l||(l=10,t=0),e("#zem_rp_edit_related_posts").length?a():3e4>t?setTimeout(function(){r(t+l,1.5*l)},l):e(function(){a()})}()}(jQuery);
/home/sudancam/.trash/wp-content/../install.1/./../related-posts-by-zemanta.1/static/js/edit_related_posts.js