// ==UserScript== // @name sup/tg/ Archive Quote Functions // @namespace https://greasyfork.org/users/2457-meganega // @description Inline Quoting ~ Quote Preview ~ Backlinks ~ Inline Image Expansion ~ Filter (Name/Tripcode) for suptg archives // @include http://suptg.thisisnotatrueending.com/archive/* // @require http://code.jquery.com/jquery-latest.min.js // @version 1.20 // @grant none // @downloadURL none // ==/UserScript== $(document) .ready(function () { /* Create Backlinks */ $('blockquote a.quotelink') .each(function () { var t = $(this) .attr('href') .replace(/#p/, ''); var q = $(this) .parents("blockquote") .eq(0) .attr('id') .replace(/m/, ''); if ($('#bl' + t) .length == 0) { $('#pi' + t + ' span.postNum.desktop') .after($('
') .attr('id', 'bl' + t) .addClass('backlink_')); } $('#bl' + t) .append($('') .attr('id', 's' + t) .append($('') .attr('href', '#p' + q) .addClass('quotelink') .append('>>' + q))); }); /* Backlink Inline Quote */ $('div.backlink_ a.quotelink') .click(function (event) { if (event.shiftKey) { event.preventDefault(); window.location = this; return ; } event.preventDefault(); var q = $(this) .attr('href') .replace(/#p/, ''); var t = $(this) .parent() .attr('id') .replace(/s/, ''); if ($(this) .parents('#pi' + t) .siblings('blockquote#m' + t) .children('[id^=f' + q + ']') .length) { $(this) .parents('#pi' + t) .siblings('blockquote#m' + t) .children('[id^=f' + q + ']') .remove(); $(this) .removeClass('qLinkOpen'); } else { $(this) .parents('#pi' + t) .siblings('blockquote#m' + t) .prepend($('#p' + q) .clone(true) .attr('id', 'f' + q + 't' + t)); $(this) .addClass('qLinkOpen'); $(this) .parents('#pi' + t) .siblings('blockquote#m' + t) .children('[id^=f' + q + ']') .find('[id$=t' + q + ']') .remove(); } }); /* Backlink Quote Preview */ $('div.backlink_ a.quotelink') .hover(function (event) { var q = $(this) .attr('href') .replace(/#p/, ''); var t = $(this) .parent() .attr('id') .replace(/s/, ''); $(this) .parent() .after($('#p' + q) .clone() .addClass('qPreview') .attr('id', '') .css('margin-top', $(this) .height() * 1.6 + 'px')); $(this) .parent() .siblings('.qPreview') .find('[id$=t' + q + ']') .remove(); var o = $('#p' + q) .width(), p = $(this) .parent() .siblings('.qPreview') .width(), po = $(this) .parent() .siblings('.qPreview') .offset() .left, w = $(window) .width(); if (po / w > 0.7 || p / o < 0.4) { $('.qPreview') .css('margin-left', '-' + (parseInt(o) + $(this) .width() * 1.2) + 'px'); } if ($('.qPreview') .offset() .left < 0) { $('.qPreview') .css({ 'margin-left': '0', 'left': '0' }); } var pb = ($(window).height() + $(window).scrollTop()) - ($('.qPreview').offset().top + $('.qPreview').height()); if(pb < 0){ $(".qPreview").css("margin-top", (parseInt(pb) + 10) +"px"); } }, function (event) { $('.qPreview') .remove(); }); /* Name - Tripcode Filter */ $("body").append( $("
").attr("class","filterWrap") ); $(".filterWrap").append( $("") ); $(".filter").after( $("") ); $("#fname").after( $("") ); $(".filter").after("
"); $("#fname").after( $("