Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //* TITLE Fix Dash Reblogs **//
- //* VERSION 1.0 REV A **//
- //* DESCRIPTION Mimics the old dashboard. **//
- //* DEVELOPER scal-aru **//
- //* DETAILS Mimics the old dashboard by nesting reblogs instead of putting them one after the other.<br/>Currently doesn't work on the in-dash blog viewer. **//
- //* FRAME false **//
- //* SLOW true **//
- XKit.extensions.fix_reblogs_update = new Object({
- running: false,
- preferences: {
- "blockquote_color": {
- text: "Blockquote color:",
- default: "#eeeeee",
- value: "#eeeeee",
- type: "text"
- },
- "blockquote_width": {
- text: "Blockquote width:<br/> (make sure to include 'px' at the end)",
- default: "3px",
- value: "3px",
- type: "text"
- }
- },
- run: function() {
- this.running = true;
- XKit.tools.init_css("fix_reblogs_update");
- XKit.post_listener.add("fix_reblogs_update", XKit.extensions.fix_reblogs_update.fixit);
- XKit.extensions.fix_reblogs_update.fixit();
- XKit.interface.post_window_listener.add("fix_reblogs_update", XKit.extensions.fix_reblogs_update.fixit);
- },
- fixit: function() {
- // CSS STYLES
- $(".reblog-list-item .reblog-tumblelog-name").attr("style","text-decoration:underline !important; font-size:1em; font-weight:400;");
- $(".reblog-list-item .reblog-avatar").css("display","none");
- $(".reblog-list-item .reblog-header").css({"padding-left":"0", "margin-bottom":"0"});
- $(".reblog-list-item").css({"border-bottom":"none", "padding":"0"});
- $(".reblog-list-item .reblog-content").css({"border-left":"solid 3px #eee", "padding-left":"20px", "margin":"10px 0px"});
- $(".reblog-list, .reblog-list-item.contributed-content").css({"border-top":"none", "padding":"5px 20px"});
- $("blockquote").css("margin-left","15px");
- $(".post_full .post_media").css("margin-bottom","15px");
- $(".reblog-list .reblog-list-item figure.tmblr-full, .reblog-list .reblog-list-item figure.tmblr-embed").css({"margin-left":"0", "margin-right":"0"});
- $(".contributed-content .reblog-header").css("display","none");
- $(".contributed-content .reblog-content").css({"margin":"initial", "padding":"initial", "border-left":"initial"});
- $(".reblog-list-item .reblog-content").css({
- "border-left-color":XKit.extensions.fix_reblogs_update.preferences.blockquote_color.value,
- "border-left-width":XKit.extensions.fix_reblogs_update.preferences.blockquote_width.value
- });
- // ACTUAL CODE
- var done = 0;
- $("div.reblog-list").each(function() {
- fixinit($(this));
- done++;
- });
- function fixinit (post) {
- var comments = post.children().length;
- post.children().each(function() {
- var index = $(this).index();
- var next = $(this).next().children("div.reblog-content");
- if (index < comments-1) {
- $(this).prependTo(next);
- }
- });
- var title = post.find(".reblog-title");
- title.prependTo(post);
- }
- $(".reblog-header").each(function() {
- var empty = $(this).next().hasClass("reblog-content");
- if ( empty == false ) {
- $(this).css("display","none");
- }
- });
- },
- destroy: function() {
- this.running = false;
- XKit.post_listener.remove("fix_reblogs_update");
- XKit.tools.remove_css("fix_reblogs_update");
- $(".reblog-header").css("display","initial");
- $(".reblog-list-item .reblog-tumblelog-name").attr("style","");
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment