Advertisement
owlman

Link_Maker | Old Script

Feb 9th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. http://javascript: if (window.fang_loaded == undefined) {    fang_loaded = true;} else {    uninstall();}var chars = 1;var number_of_slices = 1;function popup() {    $(window.menu).modal({        minHeight: 80,        minWidth: 160,        persist: true,        autoResize: true    });}$(document).on("keydown.fang", function(e) {    if (e.keyCode == $.ui.keyCode.ESCAPE) {        popup();    }    if (e.keyCode == $.ui.keyCode.DELETE) {        uninstall();    }});$("input:eq(2)").on("paste.fang", function() {    $("#the_box")[0].value = "";    $("#the_box")[0].focus();    c = $(".active-cursor")[0];    f = c.parentNode.parentNode.parentNode.parentNode;    var x1 = $.data(f, "tileX");    var y1 = $.data(f, "tileY");    var x2 = c.cellIndex;    var y2 = c.parentNode.rowIndex;    setTimeout(function() {        s = $("#the_box")[0].value;        paste(s, t, x1, y1, x2, y2);    });});function paste(s, t, x1, y1, x2, y2) {    string = s;    written_by = "Jason McDowell aka Fang. August 2010. Updated April 2011. Updated by Starfield 2012. Updated again Jan 2013. Updated again 3/27/13";    transparent = t; zxc = []; dfg = []; uio = []; jkl = [];    x_tile_width = 15;    y_tile_height = 7;    x_offset = x2;    y_offset = y2;    x_tile_start = x1;    y_tile_start = y1;    x_tile = x_tile_start;    y_tile = y_tile_start;    for (i = 0; i < string.length; ++i) {        if ((string.charAt(i) == '\n') || (string.charAt(i) == '\r')) {            if (y_offset == y_tile_height) {                y_offset = 0;                y_tile = y_tile + 1;            } else {                y_offset = y_offset + 1;            }            x_tile = x_tile_start;            x_offset = x2;        } else {            if (transparent == 1) {                if (string.charAt(i) != " ") {                    edits_array = y_tile;                    zxc.push(edits_array);                    edits_array = x_tile;                    dfg.push(edits_array);                    edits_array = y_offset;                    uio.push(edits_array);                    edits_array = x_offset;                    jkl.push(edits_array);                }            } else {                    edits_array = y_tile;                    zxc.push(edits_array);                    edits_array = x_tile;                    dfg.push(edits_array);                    edits_array = y_offset;                    uio.push(edits_array);                    edits_array = x_offset;                    jkl.push(edits_array);            }            if (x_offset == x_tile_width) {                x_offset = 0;                x_tile = x_tile + 1;            } else {                x_offset = x_offset + 1;            }        }    }    var path = window.location.pathname;    path = path[0] == '/' ? path.substr(1) : path;    function sendPacket(start_slice, end_slice) {        setTimeout(function() {            jQuery.ajax({                type: 'POST',                url: '/ajax/urllink/',                data: {                    'world': path,                    'tileY': JSON.stringify(zxc.slice(start_slice, end_slice)).replace("[", "").replace("]", ""),                    'tileX': JSON.stringify(dfg.slice(start_slice, end_slice)).replace("[", "").replace("]", ""),                    'charY': JSON.stringify(uio.slice(start_slice, end_slice)).replace("[", "").replace("]", ""),                    'charX': JSON.stringify(jkl.slice(start_slice, end_slice)).replace("[", "").replace("]", ""),                    url: string                },                dataType: 'json',                error: function() {                    console.log('post error', this);                }            });        }, (1000 / chars) * start_slice);    }    number_of_edits = Math.ceil(string.length / number_of_slices);    for (k = 0; k <= number_of_edits - 1; k++) {        start_slice = number_of_slices * (k);        end_slice = number_of_slices * (k + 1);        sendPacket(start_slice, end_slice);    }}function createMenu() {    var f, x, y;    var d = document.createElement('div');    var html = [];    html.push('<form method="get" action="#" id="fang_input_form">');    html.push('<div>Instructions:</div>');    html.push('<div>1)This is the menu</div>');    html.push('<div>2)Press ESC to see this again</div>');    html.push('<div>3)Press DEL or refresh to Uninstall</div>');    html.push('<div>4)CTRL+V TO PASTE</div>');    html.push('<div>5)Don\'t be annoying!</div><br>');    html.push('<input type = "checkbox" id = "transparent_check"/>Transparent</input><br><br>');    html.push('<div id="fang_input_submit"><input type="submit" value=" Go "> or <span id="fang_input_cancel" class="simplemodal-close simplemodal-closelink">cancel</span></div>');    html.push('</form>');    d.innerHTML = html.join('');    $('body').append(d);    window.menu = d;    $('#fang_input_form').submit(function(e) {        f = document.getElementById('fang_input_form');        t = f.transparent_check.checked;        var fail = false;        if (!fail) {            $('#fang_input_cancel').trigger('click');            e.stopPropagation();        }        return false;    })}function createInput() {    d = document.createElement('textarea');    $(d).css({        position: "absolute",        left: "-1000px",        top: "-1000px"    }).attr("id", "the_box");    $('body').append(d);}function uninstall() {    $('#fang_input_cancel').trigger('click');    $(menu).empty();    delete menu;    if (window.menu !== undefined) {        menu.remove();    }    $(d).empty();    delete d;    $(document).off("keydown.fang");    $("input:eq(2)").off("paste.fang");    $('.tilecont').effect('highlight', {        color: 'red'    }, 500);    fang_loaded = undefined;}createInput();createMenu();popup();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement