User:Tobias Alcaraz/common.min.js

From Mine Blocks Wiki
< User:Tobias Alcaraz
Revision as of 10:57, 20 December 2021 by Tobias Alcaraz (talk | contribs) (Created page with "!function(){var t,e,i,n,a={"\\&":"&","<":"<",">":">"},r=function(t){return t.replace(/\\\\/g,"\").replace(/\\&|[<>]/g,function(t){return a[t]})},s=$(),o=$(wind...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
If you find a typo, inconsistency, or error, please sign up and help out the wiki! We can't do it without your help! :D Thank you!

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
!function(){var t,e,i,n,a={"\\&":"&#38;","<":"&#60;",">":"&#62;"},r=function(t){return t.replace(/\\\\/g,"&#92;").replace(/\\&|[<>]/g,function(t){return a[t]})},s=$(),o=$(window);$("#mw-content-text").on({"mouseenter.minetip":function(a){s.remove();var l=$(this),c=l.attr("data-minetip-title");if(void 0===c&&void 0!==(c=l.attr("title"))&&(c=$.trim(c.replace(/&/g,"\\&")),l.attr("data-minetip-title",c)),"Empty"!==c){if(void 0===c||""!==c&&""===c.replace(/&([0-9a-fl-or])/g,"")){var m,d=l[0];do{d.hasAttribute("title")&&(m=d.title),d=d.firstChild}while(d&&1===d.nodeType);if(void 0===m)return;c||(c=""),c+=$.trim(m.replace(/&/g,"\\&")),l.attr("data-minetip-title",c)}if(l.data("minetip-ready")||(l.find("[title]").addBack().removeAttr("title"),l.data("minetip-ready",!0)),""!==c&&"Invisible-sprite"!==c){var p='<span class="minetip-title">'+r(c)+"&r</span>",u=$.trim(l.attr("data-minetip-text"));u&&(p+='<span class="minetip-description">'+(u=r(u).replace(/\\\//g,"&#47;")).replace(/\//g,"<br>")+"&r</span>"),p=p.replace(/&r/g,""),(s=$('<div id="minetip-tooltip">')).html(p).appendTo("body"),t=o.width(),e=o.height(),i=s.outerWidth(!0),n=s.outerHeight(!0),l.trigger("mousemove",a)}}},"mousemove.minetip":function(a,r){if(s.length){var o=(a=r||a).clientY-34,l=a.clientX+14;l+i>t&&(l-=i+36),l<0?(l=0,(o-=n-22)<0&&(o+=n+47)):o<0?o=0:o+n>e&&(o=e-n),s.css({top:o,left:l})}else $(this).trigger("mouseenter")},"mouseleave.minetip":function(){s.length&&(s.remove(),s=$())}},".minetip, .invslot-item")}(),jQuery(function(t){function e(){var e=t(this).children(),i=e.filter(".ts-active"),n=i.next();0===n.length&&(n=e.first()),i.removeClass("ts-active"),n.addClass("ts-active")}t(".ts-container").each(function(){var i,n=t(this);if(n.children().length>1){"string"==typeof(i=n.attr("data-delay-ms"))||"number"==typeof i?(i=i||0)<100&&(i=100):i=1500,n.data("delayms",i),n.on("tsanimate",e),n.trigger("tsanimate");var a=window.setInterval(function(){n.trigger("tsanimate")},i);n.mouseenter(function(){n.parents(".ts-sync").length||clearInterval(a)}).mouseleave(function(){n.parents(".ts-sync").length||(a=window.setInterval(function(){n.trigger("tsanimate")},i))}),t(".ts-sync").each(function(){t(this).mouseenter(function(){clearInterval(a)}).mouseleave(function(){a=window.setInterval(function(){n.trigger("tsanimate")},i)})})}})});