With the recent addition of search_embed iframes on other pages, we
had photo cards appearing but the photo_clipboard module was not
imported thus the checkboxes did nothing. I don't want to import
photo_clipboard onto every single page, I'd rather they click through
to the full search UI. Otherwise every single page will have the tray
and often not a good enough reason for it.
So, since the functionality of the checkbox is completely reliant on
the photo_clipboard.js module anyway, there's no reason not to have it
generated by that module.
Move save_clipboard into a 0-timeout. Check checkboxes immediately
instead of relying on apply_check_all / update_pagestate to make a
redundant loop through everything.
Following the previous commit about the checkbox on the /photo page,
this fixes all of the code assuming that we're dealing with photo_card
divs, the majority of which was doing nothing but accessing the id.
This was less helpful than expected, because if you take that
tab and navigate somewhere else, then trying to open the clipboard
would replace the current tab instead of opening a new one.