Skip to content

Commit

Permalink
update Editable Reblogs for new dashboard (#1807)
Browse files Browse the repository at this point in the history
  • Loading branch information
AprilSylph authored May 18, 2020
1 parent 0f15308 commit efdfa45
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
16 changes: 15 additions & 1 deletion Extensions/editable_reblogs.js
Original file line number Diff line number Diff line change
@@ -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 **//
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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; //?
Expand Down
8 changes: 5 additions & 3 deletions Extensions/xkit_patches.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//* TITLE XKit Patches **//
//* VERSION 7.4.0 **//
//* VERSION 7.4.1 **//
//* DESCRIPTION Patches framework **//
//* DEVELOPER new-xkit **//

Expand Down Expand Up @@ -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}) => {
Expand Down Expand Up @@ -899,6 +899,8 @@ XKit.extensions.xkit_patches = new Object({
};
},

"7.9.1": function() {},

"7.9.0": function() {},

"7.8.2": function() {
Expand Down
2 changes: 1 addition & 1 deletion WebExtension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 3 additions & 1 deletion xkit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
}
Expand Down

0 comments on commit efdfa45

Please sign in to comment.