<commit_before>if( $( '#selfmarks-window' ).length == 0 ) {
    $( 'head' ).append(
        '<link rel="stylesheet" href="#{Selfmarks::HOST}/uri/add_window.css" type="text/css" media="screen"/>'
    );
    var div = $( '#{@window_html}' );
    div.hide();
    $( 'body' ).prepend( div );

    var tags = $( "a[rel=tag]", document ).map(
        function( idx, tag ) { return(tag.innerHTML); }
    );
    var tags_text = $.unique( tags ).join( ' ' );
    $( '#selfmarks-tags' ).val( tags_text );

}
$( '#selfmarks-window' ).toggle( 'fast' );

$( '#selfmarks-submit' ).live( 'click', function() {
    var uri = $( '#selfmarks-uri' ).val();
    var title = $( '#selfmarks-title' ).val();
    var tags = $( '#selfmarks-tags' ).val();
    var notes = $( '#selfmarks-notes' ).val();
    $.getJSON(
        '#{Selfmarks::HOST}/uri/add_window_add?jsoncallback=?',<commit_msg>Copied unique_strings from manveru's ubiquity command.<commit_after>function unique_strings( a ) {
    var r = new Array();
    o:for(var i = 0, n = a.length; i < n; i++) {
        for(var x = 0, y = r.length; x < y; x++) {
            if(r[x]==a[i]) continue o;
        }
        r[r.length] = a[i];
    }
    return r;
}

if( $( '#selfmarks-window' ).length == 0 ) {
    $( 'head' ).append(
        '<link rel="stylesheet" href="#{Selfmarks::HOST}/uri/add_window.css" type="text/css" media="screen"/>'
    );
    var div = $( '#{@window_html}' );
    div.hide();
    $( 'body' ).prepend( div );

    var tags = $( "a[rel=tag]", document ).map(
        function( idx, tag ) { return(tag.innerHTML); }
    );
    var tags_text = unique_strings( tags ).join( ' ' );
    $( '#selfmarks-tags' ).val( tags_text );

}
$( '#selfmarks-window' ).toggle( 'fast' );

$( '#selfmarks-submit' ).live( 'click', function() {
    var uri = $( '#selfmarks-uri' ).val();
    var title = $( '#selfmarks-title' ).val();
    var tags = $( '#selfmarks-tags' ).val();
    var notes = $( '#selfmarks-notes' ).val();
    $.getJSON(
        '#{Selfmarks::HOST}/uri/add_window_add?jsoncallback=?',
{'fraction_non_alphanumeric': 0.2346588119783996, 'fraction_numerical': 0.0019636720667648502, 'mean_word_length': 2.881904761904762, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '5359238', 'n_tokens_mistral': 718, 'n_tokens_neox': 713, 'n_words': 154}