Question: I want to make a link that goes to wp-login.php for whatever domain I'm at now. Something like:

```
<a href="http://<script>document.write(document.domain);</script>/wp-login.php">Login</a>

```

But I don't know how to write / format that properly.

Answer: 
This block of code will add a button right next to the "Insert into post" one. When clicked, it will send selected images to WP editor, each wrapped inside your template HTML:

```
var wpMediaFramePost = wp.media.view.MediaFrame.Post;
wp.media.view.MediaFrame.Post = wpMediaFramePost.extend(
{
    mainInsertToolbar: function( view )
    {
        "use strict";

        wpMediaFramePost.prototype.mainInsertToolbar.call(this, view);

        var controller = this;

        this.selectionStatusToolbar( view );

        view.set( "customInsertIntoPost", {
            style: "primary",
            priority: 80,
            text: "Insert selected images into post",
            requires: { selection: true },

            click: function()
            {
                var state = controller.state(),
                    selection = state.get("selection")._byId,
                    template = _.template('<li><img src="<%= imagePath %>" alt="<%= altText %>" /></li>'),
                    output = "<ul>";

                _.each(selection, function( item )
                {
                    if( item.attributes.type === "image" )
                    {
                        output += template({
                            imagePath: item.attributes.sizes.full.url,
                            altText: item.attributes.alt
                        });
                    }
                });

                output += "</ul>";

                send_to_editor(output);
            }
        });
    }
});

```

Adding a custom button is not a problem. But selecting "all images" could be a bit tricky because WP 3.5 media browser loads attachments bit by bit. I'll look into it, but I recommend selecting attachments manually.
I've just encountered a case in WP 3.6 where aesqe's (very useful) answer results in images being inserted twice due to backbone's `state.get("selection")._byId` including both `id` and `cid` for each image selected. 

Changing `state.get("selection")._byId` to `state.get("selection").models` fixed this for me while preserving each object's attributes.

Hopefully this will save someone some frustration. I would have posted this as a comment instead of an answer but, alas, I have no reputation.