PageSourceSearch

https://saiatma.ru/engine/editor/scripts/webfont.js

js saiatma.ru collected 2026-10-05 00:18:22 UTC 3,019 bytes, 63 lines download raw bytes

1function LoadFont(fontFamily) {
2  if(fontFamily != "") {
3    try {
4	  fontFamily=fontFamily.split("'").join('');
5      WebFont.load({google:{families:[fontFamily + "::latin,cyrillic"]}})
6    }catch(e) {
7    }
8  }
9}
10function EmbedFont(id) {
11  var arrSysFonts = ["impact", "palatino linotype", "tahoma", "century gothic", "lucida sans unicode", "times new roman", "arial narrow", "verdana", "copperplate gothic light", "lucida console", "gill sans mt", "trebuchet ms", "courier new", "arial", "georgia", "garamond", "arial black", "bookman old style", "courier", "helvetica"];
12  var sHTML;
13  if(!id) {
14    sHTML = document.documentElement.innerHTML
15  }else {
16    sHTML = document.getElementById(id).innerHTML
17  }
18  var urlRegex = /font-family?:.+?(\;|,|")/g;
19  var matches = sHTML.match(urlRegex);
20  if(matches) {
21    for(var i = 0, len = matches.length;i < len;i++) {
22      var sFont = matches[i].replace(/font-family?:/g, "").replace(/;/g, "").replace(/,/g, "").replace(/"/g, "");
23      sFont = jQuery.trim(sFont);
24      sFont = sFont.replace("'", "").replace("'", "");
25      if($.inArray(sFont.toLowerCase(), arrSysFonts) == -1) {
26        LoadFont(sFont)
27      }
28    }
29  }
30}
31jQuery(document).ready(function() {
32  EmbedFont();
33  if(typeof oUtil != "undefined") {
34    for(var i = 0;i < oUtil.arrEditor.length;i++) {
35      var oEditor = eval("idContent" + oUtil.arrEditor[i]);
36      var sHTML;
37      if(navigator.appName.indexOf("Microsoft") != -1) {
38        sHTML = oEditor.document.documentElement.outerHTML
39      }else {
40        sHTML = getOuterHTML(oEditor.document.documentElement)
41      }
42      sHTML = sHTML.replace(/FONT-FAMILY/g, "font-family");
43      var urlRegex = /font-family?:.+?(\;|,|")/g;
44      var matches = sHTML.match(urlRegex);
45      if(matches) {
46        for(var j = 0, len = matches.length;j < len;j++) {
47          var sFont = matches[j].replace(/font-family?:/g, "").replace(/;/g, "").replace(/,/g, "").replace(/"/g, "");
48		  sFont=sFont.split("'").join('');
49          sFont = jQuery.trim(sFont);
50          var sFontLower = sFont.toLowerCase();
51          if(sFontLower != "serif" && sFontLower != "arial" && sFontLower != "arial black" && sFontLower != "bookman old style" && sFontLower != "comic sans ms" && sFontLower != "courier" && sFontLower != "courier new" && sFontLower != "garamond" && sFontLower != "georgia" && sFontLower != "impact" && sFontLower != "lucida console" && sFontLower != "lucida sans unicode" && sFontLower != "ms sans serif" && sFontLower != "ms serif" && sFontLower != "palatino linotype" && sFontLower != "tahoma" && sFontLower != 
52          "times new roman" && sFontLower != "trebuchet ms" && sFontLower != "verdana") {
53            sURL = "http://fonts.googleapis.com/css?family=" + sFont + "&subset=latin,cyrillic";
54            var objL = oEditor.document.createElement("LINK");
55            objL.href = sURL;
56            objL.rel = "StyleSheet";
57            oEditor.document.documentElement.childNodes[0].appendChild(objL)
58          }
59        }
60      }
61    }
62  }
63});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.