Skip to content

Commit

Permalink
Self submit Merge page <form> no longer has action attribute #701 #702
Browse files Browse the repository at this point in the history
Remove action={$c.req.uri} metabrainz/musicbrainz-server@2ab8141
  • Loading branch information
jesus2099 committed Aug 24, 2022
1 parent 64e80a8 commit 8ffba5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions mb. MERGE HELPOR 2.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name mb. MERGE HELPOR 2
// @version 2021.2.2.1852
// @version 2022.8.25
// @description musicbrainz.org: Merge helper highlights last clicked, shows info, indicates oldest MBID, manages (remove) entity merge list; merge queue (clear before add) tool; don’t reload page for nothing when nothing is checked
// @namespace https://github.com/jesus2099/konami-command
// @supportURL https://github.com/jesus2099/konami-command/labels/mb_MERGE-HELPOR-2
Expand All @@ -23,7 +23,7 @@ var lastTick = new Date().getTime();
var WSrate = 1000;
if (mergeType) {
/* main merge tool */
var mergeForm = document.querySelector("div#content > form[action*='/merge']");
var mergeForm = document.querySelector("div#content > form[method='post']");
var tbl = mergeForm.querySelector("table.tbl");
var entities = {};
var deferScript = setInterval(function() {
Expand Down Expand Up @@ -80,7 +80,8 @@ if (mergeType) {
});
addAfter(reMergeButton, mergeButton);
}
/* Make “Remove selected entites” and “Cancel” buttons faster */
// Page bottom mini Merge Process form
// Make “Remove selected entites” and “Cancel” buttons faster
var currentMergeForm = document.querySelector("div#current-editing > form[action*='/merge']");
if (currentMergeForm) {
currentMergeForm.querySelector("button[type='submit'][value='remove']").addEventListener("click", function(event) {
Expand Down
4 changes: 2 additions & 2 deletions mb_MASS-MERGE-RECORDINGS.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name mb. MASS MERGE RECORDINGS
// @version 2022.8.16
// @version 2022.8.25
// @description musicbrainz.org: Merges selected or all recordings from release A to release B – List all RG recordings
// @namespace https://github.com/jesus2099/konami-command
// @supportURL https://community.metabrainz.org/t/merge-duplicate-recordings-between-two-editions-of-the-same-album-with-mb-mass-merge-recordings/203168?u=jesus2099
Expand Down Expand Up @@ -180,7 +180,7 @@ function mergeRecsStep(_step) {
} else if (this.status == 200) {
if (step === 0) {
if (
this.responseText.match(new RegExp('<form action="' + MBS.replace(/[./]/g, "\\$&") + '\\/recording\\/merge\\?returnto=([^"]+)?" method="post">'))
this.responseText.match(new RegExp('<form method="post">'))
&& this.responseText.indexOf('value="' + from.value + '"') > -1
&& this.responseText.indexOf('<a href="/recording/' + from.getAttribute("ref") + '">') > -1
&& this.responseText.indexOf('value="' + to.value + '"') > -1
Expand Down

0 comments on commit 8ffba5f

Please sign in to comment.