<commit_before>jQuery(function($) {

   /* tab key handling - gemo style */
   $('#code').keydown(function(e) {
      if (e.keyCode == 9 && !e.ctrlKey && !e.altKey) {
         if (this.setSelectionRange) {
            var start = this.selectionStart;
            var end = this.selectionEnd;
            var top = this.scrollTop;
            var selected = this.value.slice(start, end);
            if (e.shiftKey) {
               // deindent
               var replacement = selected.replace(/^\t/gm, '');
            } else {
               // indent
               var replacement = selected.replace(/^/gm, '\t');
            }
            this.value = this.value.slice(0, start) + replacement + this.value.slice(end);
            this.setSelectionRange(start, end + replacement.length - selected.length );
            this.scrollTop = top;
            e.preventDefault();
         }
         else if (document.selection.createRange) {
            this.selection = document.selection.createRange();
            this.selection.text = '\t';
            e.returnValue = false;
         }
      }
   })

   /* handle paste creation */
   $('#paste').click(function(e) {
      var doc = {};
      doc.title = $('#title').val().trim();
      doc.content = $('#code').val().trim();
      var tags = $('#tags').val().split(',');
      doc.tags = tags.map(function(t) {return t.trim()});
      $Couch.create(doc, './ddoc/_update/create').done(function (data) {
            window.location.pathname += data._id;
      })
      return false;
      //e.preventDefault();
   })

   /* load archive */
   $Couch.view('timestamp', {limit:8, descending:true}).done(
      function(data) {
         var el = $("#archive ul");
         for (var i=0; i<data.rows.length; i++) {
            var date = new Date(data.rows[i].key).toLocaleDateString();
            var title = data.rows[i].value;
            var id = data.rows[i].id;
            $('<li>').html("<b>"+date+"</b><a href='"+id+"'>"+title+"</a>").appendTo(el);
         }
      });

   /* load tagcloud */
   $Couch.view('tags', {reduce:true, group:true}).done(
      function(data) {
         var el =  $('#tag-cloud ul');
         for (var i=0; i<data.rows.length; i++) {
            var tag = data.rows[i].key;
            var freq = data.rows[i].value;
            var a = $("<a>").text(tag);
            a.attr({title:"See all pastes tagged with " + tag,
                 href:"tags/" + tag});
            a.css("fontSize", (freq / 10 < 1) ? freq / 10 + 1 + "em": (freq / 10 > 2) ? "2em" : freq / 10 + "em");
            $('<li>').append(a).appendTo(el);
         }
      });

})<commit_msg>Remove user visible strings from the javascript file<commit_after>jQuery(function($) {

   /* tab key handling - gemo style */
   $('#code').keydown(function(e) {
      if (e.keyCode == 9 && !e.ctrlKey && !e.altKey) {
         if (this.setSelectionRange) {
            var start = this.selectionStart;
            var end = this.selectionEnd;
            var top = this.scrollTop;
            var selected = this.value.slice(start, end);
            if (e.shiftKey) {
               // deindent
               var replacement = selected.replace(/^\t/gm, '');
            } else {
               // indent
               var replacement = selected.replace(/^/gm, '\t');
            }
            this.value = this.value.slice(0, start) + replacement + this.value.slice(end);
            this.setSelectionRange(start, end + replacement.length - selected.length );
            this.scrollTop = top;
            e.preventDefault();
         }
         else if (document.selection.createRange) {
            this.selection = document.selection.createRange();
            this.selection.text = '\t';
            e.returnValue = false;
         }
      }
   })

   /* handle paste creation */
   $('#paste').click(function(e) {
      var doc = {};
      doc.title = $('#title').val().trim();
      doc.content = $('#code').val().trim();
      var tags = $('#tags').val().split(',');
      doc.tags = tags.map(function(t) {return t.trim()});
      $Couch.create(doc, './ddoc/_update/create').done(function (data) {
            window.location.pathname += data._id;
      })
      return false;
      //e.preventDefault();
   })

   /* load archive */
   $Couch.view('timestamp', {limit:8, descending:true}).done(
      function(data) {
         var el = $("#archive ul");
         var titleTmpl = el.attr('title') || "";
         for (var i=0; i<data.rows.length; i++) {
            var date = new Date(data.rows[i].key).toLocaleDateString();
            var title = data.rows[i].value;
            var id = data.rows[i].id;
            var a = $('<a>').text(title);
            a.attr({href:id, title: titleTmpl});
            var b = $('<b>').text(date);
            $('<li>').append(b, a).appendTo(el);
         }
      });

   /* load tagcloud */
   $Couch.view('tags', {reduce:true, group:true}).done(
      function(data) {
         var el =  $('#tag-cloud ul');
         var titleTmpl = el.attr('title') || "";
         for (var i=0; i<data.rows.length; i++) {
            var tag = data.rows[i].key;
            var freq = data.rows[i].value;
            var a = $("<a>").text(tag);
            a.attr({title: titleTmpl + " " + tag,
                 href:"tags/" + tag});
            a.css("fontSize", (freq / 10 < 1) ? freq / 10 + 1 + "em": (freq / 10 > 2) ? "2em" : freq / 10 + "em");
            $('<li>').append(a).appendTo(el);
         }
      });

})
{'fraction_non_alphanumeric': 0.18767048554282598, 'fraction_numerical': 0.006182942353155119, 'mean_word_length': 1.7707808564231737, 'pattern_counts': {'":': 2, '<': 21, '<?xml version=': 0, '>': 17, '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': '2856925', 'n_tokens_mistral': 1709, 'n_tokens_neox': 1668, 'n_words': 339}