Browse Source

Script_2.js diagrams test

pull/36/head
Jure Šorn 5 years ago
parent
commit
37cb4249f7
1 changed files with 10 additions and 12 deletions
  1. 22
      web/script_2.js

22
web/script_2.js

@ -132,18 +132,16 @@ const DIAGRAM_6_B =
// isFontAvailable: // isFontAvailable:
(function(d){function c(c){b.style.fontFamily=c;e.appendChild(b);f=b.clientWidth;e.removeChild(b);return f}var f,e=d.body,b=d.createElement("span");b.innerHTML=Array(100).join("wi");b.style.cssText=["position:absolute","width:auto","font-size:128px","left:-99999px"].join(" !important;");var g=c("monospace"),h=c("serif"),k=c("sans-serif");window.isFontAvailable=function(b){return g!==c(b+",monospace")||k!==c(b+",sans-serif")||h!==c(b+",serif")}})(document); (function(d){function c(c){b.style.fontFamily=c;e.appendChild(b);f=b.clientWidth;e.removeChild(b);return f}var f,e=d.body,b=d.createElement("span");b.innerHTML=Array(100).join("wi");b.style.cssText=["position:absolute","width:auto","font-size:128px","left:-99999px"].join(" !important;");var g=c("monospace"),h=c("serif"),k=c("sans-serif");window.isFontAvailable=function(b){return g!==c(b+",monospace")||k!==c(b+",sans-serif")||h!==c(b+",serif")}})(document);
$(document).ready(function() {
if (!isFontAvailable('Menlo')) {
$(`code:contains(${DIAGRAM_1_B})`).html(DIAGRAM_1_A);
$(`code:contains(${DIAGRAM_2_B})`).html(DIAGRAM_2_A);
$(`code:contains(${DIAGRAM_3_B})`).html(DIAGRAM_3_A);
$(`code:contains(${DIAGRAM_4_B})`).html(DIAGRAM_4_A);
$(`code:contains(${DIAGRAM_5_B})`).html(DIAGRAM_5_A);
$(`code:contains(${DIAGRAM_6_B})`).html(DIAGRAM_6_A);
// var htmlString = $('code:contains(ᴺᴱᵂ)').html().replace(/ᴺᴱᵂ/g, '');
// $('code:contains(ᴺᴱᵂ)').html(htmlString);
}
});
if (!isFontAvailable('Menlo')) {
$(`code:contains(${DIAGRAM_1_B})`).html(DIAGRAM_1_A);
$(`code:contains(${DIAGRAM_2_B})`).html(DIAGRAM_2_A);
$(`code:contains(${DIAGRAM_3_B})`).html(DIAGRAM_3_A);
$(`code:contains(${DIAGRAM_4_B})`).html(DIAGRAM_4_A);
$(`code:contains(${DIAGRAM_5_B})`).html(DIAGRAM_5_A);
$(`code:contains(${DIAGRAM_6_B})`).html(DIAGRAM_6_A);
// var htmlString = $('code:contains(ᴺᴱᵂ)').html().replace(/ᴺᴱᵂ/g, '');
// $('code:contains(ᴺᴱᵂ)').html(htmlString);
}
var isMobile = false; var isMobile = false;
// Device detection: // Device detection:

Loading…
Cancel
Save