Bookmarklet: Remove all "Never Delete" checkmarks


(Nic Hubbard) #1

Everyone has wanted a way to remove all checkmarks in the Remaps Managers "Never Deletion" column, so, I wrote a quick script that adds a checkbox for you, which, when clicked adds/removes checks to all the checkboxes in the Never Delete column.


Here is the code that you need, just add it as the Address/URL of your bookmark:


    javascript:(function(){var doc=top.sq_main.document;var mainDiv=doc.getElementsByClassName('sq-backend-table-header');for(var i=0;i';}}})()


Please let me know if it works for you, or what I can do to improve this. (Tested in Safari/Firefox for Mac)

NOTE: If your the asset id of your Remap Manager is something other than 19, you must replace 19 with your asset id. Also, this will not work in Internet Explorer.

(Marg C) #2

Hey Nic, what a fantastic idea. I haven't had any luck getting it to work though… I'm probably doing something wrong.


I'm using Firefox 3.5.2 on Windows. I created a bookmark with the code you provided in the 'Location' field. I changed the occurrences of 19 in the code to the asset ID of our remap manager.



I went to the remap manager and acquired the lock, then clicked on the bookmark but nothing happened.



I noticed it was replacing spaces with %20, so I'm not sure if that would cause a problem… I removed them but it put them back in as soon as I saved the bookmark.



I also tried it in IE7, but no luck there either.



Have I missed something?



Thanks!


(Rachel Macdonald) #3

Have you tried going to the remap manager, acquiring the lock, and then copying and pasting the code directly into the address bar? That's what I did and it worked.


(Nic Hubbard) #4

[quote]
Have I missed something?

[/quote]



It won't work in IE, so lets go back to Firefox. It does work, I have tested it. Try as Rachel said, and just put that code in the URL bar, and see if it works. Then, you can work on adding the the bookmark. Looking at Firefox, I am not sure why it is not working as a bookmark, but the JS still works…


(Marg C) #5

[quote]
Have you tried going to the remap manager, acquiring the lock, and then copying and pasting the code directly into the address bar? That's what I did and it worked.

[/quote]



Ahhh, yes, that worked. Thanks Rachel! :slight_smile:



And thanks again Nic - this solution means that my colleagues can also quickly clear the remap manager without having to worry about installing Firebug, which most of them don't require in their everyday work.



Cheers,



Margaret


(Marg C) #6

[quote]
It won't work in IE, so lets go back to Firefox. It does work, I have tested it. Try as Rachel said, and just put that code in the URL bar, and see if it works. Then, you can work on adding the the bookmark. Looking at Firefox, I am not sure why it is not working as a bookmark, but the JS still works…

[/quote]



Maybe it is the fact that Firefox is replacing the spaces with %20 when trying to put it in a bookmark…? When you place the code in the address bar it leaves it alone and it works perfectly. It'd be nice to have it as a bookmark, but for the amount of times I'm likely to be using it, I'm happy to copy and paste it as needed. It's still a gigantic improvement on deselecting each Never Delete box! :slight_smile:


(Nic Hubbard) #7

[quote]
Maybe it is the fact that Firefox is replacing the spaces with %20 when trying to put it in a bookmark…? When you place the code in the address bar it leaves it alone and it works perfectly. It'd be nice to have it as a bookmark, but for the amount of times I'm likely to be using it, I'm happy to copy and paste it as needed. It's still a gigantic improvement on deselecting each Never Delete box! :slight_smile:

[/quote]



Yeah, not sure what is up with the bookmarks. I don't think the %20 is the issue, that just is the interpretation of a space, and it does that same thing in my Safari bookmark, but it works perfectly.


(Jefferyca) #8

Here's an alternate version of Nic's great work that will uncheck all the Never Delete boxes and check all the Delete boxes.


javascript:(function(){var doc=top.sq_main.document;var mainDiv=doc.getElementsByClassName('sq-form-field');for(var i=0;i<mainDiv.length;i++){if(mainDiv[i].id.match(/remap_manager_19_never/g,'')){mainDiv[i].checked=false;}else if(mainDiv[i].id.match(/remap_manager_19_delete/g,'')){mainDiv[i].checked=true;}}doc.getElementById("remap_manager_19_select_all").checked=true;})()



All the user has to do is load it and Commit the page.