<commit_before>// identica badge -- updated to work with the native API, 12-4-2008
// Modified to point to Identi.ca, 2-20-2009 by Zach
// copyright <NAME> 2008
// see http://kentbrewster.com/identica-badge for info
( function() { 
   var trueName = '';
   for (var i = 0; i < 16; i++) { 
      trueName += String.fromCharCode(Math.floor(Math.random() * 26) + 97); 
   }
   window[trueName] = {};
   var $ = window[trueName];
   $.f = function() {
      return { 
         runFunction : [],
         init : function(target) {
            var theScripts = document.getElementsByTagName('SCRIPT');
            for (var i = 0; i < theScripts.length; i++) {
               if (theScripts[i].src.match(target)) {
                  $.a = {};
                  if (theScripts[i].innerHTML) {
                     $.a = $.f.parseJson(theScripts[i].innerHTML);
                  }
                  if ($.a.err) {
                     alert('bad json!');
                  }
                  $.f.loadDefaults();
                  $.f.buildStructure();
                  $.f.buildPresentation();
                  theScripts[i].parentNode.insertBefore($.s, theScripts[i]);
                  theScripts[i].parentNode.removeChild(theScripts[i]);
                  break;
               }
            }         
         },
         parseJson : function(json) {
            this.parseJson.data = json;
            if ( typeof json !== 'string') {
               return {"err":"trying to parse a non-string JSON object"};
            }
            try {
               var f = Function(['var document,top,self,window,parent,Number,Date,Object,Function,',
                  'Array,String,Math,RegExp,Image,ActiveXObject;',
                  'return (' , json.replace(/<\!--.+-->/gim,'').replace(/\bfunction\b/g,'function&shy;') , ');'].join(''));
               return f();
            } catch (e) {
               return {"err":"trouble parsing JSON object"};
            }
         },
         loadDefaults : function() {
            $.d = { 
               "user":"7000",
               "headerText" : "",
               "height" : 350,
               "width" : 300,
               "background" : "#193441",
               "border" : "1px solid black",
               "userFontSize" : "inherit",
               "userColor" : "inherit",
               "headerBackground" : "transparent", 
               "headerColor" : "white",
               "evenBackground" : "#fff",
               "oddBackground" : "#eee",
               "thumbnailBorder" : "1px solid black",
               "thumbnailSize" : 24,
               "padding" : 3,
               "server" : "identi.ca"
            };
            for (var k in $.d) { if ($.a[k] === undefined) { $.a[k] = $.d[k]; } }
         },
          buildPresentation : function () {
            var ns = document.createElement('style');
            document.getElementsByTagName('head')[0].appendChild(ns);
            if (!window.createPopup) {
               ns.appendChild(document.createTextNode(''));
               ns.setAttribute("type", "text/css");
            }
            var s = document.styleSheets[document.styleSheets.length - 1];
            var rules = {
               "" : "{zoom:1;margin:0;padding:0;width:" + $.a.width + "px;background:" + $.a.background + ";border:" + $.a.border + ";font:13px/1.2em tahoma, veranda, arial, helvetica, clean, sans-serif;*font-size:small;*font:x-small;}",
               "a" : "{cursor:pointer;text-decoration:none;}",
               "a:hover" : "{text-decoration:underline;}",
               "cite" : "{font-weight:bold;margin:0 0 0 4px;padding:0;display:block;font-style:normal;line-height:" + ($.a.thumbnailSize/2) + "px;}",
               "cite a" : "{color:#C15D42;}",
               "date":"{font-size:87%;margin:0 0 0 4px;padding:0;display:block;font-style:normal;line-height:" + ($.a.thumbnailSize/2) + "px;}",
               "date:after" : "{clear:both; content:\".\"; display:block; height:0; visibility:hidden; }",
               "date a" : "{color:#676;}",
               "h3" : "{margin:0;padding:" + $.a.padding + "px;font-weight:bold;background:" + $.a.headerBackground + " url('http://" + $.a.server + "/favicon.ico') " + $.a.padding + "px 50% no-repeat;text-indent:" + ($.a.padding + 16) + "px;}",
               "h3.loading" : "{background-image:url('http://l.yimg.com/us.yimg.com/i/us/my/mw/anim_loading_sm.gif');}",
               "h3 a" : "{font-size:92%; color:" + $.a.headerColor + ";}",
               "h4" : "{font-weight:normal; background:" + $.a.headerBackground + ";text-align:right;margin:0;padding:" + $.a.padding + "px;}",
               "h4 a" : "{font-size:92%; color:" + $.a.headerColor + ";}",
               "img":"{float:left; height:" + $.a.thumbnailSize + "px;width:" + $.a.thumbnailSize + "px;border:" + $.a.thumbnailBorder + ";margin-right:" + $.a.padding + "px;}",
               "p" : "{margin:0; padding:0;width:" + ($.a.width - 22) + "px;overflow:hidden;font-size:87%;}",
               "p a" : "{color:#C15D42;}",
               "ul":"{margin:0; padding:0; height:" + $.a.height + "px;width:" + $.a.width + "px;overflow:auto;}",
               "ul li":"{background:" + $.a.evenBackground + ";margin:0;padding:" + $.a.padding + "px;list-style:none;width:" + ($.a.width - 22) + "px;overflow:hidden;border-bottom:1px solid #D8E2D7;}",
               "ul li:hover":"{background:#f3f8ea;}"
            };
            var ieRules = "";
            // brute-force each and every style rule here to !important
            // sometimes you have to take off and nuke the site from orbit; it's the only way to be sure
            for (var z in rules) {
               var selector = '.' + trueName + ' ' + z;
               var rule = rules[z];
               if (typeof rule === 'string') {
                  var important = rule.replace(/;/gi, '!important;');
                  if (!window.createPopup) {
                     var theRule = document.createTextNode(selector + important);
                     ns.appendChild(theRule);
                  } else {
                     ieRules += selector + important;
                  }
               }
            }
            if (window.createPopup) { s.cssText = ieRules; }
         },
         buildStructure : function() {
            $.s = document.createElement('DIV');
            $.s.className = trueName;         
            $.s.h = document.createElement('H3');
            $.s.h.a = document.createElement('A');
            $.s.h.a.target = '_laconica';
            $.s.h.appendChild($.s.h.a);
            $.s.appendChild($.s.h);
            $.s.r = document.createElement('UL');
            $.s.appendChild($.s.r);
            $.s.f = document.createElement('H4');
            var a = document.createElement('A');
            a.innerHTML = 'get this';
            a.target = '_blank';
            a.href = 'http://identica/doc/badge';
            $.s.f.appendChild(a);
            $.s.appendChild($.s.f);<commit_msg>Fix link to identi.ca in JavaScript badge<commit_after>// identica badge -- updated to work with the native API, 12-4-2008
// Modified to point to Identi.ca, 2-20-2009 by Zach
// copyright <NAME> 2008
// see http://kentbrewster.com/identica-badge for info
( function() { 
   var trueName = '';
   for (var i = 0; i < 16; i++) { 
      trueName += String.fromCharCode(Math.floor(Math.random() * 26) + 97); 
   }
   window[trueName] = {};
   var $ = window[trueName];
   $.f = function() {
      return { 
         runFunction : [],
         init : function(target) {
            var theScripts = document.getElementsByTagName('SCRIPT');
            for (var i = 0; i < theScripts.length; i++) {
               if (theScripts[i].src.match(target)) {
                  $.a = {};
                  if (theScripts[i].innerHTML) {
                     $.a = $.f.parseJson(theScripts[i].innerHTML);
                  }
                  if ($.a.err) {
                     alert('bad json!');
                  }
                  $.f.loadDefaults();
                  $.f.buildStructure();
                  $.f.buildPresentation();
                  theScripts[i].parentNode.insertBefore($.s, theScripts[i]);
                  theScripts[i].parentNode.removeChild(theScripts[i]);
                  break;
               }
            }         
         },
         parseJson : function(json) {
            this.parseJson.data = json;
            if ( typeof json !== 'string') {
               return {"err":"trying to parse a non-string JSON object"};
            }
            try {
               var f = Function(['var document,top,self,window,parent,Number,Date,Object,Function,',
                  'Array,String,Math,RegExp,Image,ActiveXObject;',
                  'return (' , json.replace(/<\!--.+-->/gim,'').replace(/\bfunction\b/g,'function&shy;') , ');'].join(''));
               return f();
            } catch (e) {
               return {"err":"trouble parsing JSON object"};
            }
         },
         loadDefaults : function() {
            $.d = { 
               "user":"7000",
               "headerText" : "",
               "height" : 350,
               "width" : 300,
               "background" : "#193441",
               "border" : "1px solid black",
               "userFontSize" : "inherit",
               "userColor" : "inherit",
               "headerBackground" : "transparent", 
               "headerColor" : "white",
               "evenBackground" : "#fff",
               "oddBackground" : "#eee",
               "thumbnailBorder" : "1px solid black",
               "thumbnailSize" : 24,
               "padding" : 3,
               "server" : "identi.ca"
            };
            for (var k in $.d) { if ($.a[k] === undefined) { $.a[k] = $.d[k]; } }
         },
          buildPresentation : function () {
            var ns = document.createElement('style');
            document.getElementsByTagName('head')[0].appendChild(ns);
            if (!window.createPopup) {
               ns.appendChild(document.createTextNode(''));
               ns.setAttribute("type", "text/css");
            }
            var s = document.styleSheets[document.styleSheets.length - 1];
            var rules = {
               "" : "{zoom:1;margin:0;padding:0;width:" + $.a.width + "px;background:" + $.a.background + ";border:" + $.a.border + ";font:13px/1.2em tahoma, veranda, arial, helvetica, clean, sans-serif;*font-size:small;*font:x-small;}",
               "a" : "{cursor:pointer;text-decoration:none;}",
               "a:hover" : "{text-decoration:underline;}",
               "cite" : "{font-weight:bold;margin:0 0 0 4px;padding:0;display:block;font-style:normal;line-height:" + ($.a.thumbnailSize/2) + "px;}",
               "cite a" : "{color:#C15D42;}",
               "date":"{font-size:87%;margin:0 0 0 4px;padding:0;display:block;font-style:normal;line-height:" + ($.a.thumbnailSize/2) + "px;}",
               "date:after" : "{clear:both; content:\".\"; display:block; height:0; visibility:hidden; }",
               "date a" : "{color:#676;}",
               "h3" : "{margin:0;padding:" + $.a.padding + "px;font-weight:bold;background:" + $.a.headerBackground + " url('http://" + $.a.server + "/favicon.ico') " + $.a.padding + "px 50% no-repeat;text-indent:" + ($.a.padding + 16) + "px;}",
               "h3.loading" : "{background-image:url('http://l.yimg.com/us.yimg.com/i/us/my/mw/anim_loading_sm.gif');}",
               "h3 a" : "{font-size:92%; color:" + $.a.headerColor + ";}",
               "h4" : "{font-weight:normal; background:" + $.a.headerBackground + ";text-align:right;margin:0;padding:" + $.a.padding + "px;}",
               "h4 a" : "{font-size:92%; color:" + $.a.headerColor + ";}",
               "img":"{float:left; height:" + $.a.thumbnailSize + "px;width:" + $.a.thumbnailSize + "px;border:" + $.a.thumbnailBorder + ";margin-right:" + $.a.padding + "px;}",
               "p" : "{margin:0; padding:0;width:" + ($.a.width - 22) + "px;overflow:hidden;font-size:87%;}",
               "p a" : "{color:#C15D42;}",
               "ul":"{margin:0; padding:0; height:" + $.a.height + "px;width:" + $.a.width + "px;overflow:auto;}",
               "ul li":"{background:" + $.a.evenBackground + ";margin:0;padding:" + $.a.padding + "px;list-style:none;width:" + ($.a.width - 22) + "px;overflow:hidden;border-bottom:1px solid #D8E2D7;}",
               "ul li:hover":"{background:#f3f8ea;}"
            };
            var ieRules = "";
            // brute-force each and every style rule here to !important
            // sometimes you have to take off and nuke the site from orbit; it's the only way to be sure
            for (var z in rules) {
               var selector = '.' + trueName + ' ' + z;
               var rule = rules[z];
               if (typeof rule === 'string') {
                  var important = rule.replace(/;/gi, '!important;');
                  if (!window.createPopup) {
                     var theRule = document.createTextNode(selector + important);
                     ns.appendChild(theRule);
                  } else {
                     ieRules += selector + important;
                  }
               }
            }
            if (window.createPopup) { s.cssText = ieRules; }
         },
         buildStructure : function() {
            $.s = document.createElement('DIV');
            $.s.className = trueName;         
            $.s.h = document.createElement('H3');
            $.s.h.a = document.createElement('A');
            $.s.h.a.target = '_laconica';
            $.s.h.appendChild($.s.h.a);
            $.s.appendChild($.s.h);
            $.s.r = document.createElement('UL');
            $.s.appendChild($.s.r);
            $.s.f = document.createElement('H4');
            var a = document.createElement('A');
            a.innerHTML = 'get this';
            a.target = '_blank';
            a.href = 'http://identi.ca/doc/badge';
            $.s.f.appendChild(a);
            $.s.appendChild($.s.f);
{'fraction_non_alphanumeric': 0.1818829734160074, 'fraction_numerical': 0.01653481576509158, 'mean_word_length': 1.7010587102983639, 'pattern_counts': {'":': 16, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7179928', 'n_tokens_mistral': 4335, 'n_tokens_neox': 4127, 'n_words': 777}