credit_due-8.x-1.0-alpha6/js/ui.min.js
js/ui.min.js
(function(r,i){"use strict";i.behaviors.editPublishOptions={attach:function e(t){r.each(r(".expand-to-edit",t),function(){var e=r(this);var t=e.find("label, .label").first();var a=e.find("input").first().val();if(e.hasClass("field--widget-datetime-timestamp")){a+=" "+e.find(".form-time").first().val()}t.append(': <b class="expand-to-edit-value">'+a+'</b> <a href="#" class="edit-expand-field">Edit</a>')});r(".edit-expand-field",t).click(function(e){e.preventDefault();var t=r(this).closest(".expand-to-edit");var a=t.find("input").first();a.attr("data-prev-value",a.val());if(t.hasClass("field--widget-datetime-timestamp")){var i=t.find(".form-time").first();i.attr("data-prev-value",i.val())}t.addClass("is-expanded")});r(".save-cancel-ok",t).click(function(e){e.preventDefault();var t=r(this).closest(".expand-to-edit");var a=t.find("input").first().val();if(t.hasClass("field--widget-datetime-timestamp")){a+=" "+t.find(".form-time").first().val()}t.find(".expand-to-edit-value").text(a);t.removeClass("is-expanded")});r(".save-cancel-cancel",t).click(function(e){e.preventDefault();var t=r(this).closest(".expand-to-edit");var a=t.find("input").first();a.val(a.attr("data-prev-value"));if(t.hasClass("field--widget-datetime-timestamp")){var i=t.find(".form-time").first();i.val(i.attr("data-prev-value"))}t.removeClass("is-expanded")})}};i.behaviors.nodeUrlAlias={attach:function e(t){r("#edit-alias",t).click(function(){var e=r(this);if(e.hasClass("open-alias")){e.closest("fieldset").addClass("opened-alias-fieldset").find(".fieldset-wrapper").show(400);e.text("Save");e.removeClass("open-alias")}else{e.closest("fieldset").removeClass("opened-alias-fieldset").find(".fieldset-wrapper").hide(400);e.text("Edit");e.addClass("open-alias")}});var a=r(".current-url-alias").attr("data-nid");r("#edit-path-0-alias",t).keyup(function(){var e=r(this).val();if(r(".generated-automatic-message").length){if(r("input#edit-path-0-pathauto").prop("checked")){e=i.t("Generated automatically with Pathauto")}else{if(e.length===0){e=i.t("Will be based on node ID after saving")}else{e=window.location.origin+r(this).val()}}r(".generated-automatic-message").text(e)}else{if(e.length===0){if(a>0){e="/node/"+a}else{if(r("input#edit-path-0-pathauto").prop("checked")){e=i.t("Generated automatically with Pathauto")}else{e=i.t("Will be based on node ID after saving")}}}else{e=window.location.origin+e}r(".current-url-alias").html(e)}});r("input#edit-path-0-pathauto",t).change(function(){if(r(this).prop("checked")){r(".generated-automatic-message").text(i.t("Generated automatically with Pathauto"))}else{r(".generated-automatic-message").text(r("#edit-path-0-alias").val())}})}};i.behaviors.GotoSpecificPage={attach:function e(t){function s(i){var s=document.location.href;var e=s.split("?");if(e.length===1){return document.location.href}s=e[0]+"?";e=e[1];e=e.split("&");r.each(e,function(e,t){var a=t.split("=");if(a[0]!==i){s+=t+"&"}});s=s.replace(/&$/,"");s=s.replace(/\?$/,"");return s}r("#current-page-selector").keypress(function(e){if(e.which===13){if(isNaN(r(this).val())){return}var t=parseInt(r(this).val())-1;var a=s("page");var i=parseInt(r(".total-pages").first().text());if(t>i){t=i-1}if(t<=0){t=0}if(a.indexOf("?")>-1){window.location=a+"&page="+t}else{window.location=a+"?page="+t}}})}};i.behaviors.hoverFitScreen={attach:function e(t){r(".menu-item--expanded:not(.menu-item--active-trail)").hover(function(){var e=r(this).find("ul.level-1").first();var t=e.offset().top;var a=t+e.outerHeight();var i=r(window).scrollTop();var s=i+r(window).height();if(a>s){var n=s-a-60;e.css("top",n)}},function(){var e=r(this).find("ul.level-1").first();e.css("top")})}};i.behaviors.designateNestedTabs={attach:function e(t){r.each(r(".block-local-tasks-block",t),function(e,t){var a=r(this);var i=a.find(".tabs nav");if(i.length>1){a.addClass("nested-tabs")}})}};i.behaviors.addressZeroHeightCkeditor={attach:function e(t){var a=new MutationObserver(function(e,t){r.each(e,function(e,t){var a=r(t.addedNodes);var i=".cke_contents";var s=a.find(i).addBack(i);s.each(function(){var e=document.getElementById(r(this).attr("id"));var t=new MutationObserver(function(e){e.forEach(function(e){if(r(e.target).css("height")==="0px"){r(e.target).css("height","200px")}})});var a={attributes:true,attributeFilter:["style"]};t.observe(e,a)})})});var i=document.querySelector("body");a.observe(i,{childList:true,subtree:true})}};i.behaviors.unescapeTranslationMessage={attach:function e(t){var a=r("#edit-meta-actions-delete[hreflang]",t);if(a.length){var i=a.html();var s=document.createElement("div");s.innerHTML=i;var n=s.childNodes.length===0?"":s.childNodes[0].nodeValue;a.html(n)}}}})(jQuery,Drupal);