// ==UserScript== // @name RYM: Quick Edit List // @version 0.2 // @description inline editing of list items // @match https://rateyourmusic.com/lists/edit* // @copyright 2014+, thought_house // @namespace https://greasyfork.org/users/2653 // @downloadURL https://update.greasyfork.icu/scripts/2279/RYM%3A%20Quick%20Edit%20List.user.js // @updateURL https://update.greasyfork.icu/scripts/2279/RYM%3A%20Quick%20Edit%20List.meta.js // ==/UserScript== var $ = unsafeWindow.jQuery; $('#list_content .picturebutton').after('
quick edit'); $('.quick_edit').on('click', function(event) { event.preventDefault(); if (!$(this).data('editing')) { $(this).data('editing', true); var $td = $(this).closest('tr').children('td:last'); var html = $td.html().replace(/.*?

/, ''); var title = $td.html().match(/.*?

/, '')[0]; var item_type = ''; var assoc_id = 0; var item_name = ''; if (title.match(/class="album"/)) { item_type = 'l'; } else if (title.match(/class="artist"/)) { item_type = 'a'; } else if (title.match(/class="label"/)) { item_type = 'b'; } else if (title.match(/class="film"/)) { item_type = 'F'; } else if (title.match(/class="user."/)) { $(this).remove(); return; } else { item_type = 'g'; item_name = $td.find('b:first').text(); } if (item_type == 'l') { assoc_id = parseInt($td.find('a.album:first').attr('title').match(/\d*]/)[0]); } else if (item_type == 'g') { assoc_id = 0; } else { assoc_id = parseInt($td.find('a:eq(0)').attr('title').match(/\d*]/)[0]); } $td.data('html', html); var text = html.replace(/
/g, "\n"); text = text.replace(/(.*?)<\/a>/g, '[$1,$2]'); text = text.replace(//g, '[b]').replace(/<\/strong>/g, '[/b]'); text = text.replace(//g, '[i]').replace(/<\/em>/g, '[/i]'); text = text.replace(//g, '[s]').replace(/<\/s>/g, '[/s]'); text = text.replace(/(.*?)<\/span>/g, '[color $1]$2[/color]'); text = text.replace(/
/g, '[blockquote]').replace(/<\/blockquote>/g, '[/blockquote]'); text = text.replace(/(.*?)<\/a>/g, '[wp:$1]'); text = text.replace(/.*?<\/a>/g, '[wiki:$1]'); text = text.replace(/