File Editor
Directories:
.. (Back)
Files:
admin-sharing.min.asset.php
admin-sharing.min.js
sharing.min.asset.php
sharing.min.js
Create New File
Create
Edit File: admin-sharing.min.js
!function(){var e;(e=jQuery)(document).ready((function(){function i(){e(".preview a.sharing-anchor").unbind("mouseenter mouseenter").hover((function(){if(!0!==e(this).data("hasappeared")){var i=e(".sharing-hidden .inner"),a=e(this).parents("li"),s=setTimeout((function(){e(i).css({left:e(a).position().left+"px",top:e(a).position().top+e(a).height()+3+"px"}).slideDown(200,(function(){e(a).data("hasappeared",!0).data("hasoriginal",!0).data("hasitem",!1),e(i).mouseleave(s).mouseenter(n),e(a).mouseleave(r).mouseenter(t),e(a).click(l)}));var s=function(){if(e(a).data("hasitem",!1),!1===e(a).data("hasoriginal")){var i=setTimeout(l,800);e(a).data("timer2",i)}},n=function(){e(a).data("hasitem",!0),clearTimeout(e(a).data("timer2"))},r=function(){if(e(a).data("hasoriginal",!1),!1===e(a).data("hasitem")){var i=setTimeout(l,800);e(a).data("timer2",i)}},t=function(){e(a).data("hasoriginal",!0),clearTimeout(e(a).data("timer2"))},l=function(){return i.slideUp(200),e(a).unbind("mouseleave",r).unbind("mouseenter",t),e(i).unbind("mouseleave",s).unbind("mouseenter",s),e(a).data("hasappeared",!1),e(a).unbind("click",l),!1}}),200);e(this).data("timer",s)}}),(function(){clearTimeout(e(this).data("timer")),e(this).data("timer",!1)}))}function a(){var a=e("#button_style").val(),s=e(".sharedaddy"),n="sd-social-official";"official"===a?s.addClass(n):s.removeClass(n),e("#live-preview ul.preview li").remove(),(e("#save-enabled-shares input[name=visible]").val()||e("#save-enabled-shares input[name=hidden]").val())&&e("#live-preview ul.preview").append(e("#live-preview ul.archive .sharing-label").clone()),e("ul.services-enabled li").each((function(){if(e(this).hasClass("service")){var i=e(this).attr("id");e("#live-preview ul.preview").append(e("#live-preview ul.archive li.preview-"+i).clone())}})),e("#save-enabled-shares input[name=hidden]").val()&&(e("#live-preview ul.preview").append(e("#live-preview ul.archive .share-more").parent().clone()),e(".sharing-hidden ul li").remove(),e("ul.services-hidden li").each((function(){if(e(this).hasClass("service")){var i=e(this).attr("id");e(".sharing-hidden .inner ul").append(e("#live-preview ul.archive .preview-"+i).clone())}})),i()),e("#live-preview div.sharedaddy").removeClass("sd-social-icon"),e("#live-preview li.advanced").removeClass("no-icon"),"icon"===a?(e("#live-preview ul.preview div span, .sharing-hidden .inner ul div span").html(" ").parent().addClass("no-text"),e("#live-preview div.sharedaddy").addClass("sd-social-icon")):"official"===a?e("#live-preview ul.preview .advanced, .sharing-hidden .inner ul .advanced").each((function(){e(this).hasClass("preview-press-this")||e(this).hasClass("preview-email")||e(this).hasClass("preview-mastodon")||e(this).hasClass("preview-nextdoor")||e(this).hasClass("preview-print")||e(this).hasClass("preview-reddit")||e(this).hasClass("preview-telegram")||e(this).hasClass("preview-jetpack-whatsapp")||e(this).hasClass("preview-x")||e(this).hasClass("share-custom")||e(this).hasClass("share-deprecated")||e(this).find(".option a span").html("").parent().removeClass("sd-button").parent().attr("class","option option-smart-on")})):"text"===a&&e("#live-preview li.advanced").addClass("no-icon")}function s(e){jQuery("."+e+"-extra-options").css({backgroundColor:"#ffffcc"}).fadeIn()}function n(){e("#enabled-services h3 img").show(),e("#enabled-services ul.services-enabled li.service").length>0?e("#drag-instructions").hide():e("#drag-instructions").show(),e("#enabled-services li.service").length>0?e("#live-preview .services h2").hide():e("#live-preview .services h2").show();var i=[],n=[];e("ul.services-enabled li").each((function(){e(this).hasClass("service")&&(i[i.length]=e(this).attr("id"),s(e(this).attr("id")))})),e("ul.services-available li").each((function(){var i;e(this).hasClass("service")&&(i=e(this).attr("id"),jQuery("."+i+"-extra-options").fadeOut("slow"))})),e("ul.services-hidden li").each((function(){e(this).hasClass("service")&&(n[n.length]=e(this).attr("id"),s(e(this).attr("id")))})),e("#save-enabled-shares input[name=visible]").val(i.join(",")),e("#save-enabled-shares input[name=hidden]").val(n.join(",")),a(),e("#save-enabled-shares").ajaxSubmit((function(){e("#enabled-services h3 img").hide()}))}function r(e,i){var a,s=e.parent(),r=s.find("li"),t=r.index(e)+1,l=r.length-1;if(!s.hasClass("services-available")){if("left"===i){if(1===t)return;var o=e.prev();a=e.detach(),o.before(a),o.prev().focus()}if("right"===i){if(t===l)return;var d=e.next();a=e.detach(),d.after(a),d.next().focus()}n()}}function t(i){var a,s=i.parent();a=s.hasClass("services-available")?"services-enabled":s.hasClass("services-enabled")?"services-hidden":"services-available";var r=i.detach();e("."+a).prepend(r).find("li:first-child").focus(),n()}window.sharing_option_changed=function(){var i=this;return e(this).parents("li:first").css("backgroundImage",'url("'+sharing_loading_icon+'")'),e(this).parents("form").ajaxSubmit((function(s){if(s.indexOf("\x3c!---")>=0){var n=s.substring(0,s.indexOf("\x3c!---\x3e")),r=s.substring(s.indexOf("\x3c!---\x3e")+6);!0===e(i).is(":submit")&&e(i).parents("li:first").replaceWith(n),e("#live-preview ul.archive li.preview-"+e(i).parents("form").find("input[name=service]").val()).replaceWith(r)}a(),e(i).parents("li:first").removeAttr("style")})),!0!==e(i).is(":submit")},e("#enabled-services .services ul").sortable({receive:function(){n()},stop:function(){n(),e("li.service").enableSelection()},over:function(){e(this).find("ul").addClass("dropping"),e("#enabled-services li.end-fix").remove(),e("#enabled-services ul").append('<li class="end-fix"></li>')},out:function(){e(this).find("ul").removeClass("dropping"),e("#enabled-services li.end-fix").remove(),e("#enabled-services ul").append('<li class="end-fix"></li>')},helper:function(e,i){return i.find(".advanced-form").hide(),i.clone()},start:function(){e(".advanced-form").hide(),e("li.service").disableSelection()},placeholder:"dropzone",opacity:.8,delay:150,forcePlaceholderSize:!0,items:"li",connectWith:"#available-services ul, #enabled-services .services ul",cancel:".advanced-form"}),e("#available-services ul").sortable({opacity:.8,delay:150,cursor:"move",connectWith:"#enabled-services .services ul",placeholder:"dropzone",forcePlaceholderSize:!0,start:function(){e(".advanced-form").hide()}}),e(".service").on("keydown",(function(i){switch(i.keyCode){case 13:case 32:t(e(this));break;case 37:r(e(this),"left");break;case 39:r(e(this),"right");break;default:return!0}i.preventDefault()})),e(".preview-hidden a").click((function(){return e(this).parent().find(".preview").toggle(),!1})),e("#new-service form").ajaxForm({beforeSubmit:function(){e("#new-service-form .error").hide(),e("#new-service-form img").show(),e("#new-service-form input[type=submit]").prop("disabled",!0)},success:function(i){e("#new-service-form img").hide(),""+i=="1"?(e("#new-service-form .inerror").removeClass("inerror").addClass("error"),e("#new-service-form .error").show(),e("#new-service-form input[type=submit]").prop("disabled",!1)):document.location.reload()}}),e("#button_style").change((function(){return a(),!0})).change(),e("input[name=sharing_label]").blur((function(){e("#live-preview h3.sd-title").text(e("<div/>").text(e(this).val()).html())})),e("#services-config a.remove").unbind("click").click((function(){var i=e(this).parent().next();return e(this).parents("li:first").css("backgroundImage",'url("'+sharing_loading_icon+'")'),i.ajaxSubmit((function(){i.parents("li:first").fadeOut((function(){e(this).remove(),a()}))})),!1})),i()}))}();
Save Changes
Rename File
Rename