From efdfa45c667f8af4235e2246a9b44ccd1c7add8b Mon Sep 17 00:00:00 2001 From: April Sylph Date: Mon, 18 May 2020 15:39:45 +0100 Subject: [PATCH] update Editable Reblogs for new dashboard (#1807) --- Extensions/editable_reblogs.js | 16 +++++++++++++++- Extensions/xkit_patches.js | 8 +++++--- WebExtension/manifest.json | 2 +- xkit.js | 4 +++- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Extensions/editable_reblogs.js b/Extensions/editable_reblogs.js index 6d0435135..5adb33469 100644 --- a/Extensions/editable_reblogs.js +++ b/Extensions/editable_reblogs.js @@ -1,5 +1,5 @@ //* TITLE Editable Reblogs **// -//* VERSION 3.3.11 **// +//* VERSION 3.3.12 **// //* DESCRIPTION Restores ability to edit previous reblogs of a post **// //* DEVELOPER new-xkit **// //* FRAME false **// @@ -88,6 +88,11 @@ XKit.extensions.editable_reblogs = new Object({ var location_path = window.location.pathname; var location_items = location_path.split("/"); location_items.shift(); + + if (XKit.page.form_frame) { + location_items = location_items.slice(2); + } + if (location_items[0] != "reblog" && location_items[0] != "edit") { return; } @@ -169,6 +174,11 @@ XKit.extensions.editable_reblogs = new Object({ var location_path = window.location.pathname; var location_items = location_path.split("/"); location_items.shift(); + + if (XKit.page.form_frame) { + location_items = location_items.slice(2); + } + if (location_items[0] != "edit") { return; } @@ -463,6 +473,10 @@ XKit.extensions.editable_reblogs = new Object({ var location_items = location_path.split("/"); location_items.shift(); + if (XKit.page.form_frame) { + location_items = location_items.slice(2); + } + request.form_key = XKit.interface.form_key(); request.channel_id = $('.post-form--header .tumblelog-select .caption').text(); request.detached = true; //? diff --git a/Extensions/xkit_patches.js b/Extensions/xkit_patches.js index 7da011fcb..cc8b3756a 100644 --- a/Extensions/xkit_patches.js +++ b/Extensions/xkit_patches.js @@ -1,5 +1,5 @@ //* TITLE XKit Patches **// -//* VERSION 7.4.0 **// +//* VERSION 7.4.1 **// //* DESCRIPTION Patches framework **// //* DEVELOPER new-xkit **// @@ -180,10 +180,10 @@ XKit.extensions.xkit_patches = new Object({ }, 1000); }, - run_order: ["7.8.1", "7.8.2", "7.9.0", "7.9.1"], + run_order: ["7.8.1", "7.8.2", "7.9.0", "7.9.1", "7.9.2"], patches: { - "7.9.1": function() { + "7.9.2": function() { XKit.post_listener.observer = new MutationObserver(mutations => { const criteria = XKit.page.react ? "[data-id]" : ".post_container, .post"; const new_posts = mutations.some(({addedNodes}) => { @@ -899,6 +899,8 @@ XKit.extensions.xkit_patches = new Object({ }; }, + "7.9.1": function() {}, + "7.9.0": function() {}, "7.8.2": function() { diff --git a/WebExtension/manifest.json b/WebExtension/manifest.json index 1cd80eba6..36b02e8be 100644 --- a/WebExtension/manifest.json +++ b/WebExtension/manifest.json @@ -24,7 +24,7 @@ "name": "New XKit", "author": "New XKit Team", "permissions": ["storage", "unlimitedStorage", "*://*.tumblr.com/*", "https://new-xkit.github.io/XKit/*", "https://cloud.new-xkit.com/*" ], - "version": "7.9.1", + "version": "7.9.2", "web_accessible_resources": [ "manifest.json", "editor.js" ], "applications": { "gecko": { diff --git a/xkit.js b/xkit.js index a1e090c5c..f3b3039f5 100755 --- a/xkit.js +++ b/xkit.js @@ -12,6 +12,8 @@ var xkit_global_start = Date.now(); // log start timestamp standard: window.window === window.top && document.location.href.indexOf("://www.tumblr.com/dashboard/iframe?") === -1, + form_frame: + document.location.href.indexOf("://www.tumblr.com/neue_web/iframe/") !== -1, ask_frame: document.location.href.indexOf("://www.tumblr.com/ask_form/") !== -1, blog_frame: @@ -34,7 +36,7 @@ var xkit_global_start = Date.now(); // log start timestamp return; } - if (XKit.page.standard) { + if (XKit.page.standard || XKit.page.form_frame) { XKit.init_normal(); return; }