Skip to content

Instantly share code, notes, and snippets.

@jesus2099
Last active January 4, 2016 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesus2099/8580947 to your computer and use it in GitHub Desktop.
Save jesus2099/8580947 to your computer and use it in GitHub Desktop.
(☠OBSOLETE) MusicBrainz bookmarklet : “search→replace”
javascript:function sr(s,r){var ins=document.querySelectorAll("input[type='text'][name$='name']:not([value='']),input[type='text'][class$='name']:not([value=''])");for(var i=0;i<ins.length;i++){var v=s.match(/^\/.+\/[gi]*$/)?ins[i].value.replace(eval(s),r):ins[i].value.split(s).join(r);ins[i].style.removeProperty("background-color");if(ins[i].value!=v){ins[i].value=v;ins[i].style.setProperty("background-color","yellow");ins[i].focus();}}}void(sr(prompt("search\n\neither regex (case *i*nsensitive and *g*lobal are optional flags): /regex/ig\n\nor normal (case sensitive and global): My String"),prompt("replace")));
@jesus2099
Copy link
Author

this doesn’t work in the new release editor, i will integrate for fix in SUPER SCRUPT.

@jesus2099
Copy link
Author

A cropped down version (only works on tracklists) has been integrated in SUPER SRIPT’s TRACKLIST_TOOLS (link above).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment