<commit_before>// ==UserScript==
// @name         Skewer Everything
// @description  Add a toggle button to run Skewer on the current page
// @lastupdated  2013-01-24
// @version      1.0
// @license      Public Domain
// @include      http://*
// @require      http://code.jquery.com/jquery-latest.min.js
// ==/UserScript==

var toggle = $('<div/>').bind('click', inject).css({
    "width": '0px',
    "height": '0px',
    "border-style": 'solid',
    "border-width": '0 12px 12px 0',
    "border-color": 'transparent #F00 transparent transparent',
    "position": 'absolute',
    "right": 0,
    "top": 0
});

var injected = false;

function inject() {
    if (!injected) {
        var script = $('<script/>').attr({src: 'http://localhost:8080/skewer'});
        if (!unsafeWindow.jQuery) unsafeWindow.$ = $;
        $('head').append(script);
        toggle.css('border-right-color', '#0F0');
        injected = true;
    }
}

/* Don't use on iframes. */
if (window.top === window.self) {
    $('body').append(toggle);
}<commit_msg>But the button on top.<commit_after>// ==UserScript==
// @name         Skewer Everything
// @description  Add a toggle button to run Skewer on the current page
// @lastupdated  2013-01-24
// @version      1.0
// @license      Public Domain
// @include      http://*
// @require      http://code.jquery.com/jquery-latest.min.js
// ==/UserScript==

var toggle = $('<div/>').bind('click', inject).css({
    "width": '0px',
    "height": '0px',
    "border-style": 'solid',
    "border-width": '0 12px 12px 0',
    "border-color": 'transparent #F00 transparent transparent',
    "position": 'absolute',
    "right": 0,
    "top": 0,
    "z-index": 100
});

var injected = false;

function inject() {
    if (!injected) {
        var script = $('<script/>').attr({src: 'http://localhost:8080/skewer'});
        if (!unsafeWindow.jQuery) unsafeWindow.$ = $;
        $('head').append(script);
        toggle.css('border-right-color', '#0F0');
        injected = true;
    }
}

/* Don't use on iframes. */
if (window.top === window.self) {
    $('body').append(toggle);
}
{'fraction_non_alphanumeric': 0.20410109680495947, 'fraction_numerical': 0.028135431568907965, 'mean_word_length': 2.6871704745166958, 'pattern_counts': {'":': 17, '<': 7, '<?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': '5185003', 'n_tokens_mistral': 731, 'n_tokens_neox': 684, 'n_words': 170}