This repository has been archived by the owner on Sep 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
bsdebug.min.js
4 lines (4 loc) · 3.28 KB
/
bsdebug.min.js
1
2
3
4
/**
* Created by auipga on 18.08.14.
*/
jQuery(document).ready(function(b){b("head").append('<style type="text/css">#bsdebug {position: fixed;top: 10px;left: 10px;background-color: rgba(255,255,255,0.80);color: #000000;z-index: 9999;}#bsdebug table {border: 1px;}#bsdebug td,#bsdebug th {border: 1px solid black;padding:2px;}#bsdebug td {text-align: center;}#bsdebug .bold {font-weight: bold;}#bsdebug .highlighted {background-color: rgba(15,230,0,0.67);}</style>');b("body").append('<div id="bsdebug"><table><tr id="bsdebug-size"><td colspan="7" style="text-align: left"><span class="bold hidden-tn hidden-xxs"><a href="https://github.com/auipga/bootstrap-xxs/">BS-Debug</a> | </span>w<span class="hidden-tn">idth</span>:<span class="bold" id="bsdebug-width">?</span>px<span title="ScrollbarWidth" class="small" style="border-bottom: 1px black dotted; cursor: help;">(-'+getScrollbarWidth()+'px)</span>| h<span class="hidden-tn">eigth</span>:<span class="bold" id="bsdebug-height">?</span>px</td></tr><tr id="bsdebug-breakpoint"><th></th><td><span class="visible-tn-block highlighted">TN</span><span class="hidden-tn">TN</span></td><td><span class="visible-xxs-block highlighted">XXS</span><span class="hidden-xxs">XXS</span></td><td><span class="visible-xs-block highlighted">XS</span><span class="hidden-xs">XS</span></td><td class="hidden-tn"><span class="visible-sm-block highlighted">SM</span><span class="hidden-sm">SM</span></td><td class="hidden-tn hidden-xxs"><span class="visible-md-block highlighted">MD</span><span class="hidden-md">MD</span></td><td class="hidden-tn hidden-xxs"><span class="visible-lg-block highlighted">LG</span><span class="hidden-lg">LG</span></td></tr><tr id="bsdebug-min" class="small"><th>Min</th><td>0px</td><td>≥384px</td><td>≥480px</td><td class="hidden-tn">≥768px</td><td class="hidden-tn hidden-xxs">≥992px</td><td class="hidden-tn hidden-xxs">≥1200px</td></tr><tr id="bsdebug-max" class="small"><th>Max</th><td><383px</td><td><479px</td><td><767px</td><td class="hidden-tn"><991px</td><td class="hidden-tn hidden-xxs"><1199px</td><td class="hidden-tn hidden-xxs">∞</td></tr><tr id="bsdebug-diff"><th>Diff</th><td></td><td></td><td></td><td class="hidden-tn"></td><td class="hidden-tn hidden-xxs"></td><td class="hidden-tn hidden-xxs"></td></tr></table></div>');var a=getScrollbarWidth();b(window).on("resize",function(g){var h=b(window);var d=h.width()+a;var c=h.height();b("#bsdebug-width").text(d);b("#bsdebug-height").text(c);var f=[0,384,480,768,992,1200,9999];b("#bsdebug-diff>td").each(function(e){var j=d-f[e];if(j>=0){b("#bsdebug-min td").eq(e).css({"background-color":"rgba(127, 219, 124, 0.67)","font-weight":"bold"})}else{b("#bsdebug-min td").eq(e).css({"background-color":"","font-weight":""})}if(f[e+1]>d){b("#bsdebug-max td").eq(e).css({"background-color":"rgba(127, 219, 124, 0.67)","font-weight":"bold"})}else{b("#bsdebug-max td").eq(e).css({"background-color":"","font-weight":""})}if(j>0){j="+"+j}b(this).text(j)})}).trigger("resize")});function getScrollbarWidth(){var d=document.createElement("div");d.style.visibility="hidden";d.style.width="100px";document.body.appendChild(d);var b=d.offsetWidth;d.style.overflow="scroll";var a=document.createElement("div");a.style.width="100%";d.appendChild(a);var c=a.offsetWidth;d.parentNode.removeChild(d);return b-c};